From 2536cc0a3db09209e749b4b8eaf7d6b3ef55de76 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Thu, 29 Aug 2024 14:39:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/auth/wxUserInfo.vue | 174 ++++++++++++++++++++++------------------------ 1 file changed, 82 insertions(+), 92 deletions(-) diff --git a/pages/auth/wxUserInfo.vue b/pages/auth/wxUserInfo.vue index 50ff5be..26f30c2 100644 --- a/pages/auth/wxUserInfo.vue +++ b/pages/auth/wxUserInfo.vue @@ -6,25 +6,17 @@ 申请获取你的头像、昵称 - - @@ -33,19 +25,15 @@ 昵称 - + - + 确认 - - + + @@ -53,89 +41,91 @@ export default { data() { return { - userInfo : { - headImage : '', - nickName : '', + userInfo: { + headImage: '', + nickName: '', } }; }, - onShow(){ - }, - computed : { - }, - methods : { - onChooseAvatar(res){ + onShow() {}, + computed: {}, + methods: { + onChooseAvatar(res) { let self = this self.$Oss.ossUpload(res.target.avatarUrl) - .then(url => { - self.userInfo.headImage = url - }) + .then(url => { + self.userInfo.headImage = url + }) }, - submit(){ + submit() { let self = this - + uni.createSelectorQuery().in(this) - .select("#nickName") - .fields({ - properties: ["value"], - }) - .exec((res) => { - const nickName = res?.[0]?.value - self.userInfo.nickName = nickName - }) - - if(this.$utils.verificationAll(this.userInfo, { - headImage : '请选择头像', - nickName : '请填写昵称', - })){ - return - } - - this.$api('infoUpdateInfo', this.userInfo, res => { - if(res.code == 200){ - uni.navigateBack(-1) - } - }) + .select("#nickName") + .fields({ + properties: ["value"], + }) + .exec((res) => { + const nickName = res?.[0]?.value + self.userInfo.nickName = nickName + + if (self.$utils.verificationAll(self.userInfo, { + headImage: '请选择头像', + nickName: '请填写昵称', + })) { + return + } + + self.$api('infoUpdateInfo', self.userInfo, res => { + if (res.code == 200) { + uni.navigateBack(-1) + } + }) + }) }, } } + \ No newline at end of file