个人中心
This commit is contained in:
@@ -9,111 +9,113 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="user-info">
|
<div class="user-info">
|
||||||
<div class="option">
|
<div class="option">
|
||||||
<template v-if="!user.id">
|
<template v-if="!token">
|
||||||
<p>登录</p>
|
<p>登录</p>
|
||||||
<p>点击进行登录</p>
|
<p>点击进行登录</p>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<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 v-else>{{ user.nickName }}</p>
|
||||||
<p>{{ user.areaName || "" }}</p>
|
<!-- <p>共累计学习<span>{{studyDuration || 0}}</span>分钟</p> -->
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="approve">
|
<!-- <div class="list-wrap">
|
||||||
<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="card" v-for="(group,index) in listGroup" :key="index">
|
<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"
|
<div class="item" v-for="(item) in group" hover-class="bg-hover" :key="item.label"
|
||||||
@click="linkTo(item.path, item.type)">
|
@click="linkTo(item.path, item.type)">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<img class="icon" :src="item.icon" alt="">
|
<img class="icon" :src="item.icon" alt="">
|
||||||
</div>
|
</div>
|
||||||
<span class="desc" v-if="!item.share">{{ item.label }}</span>
|
<span class="desc">{{ item.label }}</span>
|
||||||
<button open-type="share" v-else>
|
|
||||||
<span>{{ item.label }}</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div> -->
|
||||||
|
<div class="logout" v-if="token">
|
||||||
|
<b class="login-out" @click="onLogout">退出登录</b>
|
||||||
</div>
|
</div>
|
||||||
<AiLogin ref="login" @success="getAuth()"/>
|
<AiLogin ref="login" @success="getAuth()"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {mapActions, mapState} from "vuex";
|
import {mapState, mapActions} from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AppMine",
|
name: "AppPcMine",
|
||||||
appName: "我的",
|
appName: "我的",
|
||||||
customNavigation: true,
|
customNavigation: true,
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
user: {},
|
||||||
|
studyDuration: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user', 'token']),
|
...mapState(['token']),
|
||||||
|
isApprove() {
|
||||||
isApprove: v => v.user?.status == 2,
|
return this.user?.areaId ? true : false
|
||||||
approveLabel() {
|
|
||||||
return this.user?.status == 2 ? "已认证" :
|
|
||||||
this.user?.status == 1 ? "审核中" :
|
|
||||||
this.user?.status == -1 ? "审核驳回" : "前往认证"
|
|
||||||
},
|
},
|
||||||
listGroup() {
|
listGroup() {
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejiating.png",
|
icon: 'https://cdn.cunwuyun.cn/qujing/jfmx.png',
|
||||||
label: "我的家庭",
|
label: "积分明细",
|
||||||
path: "./myFamily",
|
path: "./integralInfo",
|
||||||
type: 'idNumber'
|
type: 'token'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
icon: 'https://cdn.cunwuyun.cn/qujing/xxjl.png',
|
||||||
|
label: "学习记录",
|
||||||
|
path: "./studyList",
|
||||||
|
type: 'token'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: "https://cdn.cunwuyun.cn/wxmp/mine/wodejiaxiang.png",
|
icon: 'https://cdn.cunwuyun.cn/qujing/ksjl.png',
|
||||||
label: "我的家乡",
|
label: "考试记录",
|
||||||
path: "/mods/AppHometown/AppHometown",
|
path: "./testList",
|
||||||
|
type: 'token'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'https://cdn.cunwuyun.cn/qujing/wdzs.png',
|
||||||
|
label: "我的证书",
|
||||||
|
path: "./myCertificate",
|
||||||
type: 'token'
|
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: {
|
methods: {
|
||||||
...mapActions(['getUserInfo']),
|
...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() {
|
approve() {
|
||||||
if (!this.token) {
|
if (!this.token) {
|
||||||
this.$refs.login.show();
|
this.$refs.login.show();
|
||||||
} else if (!this.isApprove) {
|
} else if (!this.isApprove) {
|
||||||
if (this.user.status == 0) {
|
if (this.user.status == 0) {
|
||||||
this.$linkTo('/mods/AppAuth/AppAuth');
|
this.$linkTo('/mods/AppPartyAuth/AppPartyAuth');
|
||||||
} else {
|
} else {
|
||||||
this.$linkTo('/mods/AppAuth/authSuccess')
|
this.$linkTo('/mods/AppPartyAuth/partyAuthSuccess')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -150,15 +152,32 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.token && this.getUserInfo()
|
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() {
|
onShow() {
|
||||||
this.getAuth();
|
this.getAuth()
|
||||||
|
this.getUserInfo()
|
||||||
|
this.getStudyDuration()
|
||||||
},
|
},
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
return {
|
return {
|
||||||
title: '欢迎使用数字乡村治理服务一体化平台~',
|
title: `欢迎使用巫溪小程序~`,
|
||||||
path: `/pages/AppModules/AppModules`
|
path: `/pages/AppHome/AppHome`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -169,21 +188,20 @@ export default {
|
|||||||
.page {
|
.page {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
background-color: #F3F6F9;
|
background-color:#F4F5FA;;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.header-bg {
|
.header-bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 512px;
|
height: 512px;
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.header-info {
|
.header-info {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 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%;
|
background-size: 100% 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 240px 0 0 48px;
|
padding: 240px 32px 0 48px;
|
||||||
|
|
||||||
.wrap {
|
.wrap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -230,6 +248,9 @@ export default {
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #7088A0;
|
color: #7088A0;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
|
span {
|
||||||
|
color: #2D7DFF;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,6 +302,7 @@ export default {
|
|||||||
.list-wrap {
|
.list-wrap {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
|
margin-top: -130px;
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -322,7 +344,6 @@ export default {
|
|||||||
color: #666666;
|
color: #666666;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-bottom: 1px solid #EEEEEE;
|
|
||||||
|
|
||||||
& > span {
|
& > span {
|
||||||
width: 100%;
|
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>
|
</style>
|
||||||
|
|||||||
@@ -1,180 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="page">
|
|
||||||
<div class="credit-points">
|
|
||||||
<div class="bg-blue"></div>
|
|
||||||
<div class="header-content">
|
|
||||||
<div class="title">家庭地址</div>
|
|
||||||
<div class="address">
|
|
||||||
<img src="https://cdn.cunwuyun.cn/img/location-blue.svg" alt="">
|
|
||||||
<p>{{ info.resident.currentAreaName || '' }}{{ info.resident.currentAddress || '' }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="list-content">
|
|
||||||
<div class="title">家庭成员</div>
|
|
||||||
<div class="item" v-for="(item, index) in info.family" :key="index">
|
|
||||||
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/1.png" alt="" class="banner-top" v-if="item.sex == 1">
|
|
||||||
<img src="https://cdn.cunwuyun.cn/dvcp/myFamily/2.png" alt="" class="banner-top" v-else>
|
|
||||||
<div class="user-img">
|
|
||||||
<img v-if="item.photo" :src="item.photo" alt=""/>
|
|
||||||
<img v-else src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt=""/>
|
|
||||||
</div>
|
|
||||||
<div class="user-info">
|
|
||||||
<p>{{ item.name }}</p>
|
|
||||||
<div v-if="item.householdName == 1" class="color-5AAD6A">户主</div>
|
|
||||||
<div v-else>{{ $dict.getLabel('householdRelation', item.householdRelation) }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import {mapState} from 'vuex'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
appName: "我的家庭",
|
|
||||||
computed: {
|
|
||||||
...mapState(['user', 'token'])
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
info: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.$dict.load('householdRelation').then(() => {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getUser()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getUser() {
|
|
||||||
this.$instance.post(`/app/appresident/detailForWx?id=${this.user.residentId}`).then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.info = res.data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
@import "~dvcp-wui/common";
|
|
||||||
|
|
||||||
.page {
|
|
||||||
width: 100%;
|
|
||||||
background-color: #f3f6f9;
|
|
||||||
|
|
||||||
.credit-points {
|
|
||||||
.bg-blue {
|
|
||||||
width: 100%;
|
|
||||||
height: 112px;
|
|
||||||
background-color: #197DF0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-content {
|
|
||||||
width: 690px;
|
|
||||||
background: #FFF;
|
|
||||||
border-radius: 16px;
|
|
||||||
margin: -80px 0 32px 30px;
|
|
||||||
padding: 0 30px 80px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
|
|
||||||
|
|
||||||
.address {
|
|
||||||
font-size: 32px;
|
|
||||||
color: #666;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 34px;
|
|
||||||
height: 38px;
|
|
||||||
margin-right: 14px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
line-height: 44px;
|
|
||||||
width: 580px;
|
|
||||||
word-break: break-all;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 32px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333;
|
|
||||||
line-height: 120px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list-content {
|
|
||||||
width: 690px;
|
|
||||||
background: #FFF;
|
|
||||||
border-radius: 16px;
|
|
||||||
padding: 0 30px 110px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-left: 30px;
|
|
||||||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 630px;
|
|
||||||
height: 192px;
|
|
||||||
background: #FFF;
|
|
||||||
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.08);
|
|
||||||
border-radius: 16px;
|
|
||||||
padding-left: 30px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-bottom: 32px;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.banner-top {
|
|
||||||
width: 100%;
|
|
||||||
height: 72px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-img {
|
|
||||||
width: 104px;
|
|
||||||
height: 104px;
|
|
||||||
margin: -16px 34px 0 0;
|
|
||||||
border-radius: 50%;
|
|
||||||
float: left;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-info {
|
|
||||||
margin-top: -16px;
|
|
||||||
width: calc(100% - 138px);
|
|
||||||
float: right;
|
|
||||||
|
|
||||||
p {
|
|
||||||
font-size: 32px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
line-height: 44px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div {
|
|
||||||
font-size: 26px;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #666;
|
|
||||||
line-height: 36px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.color-5AAD6A {
|
|
||||||
color: #5AAD6A;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -4,32 +4,66 @@
|
|||||||
<div class="item-content mar-b8">
|
<div class="item-content mar-b8">
|
||||||
<div class="item solid">
|
<div class="item solid">
|
||||||
<p class="mar-t22">头像</p>
|
<p class="mar-t22">头像</p>
|
||||||
<button class="user-img-div" open-type="chooseAvatar" @chooseavatar="handleWeixinSync">
|
<button class="user-img-div" v-if="editAvatarUrl" open-type="chooseAvatar" @chooseavatar="handleWeixinSync">
|
||||||
<img v-if="user.avatarUrl" :src="user.avatarUrl" class="user-img">
|
<img v-if="user.avatarUrl && !avatar" :src="user.avatarUrl" class="user-img">
|
||||||
<img v-else src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" class="user-img">
|
<img v-if="avatar" :src="avatar" alt="" class="user-img">
|
||||||
|
<img v-if="!user.avatarUrl && !avatar" src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" class="user-img">
|
||||||
</button>
|
</button>
|
||||||
|
<div class="user-img-div" v-else>
|
||||||
|
<img v-if="user.avatarUrl && !avatar" :src="user.avatarUrl" class="user-img">
|
||||||
|
<img v-else src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" class="user-img">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<p>用户昵称</p>
|
<p>用户昵称</p>
|
||||||
<div class="item-right" v-if="!editNickName" @click="editNickName=true, userName= user.nickName">
|
<div class="item-right" v-if="!editNickName">
|
||||||
<p class="name">{{ user.nickName }}</p>
|
<p class="name">{{ user.nickName }}</p>
|
||||||
</div>
|
</div>
|
||||||
<input class="item-right" v-else type="text" v-model="userName" @blur="handleWeixinSync">
|
<input class="item-right" v-else type="text" v-model="userName">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-content mar-b8">
|
<div class="item-content mar-b8">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<p>手机号</p>
|
<p>手机号</p>
|
||||||
<div class="item-right" v-if="!!!editPhone" @click="editPhone=true, userPhone= user.phone">
|
<div class="item-right" v-if="!!!editPhone">
|
||||||
<p class="name">{{ user.phone || ''}}</p>
|
<p class="name">{{ user.phone || ''}}</p>
|
||||||
</div>
|
</div>
|
||||||
<input class="item-right" v-else type="number" v-model="userPhone" @blur="handleWeixin" maxlength="11">
|
<input class="item-right" v-else type="number" v-model="userPhone" maxlength="11">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-content" @click="onLogout">
|
|
||||||
|
<div class="item-content mar-b8">
|
||||||
|
<div class="item solid">
|
||||||
|
<p>姓名</p>
|
||||||
|
<div class="item-right" v-if="!editRealName">
|
||||||
|
<p class="name">{{ user.realName || '' }}</p>
|
||||||
|
</div>
|
||||||
|
<input class="item-right" v-else type="text" v-model="userRealName" @input="idNumberInput">
|
||||||
|
</div>
|
||||||
|
<div class="item solid">
|
||||||
|
<p>身份证号</p>
|
||||||
|
<div class="item-right" v-if="!editIdNumber">
|
||||||
|
<p class="name">{{ user.idNumber || '' }}</p>
|
||||||
|
</div>
|
||||||
|
<input class="item-right" v-else type="idNumber" v-model="userIdNumber" maxlength="18" @input="idNumberInput">
|
||||||
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<b class="login-out">退出登录</b>
|
<p>地区</p>
|
||||||
|
<div class="item-right" v-if="!editArea">
|
||||||
|
<p class="name">{{ user.areaName || '' }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
<AiAreaPicker class="item-right" :areaId="$areaId" v-model="userAreaId" :fullName.sync="userAreaName" v-else>
|
||||||
|
<div class="ai-area__wrapper">
|
||||||
|
<span class="label" v-if="userAreaName">{{ userAreaName }}</span>
|
||||||
|
<i v-else>请选择</i>
|
||||||
|
<u-icon name="arrow-right" color="#ddd"/>
|
||||||
|
</div>
|
||||||
|
</AiAreaPicker>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="btn-wrapper btn-edit">
|
||||||
|
<b class="btn" @click="btnText? submit(): editBtn()">{{ btnText? '提交': '修改' }}</b>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,55 +73,106 @@ import {mapActions, mapState} from 'vuex'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "userInfo",
|
name: "userInfo",
|
||||||
appName: "个人中心",
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user', 'token']),
|
...mapState(['user', 'token']),
|
||||||
nickName: {
|
|
||||||
set(v) {
|
|
||||||
this.userName = v
|
|
||||||
},
|
},
|
||||||
get() {
|
onLoad(o) {
|
||||||
const {nickName} = this.user
|
this.isFromTabbar = o.isFromTabbar
|
||||||
return nickName
|
this.path = o.path
|
||||||
}
|
this.getUserInfo('qujing')
|
||||||
},
|
uni.setNavigationBarTitle({
|
||||||
phone: {
|
title: '个人中心'
|
||||||
set(v) {
|
})
|
||||||
this.userPhone = v
|
|
||||||
},
|
|
||||||
get() {
|
|
||||||
const { phone } = this.user
|
|
||||||
return phone
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.getUserInfo()
|
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
editAvatarUrl: false,
|
||||||
editNickName: false,
|
editNickName: false,
|
||||||
editPhone: false,
|
editPhone: false,
|
||||||
|
editRealName: false,
|
||||||
|
editIdNumber: false,
|
||||||
|
editArea: false,
|
||||||
avatar: '',
|
avatar: '',
|
||||||
userName: '',
|
userName: '',
|
||||||
userPhone: ''
|
userPhone: '',
|
||||||
|
userRealName: '',
|
||||||
|
userIdNumber: '',
|
||||||
|
userAreaId: '',
|
||||||
|
userAreaName: '',
|
||||||
|
btnText: false,
|
||||||
|
isFromTabbar: '',
|
||||||
|
path: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['getUserInfo', 'autoLogin']),
|
...mapActions(['getUserInfo', 'autoLogin']),
|
||||||
updateInfo() {
|
editBtn() {
|
||||||
this.$instance.post(`/app/appwechatuser/update-nickName`,null,{
|
this.btnText = true
|
||||||
params: {
|
this.editAvatarUrl = true;
|
||||||
id: this.user.id,
|
this.avatar = this.user.avatarUrl
|
||||||
nickName: this.userName? this.userName : this.user.nickName,
|
this.editNickName = true;
|
||||||
avatarUrl: this.avatar? this.avatar : this.user.avatarUrl,
|
this.userName = this.user.nickName
|
||||||
phone: this.userPhone ? this.userPhone : this.user.phone,
|
this.editPhone = true;
|
||||||
|
this.userPhone = this.user.phone
|
||||||
|
this.editRealName = true;
|
||||||
|
this.userRealName = this.user.realName
|
||||||
|
this.editIdNumber = true;
|
||||||
|
this.userIdNumber = this.user.idNumber
|
||||||
|
this.editArea = true
|
||||||
|
this.userAreaId = this.user.areaId
|
||||||
|
this.userAreaName = this.user.areaName
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
if(this.flag) return
|
||||||
|
// if(!this.avatar) {
|
||||||
|
// return this.$u.toast('请上传头像')
|
||||||
|
// }
|
||||||
|
// if (!this.userName) {
|
||||||
|
// return this.$u.toast('请输入用户昵称')
|
||||||
|
// }
|
||||||
|
// if (this.userName == '微信用户') {
|
||||||
|
// return this.$u.toast('请修改用户昵称')
|
||||||
|
// }
|
||||||
|
// if (!this.userPhone) {
|
||||||
|
// return this.$u.toast('请输入手机号')
|
||||||
|
// }
|
||||||
|
if (!this.userRealName) {
|
||||||
|
return this.$u.toast('请输入姓名')
|
||||||
}
|
}
|
||||||
|
if (!this.userIdNumber) {
|
||||||
|
return this.$u.toast('请输入身份证号')
|
||||||
|
}
|
||||||
|
if (!this.$idCardNoUtil.checkIdCardNo(this.userIdNumber)) {
|
||||||
|
return this.$u.toast('请输入正确的身份证号码')
|
||||||
|
}
|
||||||
|
if (!this.userAreaId) {
|
||||||
|
return this.$u.toast('请选择地区')
|
||||||
|
}
|
||||||
|
|
||||||
|
this.flag = true
|
||||||
|
this.$instance.post(`/app/appwechatuserqujing/idNumberEdit`, {
|
||||||
|
avatarUrl: this.avatar,
|
||||||
|
nickName: this.userName,
|
||||||
|
phone: this.userPhone,
|
||||||
|
name: this.userRealName,
|
||||||
|
idNumber: this.userIdNumber,
|
||||||
|
areaId: this.userAreaId,
|
||||||
|
areaName: this.userAreaName
|
||||||
}).then(res=> {
|
}).then(res=> {
|
||||||
if(res?.code==0) {
|
if(res?.code==0) {
|
||||||
this.$u.toast('修改成功')
|
this.$u.toast('提交成功')
|
||||||
|
this.autoLogin({ loginWay:'qujing'})
|
||||||
|
uni.$emit('auth')
|
||||||
|
setTimeout(() => {
|
||||||
|
if (this.isFromTabbar == 1) {
|
||||||
|
uni.switchTab({ url: this.path })
|
||||||
|
} else {
|
||||||
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
|
}, 600);
|
||||||
|
}
|
||||||
|
}).catch(err=> {
|
||||||
|
this.$u.toast(err.msg)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
upLoad(img) {
|
upLoad(img) {
|
||||||
@@ -110,39 +195,29 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onLogout() {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: "是否要退出登录",
|
|
||||||
success: res => {
|
|
||||||
if (res.confirm) {
|
|
||||||
this.$store.commit('logout')
|
|
||||||
this.$toast('退出成功');
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/AppMine/AppMine'
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleWeixin({ detail }) {
|
|
||||||
if(detail.value) {
|
|
||||||
this.phone = detail.value
|
|
||||||
this.updateInfo()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleWeixinSync({detail}) {
|
handleWeixinSync({detail}) {
|
||||||
const { value: nickName, avatarUrl } = detail
|
const { avatarUrl } = detail
|
||||||
this.autoLogin({ nickName, avatarUrl })
|
|
||||||
if(avatarUrl?.length) {
|
if(avatarUrl?.length) {
|
||||||
this.upLoad(avatarUrl).then(() => {
|
this.upLoad(avatarUrl)
|
||||||
this.updateInfo()
|
}
|
||||||
|
},
|
||||||
|
handleSelectArea(v) {
|
||||||
|
this.userAreaName = v.areaName
|
||||||
|
this.userAreaId = v.id
|
||||||
|
},
|
||||||
|
idNumberInput() {
|
||||||
|
if(this.userIdNumber.length == 18 && this.userRealName) {
|
||||||
|
if(!this.userAreaId) {
|
||||||
|
this.$instance.post(`/app/appresidentapplet/queryDetailByIdNumberAndName`,{
|
||||||
|
name: this.userRealName,
|
||||||
|
idNumber: this.userIdNumber
|
||||||
|
}).then(res=> {
|
||||||
|
if(res.data && res.data.id) {
|
||||||
|
this.userAreaId = res.data.id
|
||||||
|
this.userAreaName = res.data.areaName
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if(nickName) {
|
|
||||||
this.updateInfo()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -191,6 +266,31 @@ export default {
|
|||||||
p {
|
p {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ai-area__wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-left: 100px;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #333;
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
color: #999;
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 16px;
|
||||||
|
height: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .AiAreaPicker {
|
||||||
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-img-div {
|
.user-img-div {
|
||||||
@@ -274,9 +374,8 @@ export default {
|
|||||||
color: #197DF0;
|
color: #197DF0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// .editNickName {
|
.btn-edit {
|
||||||
// text-align: right;
|
background: #FFF;
|
||||||
// font-size: 28px;
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user