个人中心

This commit is contained in:
liuye
2023-02-17 17:06:04 +08:00
parent ae600dc2c3
commit a36f3741bf
2 changed files with 31 additions and 10 deletions

View File

@@ -40,16 +40,21 @@
</div>
</template>
<script>
import {mapActions, mapState} from "vuex";
import {mapState, mapActions} from "vuex";
export default {
name: "AppPcMine",
appName: "我的",
customNavigation: true,
data() {
return {
user: {}
}
},
computed: {
...mapState(['user', 'token']),
...mapState(['token']),
isApprove() {
return this.user?.status == 2;
return this.user?.areaId ? true : false
},
listGroup() {
return [
@@ -86,6 +91,13 @@ export default {
},
methods: {
...mapActions(['getUserInfo']),
getUserInfo() {
this.$instance.post(`/app/appwechatuserqujing/check`).then(res=> {
if(res?.data) {
this.user = res.data
}
})
},
approve() {
if (!this.token) {
this.$refs.login.show();
@@ -133,7 +145,8 @@ export default {
}
},
onShow() {
this.getAuth();
this.getAuth()
this.getUserInfo()
},
onShareAppMessage() {
return {

View File

@@ -22,7 +22,7 @@
<div>{{ user.phone || '' }}</div>
</div>
</div>
<div class="item-content mar-b8" v-if="user.idNumber">
<div class="item-content mar-b8" v-if="user.areaId">
<div class="item solid">
<p>姓名</p>
<div>{{ user.realName || '' }}</div>
@@ -33,7 +33,7 @@
</div>
<div class="item">
<p>地区</p>
<div>{{ user.homeName || '' }}</div>
<div>{{ user.areaName || '' }}</div>
</div>
</div>
<div class="item-content" @click="onLogout">
@@ -51,7 +51,7 @@ export default {
name: "userInfo",
appName: "个人中心",
computed: {
...mapState(['user', 'token']),
...mapState(['token']),
nickName: {
set(v) {
},
@@ -73,11 +73,12 @@ export default {
},
data() {
return {
editNickName: false
editNickName: false,
user: {}
}
},
methods: {
...mapActions(['getUserInfo', 'autoLogin']),
...mapActions(['autoLogin']),
upLoad(img) {
return new Promise((resolve, reject) => {
uni.uploadFile({
@@ -117,7 +118,14 @@ export default {
handleWeixinSync({detail}) {
const {value: nickName, avatarUrl} = detail
this.autoLogin({nickName, avatarUrl})
}
},
getUserInfo() {
this.$instance.post(`/app/appwechatuserqujing/check`).then(res=> {
if(res?.data) {
this.user = res.data
}
})
},
}
}
</script>