Browse Source

1.增加手机号码格式限制
2.关闭后清空倒计时

tanxue 3 years ago
parent
commit
02693aebd4
1 changed files with 8 additions and 0 deletions
  1. 8 0
      components/registerDialog.vue

+ 8 - 0
components/registerDialog.vue

@@ -82,6 +82,8 @@
     methods:  {
       // 关闭
       delDlClose(){
+        this.countdown = -1;
+        this.telChangeDate.appKey=undefined;
         this.$refs.ruleTelForm.resetFields();
         // 子组件调用父组件方法,并传递参数
         this.$emit('changeShow','false')
@@ -169,6 +171,10 @@
           this.btnTextDisabled = false;
           this.btnText = '免费获取验证码';
           this.countdown = 60;
+        } else if(this.sqfaCountdown === -1){
+          this.btnTextDisabled = false;
+          this.btnText = '获取验证码';
+          this.countdown = 60;
         } else {
           this.btnTextDisabled = true;
           this.btnText = '重新发送(' + this.countdown + 's)';
@@ -205,6 +211,8 @@
             this.$axios.$post('/sendCode',req).then(res=>{
               if (res.code === 0 && res.data) {
                 this.setTime();
+              }else {
+                this.$message.error(res.msg||'手机号已存在');
               }
             })
           } else {