You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
3.4 KiB

3 years ago
<template>
<view class="page">
3 years ago
<image class="bg" src="@/static/image/person-bg.png"></image>
<view class="wrap">
<view class="info">
3 years ago
<image class="avatar" :src="avatar" mode=""></image>
<view class="text">
2 years ago
<view class="name">{{ my.info.userName }}</view>
2 years ago
<view class="phone">{{ my.info.phone }}</view>
</view>
</view>
<view class="list">
2 years ago
<view v-if="auth('我的:我的收益')" class="item">
<view class="left">
3 years ago
<image class="icon" src="@/static/image/person1.png" mode=""></image>
2 years ago
<text class="name">我的项目收益</text>
</view>
2 years ago
<text class="val">{{ my.myIncome}}</text>
</view>
2 years ago
<view v-if="auth('我的:团队收益')" class="item">
<view class="left">
3 years ago
<image class="icon" src="@/static/image/person2.png" mode=""></image>
<text class="name">团队收益</text>
</view>
2 years ago
<text class="val">{{ my.teamIncome}}</text>
</view>
2 years ago
<view v-if="auth('我的:设置')" class="item" @click="$util.to('../setting/setting')">
<view class="left">
3 years ago
<image class="icon" src="@/static/image/person3.png" mode=""></image>
<text class="name">设置</text>
</view>
</view>
<view v-if="auth('我的:退出账号')" class="item" @click="logout">
<view class="left">
<image class="icon" src="@/static/image/person4.png" mode=""></image>
<text class="name">退出账号</text>
</view>
</view>
</view>
</view>
2 years ago
<view v-if="!per" class="per-mask">功能升级中敬请期待...</view>
3 years ago
</view>
</template>
<script>
2 years ago
import { my } from '@/apis/modules/parner.js'
3 years ago
export default {
data() {
return {
2 years ago
per: true, // 是否有权限
my: {
info: {
phone: ''
},
myIncome: 0,
teamIncome: 0
},
3 years ago
avatar: uni.getStorageSync('avatar') || '@/static/image/avatar.png',
2 years ago
userName: uni.getStorageSync('userName')
3 years ago
}
},
2 years ago
onShow() {
this.initRole()
},
3 years ago
methods: {
2 years ago
// 初始化权限
initRole() {
if (!uni.getStorageSync('auth').includes('我的')) {
this.per = false
} else {
this.getInfo()
}
},
// 获取个人信息
getInfo() {
const team = uni.getStorageSync('team')
my({
partnerId: team.partnerId,
teamId: team.teamId
}).then(({ my }) => {
this.my = my
}).catch(e => {})
},
// 退出登录
logout() {
2 years ago
const that = this
uni.showModal({
title: '提示',
content: '确定要退出账号吗?',
success(res) {
if (res.confirm) {
uni.clearStorageSync()
2 years ago
that.$util.to('../login/login')
}
}
})
2 years ago
}
3 years ago
}
}
</script>
<style scoped lang="scss">
.bg {
width: 100%;
height: 300rpx;
}
.wrap {
position: relative;
padding: 0 24rpx;
margin-top: -150rpx;
}
.info {
display: flex;
align-items: center;
padding: 26rpx 34rpx;
background-color: #fff;
border-radius: 16rpx;
.avatar {
width: 120rpx;
height: 120rpx;
margin-right: 28rpx;
3 years ago
border-radius: 50%;
}
.name {
margin-bottom: 10rpx;
font-size: 40rpx;
color: #333;
}
.phone {
font-size: 28rpx;
color: #333;
}
}
.list {
margin-top: 16rpx;
.item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 26rpx 28rpx;
margin-bottom: 16rpx;
background-color: #fff;
border-radius: 16rpx;
}
.left {
display: inline-flex;
align-items: center;
}
.icon {
width: 48rpx;
height: 48rpx;
margin-right: 16rpx;
}
text {
font-size: 28rpx;
color: #333;
}
}
3 years ago
</style>