From 5d391a3297fa02eeaab04bf49a5def5310b860cd Mon Sep 17 00:00:00 2001 From: song Date: Wed, 8 Dec 2021 10:12:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../git-phone-power/git-phone-power.vue | 29 ++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1bf28b..d8dc6e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -182,6 +182,7 @@ - | 时间轴骨架屏修改 | [ca78d02](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/ca78d02) - | 添加canvas | [9bc13c7](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/9bc13c7) - | 监听时间基本点 | [033fca0](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/033fca0) + - | 答题时记录做到第几题 | [547eb6e](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/547eb6e) - | 绘制canvas | [3c9d471](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/3c9d471) - | 绘图背景图显示及路径绘制 | [964e41e](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/964e41e) - | 缓存基本信息 | [d160dad](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/d160dad) diff --git a/src/pagesUser/git-phone-power/git-phone-power.vue b/src/pagesUser/git-phone-power/git-phone-power.vue index 927ac04..23b3f46 100644 --- a/src/pagesUser/git-phone-power/git-phone-power.vue +++ b/src/pagesUser/git-phone-power/git-phone-power.vue @@ -66,7 +66,6 @@ export default { // 如果没有id,则提示当前手机号已存在,是否合并信息 async getphonenumber(e) { if (this.user && this.user.phone) return; - console.log('e: ', e, e.detail.errMsg); // if (e.detail.errMsg === 'getPhoneNumber:fail user deny') { // this.$u.route('/pagesUser/phone-bind/phone-bind'); // } else { @@ -106,8 +105,9 @@ export default { }, // 取消合并账号弹窗 - noMerge() { + async noMerge() { this.bindingPhone = false; + await this.isMerge(1); }, // 确定合并账号弹窗 yesMerge() { @@ -117,14 +117,23 @@ export default { async isMerge(merge) { try { const data = await this.$u.api.phoneMerge(this.phone, merge); - this.setUser(data); - this.setToken(data.token); - this.$refs.uTips.show({ - title: '手机号合并成功, 即将跳转上一页', - type: 'success', - duration: '3000', - }); - setTimeout(() => uni.redirectTo({ url: '/pages/index/index' }), 3000); + if (data && merge === 0) { + this.setUser(data); + this.setToken(data.token); + this.$refs.uTips.show({ + title: '手机号合并成功, 即将跳转上一页', + type: 'success', + duration: '3000', + }); + setTimeout(() => uni.redirectTo({ url: '/pages/index/index' }), 3000); + } else { + this.$refs.uTips.show({ + title: '即将跳转上一页', + type: 'success', + duration: '3000', + }); + setTimeout(() => uni.redirectTo({ url: '/pages/index/index' }), 3000); + } } catch (error) { console.error('error: ', error); this.$t.ui.showToast(error.msg || '手机号合并失败');