wangJJ hace 5 años
padre
commit
c57901a9cf

+ 2 - 0
src/main.js

@@ -12,6 +12,7 @@ import moment from 'moment'
 import vRegion from 'v-region'
 import {
   Avatar,
+  Alert,
   Badge,
   Button,
   ButtonGroup,
@@ -192,6 +193,7 @@ Vue.use(Progress)
 Vue.use(Steps)
 Vue.use(Step)
 Vue.use(Divider)
+Vue.use(Alert)
 Vue.prototype.$msgbox = MessageBox
 Vue.prototype.$alert = MessageBox.alert
 Vue.prototype.$confirm = MessageBox.confirm

+ 36 - 17
src/pages/UserCenter/EnterpriseAuth.vue

@@ -4,20 +4,24 @@
       <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">编辑</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="margin-bottom: 20px">
+    <el-steps :active="active" process-status="finish" style="width: 400px;margin: 0 auto;margin-bottom: 20px;">
       <el-step title="上传企业信息"></el-step>
       <el-step title="上传法人信息"></el-step>
 <!--      <el-step title="确认信息"></el-step>-->
 <!--      <el-step title="认证结果"></el-step>-->
     </el-steps>
-    <div class="upload-wrapper" v-if="active===0">
+    <el-alert
+      :title="failureReason"
+      type="error">
+    </el-alert>
+    <div class="upload-wrapper" v-if="active===0" style="margin-top: 10px">
       <el-row class="agency-form-item">
         <el-col :span="3">企业logo:</el-col>
         <el-col :span="12">
           <el-upload
-            class="avatar-uploader idcard-uploader"
+            class="avatar-uploader"
             style="border: lightgrey 1px solid"
             action="https://jsonplaceholder.typicode.com/posts/"
             :before-upload="beforeFileUpload"
@@ -98,9 +102,9 @@
       <div class="upload-wrapper">
         <el-row style="width: 100%">
           <el-col :span="9" style="padding-left: 30px">
-            <div>
+            <div style="height:50%">
               <el-upload
-                class="avatar-uploader"
+                class="avatar-uploader idcard-uploader"
                 style="border: lightgrey 1px solid"
                 action="https://jsonplaceholder.typicode.com/posts/"
                 :before-upload="beforeFileUpload"
@@ -112,7 +116,7 @@
               </el-upload>
               <div style="text-align: center">身份证正面照</div>
             </div>
-            <div style="width: 280px">
+            <div style="width: 280px;margin-top: 50px">
               <el-upload
                 class="avatar-uploader idcard-uploader"
                 style="border: lightgrey 1px solid"
@@ -172,6 +176,7 @@
         active: 0,
         user: {},
         canEdit:false,
+        authType:-1,
         enterpriseForm: {
           roleList: [],//0是发包 1是接包 如果两个都有那么权限都有。
           legalPersonName: "", //法人姓名
@@ -201,13 +206,14 @@
       getAuthStatus() {
         Http.get(`/api/user/${this.user.id}`).then(res => {
           if (res.agencyVO) {
-            this.authType = 1  //个人已参与认证
+            this.authType = 1  //企业已参与认证
             this.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 {
-            this.authType = 0  //未参与个人认证
+            this.authType = 0  //未参与企业认证
             this.canEdit = true
           }
         })
@@ -268,7 +274,6 @@
             this.enterpriseForm.IDCardPositivePhoto = res.data
           }else if(param.data.type == 3){
             this.enterpriseForm.agencyPhoto = res.data
-
           }
           notify('success', '上传成功')
           // this.$refs['agency'].validateField('photoUrl');
@@ -285,13 +290,27 @@
 </script>
 
 <style scoped lang="less">
-  .avatar-uploader .el-upload {
-    //border: 1px dashed #d9d9d9;
+  .avatar-uploader{
     border-radius: 6px;
     cursor: pointer;
     position: relative;
     overflow: hidden;
     margin-right: 30px;
+    width: 170px;
+    height: 170px;
+  }
+  .idcard-uploader {
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    margin-right: 30px;
+    width: 270px;
+    height: 150px;
+  }
+  .idcard-uploader .el-upload{
+    width: 270px;
+    height: 170px;
   }
   .avatar-uploader .el-upload:hover {
     border-color: #409EFF;
@@ -299,14 +318,14 @@
   .avatar-uploader-icon {
     font-size: 28px;
     color: #8c939d;
-    width: 278px;
-    height: 178px;
+    width: 100%;
+    height:170px;
     line-height: 178px;
     text-align: center;
   }
   .avatar {
-    width: 220px;
-    height: 150px;
+    width: 100%;
+    height: 170px;
     display: block;
   }
   .right-modifyPsw {

+ 41 - 6
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">编辑</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">-->
@@ -12,7 +12,12 @@
     <!--        <el-step title="认证结果"></el-step>-->
     <!--      </el-steps>-->
     <!--    </div>-->
-    <el-form ref="individualForm" :model="individualForm" label-width="120px" style="width: 70%">
+
+    <el-alert
+      :title="failureReason"
+      type="error">
+    </el-alert>
+    <el-form ref="individualForm" :model="individualForm" label-width="120px" style="width: 70%;margin-top: 10px">
       <el-form-item label="真实姓名">
         <el-input :disabled="!canEdit" v-model="individualForm.realName" placeholder="请输入您的姓名,需与身份证保持一致"></el-input>
       </el-form-item>
@@ -43,7 +48,7 @@
         <el-col :span="9" style="padding-left: 30px">
           <div style="width: 280px">
             <el-upload
-              class="avatar-uploader idcard-uploader"
+              class="avatar-uploader"
               style="border: lightgrey 1px solid"
               action="https://jsonplaceholder.typicode.com/posts/"
               :before-upload="beforeFileUpload"
@@ -82,7 +87,7 @@
         <el-col :span="9" style="padding-left: 30px">
           <div>
             <el-upload
-              class="avatar-uploader idcard-uploader"
+              class="avatar-uploader"
               style="border: lightgrey 1px solid"
               action="https://jsonplaceholder.typicode.com/posts/"
               :before-upload="beforeFileUpload"
@@ -147,6 +152,7 @@
           idCardDeadTime: "",
           address: ""
         },
+        failureReason:'',
         authType: -1,
         authDetail: {},
         authStatus: '',
@@ -163,6 +169,8 @@
             notify('success', '认证成功');
             this.$router.push('/personal/authentication')
           }
+        }).catch(err=>{
+          notify('error',err.data)
         })
       },
       //获取当前认证状态
@@ -172,12 +180,15 @@
             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 {
             this.authType = 0  //未参与个人认证
             this.canEdit = true
           }
+        }).catch(err=>{
+          notify('error',err.data)
         })
       },
       setFormInfo(detail) {
@@ -227,7 +238,6 @@
           } else {
             this.individualForm.IDCardBackPhoto = res.data
           }
-
           notify('success', '上传成功')
           // this.$refs['agency'].validateField('photoUrl');
         }).catch(error => {
@@ -243,6 +253,31 @@
 </script>
 
 <style scoped lang="less">
+  .avatar-uploader{
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    margin-right: 30px;
+    width: 270px;
+    height: 170px;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 270px;
+    height: 170px;
+    line-height: 178px;
+    text-align: center;
+  }
+  .avatar {
+    width: 270px;
+    height: 170px;
+    display: block;
+  }
 
   .right-modifyPsw {
     padding: 20px;

+ 6 - 5
src/pages/UserCenter/Mine.vue

@@ -4,11 +4,12 @@
       <span style="font-size: 18px;font-weight: bold">基本设置</span>
       <el-button v-if="!isModifyMode" type="primary" size="mini" class="pull-right" @click="isModifyMode = true">编辑</el-button>
     </div>
-    <div style="margin-bottom: 15px;width: 60%">
+    <div style="margin-bottom: 15px;width: 550px">
       <el-form :model="userForm" :rules="rules" status-icon ref="userForm" label-width="100px" class="demo-ruleForm">
         <el-form-item label="头像" prop="avator">
           <el-upload
             class="avatar-uploader"
+            style="border: lightgrey 1px solid;width:178px;"
             action="https://jsonplaceholder.typicode.com/posts/"
             :before-upload="beforeFileUpload"
             :http-request="uploadFile"
@@ -112,7 +113,6 @@
       },
       //联系地址改变
       locationChange (provinceId, cityId) {
-        console.log("aaa",provinceId,cityId)
         if (provinceId || cityId) {
           this.userForm.province = provinceId
           this.userForm.city = cityId
@@ -193,13 +193,14 @@
 </script>
 
 <style scoped lang="less">
-  .avatar-uploader .el-upload {
-    //border: 1px dashed #d9d9d9;
+  .avatar-uploader{
     border-radius: 6px;
     cursor: pointer;
     position: relative;
     overflow: hidden;
     margin-right: 30px;
+    width: 178px;
+    height: 178px;
   }
   .avatar-uploader .el-upload:hover {
     border-color: #409EFF;
@@ -207,7 +208,7 @@
   .avatar-uploader-icon {
     font-size: 28px;
     color: #8c939d;
-    width: 278px;
+    width: 178px;
     height: 178px;
     line-height: 178px;
     text-align: center;