guo00guo 5 yıl önce
ebeveyn
işleme
a183cb9223

+ 5 - 5
src/pages/DetailPage/AgencyDetail.vue

@@ -32,11 +32,11 @@
           <span  v-for="(item,index) in authentication.evaluationAgencyAbilityList"
                 :key="index"><span class="badge">{{item}}</span></span>
         </el-form-item>
-        <el-form-item label="测评机构资源" prop="evaluationAgencyResourceList">
-          <span  v-for="item in authentication.evaluationAgencyResourceList" :key="item.id">
-            资源类型:{{item.type}};&nbsp;&nbsp;资源名称:{{item.name}};&nbsp;&nbsp;资源总量:{{item.totalNum}};&nbsp;&nbsp;可用资源:{{item.availableNum}}<br/>
-          </span>
-        </el-form-item>
+<!--        <el-form-item label="测评机构资源" prop="evaluationAgencyResourceList">-->
+<!--          <span  v-for="item in authentication.evaluationAgencyResourceList" :key="item.id">-->
+<!--            资源类型:{{item.type}};&nbsp;&nbsp;资源名称:{{item.name}};&nbsp;&nbsp;资源总量:{{item.totalNum}};&nbsp;&nbsp;可用资源:{{item.availableNum}}<br/>-->
+<!--          </span>-->
+<!--        </el-form-item>-->
 
         <el-form-item label="接包数量" prop="taskCount" v-if="this.type == 0">
           <span >{{authentication.taskCount}}</span>

+ 1 - 0
src/pages/UserCenter/ReBindingMail.vue

@@ -51,6 +51,7 @@
         rules: {
           verifyCode: [
             {required: true, message: '请输入验证码', trigger: 'blur'},
+              {min:6, max: 6, message: '验证码长度为6个字符', trigger: 'blur'}
           ],
           email: [
             {required: true, message: '请输入邮箱', trigger: 'blur'},

+ 59 - 24
src/pages/UserCenter/ReBindingMobile.vue

@@ -5,12 +5,12 @@
       <el-step title="绑定新手机"></el-step>
     </el-steps>
 
-    <el-form label-width="80px" style="width:400px;" :rules="rules">
+    <el-form label-width="80px" style="width:400px;" :rules="rules" :model="phoneBindingForm">
       <el-form-item label="原手机号" v-if="active===0" prop="phone">
         <span v-model="phoneBindingForm.phone">{{this.user.mobile}}</span>
       </el-form-item>
-      <el-form-item label="新手机号" v-if="active===1" prop="phone">
-        <el-input v-model="phoneBindingForm.phone"></el-input>
+      <el-form-item label="新手机号" v-if="active===1" prop="newPhone">
+        <el-input v-model="phoneBindingForm.newPhone"></el-input>
       </el-form-item>
       <el-form-item label="验证码" prop="verifyCode">
         <el-input placeholder="验证码内容" v-model="phoneBindingForm.verifyCode" class="input-with-select">
@@ -41,17 +41,23 @@
         user: {},
         phoneBindingForm: {
           phone: '',
-          verifyCode: ''
+          verifyCode: '',
+          newPhone:'',
         },
         hasVerifyCode: false,
         codeTime: 60,
         rules: {
           verifyCode: [
             {required: true, message: '请输入验证码', trigger: 'blur'},
+              {min: 6, max: 6, message: '验证码长度为6个字符', trigger: 'blur'}
           ],
           phone: [
             {required: true, message: '请输入手机号', trigger: 'blur'},
           ],
+          newPhone:  [
+              {required: true, message: '请输入手机号', trigger: 'blur'},
+              {min: 11, max: 11, message: '手机号不合法', trigger: 'blur'}
+          ],
         }
       }
     },
@@ -78,6 +84,8 @@
               this.phoneBindingForm.phone = '';
               this.phoneBindingForm.verifyCode = '';
               this.setUserInfo();
+            }else{
+                notify('error', '验证原手机失败:' + res.data);
             }
           }).catch(err => {
             notify('error', '验证原手机失败:' + err.data);
@@ -85,7 +93,7 @@
         } else {
           let params = {
             "id": this.user.id,
-            "mobile": this.phoneBindingForm.phone,
+            "mobile": this.phoneBindingForm.newPhone,
             "verifyCode": this.phoneBindingForm.verifyCode
           };
           Http.put('/api/user/mobile', params).then(res => {
@@ -102,26 +110,53 @@
 
       },
       getVerifyCode() {
-        let params = {
-          id: this.user.id,
-          mobile: this.phoneBindingForm.phone
-        }
-        Http.put('/api/verify/mobile', params).then((res) => {
-          this.hasVerifyCode = true;
-          let _this = this;
-          let codeTimer = setInterval(function () {
-            if (_this.codeTime > 0) {
-              _this.codeTime--;
-            } else {
-              clearInterval(codeTimer);
-              _this.hasVerifyCode = false;
-              this.codeTime = 10;
-            }
-          }, 1000)
-        }).catch(err => {
-          notify('error', '获取验证码失败:' + err.data);
-        })
+          if (this.active === 0) {
+              //1.验证原手机
+              let params = {
+                  id: this.user.id,
+                  mobile: this.phoneBindingForm.phone
+              }
+              Http.put('/api/verify/mobile', params).then((res) => {
+                  this.hasVerifyCode = true;
+                  let _this = this;
+                  let codeTimer = setInterval(function () {
+                      if (_this.codeTime > 0) {
+                          _this.codeTime--;
+                      } else {
+                          clearInterval(codeTimer);
+                          _this.hasVerifyCode = false;
+                          this.codeTime = 10;
+                      }
+                  }, 1000)
+              }).catch(err => {
+                  notify('error', '获取验证码失败:' + err.data);
+              })
+          }else{
+              //2.验证新手机
+              let params = {
+                  id: this.user.id,
+                  mobile: this.phoneBindingForm.newPhone
+              }
+              console.log("手机号:" + this.phoneBindingForm.newPhone);
+              notify("手机号:" + this.phoneBindingForm.newPhone);
+              Http.put('/api/verify/mobile', params).then((res) => {
+                  this.hasVerifyCode = true;
+                  let _this = this;
+                  let codeTimer = setInterval(function () {
+                      if (_this.codeTime > 0) {
+                          _this.codeTime--;
+                      } else {
+                          clearInterval(codeTimer);
+                          _this.hasVerifyCode = false;
+                          this.codeTime = 10;
+                      }
+                  }, 1000)
+              }).catch(err => {
+                  notify('error', '获取验证码失败:' + err.data);
+              })
+          }
       }
+
     },
     mounted() {
       this.setUserInfo();