修改回显头像和昵称
This commit is contained in:
parent
f795dd9798
commit
dc2e5cb84a
@ -235,14 +235,15 @@
|
|||||||
this.phoneNumber = userInfo.mobile
|
this.phoneNumber = userInfo.mobile
|
||||||
this.niName = userInfo.nickname
|
this.niName = userInfo.nickname
|
||||||
this.realname = userInfo.username
|
this.realname = userInfo.username
|
||||||
this.avatar = uni.getStorageSync('userInfo').avatar
|
this.avatar = userInfo.avatar
|
||||||
this.$refs.datetimePicker.setFormatter(this.formatter)
|
this.$refs.datetimePicker.setFormatter(this.formatter)
|
||||||
// this.handelData()
|
// this.handelData()
|
||||||
this.getDetail()
|
// this.getDetail()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getSfInfo();
|
this.getSfInfo();
|
||||||
this.getBankList();
|
this.getBankList();
|
||||||
|
this.getDetail();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getBankList() {
|
getBankList() {
|
||||||
@ -301,7 +302,7 @@
|
|||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
uni.setStorageSync('userInfo', {
|
uni.setStorageSync('userInfo', {
|
||||||
...uni.getStorageSync('userInfo'),
|
...uni.getStorageSync('userInfo'),
|
||||||
avatar: avatar
|
avatar: this.avatar
|
||||||
});
|
});
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
@ -309,9 +310,9 @@
|
|||||||
message: '保存成功',
|
message: '保存成功',
|
||||||
duration: '1000',
|
duration: '1000',
|
||||||
complete: function() {
|
complete: function() {
|
||||||
setTimeout(function() {
|
// setTimeout(function() {
|
||||||
uni.navigateBack(1)
|
// uni.navigateBack(1)
|
||||||
}, 1000);
|
// }, 1000);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (res.code == 0) {
|
} else if (res.code == 0) {
|
||||||
@ -329,29 +330,29 @@
|
|||||||
const userinfo = res.data.user_info
|
const userinfo = res.data.user_info
|
||||||
uni.setStorageSync('userInfo', res.data.user_info)
|
uni.setStorageSync('userInfo', res.data.user_info)
|
||||||
uni.setStorageSync("niName", res.data.user_info.nickname)
|
uni.setStorageSync("niName", res.data.user_info.nickname)
|
||||||
if (userinfo.birthday !== null) {
|
// if (userinfo.birthday !== null) {
|
||||||
this.birthday = userinfo.birthday
|
// this.birthday = userinfo.birthday
|
||||||
}
|
// }
|
||||||
if (userinfo.work !== null) {
|
// if (userinfo.work !== null) {
|
||||||
this.zhiYe = userinfo.work
|
// this.zhiYe = userinfo.work
|
||||||
}
|
// }
|
||||||
if (userinfo.diqu !== null) {
|
// if (userinfo.diqu !== null) {
|
||||||
this.area = userinfo.diqu
|
// this.area = userinfo.diqu
|
||||||
}
|
// }
|
||||||
if (userinfo.avatar !== null) {
|
if (userinfo.avatar !== null) {
|
||||||
this.avatar = userinfo.avatar
|
this.avatar = userinfo.avatar
|
||||||
uni.setStorageSync('avatar', this.avatar)
|
uni.setStorageSync('avatar', this.avatar)
|
||||||
}
|
}
|
||||||
if (userinfo.nickname !== null) {
|
if (userinfo.nickname !== null) {
|
||||||
this.nickname = userinfo.nickname
|
this.niName = userinfo.nickname
|
||||||
uni.setStorageSync('niName', this.nickname)
|
uni.setStorageSync('niName', this.niName)
|
||||||
}
|
|
||||||
if (userinfo.gender !== null) {
|
|
||||||
this.gender = userinfo.gender == '1' ? '男' : '女'
|
|
||||||
}
|
|
||||||
if (userinfo.realname !== null) {
|
|
||||||
this.realname = userinfo.realname
|
|
||||||
}
|
}
|
||||||
|
// if (userinfo.gender !== null) {
|
||||||
|
// this.gender = userinfo.gender == '1' ? '男' : '女'
|
||||||
|
// }
|
||||||
|
// if (userinfo.realname !== null) {
|
||||||
|
// this.realname = userinfo.realname
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user