wangJJ 5 年之前
父节点
当前提交
d87a7572b6

+ 5 - 3
src/pages/UserCenter/Authentication.vue

@@ -74,7 +74,8 @@
         authType:-1,
         authDetail:{},
         authInfo:{},
-        authStatus:''
+        authStatus:'',
+        firstSubmit:0
       }
     },
     methods: {
@@ -85,10 +86,10 @@
         this.loading = false
       },
       gotoPersonalAuth(){
-        this.$router.push({path:'/personal/authentication/individual'})
+        this.$router.push({path:'/personal/authentication/individual',query:{type:this.firstSubmit}})
       },
       gotoEnterpriseAuth(){
-        this.$router.push({path:'/personal/authentication/enterprise'})
+        this.$router.push({path:'/personal/authentication/enterprise',query:{type:this.firstSubmit}})
       },
       //获取当前资质状态
       getAuthStatus(){
@@ -108,6 +109,7 @@
             this.selectedCardImg = 'authentication-card-select'
           }else if((!res.enterpriseAuthVO) || (!res.agencyVO)){
             this.authType = 0  //无
+            this.firstSubmit = 1
           }
           this.hideLoading();
         })

+ 4 - 0
src/pages/UserCenter/BindingMail.vue

@@ -100,6 +100,10 @@
         Http.put('/api/user/email',params).then(res=>{
           if(res.msg == "ERROR"){
             notify('error', '重新绑定失败:' + res.data);
+            this.emailBindingForm.email = '';
+            this.emailBindingForm.verifyCode = '';
+            this.codeTime = 60;
+            this.hasVerifyCode = false;
           }else{
             notify('success', '重新绑定成功');
             this.$router.push({path:'/personal/mailBinding'});

+ 5 - 0
src/pages/UserCenter/BindingMobile.vue

@@ -91,6 +91,11 @@
         Http.put('/api/user/mobile', params).then(res => {
           if (res.msg == "ERROR") {
             notify('error', '重新绑定失败:' + res.data);
+            this.active = 1;
+            this.phoneBindingForm.phone = '';
+            this.phoneBindingForm.verifyCode = '';
+            this.codeTime = 60;
+            this.hasVerifyCode = false;
           } else {
             notify('success', '重新绑定成功');
             this.$router.push({path: '/personal/phoneBinding'});

+ 28 - 11
src/pages/UserCenter/EnterpriseAuth.vue

@@ -4,7 +4,7 @@
       <span style="font-size: 18px;font-weight: bold">企业认证</span>
       <el-tag :type="authStatus.style" v-if="authType===1">{{authStatus.text}}</el-tag>
       <el-tag type="danger" v-if="authType===0">未认证</el-tag>
-      <el-button type="primary" class="pull-right" size="small" v-if="!canEdit" @click="canEdit = true">编辑</el-button>
+<!--      <el-button type="primary" class="pull-right" size="small" v-if="canEdit" @click="canEdit = true">编辑</el-button>-->
     </div>
     <el-steps :active="active" process-status="finish" style="width: 400px;margin: 0 auto;margin-bottom: 20px;">
       <el-step title="上传企业信息"></el-step>
@@ -186,6 +186,7 @@
         user: {},
         canEdit:false,
         authType:-1,
+        authStatus:{},
         enterpriseForm: {
           roleList: [],//0是发包 1是接包 如果两个都有那么权限都有。
           legalPersonName: "", //法人姓名
@@ -205,21 +206,31 @@
     },
     methods: {
       submitEnterpriseAuth() {
-        Http.put(`/api/user/${this.user.id}/agency`, this.enterpriseForm).then(res => {
-          if (res) {
-            notify('success', '提交成功');
-            this.$router.push('/personal/authentication')
-          }
-        })
+        let firstSubmit = this.$route.query.type;
+        if(firstSubmit==1){
+          Http.post(`/api/user/${this.user.id}/agency`, this.enterpriseForm).then(res => {
+            if (res) {
+              notify('success', '提交成功');
+              this.$router.push('/personal/authentication')
+            }
+          })
+        }else{
+          Http.put(`/api/user/${this.user.id}/agency`, this.enterpriseForm).then(res => {
+            if (res) {
+              notify('success', '修改成功');
+              this.$router.push('/personal/authentication')
+            }
+          })
+        }
       },
       //获取当前认证状态
       getAuthStatus() {
         Http.get(`/api/user/${this.user.id}`).then(res => {
           if (res.agencyVO) {
             this.authType = 1  //企业已参与认证
-            this.authStatus = res.agencyVO.authStatus
+            this.authStatus = res.agencyVO.authStatus ? res.agencyVO.authStatus : {}
             //成功和审核中状态不可编辑,认证失败状态可编辑
-            this.authStatus.style !== 'info' ? this.canEdit = true : null
+            this.authStatus.style === 'info' ? this.canEdit = true : null
             this.failureReason = res.agencyVO.explain
             this.setFormInfo(res.agencyVO);
           } else {
@@ -294,7 +305,8 @@
     },
     mounted() {
       this.setUserInfo();
-      this.getAuthStatus()
+      this.getAuthStatus();
+      console.log(this.$route.params.type)
     }
   }
 </script>
@@ -322,15 +334,20 @@
     width: 270px;
     height: 170px;
   }
+  .avatar-uploader .el-upload{
+    width: 170px;
+    height: 170px;
+  }
   .avatar-uploader .el-upload:hover {
     border-color: #409EFF;
   }
+
   .avatar-uploader-icon {
     font-size: 28px;
     color: #8c939d;
     width: 100%;
     height:170px;
-    line-height: 178px;
+    line-height: 170px;
     text-align: center;
   }
   .avatar {

+ 23 - 12
src/pages/UserCenter/IndividualAuth.vue

@@ -4,7 +4,7 @@
       <span style="font-size: 18px;font-weight: bold;margin-right: 10px">个人认证</span>
       <el-tag :type="authStatus.style" v-if="authType===1">{{authStatus.text}}</el-tag>
       <el-tag type="danger" v-if="authType===0">未认证</el-tag>
-      <el-button type="primary" class="pull-right" size="small" v-if="!canEdit" @click="canEdit = true">编辑</el-button>
+<!--      <el-button type="primary" class="pull-right" size="small" v-if="canEdit" @click="canEdit = true">编辑</el-button>-->
     </div>
     <!--    <div class="individual-steps-wrapper">-->
     <!--      <el-steps :active="active" process-status="finish" style="margin-bottom: 20px;width: 300px">-->
@@ -165,7 +165,7 @@
         authType: -1,
         authDetail: {},
         authStatus: '',
-        canEdit: false
+        canEdit: false,
       }
     },
     methods: {
@@ -173,16 +173,27 @@
         this.user = storageGet('user') && storageGet('user').userVO;
       },
       submitIndividualAuth() {
-        let requestMethod = canEdit ? 'put' : 'post'
+        let firstSubmit = this.$route.query.type;
+        if(firstSubmit == 1){
+          Http.post(`/api/user/${this.user.id}/personalAuth`, this.individualForm).then(res => {
+            if (res) {
+              notify('success', '提交成功');
+              this.$router.push('/personal/authentication')
+            }
+          }).catch(err => {
+            notify('error', err.data)
+          })
+        }else{
+          Http.put(`/api/user/${this.user.id}/personalAuth`, this.individualForm).then(res => {
+            if (res) {
+              notify('success', '修改成功');
+              this.$router.push('/personal/authentication')
+            }
+          }).catch(err => {
+            notify('error', err.data)
+          })
+        }
 
-        Http.put(`/api/user/${this.user.id}/personalAuth`, this.individualForm).then(res => {
-          if (res) {
-            notify('success', '提交成功');
-            this.$router.push('/personal/authentication')
-          }
-        }).catch(err => {
-          notify('error', err.data)
-        })
       },
       //获取当前认证状态
       getAuthStatus() {
@@ -191,7 +202,7 @@
             this.authType = 1  //个人已参与认证
             this.authStatus = res.personalAuthVO.authStatus
             //成功和审核中状态不可编辑,认证失败状态可编辑
-            // this.authStatus.style === 'info' ? this.canEdit = true : null
+            this.authStatus.style === 'info' ? this.canEdit = true : null
             this.failureReason = res.personalAuthVO.explain
             this.setFormInfo(res.personalAuthVO);
           } else {

+ 10 - 1
src/pages/UserCenter/PhoneBinding.vue

@@ -4,7 +4,7 @@
       <div class="right-modifyPsw-title">
         <span style="font-size: 18px;font-weight: bold">手机绑定</span>
       </div>
-      <div>
+      <div v-loading="loading">
         <div style="background-color: rgba(233,239,249,1);padding: 10px;margin-bottom: 30px" v-if="user.mobile">
           <img src="../../assets/img/phoneBinding.png"></img>
           <span style="font-size: 16px">您已绑定的手机号码是{{this.user.mobile}}</span>
@@ -35,6 +35,7 @@
     data() {
       return {
         active: 0,
+        loading:false,
         showBingWranning:false,
         user:{},
         phoneBindingForm: {
@@ -44,6 +45,12 @@
       }
     },
     methods: {
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
       changePhoneNumber(){
         this.$router.push({
           path: '/personal/phoneBinding/rebinding',
@@ -55,9 +62,11 @@
         });
       },
       setUserInfo(){
+        this.showLoading()
         let userId = storageGet('user')&&storageGet('user').userVO.id;
         Http.get(`/api/user/${userId}`).then(res=>{
           this.user = res.userVO
+          this.hideLoading()
         })
       },
     },

+ 7 - 2
src/pages/UserCenter/ReBindingMail.vue

@@ -57,7 +57,6 @@
             { validator: isEmail, trigger: "blur" }
           ],
         },
-
       }
     },
     methods: {
@@ -76,9 +75,15 @@
         Http.put('/api/user/email', params).then((res) => {
           if (res.msg == "ERROR") {
             notify('error', '重新绑定失败:' + res.data);
+            this.emailBindingForm.email = '';
+            this.emailBindingForm.verifyCode = '';
+            this.codeTime = 60;
+            this.hasVerifyCode = false;
           } else {
             notify('success', '重新绑定成功');
-            this.$router.push({path: '/personal/mailBinding'});
+            if(confirm('重新绑定成功,即将跳转至邮箱绑定页面...')){
+              this.$router.push({path: '/personal/mailBinding'});
+            }
           }
         })
       },

+ 10 - 3
src/pages/UserCenter/ReBindingMobile.vue

@@ -5,7 +5,7 @@
       <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" :ref="phoneBindingForm">
       <el-form-item label="原手机号" v-if="active===0" prop="phone">
         <span v-model="phoneBindingForm.phone">{{this.user.mobile}}</span>
       </el-form-item>
@@ -77,9 +77,14 @@
               this.active = 1;
               this.phoneBindingForm.phone = '';
               this.phoneBindingForm.verifyCode = '';
-              this.setUserInfo();
+              this.codeTime = 60;
+              this.hasVerifyCode = false;
             }
           }).catch(err => {
+            this.phoneBindingForm.phone = '';
+            this.phoneBindingForm.verifyCode = '';
+            this.codeTime = 60;
+            this.hasVerifyCode = false;
             notify('error', '验证原手机失败:' + err.data);
           })
         } else {
@@ -93,7 +98,9 @@
               notify('error', '重新绑定失败:' + res.data);
             } else {
               notify('success', '重新绑定成功');
-              this.$router.push({path: '/personal/phoneBinding'});
+              if(confirm('重新绑定成功,即将跳转至手机绑定页面...')){
+                this.$router.push({path: '/personal/mailBinding'});
+              }
             }
           }).catch(err => {
             notify('error', '重新绑定失败:' + err.data);