From a296d76edaffb35ab2952641582369953b1e6595 Mon Sep 17 00:00:00 2001 From: From-wh Date: Wed, 22 Mar 2023 17:46:04 +0800 Subject: [PATCH] =?UTF-8?q?improve:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E8=8E=B7=E5=8F=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uni-app/pages/users/user_info/index.vue | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/template/uni-app/pages/users/user_info/index.vue b/template/uni-app/pages/users/user_info/index.vue index 8116dc3c2..a0455089f 100644 --- a/template/uni-app/pages/users/user_info/index.vue +++ b/template/uni-app/pages/users/user_info/index.vue @@ -170,7 +170,7 @@ userEdit, getLogout, getLangList, - getLangJson, + getLangJson, mpBindingPhone } from '@/api/user.js'; import { @@ -257,29 +257,31 @@ }); }, getphonenumber(e) { - Routine.getCode() - .then(code => { - let data = { - code, - iv: e.detail.iv, - encryptedData: e.detail.encryptedData, - } - mpBindingPhone(data).then(res => { - this.getUserInfo() - this.$util.Tips({ - title: res.msg, - icon: 'success' - }); - }).catch(err => { - return this.$util.Tips({ - title: err - }); + console.log(e) + if (e.detail.errMsg == 'getPhoneNumber:ok') { + Routine.getCode() + .then(code => { + let data = { + code, + iv: e.detail.iv, + encryptedData: e.detail.encryptedData, + } + mpBindingPhone(data).then(res => { + this.getUserInfo() + this.$util.Tips({ + title: res.msg, + icon: 'success' + }); + }).catch(err => { + return this.$util.Tips({ + title: err + }); + }) }) - }) - .catch(error => { - uni.hideLoading(); - }); - + .catch(error => { + uni.hideLoading(); + }); + } }, setLang() { this.array.map((item, i) => {