wangJJ há 5 anos atrás
pai
commit
74cb8cb5ba

+ 2 - 1
src/components/project/Project.vue

@@ -25,12 +25,13 @@
               <el-input v-if="isModifyMode" v-model="project.contactPhone" placeholder="请输入联系人电话"></el-input>
               <span v-if="!isModifyMode">{{project.contactPhone}}</span>
             </el-form-item>
+            aaaaa
             <el-form-item size="small" label="预算" prop="budget">
               <el-input v-if="isModifyMode" type="number" v-model="project.budget">
                 ¥
                 <template slot="append"></template>
               </el-input>
-              <span v-if="!isModifyMode">{{project.budget}}¥</span>
+              <span v-if="!isModifyMode">¥{{project.budget}}</span>
             </el-form-item>
 
             <el-form-item label="计价标准" prop="valuationStandard">

+ 1 - 1
src/pages/Homepage/LoginCard.vue

@@ -27,7 +27,7 @@
 <script>
   import Http from '@/js/http.js'
   import Apis from '@/js/api.js'
-  import {storageGet} from '@/js/index.js'
+  import {storageGet,logout} from '@/js/index.js'
 
   export default {
     name: "LoginCard",

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

@@ -4,7 +4,7 @@
       <div class="right-modifyPsw-title">
         <span style="font-size: 18px;font-weight: bold">身份认证</span>
       </div>
-      <el-row :gutter="20">
+      <el-row :gutter="20" v-loading="loading">
         <el-col :span="12">
           <div class="authentication-card" :class="selectedCardImg"  @click="gotoPersonalAuth" v-if="authType<2">
             <div class="authentication-card-title">个人认证</div>
@@ -69,6 +69,7 @@
     name: "Authentication",
     data() {
       return {
+        loading: false,
         selectedCardImg:'',
         authType:-1,
         authDetail:{},
@@ -77,6 +78,12 @@
       }
     },
     methods: {
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
       gotoPersonalAuth(){
         this.$router.push({path:'/personal/authentication/individual'})
       },
@@ -85,6 +92,7 @@
       },
       //获取当前资质状态
       getAuthStatus(){
+        this.showLoading();
         let userId = storageGet('user')&&storageGet('user').userVO.id;
         Http.get(`/api/user/${userId}`).then(res=>{
           this.authInfo = res;
@@ -101,6 +109,7 @@
           }else if((!res.enterpriseAuthVO) || (!res.agencyVO)){
             this.authType = 0  //无
           }
+          this.hideLoading();
         })
       }
     },

+ 16 - 2
src/pages/UserCenter/BindingMail.vue

@@ -6,12 +6,12 @@
       </el-form-item>
       <el-form-item label="验证码" prop="verifyCode">
         <el-input placeholder="验证码内容" v-model="mailBindingForm.verifyCode" class="input-with-select">
-          <el-button slot="append" @click="getVerifyCode">{{hasVerifyCode ? codeTime : '获取验证码'}}</el-button>
+          <el-button slot="append" @click="getVerifyCode" :disabled="hasVerifyCode">{{hasVerifyCode ? codeTime : '获取验证码'}}</el-button>
         </el-input>
         <span v-if="hasVerifyCode">验证码已发送到您邮箱上</span>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" plain  @click="bindingEmail">完成绑定</el-button>
+        <el-button type="primary" plain  @click="bindingEmail ">完成绑定</el-button>
       </el-form-item>
     </el-form>
   </div>
@@ -25,6 +25,19 @@
   export default {
     name: "BindingMail",
     data(){
+      let isEmail = (rule, value, callback) => {
+        if (!value) {
+          callback();
+        } else {
+          const reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/;
+          const email = reg.test(value);
+          if (!email) {
+            callback(new Error("请输入正确的邮箱格式"));
+          } else {
+            callback();
+          }
+        }
+      };
       return{
         mailBindingForm:{
           mail:'',
@@ -40,6 +53,7 @@
           ],
           mail: [
             {required: true, message: '请输入邮箱', trigger: 'blur'},
+            { validator: isEmail, trigger: "blur" }
           ],
         }
       }

+ 82 - 84
src/pages/UserCenter/BindingMobile.vue

@@ -6,7 +6,9 @@
       </el-form-item>
       <el-form-item label="验证码" prop="verifyCode">
         <el-input placeholder="验证码内容" v-model="phoneBindingForm.verifyCode" class="input-with-select">
-          <el-button slot="append" @click="getVerifyCode">{{hasVerifyCode ? codeTime : '获取验证码'}}</el-button>
+          <el-button slot="append" @click="getVerifyCode" :disabled="hasVerifyCode">{{hasVerifyCode ? codeTime :
+            '获取验证码'}}
+          </el-button>
         </el-input>
         <span v-if="hasVerifyCode">验证码已发送到您手机上</span>
       </el-form-item>
@@ -19,94 +21,90 @@
 </template>
 
 <script>
-    import Http from '@/js/http.js'
-    import {storageGet} from '@/js/index'
-    import {notify} from '@/constants/index'
+  import Http from '@/js/http.js'
+  import {storageGet} from '@/js/index'
+  import {notify} from '@/constants/index'
 
-    export default {
-        name: "BindingMobile",
-        data() {
-            return {
-                phoneBindingForm: {
-                    phone: '',
-                    verifyCode: ''
-                },
-                hasVerifyCode: false,
-                codeTime: 60,
-                user: {},
-                rules: {
-                    verifyCode: [
-                        {required: true, message: '请输入验证码', trigger: 'blur'},
-                        {min: 6, max: 6, message: '验证码长度为6个字符', trigger: 'blur'}
-                    ],
-                    phone: [
-                        {required: true, message: '请输入手机号', trigger: 'blur'},
-                        {min: 11, max: 11, message: '手机号长度为11个字符', trigger: 'blur'}
-                    ],
-                }
-            }
+  export default {
+    name: "BindingMobile",
+    data() {
+      return {
+        phoneBindingForm: {
+          phone: '',
+          verifyCode: ''
         },
-        methods: {
-            setUserInfo() {
-                let userId = storageGet('user') && storageGet('user').userVO.id;
-                Http.get(`/api/user/${userId}`).then(res => {
-                    this.user = res.userVO
-                })
-            },
-            getVerifyCode() {
-                let params = {
-                    id: this.user.id,
-                    mobile: this.phoneBindingForm.phone
-                }
-                Http.put('/api/verify/mobile', params).then((res) => {
-                    if (res.msg == "ERROR") {
-                        notify('error', res.data);
-                    } else {
-                        notify('success', res.data);
-                        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);
-                })
-            },
-            bindingMobile() {
-                // this.$refs['phoneBindingForm'].validate(valid => {
-                //     if (valid) {
-                //
-                //     }
-                // })
-                let params = {
-                    id: this.user.id,
-                    mobile: this.phoneBindingForm.phone,
-                    verifyCode: this.phoneBindingForm.verifyCode
-                };
-                Http.put('/api/user/mobile', params).then(res => {
-                    if (res.msg == "ERROR") {
-                        notify('error', '重新绑定失败:' + res.data);
-                    } else {
-                        notify('success', '重新绑定成功');
-                        this.$router.push({path: '/personal/phoneBinding'});
-                    }
-                }).catch(err => {
-                    notify('error', err.data);
-                })
-            }
-        },
-        mounted() {
-            this.setUserInfo()
+        hasVerifyCode: false,
+        codeTime: 60,
+        user: {},
+        rules: {
+          verifyCode: [
+            {required: true, message: '请输入验证码', trigger: 'blur'},
+            {min: 6, max: 6, message: '验证码长度为6个字符', trigger: 'blur'}
+          ],
+          phone: [
+            {required: true, message: '请输入手机号', trigger: 'blur'},
+            {min: 11, max: 11, message: '手机号不合法', trigger: 'blur'}
 
+          ],
+        }
+      }
+    },
+    methods: {
+      setUserInfo() {
+        let userId = storageGet('user') && storageGet('user').userVO.id;
+        Http.get(`/api/user/${userId}`).then(res => {
+          this.user = res.userVO
+        })
+      },
+      getVerifyCode() {
+        let params = {
+          id: this.user.id,
+          mobile: this.phoneBindingForm.phone
         }
+        Http.put('/api/verify/mobile', params).then((res) => {
+          if (res.msg == "ERROR") {
+            notify('error', res.data);
+          } else {
+            notify('success', res.data);
+            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);
+        })
+      },
+      bindingMobile() {
+        let params = {
+          id: this.user.id,
+          mobile: this.phoneBindingForm.phone,
+          verifyCode: this.phoneBindingForm.verifyCode
+        };
+        Http.put('/api/user/mobile', params).then(res => {
+          if (res.msg == "ERROR") {
+            notify('error', '重新绑定失败:' + res.data);
+          } else {
+            notify('success', '重新绑定成功');
+            this.$router.push({path: '/personal/phoneBinding'});
+          }
+        }).catch(err => {
+          notify('error', err.data);
+        })
+      }
+    },
+    mounted() {
+      this.setUserInfo()
+
     }
+  }
 </script>
 
 <style scoped>

+ 2 - 2
src/pages/UserCenter/EnterpriseAuth.vue

@@ -279,9 +279,9 @@
           if(param.data.type==2){
             this.enterpriseForm.businessLicensePhoto = res.data;
           }else if(param.data.type == 1){
-            this.enterpriseForm.IDCardBackPhoto = res.data
+            this.enterpriseForm.idCardBackPhoto = res.data
           }else if(param.data.type == 0){
-            this.enterpriseForm.IDCardPositivePhoto = res.data
+            this.enterpriseForm.idCardPositivePhoto = res.data
           }else if(param.data.type == 3){
             this.enterpriseForm.agencyPhoto = res.data
           }

+ 4 - 3
src/pages/UserCenter/IndividualAuth.vue

@@ -173,6 +173,8 @@
         this.user = storageGet('user') && storageGet('user').userVO;
       },
       submitIndividualAuth() {
+        let requestMethod = canEdit ? 'put' : 'post'
+
         Http.put(`/api/user/${this.user.id}/personalAuth`, this.individualForm).then(res => {
           if (res) {
             notify('success', '提交成功');
@@ -243,12 +245,11 @@
         //console.log(JSON.parse(this.user).userVO)
         Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.id), formData, config).then((res) => {
           if (param.data.type === 0) {
-            this.individualForm.IDCardPositivePhoto = res.data
+            this.individualForm.idCardPositivePhoto = res.data
           } else {
-            this.individualForm.IDCardBackPhoto = res.data
+            this.individualForm.idCardBackPhoto = res.data
           }
           notify('success', '上传成功')
-          // this.$refs['agency'].validateField('photoUrl');
         }).catch(error => {
           notify('error', error.data)
         })

+ 11 - 2
src/pages/UserCenter/MailBinding.vue

@@ -5,7 +5,7 @@
         <div class="right-modifyPsw-title">
           <span style="font-size: 18px;font-weight: bold">邮箱绑定</span>
         </div>
-        <div>
+        <div v-loading="loading">
           <div v-if="!user.email">
             <div style="background-color: rgba(233,239,249,1);padding: 10px;margin-bottom: 30px">
               <img src="../../assets/img/phoneUnbinding.png"></img>
@@ -43,6 +43,7 @@
     name: "MailBinding",
     data() {
       return {
+        loading:false,
         hasVerifyCode: false,
         bindingEmail: false,
         codeTime: 10,
@@ -54,10 +55,18 @@
       }
     },
     methods: {
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
       setUserInfo() {
+        this.showLoading()
         let userId = storageGet('user')&&storageGet('user').userVO.id;
         Http.get(`/api/user/${userId}`).then(res=>{
-          this.user = res.userVO
+          this.user = res.userVO;
+          this.hideLoading()
         })
       },
       handleBindingEmail(){

+ 25 - 20
src/pages/UserCenter/Mine.vue

@@ -33,14 +33,16 @@
         </el-form-item>
         <el-form-item label="生日" prop="birthday">
           <el-date-picker type="date" placeholder="选择日期" v-model="userForm.birthday"
-                          style="width: 100%;" :disabled="!isModifyMode"></el-date-picker>
+                          style="width: 100%;" :disabled="!isModifyMode"
+                          :picker-options="pickerOptions"></el-date-picker>
         </el-form-item>
+        {{userForm.location}}
         <el-form-item label="地址" prop="address" style="width: 160%">
           <provincecity
             ref="addFormProvince"
             @selectChange="locationChange"
-            :provinceCode="userForm.location==null?'3200':userForm.location.provinceCode"
-            :cityCode="userForm.location==null?'3201':userForm.location.cityCode"
+            :provinceCode="location?location.provinceCode:'3200'"
+            :cityCode="location?location.cityCode:'3201'"
             :isModifyMode="!isModifyMode"
           ></provincecity>
         </el-form-item>
@@ -78,7 +80,13 @@
           unit:'',
           personalCompetence:[],
           province:'',
-          city:''
+          city:'',
+        },
+        location:{},
+        pickerOptions: {
+          disabledDate(time) {
+            return time.getTime() > Date.now();
+          }
         },
         rules: {
           photoUrl: [
@@ -106,16 +114,14 @@
       provincecity
     },
     methods: {
-      submitUserInfo(){
-
-          this.$refs['userForm'].validate(valid => {
-              if (valid) {
-                  Http.put(`/api/personal/update/${this.user.id}`,this.userForm).then(res=>{
-                      this.isModifyMode = false;
-                  })
-              }
-          })
-
+      submitUserInfo() {
+        this.$refs['userForm'].validate(valid => {
+          if (valid) {
+            Http.put(`/api/personal/update/${this.user.id}`, this.userForm).then(res => {
+              this.isModifyMode = false;
+            })
+          }
+        })
       },
       //联系地址改变
       locationChange (provinceId, cityId) {
@@ -169,14 +175,13 @@
           this.userForm.birthday = res.userVO.birthday ? res.userVO.birthday : new Date();
           this.userForm.userName = res.userVO.userName ? res.userVO.userName : '';
           this.userForm.unit = res.userVO.unit ? res.userVO.unit : '';
-          this.userForm.province = res.userVO.unit ? res.userVO.province : '';
-          this.userForm.city = res.userVO.unit ? res.userVO.city : '';
+          this.userForm.province = res.userVO.province ? res.userVO.province : '';
+          this.userForm.city = res.userVO.city ? res.userVO.city : '';
           this.userForm.personalCompetence = res.userVO.personalCompetence ? res.userVO.personalCompetence : [];
-          //获取省市code
           let location = getProvinceCodeByProvinceName(this.userForm.province, this.userForm.city);
-          this.userForm.province = location.provinceCode;
-          this.userForm.city = location.cityCode;
-          this.userForm.location=location;
+          this.userForm.province = location&&location.provinceCode;
+          this.userForm.city = location&&location.cityCode;
+          this.location = location;
         })
       },
       setUserInfo(){

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

@@ -189,7 +189,6 @@
         this.deleteQualification = true;
       },
       handleDeleteQualification(item){
-        console.log('delete')
         Http.delete(`/api/personal/deletequalification/${this.form.id}/${this.user.id}`,{}).then((res) => {
           this.deleteQualification = false;
           this.addQualification = false;

+ 19 - 8
src/pages/UserCenter/ReBindingMail.vue

@@ -1,12 +1,12 @@
 <template>
   <div>
-    <el-form label-width="80px" style="width:400px;" :rules="rules">
+    <el-form label-width="80px" style="width:400px;" :rules="rules" :model="emailBindingForm" :ref="emailBindingForm">
       <el-form-item label="新邮箱号" prop="email">
         <el-input v-model="emailBindingForm.email"></el-input>
       </el-form-item>
       <el-form-item label="验证码" prop="verifyCode">
         <el-input placeholder="验证码内容" v-model="emailBindingForm.verifyCode" class="input-with-select">
-          <el-button slot="append" @click="getVerifyCode">{{hasVerifyCode ? codeTime : '获取验证码'}}</el-button>
+          <el-button slot="append" @click="getVerifyCode" :disabled="hasVerifyCode">{{hasVerifyCode ? codeTime : '获取验证码'}}</el-button>
         </el-input>
         <span v-if="hasVerifyCode">验证码已发送到您邮箱上</span>
       </el-form-item>
@@ -26,6 +26,19 @@
   export default {
     name: "ReBindingMail",
     data() {
+      let isEmail = (rule, value, callback) => {
+        if (!value) {
+          callback();
+        } else {
+          const reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/;
+          const email = reg.test(value);
+          if (!email) {
+            callback(new Error("请输入正确的邮箱格式"));
+          } else {
+            callback();
+          }
+        }
+      };
       return {
         active: 0,
         user: {},
@@ -39,10 +52,12 @@
           verifyCode: [
             {required: true, message: '请输入验证码', trigger: 'blur'},
           ],
-          phone: [
+          email: [
             {required: true, message: '请输入邮箱', trigger: 'blur'},
+            { validator: isEmail, trigger: "blur" }
           ],
-        }
+        },
+
       }
     },
     methods: {
@@ -58,11 +73,7 @@
           "email": this.emailBindingForm.email,
           "verifyCode": this.emailBindingForm.verifyCode
         };
-        if (this.emailBindingForm.email == this.user.email) {
-          notify('error', '请使用其他邮箱,此邮箱您已绑定!');
-        }
         Http.put('/api/user/email', params).then((res) => {
-
           if (res.msg == "ERROR") {
             notify('error', '重新绑定失败:' + res.data);
           } else {

+ 1 - 1
src/pages/UserCenter/ReBindingMobile.vue

@@ -14,7 +14,7 @@
       </el-form-item>
       <el-form-item label="验证码" prop="verifyCode">
         <el-input placeholder="验证码内容" v-model="phoneBindingForm.verifyCode" class="input-with-select">
-          <el-button slot="append" @click="getVerifyCode">{{hasVerifyCode ? codeTime : '获取验证码'}}</el-button>
+          <el-button slot="append" @click="getVerifyCode" :disabled="hasVerifyCode">{{hasVerifyCode ? codeTime : '获取验证码'}}</el-button>
         </el-input>
         <span v-if="hasVerifyCode">验证码已发送到您手机上</span>
       </el-form-item>