From 75bde22add4cf6552cbf3d47df2a92d7fbe1ecc0 Mon Sep 17 00:00:00 2001 From: linju-json Date: Thu, 11 Nov 2021 16:08:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=95=B4=E7=90=86=E5=90=8E?= =?UTF-8?q?=E7=AC=AC1=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uni-send-sms-code/uni-send-sms-code.vue | 100 ++++++------------ manifest.json | 12 +-- pages/grid/grid.vue | 89 ++++++++-------- pages/list/list.nvue | 14 ++- .../login-page/phone-code/phone-code.vue | 45 ++++---- .../login-page/pwd-login/pwd-login.vue | 94 ++++++++-------- .../login-page/pwd-retrieve/pwd-retrieve.vue | 50 ++++----- .../ucenter/login-page/register/register.vue | 32 +++--- pages/ucenter/settings/settings.vue | 6 +- .../userinfo/bind-mobile/bind-mobile.vue | 22 ++-- pages/ucenter/userinfo/userinfo.vue | 46 ++++---- 11 files changed, 238 insertions(+), 272 deletions(-) diff --git a/components/uni-send-sms-code/uni-send-sms-code.vue b/components/uni-send-sms-code/uni-send-sms-code.vue index 5e4615b..3b2f837 100644 --- a/components/uni-send-sms-code/uni-send-sms-code.vue +++ b/components/uni-send-sms-code/uni-send-sms-code.vue @@ -53,6 +53,7 @@ }; }, computed: { + innerText() { if (this.reverseNumber == 0) return this.$t('common.getVerifyCode'); return this.$t('smsCode.resendVerifyCode')+ '('+this.reverseNumber+'s)'; @@ -84,77 +85,48 @@ "type": this.codeType }, }, - }).then(({result})=>{ - console.log(result); - if (result.code === 0) { - uni.showToast({ - title: this.$t('smsCode.sendSuccessTip'), - icon: 'none' - }); - this.reverseNumber = Number(this.count); - this.getCode(); - this.$emit('getCode'); - } else { - uni.showModal({ - content: result.msg, - showCancel: false - }); + success: ({result}) => { + console.log(result); + if(result.code===0){ + uni.showToast({ + title: this.$t('smsCode.sendSuccessTip'), + icon: 'none' + }); + this.reverseNumber = Number(this.count); + this.getCode(); + this.$emit('getCode'); + }else{ + uni.showModal({ + content: result.msg, + showCancel: false + }); + } } - return result }) - - // uniCloud.callFunction({ - // name:'uni-id-cf', - // data:{ - // action:'sendSmsCode', - // params:{ - // "mobile": this.phone, - // "type": this.codeType - // }, - // }, - // success: ({result}) => { - // console.log(result); - // if(result.code===0){ - // uni.showToast({ - // title: this.$t('smsCode.sendSuccessTip'), - // icon: 'none' - // }); - // this.reverseNumber = Number(this.count); - // this.getCode(); - // this.$emit('getCode'); - // }else{ - // uni.showModal({ - // content: result.msg, - // showCancel: false - // }); - // } - // } - // }) - }, - getCode() { - if (this.reverseNumber == 0) { - clearTimeout(this.reverseTimer); - this.reverseTimer = null; - return; + }, + getCode() { + if (this.reverseNumber == 0) { + clearTimeout(this.reverseTimer); + this.reverseTimer = null; + return; + } + this.reverseNumber--; + this.reverseTimer = setTimeout(() => { + this.getCode(); + }, 1000) } - this.reverseNumber--; - this.reverseTimer = setTimeout(() => { - this.getCode(); - }, 1000) } } - } + diff --git a/pages/list/list.nvue b/pages/list/list.nvue index fb80bd8..1e5281e 100644 --- a/pages/list/list.nvue +++ b/pages/list/list.nvue @@ -22,7 +22,6 @@ - @@ -40,9 +39,8 @@ format="yyyy-MM-dd" :threshold="[60000, 2592000000]" /> - + - - - - + + + - - + +