Browse Source

账号申诉、更换管理员申诉、密码重置申诉页面增加验证手机号是否已注册的接口

hangb 7 years ago
parent
commit
0ce5331e7f

+ 25 - 3
components/appeal/AccountAppeal.vue

@@ -8,7 +8,10 @@
         <div>
           <el-form :model="account" :rules="rules" ref="account" label-width="100px" class="demo-ruleForm">
             <el-form-item prop="mobile">
-              <el-input v-model="account.mobile" placeholder="新手机号码"></el-input>
+              <el-input v-model="account.mobile"
+                        v-bind:class="{active: mobileExit}"
+                        placeholder="新手机号码"></el-input>
+              <span class="tip tip-mobile" v-show="mobileExit">该手机已被注册</span>
             </el-form-item>
             <el-form-item prop="code">
               <el-input type="text" v-model="account.code"
@@ -78,6 +81,7 @@
           callback(new Error('请填写正确的手机号'))
           this.getCodeBtnIsDisabled = true
           this.mobileChecked = false
+          this.mobileExit = false
         } else {
           if (this.account.mobile !== '') {
             var reg = /^1[0-9]{10}$/
@@ -85,9 +89,20 @@
               callback(new Error('请填写正确的手机号'))
               this.getCodeBtnIsDisabled = true
               this.mobileChecked = false
+              this.mobileExit = false
             } else {
-              this.getCodeBtnIsDisabled = false
-              this.mobileChecked = true
+              this.$http.get(`/update/user/mobile/hasRegister`, {params: {mobile: this.account.mobile}})
+                .then(response => {
+                  if (response.data.content.hasRegister) {
+                    this.getCodeBtnIsDisabled = true
+                    this.mobileChecked = false
+                    this.mobileExit = true
+                  } else {
+                    this.getCodeBtnIsDisabled = false
+                    this.mobileChecked = true
+                    this.mobileExit = false
+                  }
+                })
             }
           }
           callback()
@@ -241,6 +256,7 @@
         contactNameChecked: false,
         contactTelChecked: false,
         contactEmailChecked: false,
+        mobileExit: false,
         rules: {
           mobile: [
             {validator: validateMobile, trigger: 'blur'}
@@ -436,6 +452,12 @@
     color: #0076ad;
   }
   }
+  span.tip.tip-mobile{
+    top: 3px;
+    right: -105px;
+    color: #ff4949;
+    font-size: 12px;
+  }
   span.tip.description {
     top: 10px;
     right: -266px;

+ 26 - 4
components/appeal/ChangeManagerAppeal.vue

@@ -8,11 +8,14 @@
         <div>
           <el-form :model="changeManager" :rules="rules" ref="changeManager" label-width="100px" class="demo-ruleForm">
             <el-form-item prop="mobile">
-              <el-input v-model="changeManager.mobile" placeholder="新管理员手机号"></el-input>
+              <el-input v-model="changeManager.mobile"
+                        v-bind:class="{active: mobileExit}"
+                        placeholder="新管理员手机号"></el-input>
+              <span class="tip tip-mobile" v-show="mobileExit">该手机已被注册</span>
             </el-form-item>
             <el-form-item prop="code">
               <el-input type="text" v-model="changeManager.code"
-                        v-bind:class="{ active: codeErrorChecked }"
+                        v-bind:class="{active: codeErrorChecked}"
                         auto-complete="off" class="msg"
                         placeholder="短信验证码"></el-input>
               <el-button type="primary" class="code"
@@ -154,6 +157,7 @@
           callback(new Error('请填写正确的手机号'))
           this.getCodeBtnIsDisabled = true
           this.mobileChecked = false
+          this.mobileExit = false
         } else {
           if (this.changeManager.mobile !== '') {
             var reg = /^1[0-9]{10}$/
@@ -161,9 +165,20 @@
               callback(new Error('请填写正确的手机号'))
               this.getCodeBtnIsDisabled = true
               this.mobileChecked = false
+              this.mobileExit = false
             } else {
-              this.getCodeBtnIsDisabled = false
-              this.mobileChecked = true
+              this.$http.get(`/update/user/mobile/hasRegister`, {params: {mobile: this.changeManager.mobile}})
+                .then(response => {
+                  if (response.data.content.hasRegister) {
+                    this.getCodeBtnIsDisabled = true
+                    this.mobileChecked = false
+                    this.mobileExit = true
+                  } else {
+                    this.getCodeBtnIsDisabled = false
+                    this.mobileChecked = true
+                    this.mobileExit = false
+                  }
+                })
             }
           }
           callback()
@@ -375,6 +390,7 @@
         descriptionTip: true,
         isSpaceNameExist: false,
         mobileChecked: false,
+        mobileExit: false,
         codeChecked: false,
         spaceNameChecked: false,
         businessCodeChecked: false,
@@ -748,6 +764,12 @@
     color: #0076ad;
   }
   }
+  span.tip.tip-mobile{
+    top: 3px;
+    right: -105px;
+    color: #ff4949;
+    font-size: 12px;
+  }
   span.tip.exist {
     color: #f56c6c;
     font-size: 12px;

+ 26 - 4
components/appeal/PasswordRestAppeal.vue

@@ -8,7 +8,10 @@
         <div>
           <el-form :model="passwordRest" :rules="rules" ref="passwordRest" label-width="100px" class="demo-ruleForm">
             <el-form-item prop="mobile">
-              <el-input v-model="passwordRest.mobile" placeholder="新手机号码"></el-input>
+              <el-input v-model="passwordRest.mobile"
+                        v-bind:class="{active: mobileExit}"
+                        placeholder="新手机号码"></el-input>
+              <span class="tip tip-mobile" v-show="mobileExit">该手机已被注册</span>
             </el-form-item>
             <el-form-item prop="code">
               <el-input type="text" v-model="passwordRest.code"
@@ -90,6 +93,7 @@
           callback(new Error('请填写正确的手机号'))
           this.getCodeBtnIsDisabled = true
           this.mobileChecked = false
+          this.mobileExit = false
         } else {
           if (this.passwordRest.mobile !== '') {
             var reg = /^1[0-9]{10}$/
@@ -97,9 +101,20 @@
               callback(new Error('请填写正确的手机号'))
               this.getCodeBtnIsDisabled = true
               this.mobileChecked = false
+              this.mobileExit = false
             } else {
-              this.getCodeBtnIsDisabled = false
-              this.mobileChecked = true
+              this.$http.get(`/update/user/mobile/hasRegister`, {params: {mobile: this.passwordRest.mobile}})
+                .then(response => {
+                  if (response.data.content.hasRegister) {
+                    this.getCodeBtnIsDisabled = true
+                    this.mobileChecked = false
+                    this.mobileExit = true
+                  } else {
+                    this.getCodeBtnIsDisabled = false
+                    this.mobileChecked = true
+                    this.mobileExit = false
+                  }
+                })
             }
           }
           callback()
@@ -113,7 +128,7 @@
         } else {
           if (this.passwordRest.code !== '') {
             if (this.passwordRest.mobile === '') {
-              callback(new Error('请先填写正确的手机号'))
+              callback(new Error('请先填写正确的验证码'))
             } else {
               if (this.token) {
                 let param = new FormData()
@@ -338,6 +353,7 @@
         contactNameChecked: false,
         contactTelChecked: false,
         contactEmailChecked: false,
+        mobileExit: false,
         rules: {
           mobile: [
             {validator: validateMobile, trigger: 'blur'}
@@ -574,6 +590,12 @@
     color: #0076ad;
   }
   }
+  span.tip.tip-mobile{
+    top: 3px;
+    right: -105px;
+    color: #ff4949;
+    font-size: 12px;
+  }
   span.tip.description {
     top: 10px;
     right: -266px;