wangJJ vor 5 Jahren
Ursprung
Commit
36450dd1de

+ 0 - 3
src/pages/DetailPage/AgencyDetail.vue

@@ -156,7 +156,4 @@
     font-size: 32px;
   }
 
-  .el-form-item {
-    max-height: 120px !important;
-  }
 </style>

+ 18 - 5
src/pages/Homepage/Homepage.vue

@@ -82,6 +82,7 @@
   import WaterfallSlot from 'vue-waterfall/lib/waterfall-slot'
   import {storageGet, getAllFields} from '@/js/index.js'
   import {notify} from "../../constants";
+  import Apis from '@/js/api'
   // console.log(commonData);
   export default {
     name: 'Homepage',
@@ -104,6 +105,7 @@
     },
     data() {
       return {
+        user:{},
         isLogin: false,
         loading: false,
         searchType:'0',
@@ -177,12 +179,19 @@
           })
       },
       checkLogin(){
-        if(!this.isLogin){
-            console.log("请登录后访问");
-            notify('warning','请登录后访问');
-        }else{
-            console.log("已登录");
+        this.checkCreateProjectAuth();
+      },
+      checkCreateProjectAuth() {
+        if (!this.isLogin) {
+          console.log("请登录后访问");
+          notify('warning', '请登录后访问');
+        }
+        else if(this.isLogin){
+          Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.id)).then((res) => {
             this.$router.push('/project/create');
+          }).catch((error) => {
+            notify('error', error.data)
+          })
         }
       },
       handleTabClick(tab){
@@ -221,10 +230,14 @@
       },
       hideLoading() {
           this.loading = false
+      },
+      setUserInfo(){
+        this.user = storageGet('user')&&storageGet('user').userVO;
       }
     },
 
     mounted() {
+      this.setUserInfo();
       this.loadData();
     }
   }

+ 7 - 1
src/pages/Homepage/HotCrowd.vue

@@ -6,7 +6,7 @@
       <el-button style="float: right; padding: 3px 0;line-height: 25px" type="text"  @click="getMore()">more>></el-button>
     </div>
     <div class="popular-list">
-      <el-row class="popular-list-item" v-for="item in applicationTypeRank" :key="item.id">
+      <el-row class="popular-list-item" v-for="item in applicationTypeRank" :key="item.id" @click.native="goToDetail(item.code)">
         <el-col :span="19">
           <img :src="item.image" alt="logo-project" class="pull-left project-logo-img">
           <div style="margin-left: 55px">
@@ -38,6 +38,12 @@
                 name: 'CrowdList',
             });
         },
+      goToDetail(code) {
+        this.$router.push({
+          name: 'CrowdDetail',
+          params: {code: code}
+        })
+      },
     }
   }
 </script>

+ 64 - 41
src/pages/Square/SquareCard.vue

@@ -37,49 +37,72 @@
 </template>
 
 <script>
-    import {notify} from "../../constants";
-    import {storageGet} from '@/js/index.js'
-
-    export default {
-        name: 'SquareCard',
-        props: ['card'],
-        data() {
-            return {
-                isLogin: false,
-            }
-        },
-        methods: {
-            onload() {
-                if (storageGet('user') != null) {
-                    this.isLogin = true;
-                }
-            },
-            goToProjectDetail(id) {
-                if (!this.isLogin) {
-                    console.log("请登录后访问");
-                    notify('warning', '请登录后访问');
-                } else {
-                    console.log("已登录");
-                    this.$router.push({name: 'Project', params: {projectId: id}})
-                }
-            },
-            goToTaskDetail(projectId, taskId) {
-                if (!this.isLogin) {
-                    console.log("请登录后访问");
-                    notify('warning', '请登录后访问');
-                } else {
-                    console.log("已登录");
-                    this.$router.push({
-                        name: 'Task',
-                        params: {projectId: projectId, taskId: taskId}
-                    })
-                }
-            },
-        },
-        mounted() {
-            this.onload();
+  import {notify} from "../../constants";
+  import Http from '@/js/http.js';
+  import {storageGet} from '@/js/index.js'
+  import Apis from '@/js/api'
+  export default {
+    name: 'SquareCard',
+    props: ['card'],
+    data() {
+      return {
+        isLogin: false,
+        user:{}
+      }
+    },
+    methods: {
+      onload() {
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+      },
+      checkCreateProjectAuth() {
+        if (!this.isLogin) {
+          console.log("请登录后访问");
+          notify('warning', '请登录后访问');
+        } else if (this.isLogin) {
+          Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.id)).then((res) => {
+            this.$router.push('/project/create');
+          }).catch((error) => {
+            notify('error', error.data)
+          })
+        }
+      },
+      goToProjectDetail(id) {
+        if (!this.isLogin) {
+          notify('warning', '请登录后访问');
+        } else if (this.isLogin) {
+          Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.id)).then((res) => {
+            this.$router.push({name: 'Project', params: {projectId: id}})
+          }).catch((error) => {
+            notify('error', error.data)
+          })
         }
+      },
+      goToTaskDetail(projectId, taskId) {
+        if (!this.isLogin) {
+          console.log("请登录后访问");
+          notify('warning', '请登录后访问');
+        } else if (this.isLogin) {
+          Http.get(Apis.USER.IS_AGENCY.replace('{userId}', this.user.id)).then((res) => {
+            this.$router.push({
+              name: 'Task',
+              params: {projectId: projectId, taskId: taskId}
+            })
+          }).catch((error) => {
+            notify('error', error.data)
+          })
+        }
+      },
+      setUserInfo() {
+        this.user = storageGet('user')&&storageGet('user').userVO;
+      }
+    },
+    mounted() {
+      this.onload();
+      this.setUserInfo();
     }
+  }
 </script>
 
 <style lang="less">

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

@@ -306,9 +306,9 @@
           this.enterpriseForm.idCardPositivePhoto = detail.idCardPositivePhoto,
           this.enterpriseForm.idCardBackPhoto = detail.idCardBackPhoto,
           this.enterpriseForm.idCardDeadTime = detail.idCardDeadTime
-          this.enterpriseForm.businessLicensePhoto = detail.businessLicensePhoto
-          this.enterpriseForm.evaluationAgencyName = detail.evaluationAgencyName
-          this.enterpriseForm.agencyPhoto = detail.agencyPhoto
+          this.enterpriseForm1.businessLicensePhoto = detail.businessLicensePhoto
+          this.enterpriseForm1.evaluationAgencyName = detail.evaluationAgencyName
+          this.enterpriseForm1.agencyPhoto = detail.agencyPhoto
       },
       setUserInfo() {
         this.user = storageGet('user') && storageGet('user').userVO;

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

@@ -66,6 +66,7 @@
               :disabled="!canEdit"
             >
               <img v-if="individualForm.idCardPositivePhoto" :src="individualForm.idCardPositivePhoto" class="avatar">
+              <i v-else class="el-icon-plus avatar-uploader-icon card-uploader-icon"></i>
             </el-upload>
             <div style="text-align: center">身份证正面照<span style="color:red">(必填)</span></div>
           </div>
@@ -104,6 +105,7 @@
               :data="{type:1}"
             >
               <img v-if="individualForm.idCardBackPhoto" :src="individualForm.idCardBackPhoto" class="avatar">
+              <i v-else class="el-icon-plus avatar-uploader-icon card-uploader-icon"></i>
             </el-upload>
 
             <div style="text-align: center">身份证反面照<span style="color:red">(必填)</span></div>

+ 42 - 45
src/pages/UserCenter/ReBindingMobile.vue

@@ -4,8 +4,6 @@
       <el-step title="验证原手机"></el-step>
       <el-step title="绑定新手机"></el-step>
     </el-steps>
-
-
     <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>
@@ -123,51 +121,50 @@
 
       },
       getVerifyCode() {
-          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
+        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;
               }
-              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);
-              })
+            }, 1000)
+          }).catch(err => {
+            notify('error', '获取验证码失败:' + err.data);
+          })
+        } else {
+          //2.验证新手机
+          let params = {
+            id: this.user.id,
+            mobile: 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);
+          })
+        }
       }
 
     },