|
|
@@ -21,6 +21,7 @@ Component({
|
|
|
*/
|
|
|
data: {
|
|
|
inputNickName: '',
|
|
|
+ inputPhone: '',
|
|
|
avatarUrl: `${CDN_URL}images/default.png`,
|
|
|
CDN_URL
|
|
|
},
|
|
|
@@ -35,6 +36,11 @@ Component({
|
|
|
inputNickName: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
+ bindKeyPhone(e) {
|
|
|
+ this.setData({
|
|
|
+ inputPhone: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
onChooseAvatar(e) {
|
|
|
const {
|
|
|
avatarUrl
|
|
|
@@ -87,9 +93,9 @@ Component({
|
|
|
},
|
|
|
|
|
|
|
|
|
- updateUserInfo(cb = () => {}) {
|
|
|
+ updateUserInfo(cb = () => { }) {
|
|
|
|
|
|
- if (!this.data.avatarUrl || !this.data.inputNickName.trim()) {
|
|
|
+ if (!this.data.avatarUrl || !this.data.inputNickName.trim() || !this.data.inputPhone.trim()||this.data.inputPhone.length<11) {
|
|
|
wx.showToast({
|
|
|
title: '请补充完整信息~',
|
|
|
icon: 'error'
|
|
|
@@ -100,10 +106,11 @@ Component({
|
|
|
fetchutil.post(`api/cms/wxUser/update`, {
|
|
|
"avatarUrl": this.data.avatarUrl,
|
|
|
"nickName": this.data.inputNickName,
|
|
|
+ "phone": this.data.inputPhone,
|
|
|
}, {}).then((res) => {
|
|
|
app.globalData.userInfo = res.data;
|
|
|
cb()
|
|
|
- }).catch(() => {})
|
|
|
+ }).catch(() => { })
|
|
|
},
|
|
|
|
|
|
|