diff --git a/pages/mine/index.vue b/pages/mine/index.vue index cab583b..0a7ee4f 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -111,7 +111,7 @@ data() { return { fontValue:uni.getStorageSync('fontSize') || 8, - userName: uni.getStorageSync('userName')||"", + userName: "", phonenumber: uni.getStorageSync('phonenumber')||"", headPortraitUrl:"/static/images/my/face.png", defaultImg: '/static/images/my/face.png', @@ -134,6 +134,7 @@ getUserInfo() { getUserInfo().then(res => { this.headPortraitUrl= res.user.avatar + this.userName = res.user.nickName }) }, // 获取钱包余额 diff --git a/pages/mine/me/basicInfo.vue b/pages/mine/me/basicInfo.vue index d0ce0e3..5366817 100644 --- a/pages/mine/me/basicInfo.vue +++ b/pages/mine/me/basicInfo.vue @@ -25,7 +25,7 @@ 姓名 - {{userInfo.userName}} + {{userInfo.nickName}} @@ -34,9 +34,7 @@ 手机号 - - @@ -202,6 +200,13 @@ // "pwd":uni.getStorageSync('pwd'), // "sourceType":7 // } + if (!/^1[3456789]\d{9}$/.test(this.userInfo.phonenumber)) { + uni.showToast({ + title: '请输入正确的手机号', + icon: 'none' + }); + return false; + } updateUserProfile(this.userInfo).then(res => { if(res.code==200){ uni.showToast({