Jelajahi Sumber

Merge branch 'feature-2.0' of ssh://git.mooctest.com:1022/crowd-2019/crowd-test-service-front into feature-2.0

wangJJ 5 tahun lalu
induk
melakukan
4e664e901e

+ 15 - 2
src/components/commons/Header2.0.vue

@@ -3,7 +3,7 @@
     <div class="container">
         <div class="nav-location pull-left">
           <i class="el-icon-location-outline" style="margin-right: 5px"></i>
-          <span style="line-height: 34px">广州</span>
+          <span style="line-height: 34px">{{city}}</span>
         </div>
         <div class="nav-list pull-right">
           <ul>
@@ -107,6 +107,9 @@
       storageGet,
       storageSave
   } from '@/js/index'
+  import Http from '@/js/http.js'
+  import Apis from '@/js/api.js'
+
   export default {
     name: "Header2.0",
     data(){
@@ -124,7 +127,8 @@
         defaultValue: defaultValue,
         userIdentity: '',
         isLogin: false,
-        rolesPermissions: {}
+        rolesPermissions: {},
+        city: ''
       }
     },
     watch: {
@@ -142,6 +146,14 @@
         openNavBarFunc () {
             this.openNavBar = !this.openNavBar
         },
+        getAddress(){
+            Http.get(Apis.USER.GET_ADDRESS).then((res) => {
+                this.city = res.city
+            }).catch((error) => {
+                this.hideLoading()
+                notify('error', '获取定位失败:' + error.data)
+            })
+        },
         setUserInfo () {
             if (storageGet('user') == null) {
                 storageSave('rolesPermissions', {
@@ -365,6 +377,7 @@
         // if (storageGet('user' != null)){
         //   this.isLogin = true
         // }
+        this.getAddress();
         console.log(this.isLogin)
     }
   }

+ 1 - 1
src/constants/tabMenu.js

@@ -22,7 +22,7 @@ const homeTabArr = {
   ],
   menuArr3:[
     {label: "找机构", name: "findInstitution"},
-    {label: "找专家", name: "finfExpert"},
+    {label: "找专家", name: "findExpert"},
   ],
 };
 

+ 3 - 1
src/js/api.js

@@ -10,7 +10,8 @@ export default {
     ACCEPT_PROJECT: '/api/project/{projectId}/regionManager/{userId}',
     REJECT_PROJECT: '/api/project/{projectId}/status/rejected',
     SUBMIT_PROJECT: '/api/project/{projectId}/status/committed',
-    END_PROJECT: '/api/project/{projectId}/status/finished'
+    END_PROJECT: '/api/project/{projectId}/status/finished',
+    MORE_HOT_PROJECT: '/api/square/hotProject/list/more',
   },
   TASK: {
     GET_TASK: '/api/project/{projectId}/task/{taskId}/',
@@ -65,6 +66,7 @@ export default {
     REJECT_ENTERPRISE_AUTH:'/api/user/{userId}/enterpriseAuth/status/reject',
     REJECT_INDIVIDUAL_AUTH:'/api/user/{userId}/personalAuth/status/reject',
     GET_DETAIL: "/api/user/detail/{userId}",
+    GET_ADDRESS: "/api/index/address",
   },
   PAGE: {
     HOME_PAGE: '/api/common/index/',

+ 2 - 2
src/pages/DetailPage/AgencyDetail.vue

@@ -3,7 +3,7 @@
     <div class="create-body" v-loading="loading" style="width: 100%">
       <div class="title" v-if="this.type == 0">测评机构信息</div>
       <div class="title" v-else>入驻品牌机构信息</div>
-      <el-form :model="authentication" :rules="rules" ref="authentication" label-width="12%" class="demo-report">
+      <el-form :model="authentication" ref="authentication" label-width="12%" class="demo-report">
         <el-form-item prop="agencyPhoto" label="机构logo">
           <span >
           <el-image
@@ -18,7 +18,7 @@
         <el-form-item  label="认证状态" prop="name">
           <el-tag :type="authentication.authStatus.style">{{authentication.authStatus.text}}</el-tag>
         </el-form-item>
-        <el-form-item v-if="!isModifyMode && authentication.authStatus.text == '认证失败'" label="失败原因" prop="name">
+        <el-form-item v-if="authentication.authStatus.text == '认证失败'" label="失败原因" prop="name">
           <el-link v-if="authentication.explain!=null&&authentication.explain!=''" type="danger" disabled>
             {{authentication.explain}}
           </el-link>

+ 6 - 3
src/pages/Homepage/Homepage.vue

@@ -140,8 +140,8 @@
             {code: '', name: ''}
           ],
           menuArr3:[
-            {label: "找机构", name: "findInstitution"},
-            {label: "找专家", name: "finfExpert"},
+            {label: "找机构", name: "findInstitution",linkTo:'/agency/list'},
+            {label: "找专家", name: "findExpert",linkTo:'/expert/list'},
           ],
         },
         homeData:{},
@@ -154,6 +154,7 @@
             this.isLogin = true;
         }
         this.setFields();
+
         Http.get('/api/common/index/info').then((res)=>{
           this.homeData = res.data;
           this.homeData.applicationTypeList.map((item)=>{
@@ -165,7 +166,7 @@
       setFields(){
           getAllFields().then((res) => {
               this.homeTabArr.menuArr2 = res
-              console.log(this.homeTabArr.menuArr2)
+              // console.log(this.homeTabArr.menuArr2)
           })
 
       },
@@ -180,6 +181,8 @@
       },
       handleTabClick(tab){
         this.currTab = tab.name;
+        console.log(this.currTab);
+        console.log(this.homeTabArr.menuArr1[Number(tab.index)].linkTo)
         this.$router.push(this.homeTabArr.menuArr1[Number(tab.index)].linkTo);
       },
       handleTypeClick(tab){

+ 25 - 2
src/pages/Square/PopularProject.vue

@@ -4,7 +4,7 @@
     <div slot="header" class="popular-header">
       <img src="../../assets/img/popular-project.png" alt="popular-project" class="popular-header-img"/>
       <span class="popular-header-title">热门项目</span>
-      <el-button style="float: right; padding: 3px 0" type="text">more>></el-button>
+      <el-button style="float: right; padding: 3px 0;line-height: 25px" type="text" @click="goToMore()">more>></el-button>
     </div>
     <div class="popular-list">
       <el-row class="popular-list-item" v-for="item in hotCrowdTestProjectVOs" :key="item.id">
@@ -32,9 +32,32 @@
 </template>
 
 <script>
+    import Http from '@/js/http.js';
+    import Apis from '@/js/api.js';
+    import {notify} from "../../constants";
   export default {
     name: 'PopularProject',
-    props:['hotCrowdTestProjectVOs']
+    props:['hotCrowdTestProjectVOs'],
+    methods:{
+        goToMore(){
+            console.log("goToMoreProject");
+            let params = {
+                "keyword": '',//搜索关键字
+                "activePage": 1,//指定页面
+                "columnFilters":
+                [
+
+                ]
+            };
+            Http.post(Apis.PROJECT.MORE_HOT_PROJECT, params).then((res) => {
+                console.log(res)
+                this.$router.push({
+                    name: 'Square',
+                    params: {projectAndTaskArr: res.data.content, type: 1, searchType:"project"}
+                })
+            })
+        },
+    }
   }
 </script>
 

+ 26 - 10
src/pages/Square/Square2.0.vue

@@ -91,6 +91,7 @@
           {label:"测试任务",name:"task"}
         ],
         projectAndTaskArr:[],
+        type: 0,
         hotCrowdTestProjectVOs:[],
         hotCrowdTaskVOs:[],
         activePage:1,
@@ -132,16 +133,31 @@
         if (storageGet('user') != null) {
             this.isLogin = true;
         }
-        this.searchVal = this.$route.params.searchVal;
-        this.searchType = this.$route.params.searchType;
-        Http.get('/api/square/list').then((res)=>{
-          let crowdTestProjectVOs = res.data.crowdTestProjectVOs;
-          let crowdTestTaskVOS = res.data.crowdTestTaskVOS;
-          let projectAndTaskArr = crowdTestProjectVOs.concat(crowdTestTaskVOS);
-          this.hotCrowdTestProjectVOs = res.data.hotCrowdTestProjectVOs;
-          this.hotCrowdTaskVOs = res.data.hotCrowdTaskVOs;
-          this.projectAndTaskArr = projectAndTaskArr;
-        })
+
+        this.projectAndTaskArr = this.$route.params.projectAndTaskArr;
+        this.type = this.$route.params.type;
+
+        if(this.type == 1){
+            console.log("type " + this.type);
+            this.searchType = this.$route.params.searchType;
+            Http.get('/api/square/list').then((res)=>{
+                this.hotCrowdTestProjectVOs = res.data.hotCrowdTestProjectVOs;
+                this.hotCrowdTaskVOs = res.data.hotCrowdTaskVOs;
+            })
+        }else{
+            this.searchVal = this.$route.params.searchVal;
+            this.searchType = this.$route.params.searchType;
+            Http.get('/api/square/list').then((res)=>{
+                let crowdTestProjectVOs = res.data.crowdTestProjectVOs;
+                let crowdTestTaskVOS = res.data.crowdTestTaskVOS;
+                let projectAndTaskArr = crowdTestProjectVOs.concat(crowdTestTaskVOS);
+                this.hotCrowdTestProjectVOs = res.data.hotCrowdTestProjectVOs;
+                this.hotCrowdTaskVOs = res.data.hotCrowdTaskVOs;
+                this.projectAndTaskArr = projectAndTaskArr;
+            })
+        }
+
+
       },
       checkLogin(){
           if(!this.isLogin){