实名认证修改
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
<input class="input" type="text" placeholder="请输入姓名" v-model="form.name"/>
|
<input class="input" type="text" placeholder="请输入姓名" v-model="form.name"/>
|
||||||
<div class="form_name"><span class="red">*</span>身份证号</div>
|
<div class="form_name"><span class="red">*</span>身份证号</div>
|
||||||
<input class="input" type="idcard" placeholder="请输入18位身份证号" v-model="form.idNumber"/>
|
<input class="input" type="idcard" placeholder="请输入18位身份证号" v-model="form.idNumber"/>
|
||||||
<div class="form_name"><span class="red">*</span>地区</div>
|
<div class="form_name"><span class="red">*</span>地区<span class="mini-text">(本地人员填户籍所在地,外地人员填常住地)</span></div>
|
||||||
<AiAreaPicker class="ai-area" v-model="form.areaId" :areaId="$areaId" :fullName.sync="form.areaName">
|
<AiAreaPicker class="ai-area" v-model="form.areaId" :areaId="$areaId" :fullName.sync="form.areaName">
|
||||||
<div class="ai-area__wrapper">
|
<div class="ai-area__wrapper">
|
||||||
<div>
|
<div>
|
||||||
@@ -324,6 +324,10 @@ export default {
|
|||||||
.red {
|
.red {
|
||||||
color: #FF4466;
|
color: #FF4466;
|
||||||
}
|
}
|
||||||
|
.mini-text {
|
||||||
|
color: #999;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
|
|||||||
@@ -4,46 +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">
|
||||||
<div class="name">{{ user.nickName }}</div>
|
<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 mar-b8" v-if="user.areaId">
|
|
||||||
|
<div class="item-content mar-b8">
|
||||||
<div class="item solid">
|
<div class="item solid">
|
||||||
<p>姓名</p>
|
<p>姓名</p>
|
||||||
<div class="item-right">{{ user.realName || '' }}</div>
|
<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>
|
||||||
<div class="item solid">
|
<div class="item solid">
|
||||||
<p>身份证号</p>
|
<p>身份证号</p>
|
||||||
<div class="item-right">{{ user.idNumber || '' }}</div>
|
<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>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<p>地区</p>
|
<p>地区</p>
|
||||||
<div class="item-right">{{ user.areaName || '' }}</div>
|
<div class="item-right" v-if="!editArea">
|
||||||
|
<p class="name">{{ user.areaName || '' }}</p>
|
||||||
|
</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>
|
</div>
|
||||||
<div class="item-content" @click="onLogout">
|
<div class="btn-wrapper btn-edit">
|
||||||
<div class="item">
|
<b class="btn" @click="btnText? submit(): editBtn()">{{ btnText? '提交': '修改' }}</b>
|
||||||
<p class="login-out">退出登录</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -53,64 +73,106 @@ import {mapActions, mapState} from 'vuex'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "userInfo",
|
name: "userInfo",
|
||||||
appName: "个人中心",
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['token']),
|
...mapState(['user', 'token']),
|
||||||
nickName: {
|
|
||||||
set(v) {
|
|
||||||
this.userName = v
|
|
||||||
},
|
|
||||||
get() {
|
|
||||||
const {nickName} = this.user
|
|
||||||
return nickName
|
|
||||||
}
|
|
||||||
},
|
|
||||||
phone: {
|
|
||||||
set(v) {
|
|
||||||
this.userPhone = v
|
|
||||||
},
|
|
||||||
get() {
|
|
||||||
const { phone } = this.user
|
|
||||||
return phone
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(o) {
|
||||||
uni.setNavigationBarTitle({
|
this.isFromTabbar = o.isFromTabbar
|
||||||
|
this.path = o.path
|
||||||
|
this.getUserInfo('qujing')
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
title: '个人中心'
|
title: '个人中心'
|
||||||
})
|
})
|
||||||
uni.setNavigationBarColor({
|
|
||||||
frontColor: "#000000",
|
|
||||||
backgroundColor: "#F4F6FA",
|
|
||||||
})
|
|
||||||
this.getUserInfo()
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
editAvatarUrl: false,
|
||||||
editNickName: false,
|
editNickName: false,
|
||||||
user: {},
|
|
||||||
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(['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;
|
||||||
areaId: this.userAreaId? this.userAreaId : this.user.areaId,
|
this.userPhone = this.user.phone
|
||||||
areaName: this.userAreaName ? this.userAreaName : this.user.areaName,
|
this.editRealName = true;
|
||||||
}
|
this.userRealName = this.user.realName
|
||||||
}).then(res => {
|
this.editIdNumber = true;
|
||||||
if (res?.code == 0) {
|
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=> {
|
||||||
|
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) {
|
||||||
@@ -133,54 +195,31 @@ 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()
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
this.getUserInfo()
|
|
||||||
}, 500)
|
|
||||||
},
|
|
||||||
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)
|
||||||
this.upLoad(avatarUrl).then(() => {
|
|
||||||
this.updateInfo()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
if (nickName) {
|
|
||||||
this.updateInfo()
|
|
||||||
}
|
|
||||||
setTimeout(()=> {
|
|
||||||
this.getUserInfo()
|
|
||||||
}, 500)
|
|
||||||
},
|
},
|
||||||
getUserInfo() {
|
handleSelectArea(v) {
|
||||||
this.$instance.post(`/app/appwechatuserqujing/check`).then(res=> {
|
this.userAreaName = v.areaName
|
||||||
if(res?.data) {
|
this.userAreaId = v.id
|
||||||
this.user = res.data
|
},
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -189,7 +228,7 @@ export default {
|
|||||||
|
|
||||||
.page {
|
.page {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #F4F5FA;
|
background-color: #F5F5F5;
|
||||||
|
|
||||||
.info-list {
|
.info-list {
|
||||||
padding: 50px 32px 0 32px;
|
padding: 50px 32px 0 32px;
|
||||||
@@ -227,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 {
|
||||||
@@ -251,14 +315,13 @@ export default {
|
|||||||
.mar-t22 {
|
.mar-t22 {
|
||||||
margin-top: 44px;
|
margin-top: 44px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.login-out {
|
.login-out {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 34px;
|
font-size: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: PingFangSC-Regular;
|
color: #4181FF;
|
||||||
color: #4181FF;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,12 +374,8 @@ export default {
|
|||||||
color: #197DF0;
|
color: #197DF0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editNickName {
|
.btn-edit {
|
||||||
text-align: right;
|
background: #FFF;
|
||||||
font-size: 28px;
|
|
||||||
}
|
|
||||||
.solid {
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user