Bladeren bron

fix index

wangJJ 5 jaren geleden
bovenliggende
commit
4a2b9de7fd

+ 1 - 1
src/pages/DetailPage/CrowdDetail.vue

@@ -44,7 +44,7 @@
             <el-col :span="4" type="flex" align="middle" justify="center">操作</el-col>
           </el-row>
           <project-item v-if="(projectList != null || projectList.length > 0 )"
-                                    v-for="(item,index) in projectList" :key="index" :projectItem="item"/>
+                                    v-for="(item,index) in projectList" :key="item.id" :projectItem="item"/>
         </el-tab-pane>
       </el-tabs>
     </div>

+ 73 - 58
src/pages/Homepage/LoginCard.vue

@@ -1,9 +1,9 @@
 <template>
   <el-card class="login-card">
     <div class="login-welcome">
-      <img v-if="this.user.userVO.photo != null && this.user.userVO.photo != ''" :src="this.user.userVO.photo" alt="welcome-img" class="pull-left welcome-img">
+      <img v-if="user.userVO&&user.userVO.photoUrl" :src="user.userVO&&user.userVO.photoUrl" alt="welcome-img"
+           class="pull-left welcome-img">
       <img v-else src="../../assets/img/logo-project.png" alt="welcome-img" class="pull-left welcome-img">
-
       <div style="margin-left: 46px">
         <div class="welcome-title">
           hi,欢迎使用群智众测平台
@@ -13,8 +13,12 @@
         </div>
       </div>
       <div class="welcome-btn">
-        <a :href="loginUrl"><el-button type="primary" size="mini" class="pull-left login-btn" v-if="!isLogin">登录</el-button></a>
-        <el-button type="danger" size="mini" class="pull-right cancel-btn" v-if="isLogin"  @click.native="userLogout()">登出</el-button>
+        <a :href="loginUrl">
+          <el-button type="primary" size="mini" class="pull-left login-btn" v-if="!isLogin">登录</el-button>
+        </a>
+        <el-button type="danger" size="mini" class="pull-right cancel-btn" v-if="isLogin" @click.native="userLogout()">
+          登出
+        </el-button>
       </div>
     </div>
   </el-card>
@@ -24,72 +28,83 @@
   import Http from '@/js/http.js'
   import Apis from '@/js/api.js'
   import {storageGet} from '@/js/index.js'
+
   export default {
     name: "LoginCard",
-    data(){
-        return {
-            isLogin: false,
-            user: {},
-            loginUrl: process.env.LOGIN_URL,
-        }
+    data() {
+      return {
+        isLogin: false,
+        user: {},
+        loginUrl: process.env.LOGIN_URL,
+      }
     },
     methods: {
-        loadData() {
-            this.showLoading();
-            if (storageGet('user') != null) {
-                this.isLogin = true;
-                this.user = storageGet('user');
-            }
-        },
-        userLogout () {
-            this.isLogin = false
-            logout().then((res) => {
-                location.reload();
-                this.$router.push('/home')
-            })
+      loadData() {
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+          this.user = storageGet('user');
+        }
+      },
+      userLogout() {
+        this.isLogin = false
+        logout().then((res) => {
+          location.reload();
+          this.$router.push('/home')
+        })
 
-        },
+      },
+    },
+    mounted() {
+      this.loadData();
     }
   }
 </script>
 
 <style scoped lang="less">
-.login-card {
-  margin-bottom: 15px;
-  .welcome-img {
-    width: 40px;
-    height: 40px;
-    display: inline-block;
-    margin: 2px 0;
-  }
-  .welcome-title {
-    font-size:14px;
-    font-family:Source Han Sans CN;
-    font-weight:bold;
-    color:rgba(0,0,0,1);
-  }
-  .welcome-content {
-    font-size:13px;
-    font-family:Source Han Sans CN;
-    font-weight:400;
-    color:rgba(0,0,0,1);
-  }
-  .welcome-btn {
-    width: 100%;
-    height: 28px;
-    margin-top: 25px;
-    .login-btn {
-      background-color: rgba(0, 118, 203,1);
-      &:hover {
-        background-color: rgba(0, 118, 203,0.8);
-      }
+  .login-card {
+    margin-bottom: 15px;
+
+    .welcome-img {
+      width: 40px;
+      height: 40px;
+      display: inline-block;
+      margin: 2px 0;
     }
-    .cancel-btn {
-      background-color:rgba(217,92,93,1);
-      &:hover {
-        background-color:rgba(217,92,93,0.8);
+
+    .welcome-title {
+      font-size: 14px;
+      font-family: Source Han Sans CN;
+      font-weight: bold;
+      color: rgba(0, 0, 0, 1);
+    }
+
+    .welcome-content {
+      font-size: 13px;
+      font-family: Source Han Sans CN;
+      font-weight: 400;
+      color: rgba(0, 0, 0, 1);
+    }
+
+    .welcome-btn {
+      width: 100%;
+      height: 28px;
+      margin-top: 25px;
+
+      .login-btn {
+        background-color: rgba(0, 118, 203, 1);
+
+        &:hover {
+          background-color: rgba(0, 118, 203, 0.8);
+        }
+      }
+
+      .cancel-btn {
+        background-color: rgba(217, 92, 93, 1);
+
+        &:hover {
+          background-color: rgba(217, 92, 93, 0.8);
+        }
       }
     }
   }
-}
 </style>

+ 1 - 2
src/pages/Square/PopularProjectAndTaskList.vue

@@ -50,7 +50,7 @@
             <el-col :span="4" type="flex" align="middle" justify="center">操作</el-col>
           </el-row>
           <project-item v-if="(projectAndTaskArr != null || projectAndTaskArr.length > 0 )"
-                                    v-for="(item,index) in projectAndTaskArr" :key="index" :projectItem="item"/>
+                                    v-for="(item,index) in projectAndTaskArr" :key="item.id" :projectItem="item"/>
         </el-tab-pane>
 
         <el-tab-pane name="myProject" v-if="currTab == 'task'">
@@ -68,7 +68,6 @@
                      v-for="(item,index2) in projectAndTaskArr" :key="index2" :task="item"/>
         </el-tab-pane>
 
-
       </el-tabs>
     </div>
 

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

@@ -1,17 +1,19 @@
 <template>
   <div style="margin-top: 20px">
-    <el-form label-width="80px" style="width:400px">
-      <el-form-item label="邮箱号" >
+    <el-form label-width="80px" style="width:400px" :rules="rules">
+      <el-form-item label="邮箱号" prop="mail">
         <el-input v-model="mailBindingForm.mail"></el-input>
       </el-form-item>
-      <el-form-item label="验证码">
+      <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-input>
         <span v-if="hasVerifyCode">验证码已发送到您邮箱上</span>
       </el-form-item>
+      <el-form-item>
+        <el-button type="primary" plain  @click="bindingEmail">完成绑定</el-button>
+      </el-form-item>
     </el-form>
-    <el-button type="primary" plain style="margin-left: 80px" @click="bindingEmail">完成绑定</el-button>
   </div>
 
 </template>
@@ -29,8 +31,16 @@
           verifyCode:''
         },
         hasVerifyCode:false,
-        codeTime:10,
-        user:{}
+        codeTime:60,
+        user:{},
+        rules: {
+          verifyCode: [
+            {required: true, message: '请输入验证码', trigger: 'blur'},
+          ],
+          mail: [
+            {required: true, message: '请输入邮箱', trigger: 'blur'},
+          ],
+        }
       }
     },
     methods:{

+ 16 - 6
src/pages/UserCenter/BindingMobile.vue

@@ -1,17 +1,19 @@
 <template>
   <div style="margin-top: 20px">
-    <el-form label-width="80px" style="width:400px">
-      <el-form-item label="手机号码" >
+    <el-form label-width="80px" style="width:400px" :rules="rules">
+      <el-form-item label="手机号码" prop="phone">
         <el-input v-model="phoneBindingForm.phone"></el-input>
       </el-form-item>
-      <el-form-item label="验证码">
+      <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-input>
         <span v-if="hasVerifyCode">验证码已发送到您手机上</span>
       </el-form-item>
+      <el-form-item>
+        <el-button type="primary" plain  @click="bindingMobile">完成绑定</el-button>
+      </el-form-item>
     </el-form>
-    <el-button type="primary" plain style="margin-left: 80px" @click="bindingMobile">完成绑定</el-button>
   </div>
 
 </template>
@@ -29,8 +31,16 @@
           verifyCode:''
         },
         hasVerifyCode:false,
-        codeTime:10,
-        user:{}
+        codeTime:60,
+        user:{},
+        rules: {
+          verifyCode: [
+            {required: true, message: '请输入验证码', trigger: 'blur'},
+          ],
+          phone: [
+            {required: true, message: '请输入手机号', trigger: 'blur'},
+          ],
+        }
       }
     },
     methods:{

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

@@ -13,6 +13,7 @@
 <!--      <el-step title="认证结果"></el-step>-->
     </el-steps>
     <el-alert
+      v-if="failureReason&&failureReason!==''"
       :title="failureReason"
       type="error">
     </el-alert>
@@ -189,13 +190,14 @@
           idCardDeadTime: "",//身份证过期时间
           evaluationAgencyName:"", //企业名称
           agencyPhoto:"", //企业logo
-        }
+        },
+        failureReason:''
 
       }
     },
     methods: {
       submitEnterpriseAuth() {
-        Http.post(`/api/user/${this.user.id}/agency`, this.enterpriseForm).then(res => {
+        Http.put(`/api/user/${this.user.id}/agency`, this.enterpriseForm).then(res => {
           if (res) {
             notify('success', '认证成功');
             this.$router.push('/personal/authentication')

+ 2 - 1
src/pages/UserCenter/IndividualAuth.vue

@@ -14,6 +14,7 @@
     <!--    </div>-->
 
     <el-alert
+      v-if="failureReason&&failureReason!==''"
       :title="failureReason"
       type="error">
     </el-alert>
@@ -164,7 +165,7 @@
         this.user = storageGet('user') && storageGet('user').userVO;
       },
       submitIndividualAuth() {
-        Http.post(`/api/user/${this.user.id}/personalAuth`, this.individualForm).then(res => {
+        Http.put(`/api/user/${this.user.id}/personalAuth`, this.individualForm).then(res => {
           if (res) {
             notify('success', '认证成功');
             this.$router.push('/personal/authentication')

+ 15 - 5
src/pages/UserCenter/ReBindingMail.vue

@@ -1,17 +1,19 @@
 <template>
   <div>
-    <el-form label-width="80px" style="width:400px;">
-      <el-form-item label="新邮箱号">
+    <el-form label-width="80px" style="width:400px;" :rules="rules">
+      <el-form-item label="新邮箱号" prop="email">
         <el-input v-model="emailBindingForm.email"></el-input>
       </el-form-item>
-      <el-form-item label="验证码">
+      <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-input>
         <span v-if="hasVerifyCode">验证码已发送到您邮箱上</span>
       </el-form-item>
+      <el-form-item>
+        <el-button type="primary" plain  @click="reBindingMail">完成绑定</el-button>
+      </el-form-item>
     </el-form>
-    <el-button type="primary" plain style="margin-left: 80px" @click="reBindingMail">完成绑定</el-button>
   </div>
 
 </template>
@@ -32,7 +34,15 @@
           verifyCode: ''
         },
         hasVerifyCode: false,
-        codeTime: 10,
+        codeTime: 60,
+        rules: {
+          verifyCode: [
+            {required: true, message: '请输入验证码', trigger: 'blur'},
+          ],
+          phone: [
+            {required: true, message: '请输入邮箱', trigger: 'blur'},
+          ],
+        }
       }
     },
     methods: {

+ 23 - 11
src/pages/UserCenter/ReBindingMobile.vue

@@ -5,24 +5,25 @@
       <el-step title="绑定新手机"></el-step>
     </el-steps>
 
-    <el-form label-width="80px" style="width:400px;">
-      <el-form-item label="原手机号" v-if="active===0">
+    <el-form label-width="80px" style="width:400px;" :rules="rules">
+      <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">
+      <el-form-item label="新手机号" v-if="active===1" prop="phone">
         <el-input v-model="phoneBindingForm.phone"></el-input>
       </el-form-item>
-      <el-form-item label="验证码">
+      <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-input>
         <span v-if="hasVerifyCode">验证码已发送到您手机上</span>
       </el-form-item>
+      <el-form-item>
+        <el-button type="primary" plain  @click="reBindingMobile">{{this.active===0 ?
+          '下一步':'完成绑定'}}
+        </el-button>
+      </el-form-item>
     </el-form>
-    <el-button type="primary" plain style="margin-left: 80px" @click="reBindingMobile">{{this.active===0 ?
-      '下一步':'完成绑定'}}
-    </el-button>
-
   </div>
 
 </template>
@@ -43,14 +44,23 @@
           verifyCode: ''
         },
         hasVerifyCode: false,
-        codeTime: 10,
+        codeTime: 60,
+        rules: {
+          verifyCode: [
+            {required: true, message: '请输入验证码', trigger: 'blur'},
+          ],
+          phone: [
+            {required: true, message: '请输入手机号', trigger: 'blur'},
+          ],
+        }
       }
     },
     methods: {
       setUserInfo() {
         let userId = storageGet('user') && storageGet('user').userVO.id;
         Http.get(`/api/user/${userId}`).then(res => {
-          this.user = res.userVO
+          this.user = res.userVO;
+          this.phoneBindingForm.phone = this.user.mobile;
         })
       },
       reBindingMobile() {
@@ -64,7 +74,9 @@
           Http.put('/api/verify/old/mobile', params).then(res => {
             if (res.code === 20000) {
               notify('success', '验证成功');
-              this.active = 0;
+              this.active = 1;
+              this.phoneBindingForm.phone = '';
+              this.phoneBindingForm.verifyCode = '';
               this.setUserInfo();
             }
           }).catch(err => {