个人中心
This commit is contained in:
@@ -9,111 +9,113 @@
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="option">
|
||||
<template v-if="!user.id">
|
||||
<template v-if="!token">
|
||||
<p>登录</p>
|
||||
<p>点击进行登录</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<p v-if="isApprove">{{ user.realName }}</p>
|
||||
<p v-if="isApprove">{{ user.realName || user.nickName}}</p>
|
||||
<p v-else>{{ user.nickName }}</p>
|
||||
<p>{{ user.areaName || "" }}</p>
|
||||
<!-- <p>共累计学习<span>{{studyDuration || 0}}</span>分钟</p> -->
|
||||
</template>
|
||||
</div>
|
||||
<p class="info" v-if="user.id" @click.stop="$linkTo('./userInfo')">个人信息</p>
|
||||
<p class="info" @click.stop="$linkTo('./userInfo')" v-if="token">个人信息</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="approve">
|
||||
<img class="icon" src="https://cdn.cunwuyun.cn/wxmp/mine/approve.png" alt="">
|
||||
<div class="flex">
|
||||
<span class="cert" v-if="isApprove" v-text="approveLabel" @click="$linkTo('/mods/AppAuth/AppAuth')"/>
|
||||
<u-icon v-else name="arrow-right" color="#E7F2FF" size="28"
|
||||
:label="approveLabel" label-color="#E7F2FF" label-pos="left" @click="approve"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-wrap">
|
||||
<!-- <div class="list-wrap">
|
||||
<div class="card" v-for="(group,index) in listGroup" :key="index">
|
||||
<div class="item" v-for="(item) in group" hover-class="bg-hover" :key="item.label"
|
||||
@click="linkTo(item.path, item.type)">
|
||||
<div class="block">
|
||||
<img class="icon" :src="item.icon" alt="">
|
||||
</div>
|
||||
<span class="desc" v-if="!item.share">{{ item.label }}</span>
|
||||
<button open-type="share" v-else>
|
||||
<span>{{ item.label }}</span>
|
||||
</button>
|
||||
<span class="desc">{{ item.label }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="logout" v-if="token">
|
||||
<b class="login-out" @click="onLogout">退出登录</b>
|
||||
</div>
|
||||
<AiLogin ref="login" @success="getAuth()"/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapActions, mapState} from "vuex";
|
||||
import {mapState, mapActions} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "AppMine",
|
||||
name: "AppPcMine",
|
||||
appName: "我的",
|
||||
customNavigation: true,
|
||||
data() {
|
||||
return {
|
||||
user: {},
|
||||
studyDuration: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user', 'token']),
|
||||
|
||||
isApprove: v => v.user?.status == 2,
|
||||
approveLabel() {
|
||||
return this.user?.status == 2 ? "已认证" :
|
||||
this.user?.status == 1 ? "审核中" :
|
||||
this.user?.status == -1 ? "审核驳回" : "前往认证"
|
||||
...mapState(['token']),
|
||||
isApprove() {
|
||||
return this.user?.areaId ? true : false
|
||||
},
|
||||
listGroup() {
|
||||
return [
|
||||
[
|
||||
{
|
||||
icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejiating.png",
|
||||
label: "我的家庭",
|
||||
path: "./myFamily",
|
||||
type: 'idNumber'
|
||||
icon: 'https://cdn.cunwuyun.cn/qujing/jfmx.png',
|
||||
label: "积分明细",
|
||||
path: "./integralInfo",
|
||||
type: 'token'
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
icon: 'https://cdn.cunwuyun.cn/qujing/xxjl.png',
|
||||
label: "学习记录",
|
||||
path: "./studyList",
|
||||
type: 'token'
|
||||
},
|
||||
{
|
||||
icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejiaxiang.png",
|
||||
label: "我的家乡",
|
||||
path: "/mods/AppHometown/AppHometown",
|
||||
icon: 'https://cdn.cunwuyun.cn/qujing/ksjl.png',
|
||||
label: "考试记录",
|
||||
path: "./testList",
|
||||
type: 'token'
|
||||
},
|
||||
{
|
||||
icon: 'https://cdn.cunwuyun.cn/qujing/wdzs.png',
|
||||
label: "我的证书",
|
||||
path: "./myCertificate",
|
||||
type: 'token'
|
||||
}
|
||||
],
|
||||
// [
|
||||
// {
|
||||
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejifen.png",
|
||||
// label: "我的积分",
|
||||
// path: "/mods/AppCreditPoints/AppCreditPoints?type=detail",
|
||||
// type: 'idNumber'
|
||||
// },
|
||||
// {
|
||||
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/chaoshidingdan.png",
|
||||
// label: "超市订单",
|
||||
// path: "/mods/AppOrderList/AppOrderList",
|
||||
// type: 'idNumber'
|
||||
// },
|
||||
// {
|
||||
// icon: "https://cdn.cunwuyun.cn/wxmp/mine/banshijindu.png",
|
||||
// label: "办事进度",
|
||||
// path: "/mods/AppProgress/AppProgress",
|
||||
// type: 'idNumber'
|
||||
// }
|
||||
// ],
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['getUserInfo']),
|
||||
getUserInfo() {
|
||||
this.$instance.post(`/app/appwechatuserqujing/check`).then(res=> {
|
||||
if(res?.data) {
|
||||
this.user = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getStudyDuration() {
|
||||
this.$instance.post(`/app/appwechatuserqujing/queryStudyDuration`).then(res=> {
|
||||
if(res?.data) {
|
||||
this.studyDuration = res.data.studyDuration
|
||||
}
|
||||
})
|
||||
},
|
||||
approve() {
|
||||
if (!this.token) {
|
||||
this.$refs.login.show();
|
||||
} else if (!this.isApprove) {
|
||||
if (this.user.status == 0) {
|
||||
this.$linkTo('/mods/AppAuth/AppAuth');
|
||||
this.$linkTo('/mods/AppPartyAuth/AppPartyAuth');
|
||||
} else {
|
||||
this.$linkTo('/mods/AppAuth/authSuccess')
|
||||
this.$linkTo('/mods/AppPartyAuth/partyAuthSuccess')
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -150,15 +152,32 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.token && this.getUserInfo()
|
||||
})
|
||||
}
|
||||
},
|
||||
onLogout() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: "是否要退出登录",
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$store.commit('logout')
|
||||
this.$toast('退出成功');
|
||||
setTimeout(() => {
|
||||
this.getAuth();
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.getAuth();
|
||||
this.getAuth()
|
||||
this.getUserInfo()
|
||||
this.getStudyDuration()
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: '欢迎使用数字乡村治理服务一体化平台~',
|
||||
path: `/pages/AppModules/AppModules`
|
||||
title: `欢迎使用巫溪小程序~`,
|
||||
path: `/pages/AppHome/AppHome`
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -169,21 +188,20 @@ export default {
|
||||
.page {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
background-color: #F3F6F9;
|
||||
background-color:#F4F5FA;;
|
||||
position: relative;
|
||||
|
||||
.header-bg {
|
||||
width: 100%;
|
||||
height: 512px;
|
||||
position: relative;
|
||||
|
||||
.header-info {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url("https://cdn.cunwuyun.cn/wxmp/sanjianxi/mineBg.png") no-repeat no-repeat;
|
||||
background: url("https://cdn.cunwuyun.cn/qujing/header-banner.png") no-repeat no-repeat;
|
||||
background-size: 100% 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 240px 0 0 48px;
|
||||
padding: 240px 32px 0 48px;
|
||||
|
||||
.wrap {
|
||||
width: 100%;
|
||||
@@ -230,6 +248,9 @@ export default {
|
||||
font-weight: 400;
|
||||
color: #7088A0;
|
||||
line-height: 36px;
|
||||
span {
|
||||
color: #2D7DFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,6 +302,7 @@ export default {
|
||||
.list-wrap {
|
||||
box-sizing: border-box;
|
||||
padding: 32px;
|
||||
margin-top: -130px;
|
||||
|
||||
.card {
|
||||
width: 100%;
|
||||
@@ -322,7 +344,6 @@ export default {
|
||||
color: #666666;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
|
||||
& > span {
|
||||
width: 100%;
|
||||
@@ -348,5 +369,27 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.point-card {
|
||||
padding: 0 32px!important;
|
||||
.card {
|
||||
margin-bottom: 0!important;
|
||||
}
|
||||
}
|
||||
.logout {
|
||||
width: 100%;
|
||||
height: 96px;
|
||||
padding: 0 32px;
|
||||
box-sizing: border-box;
|
||||
line-height: 96px;
|
||||
text-align: center;
|
||||
.login-out {
|
||||
background: #FFF;
|
||||
border-radius: 16px;
|
||||
font-size: 34px;
|
||||
font-weight: 500;
|
||||
color: #4181FF;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user