曲靖
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
<div class="wrap" @click="handleLogin()">
|
<div class="wrap" @click="handleLogin()">
|
||||||
<div class="user-img-div">
|
<div class="user-img-div">
|
||||||
<img :src="user.avatarUrl" alt="" class="user-img" v-if="user.id && user.avatarUrl"/>
|
<img :src="user.avatarUrl" alt="" class="user-img" v-if="user.id && user.avatarUrl"/>
|
||||||
<open-data type="userAvatarUrl" lang="zh_CN" class="user-img" v-else/>
|
<img class="user-img" src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" v-else alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="user-info">
|
<div class="user-info">
|
||||||
<div class="option">
|
<div class="option">
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
<template v-else>
|
<template v-else>
|
||||||
<p v-if="isApprove">{{ user.realName || user.nickName}}</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>
|
<p>共累计学习<span>{{studyDuration || 0}}</span>分钟</p>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,35 +5,39 @@
|
|||||||
<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" open-type="chooseAvatar" @chooseavatar="handleWeixinSync">
|
||||||
<img :src="user.avatarUrl" class="user-img">
|
<img v-if="user.avatarUrl" :src="user.avatarUrl" class="user-img">
|
||||||
|
<img v-else src="https://cdn.cunwuyun.cn/dvcp/myFamily/tx.png" alt="" class="user-img">
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<p>用户昵称</p>
|
<p>用户昵称</p>
|
||||||
<div v-if="!editNickName" @click="editNickName=true">
|
<div class="item-right" v-if="!editNickName" @click="editNickName=true, userName = user.nickName">
|
||||||
<div class="name" v-text="nickName"/>
|
<div class="name">{{ user.nickName }}</div>
|
||||||
</div>
|
</div>
|
||||||
<input v-else type="nickname" class="editNickName" v-model="nickName" @blur="handleWeixinSync">
|
<input class="item-right" v-else type="text" v-model="userName" @blur="handleWeixinSync">
|
||||||
</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>{{ user.phone || '' }}</div>
|
<div class="item-right" v-if="!!!editPhone" @click="editPhone = true, userPhone = user.phone">
|
||||||
|
<p class="name">{{ user.phone || '' }}</p>
|
||||||
|
</div>
|
||||||
|
<input class="item-right" v-else type="number" v-model="userPhone" @blur="handleWeixin" maxlength="11">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-content mar-b8" v-if="user.areaId">
|
<div class="item-content mar-b8" v-if="user.areaId">
|
||||||
<div class="item solid">
|
<div class="item solid">
|
||||||
<p>姓名</p>
|
<p>姓名</p>
|
||||||
<div>{{ user.realName || '' }}</div>
|
<div class="item-right">{{ user.realName || '' }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item solid">
|
<div class="item solid">
|
||||||
<p>身份证号</p>
|
<p>身份证号</p>
|
||||||
<div>{{ user.idNumber || '' }}</div>
|
<div class="item-right">{{ user.idNumber || '' }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<p>地区</p>
|
<p>地区</p>
|
||||||
<div>{{ user.areaName || '' }}</div>
|
<div class="item-right">{{ user.areaName || '' }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-content" @click="onLogout">
|
<div class="item-content" @click="onLogout">
|
||||||
@@ -54,11 +58,21 @@ export default {
|
|||||||
...mapState(['token']),
|
...mapState(['token']),
|
||||||
nickName: {
|
nickName: {
|
||||||
set(v) {
|
set(v) {
|
||||||
|
this.userName = v
|
||||||
},
|
},
|
||||||
get() {
|
get() {
|
||||||
const {nickName} = this.user
|
const {nickName} = this.user
|
||||||
return nickName
|
return nickName
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
phone: {
|
||||||
|
set(v) {
|
||||||
|
this.userPhone = v
|
||||||
|
},
|
||||||
|
get() {
|
||||||
|
const { phone } = this.user
|
||||||
|
return phone
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -74,11 +88,29 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
editNickName: false,
|
editNickName: false,
|
||||||
user: {}
|
user: {},
|
||||||
|
editPhone: false,
|
||||||
|
avatar: '',
|
||||||
|
userName: '',
|
||||||
|
userPhone: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['autoLogin']),
|
...mapActions(['autoLogin']),
|
||||||
|
updateInfo() {
|
||||||
|
this.$instance.post(`/app/appwechatuser/update-nickName`, null, {
|
||||||
|
params: {
|
||||||
|
id: this.user.id,
|
||||||
|
nickName: this.userName ? this.userName : this.user.nickName,
|
||||||
|
avatarUrl: this.avatar ? this.avatar : this.user.avatarUrl,
|
||||||
|
phone: this.userPhone ? this.userPhone : this.user.phone,
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$u.toast('修改成功')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
upLoad(img) {
|
upLoad(img) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
@@ -90,6 +122,7 @@ export default {
|
|||||||
Authorization: uni.getStorageSync('token')
|
Authorization: uni.getStorageSync('token')
|
||||||
},
|
},
|
||||||
success: uploadFileRes => {
|
success: uploadFileRes => {
|
||||||
|
this.avatar = JSON.parse(uploadFileRes.data).data[0].split(';')[0]
|
||||||
resolve(uploadFileRes)
|
resolve(uploadFileRes)
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
@@ -115,9 +148,29 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
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 {value: nickName, avatarUrl} = detail
|
||||||
this.autoLogin({nickName, avatarUrl})
|
this.autoLogin({nickName, avatarUrl})
|
||||||
|
if (avatarUrl?.length) {
|
||||||
|
this.upLoad(avatarUrl).then(() => {
|
||||||
|
this.updateInfo()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (nickName) {
|
||||||
|
this.updateInfo()
|
||||||
|
}
|
||||||
|
setTimeout(()=> {
|
||||||
|
this.getUserInfo()
|
||||||
|
}, 500)
|
||||||
},
|
},
|
||||||
getUserInfo() {
|
getUserInfo() {
|
||||||
this.$instance.post(`/app/appwechatuserqujing/check`).then(res=> {
|
this.$instance.post(`/app/appwechatuserqujing/check`).then(res=> {
|
||||||
@@ -137,10 +190,12 @@ export default {
|
|||||||
background-color: #F4F5FA;
|
background-color: #F4F5FA;
|
||||||
|
|
||||||
.info-list {
|
.info-list {
|
||||||
padding: 50px 16px 0;
|
padding: 50px 32px 0 32px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
.item-content {
|
.item-content {
|
||||||
padding: 0 32px;
|
padding: 0 32px;
|
||||||
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 32px;
|
border-radius: 32px;
|
||||||
}
|
}
|
||||||
@@ -151,25 +206,31 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: content-box;
|
box-sizing: content-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
|
||||||
font-size: 30px;
|
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-family: PingFangSC-Regular;
|
color: #333;
|
||||||
color: #666;
|
font-weight: 400;
|
||||||
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div {
|
div {
|
||||||
font-family: PingFangSC-Medium;
|
color: #666;
|
||||||
font-weight: 500;
|
font-size: 28px;
|
||||||
color: #333;
|
}
|
||||||
|
|
||||||
|
.item-right {
|
||||||
|
width: calc(100% - 200px);
|
||||||
|
text-align: right;
|
||||||
|
font-size: 28px;
|
||||||
|
p {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-img-div {
|
.user-img-div {
|
||||||
width: 104px;
|
width: calc(100% - 200px);
|
||||||
height: 104px;
|
text-align: right;
|
||||||
border-radius: 50%;
|
display: inline-block;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-img {
|
.user-img {
|
||||||
|
|||||||
Reference in New Issue
Block a user