Browse Source

Merge branch 'feature-2.0' into 'Dev'

Feature 2.0

See merge request crowd-2019/crowd-test-service-front!99
郭超 5 years ago
parent
commit
611a48c4f5

+ 1 - 1
src/components/Mine.vue

@@ -243,7 +243,7 @@ export default {
         xAxis: {
           type: 'category',
           boundaryGap: false,
-          data: ['2019年11月', '2019年12月', '2020年1月', '2020年2月', '2020年3月', '2020年4月', '2020年5月']
+          data: ['2020年1月', '2020年2月', '2020年3月', '2020年4月', '2020年5月', '2020年6月', '2020年7月']
         },
         yAxis: {
           type: 'value'

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

@@ -1,10 +1,10 @@
 <template>
-  <div class="header-nav">
+  <div class="header-nav" v-loading="loading">
     <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" v-if="!city && city != ''">{{city}}</span>
-          <span style="line-height: 34px" v-else>暂无</span>
+          <span style="line-height: 34px" v-if="!city || city == ''">暂无</span>
+          <span style="line-height: 34px" v-else>{{city}}</span>
         </div>
         <div class="nav-list pull-right">
           <ul>
@@ -92,6 +92,7 @@
     data(){
       return {
         user: {},
+        loading: false,
         fullScreenLoading: true,
         loginUrl: process.env.LOGIN_URL,
         registerUrl: process.env.REGISTER_URL,
@@ -125,13 +126,23 @@
         },
         getAddress(){
             Http.get(Apis.USER.GET_ADDRESS).then((res) => {
+              console.log(res);
                 this.city = res.city
+              console.log(this.city);
             }).catch((error) => {
                 this.hideLoading()
                 notify('error', '获取定位失败:' + error.data)
             })
         },
+
+        showLoading() {
+          this.loading = true
+        },
+        hideLoading() {
+          this.loading = false
+        },
         setUserInfo () {
+            this.showLoading();
             if (storageGet('user') == null) {
                 storageSave('rolesPermissions', {
                     'isRegionManager': false,
@@ -149,23 +160,25 @@
               // this.fullScreenLoading = false
 
                 getCurrentUser().then((res) => {
-                    // console.log(res)
                     storageSave('user', res)
                     this.user = res
                     this.rolesPermissions = getRolesPermissions(res.roleList)
                     storageSave('rolesPermissions', getRolesPermissions(res.roleList))
                     console.log('用户信息加载成功')
                     this.isLogin = true
-                    this.fullScreenLoading = false
+                    // this.fullScreenLoading = false
+                    this.hideLoading();
                 }).catch((error) => {
                     console.log('用户信息加载失败')
-                    this.fullScreenLoading = false
+                    // this.fullScreenLoading = false
+                    this.hideLoading();
                 })
             } else {
                 this.user = storageGet('user')
-                this.fullScreenLoading = false
+                // this.fullScreenLoading = false
                 this.isLogin = true
             }
+            this.hideLoading();
         },
         getCurrentUserSuccess (res) {
             // console.log(res)
@@ -189,12 +202,12 @@
             })
 
         },
-        showLoading () {
-            this.fullScreenLoading = true
-        },
-        hideLoading () {
-            this.fullScreenLoading = false
-        },
+        // showLoading () {
+        //     this.fullScreenLoading = true
+        // },
+        // hideLoading () {
+        //     this.fullScreenLoading = false
+        // },
         handleClickAuthReject () {
             if (this.user.userVO.authType == 'agency') {
                 this.$router.push({
@@ -357,12 +370,11 @@
         })
     },
     beforeMount () {
+      this.getAddress();
         this.setUserInfo()
         // if (storageGet('user' != null)){
         //   this.isLogin = true
         // }
-        this.getAddress();
-        console.log(this.isLogin)
     }
   }
 </script>

+ 2 - 1
src/components/commons/HomeSlice.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="home-slice">
-    <el-row style="padding-top: 40px" v-loading="loading" element-loading-text="权限检查中...">
+<!--    <el-row style="padding-top: 40px" v-loading="loading" element-loading-text="权限检查中...">-->
+    <el-row style="padding-top: 40px">
       <el-col :span="14">
         <div class="slice-wrapper" style="padding-left: 20%">
           <div class="slice-title"><img src="../../assets/img/homeslice1.png" alt="slice1"></div>

+ 1 - 1
src/components/commons/ProvinceCity.vue

@@ -21,7 +21,7 @@
       style="width: calc(50% - 20px);margin-right: 0px"
     >
       <el-select v-model="city" :loading="loadingCity" @change="cityChanged" placeholder="请选择" :disabled="isModifyMode">
-<!--        <el-option :key="''" :label="'请选择'" :value="''"></el-option>-->
+        <el-option :key="''" :label="'请选择'" :value="''"></el-option>
         <el-option v-for="item in cities" :key="item.code" :label="item.name" :value="item.code"></el-option>
       </el-select>
     </el-form-item>

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

@@ -151,7 +151,7 @@
                   <em>点击上传</em>
                 </div>
               </el-upload>
-              <span v-if="!isModifyMode">
+              <span >
             <a :href="project.requireDocUrl" v-if="project.requireDocUrl!=null && project.requireDocUrl!=''"><el-link
               :underline="false" type="primary"><i
               class="el-icon-document"></i>下载文档</el-link></a>

+ 3 - 1
src/components/project/ProjectCreate.vue

@@ -197,7 +197,7 @@ export default {
         requireDocUrl: '',
         fileUrl: '',
         resource: '0',
-        location: {provinceCode: '3200', cityCode: '3201'},
+        location: {provinceCode: '3200', cityCode: ''},
         institution: {},
         datetime: '',
         price: '',
@@ -356,6 +356,8 @@ export default {
       return provinceName + ' / ' + cityName
     },
     locationChange (provinceId, cityId) {
+      // console.log("测试省:" + provinceId);
+      // console.log("测试市:" + cityId);
       if (provinceId || cityId) {
         this.project.location = {provinceCode: provinceId, cityCode: cityId}
       }

+ 1 - 1
src/components/task/Task.vue

@@ -94,7 +94,7 @@
               <em>点击上传</em>
             </div>
           </el-upload>
-          <span v-if="!isModifyMode">
+          <span>
               <span v-if="task.requireDocUrl == null || task.requireDocUrl == ''">
                 <i class="el-icon-document"></i>暂无文件
               </span>

+ 62 - 62
src/main.js

@@ -78,68 +78,68 @@ function getCurrentUserSuccess(res){
 //   var s = document.getElementsByTagName("script")[0];
 //   s.parentNode.insertBefore(hm, s);
 // })();
-router.beforeEach((to, from, next) => {
-  // if (_hmt) {
-  //   if (to.path) {
-  //     _hmt.push(['_trackPageview', '/#' + to.fullPath]);
-  //   }
-  // }
-  const urls = getAuthUrls()
-  if (storageGet('user') == null) {
-    getCurrentUser().then((res) => {
-      storageSave('user', res)
-      storageSave('rolesPermissions', getRolesPermissions(res.roleList))
-      if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
-        if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
-          next()
-        } else {
-          next({
-            path: '/',
-            query: {
-              redirect: to.fullPath
-            } // 将跳转的路由path作为参数,登录成功后跳转到该路由
-          })
-        }
-      } else {
-        next()
-      }
-    }).catch((error) => {
-      // notify('warning', '请登录')
-      if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
-        if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
-          next()
-        } else {
-          next({
-            path: '/',
-            query: {
-              redirect: to.fullPath
-            } // 将跳转的路由path作为参数,登录成功后跳转到该路由
-          })
-        }
-      } else {
-        next()
-      }
-    })
-  } else {
-    if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
-      if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
-        next()
-      } else {
-        next({
-          path: '/',
-          query: {
-            redirect: to.fullPath
-          } // 将跳转的路由path作为参数,登录成功后跳转到该路由
-        })
-      }
-    } else {
-      next()
-    }
-  }
-  //console.log(to.matched[0].path)
-  //console.log(urls.includes(to.matched[0].path))
-
-})
+// router.beforeEach((to, from, next) => {
+//   // if (_hmt) {
+//   //   if (to.path) {
+//   //     _hmt.push(['_trackPageview', '/#' + to.fullPath]);
+//   //   }
+//   // }
+//   const urls = getAuthUrls()
+//   if (storageGet('user') == null) {
+//     getCurrentUser().then((res) => {
+//       storageSave('user', res)
+//       storageSave('rolesPermissions', getRolesPermissions(res.roleList))
+//       if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
+//         if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
+//           next()
+//         } else {
+//           next({
+//             path: '/',
+//             query: {
+//               redirect: to.fullPath
+//             } // 将跳转的路由path作为参数,登录成功后跳转到该路由
+//           })
+//         }
+//       } else {
+//         next()
+//       }
+//     }).catch((error) => {
+//       // notify('warning', '请登录')
+//       if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
+//         if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
+//           next()
+//         } else {
+//           next({
+//             path: '/',
+//             query: {
+//               redirect: to.fullPath
+//             } // 将跳转的路由path作为参数,登录成功后跳转到该路由
+//           })
+//         }
+//       } else {
+//         next()
+//       }
+//     })
+//   } else {
+//     if (to.matched.some(record => record.meta.requireAuth)) { // 判断该路由是否需要登录权限
+//       if (sessionStorage.userName === '2' && urls.includes(to.matched[0].path)) { // 判断缓存里面是否有 userName  //在登录的时候设置它的值
+//         next()
+//       } else {
+//         next({
+//           path: '/',
+//           query: {
+//             redirect: to.fullPath
+//           } // 将跳转的路由path作为参数,登录成功后跳转到该路由
+//         })
+//       }
+//     } else {
+//       next()
+//     }
+//   }
+//   //console.log(to.matched[0].path)
+//   //console.log(urls.includes(to.matched[0].path))
+//
+// })
 
 // require('./mock.js')
 Vue.use(Carousel)

+ 100 - 93
src/pages/DetailPage/CrowdDetail.vue

@@ -5,7 +5,7 @@
       <el-row class="search-nav" style="padding: 30px 0 20px 0">
         <el-col :span="6">
           <div class="pull-left" @click="gotoHome" style="cursor: pointer">
-            <img class="logo-img" src="../../assets/img/logo-blue.png" />
+            <img class="logo-img" src="../../assets/img/logo-blue.png"/>
             <span class="logo-title">群智众测平台</span>
           </div>
         </el-col>
@@ -13,11 +13,12 @@
           <div class="search-nav">
             <div id="search-block " class="">
               <el-tabs v-model="searchType" type="card">
-                <el-tab-pane v-for="item in tabArr" :label="item.label" :name="item.name" :key="item.label"></el-tab-pane>
+                <el-tab-pane v-for="item in tabArr" :label="item.label" :name="item.name"
+                             :key="item.label"></el-tab-pane>
               </el-tabs>
               <div class="search-input">
                 <el-input placeholder="请输入内容" v-model="searchVal" class="input-with-select">
-                  <el-button class="search-button" slot="append"  type="primary" @click="handleSearchData">搜索</el-button>
+                  <el-button class="search-button" slot="append" type="primary" @click="handleSearchData">搜索</el-button>
                 </el-input>
               </div>
             </div>
@@ -44,7 +45,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="item.id" :projectItem="item"/>
+                        v-for="(item,index) in projectList" :key="item.id" :projectItem="item"/>
         </el-tab-pane>
       </el-tabs>
     </div>
@@ -57,7 +58,7 @@
             :page-size="10"
             layout="prev, pager, next"
             :total="totalElements"
-            :current-page = "activePage"
+            :current-page="activePage"
             @current-change="handlePageChange"
             class="pull-right"
           >
@@ -69,102 +70,108 @@
 </template>
 
 <script>
-    import Http from '@/js/http.js'
-    import Apis from '@/js/api.js'
-    import SearchBar from '../../components/commons/SearchBar'
-    import {notify} from "../../constants"
-    import ProjectItem from '../../components/commons/ProjectItem'
-    import {defaultValue, storageGet} from '@/js/index'
-    export default {
-        name: 'CrowdDetail',
-        comments: {ProjectItem},
-        data(){
-            return {
-                loading: false,
-                isLogin: false,
-                searchType:'project',
-                searchVal: '',
-                currTab:'project',
-                tabArr : [
-                    {label:"众测项目",name:"project"},
-                ],
-                projectList:[],
-                activePage:1,
-                totalElements:0,
-                code: ''
-            }
-        },
-        components: {
-            ProjectItem,
-            SearchBar,
-        },
-        computed:{
-        },
-        methods:{
-            loadData(){
-                this.showLoading();
-                if (storageGet('user') != null) {
-                    this.isLogin = true;
-                }
-                this.code = this.$route.params.code;
-                this.getCrowdProject();
-                this.hideLoading();
-            },
-            getCrowdProject(){
-                let params = {
-                    "keyword": this.searchVal,//搜索关键字
-                    "activePage": this.activePage,//指定页面
-                    "columnFilters":[]
-                };
-                Http.post(Apis.PROJECT.CROWD_PROJECT.replace('{code}', this.code), params).then((res) => {
-                    this.projectList = res.data.content;
-                    this.totalElements = res.data.totalElements;
-                    console.log(this.projectList)
-                })
-            },
-            gotoHome(){
-                this.$router.push('/home');
-            },
-          checkLogin() {
-            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)
-              })
-            }
-          },
-            handleSearchData(){
-              this.activePage = 1;
-              this.getCrowdProject();
-            },
-            handlePageChange(index){
-                this.activePage = index;
-                this.getCrowdProject();
-            },
-            showLoading () {
-                this.loading = true
-            },
-            hideLoading () {
-                this.loading = false
-            },
-        },
-        mounted() {
-            this.loadData();
+  import Http from '@/js/http.js'
+  import Apis from '@/js/api.js'
+  import SearchBar from '../../components/commons/SearchBar'
+  import {notify} from "../../constants"
+  import ProjectItem from '../../components/commons/ProjectItem'
+  import {defaultValue, storageGet} from '@/js/index'
+
+  export default {
+    name: 'CrowdDetail',
+    comments: {ProjectItem},
+    data() {
+      return {
+        user: {},
+        loading: false,
+        isLogin: false,
+        searchType: 'project',
+        searchVal: '',
+        currTab: 'project',
+        tabArr: [
+          {label: "众测项目", name: "project"},
+        ],
+        projectList: [],
+        activePage: 1,
+        totalElements: 0,
+        code: ''
+      }
+    },
+    components: {
+      ProjectItem,
+      SearchBar,
+    },
+    computed: {},
+    methods: {
+      loadData() {
+        this.showLoading();
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+        this.code = this.$route.params.code;
+        this.getCrowdProject();
+        this.hideLoading();
+      },
+      getCrowdProject() {
+        let params = {
+          "keyword": this.searchVal,//搜索关键字
+          "activePage": this.activePage,//指定页面
+          "columnFilters": []
+        };
+        Http.post(Apis.PROJECT.CROWD_PROJECT.replace('{code}', this.code), params).then((res) => {
+          this.projectList = res.data.content;
+          this.totalElements = res.data.totalElements;
+        })
+      },
+      gotoHome() {
+        this.$router.push('/home');
+      },
+      checkLogin() {
+        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)
+          })
         }
+      },
+      handleSearchData() {
+        this.activePage = 1;
+        this.getCrowdProject();
+      },
+      handlePageChange(index) {
+        this.activePage = index;
+        this.getCrowdProject();
+      },
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
+      }
+    },
+    mounted() {
+      this.setUserInfo();
+      this.loadData();
     }
+  }
 </script>
 
 <style lang="less">
   @import "../../style/search-nav";
+
   .project-task {
     padding: 15px 0;
+
     .el-card {
       border: none;
     }

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

@@ -15,14 +15,14 @@
         <el-form-item label="头衔" prop="address">
           <span>{{expert.title}}</span>
         </el-form-item>
-        <el-form-item label="简介" prop="address">
+        <el-form-item label="简介" prop="address" style="height: 500px; overflow: scroll">
           <span>{{expert.introduction}}</span>
         </el-form-item>
 <!--        <el-form-item label="接包次数" prop="count">-->
 <!--          <span>{{expert.taskCount}}</span>-->
 <!--        </el-form-item>-->
         <el-form-item>
-          <div class="btn btn-medium" @click="back()">返回</div>
+          <div class="btn btn-medium" style="margin-top: 20px" @click="back()">返回</div>
         </el-form-item>
       </el-form>
     </div>

+ 4 - 4
src/pages/DetailPage/UserDetail.vue

@@ -9,12 +9,12 @@
           <!--          <span  class="badge">{{user.photo}}</span>-->
           <img :src="user.photo==null?defaultValue.image:user.photo" style="width: 50px; height: 50px;"/>
         </el-form-item>
-        <el-form-item label="性别" prop="count" v-if="this.gender != null &&  this.gender != ''">
+        <el-form-item label="性别" prop="gender" v-if="user.gender != null &&  user.gender != ''">
           <span>{{user.gender}}</span>
         </el-form-item>
-        <el-form-item label="地址" prop="address">
-          <span class="badge">{{user.address}}</span>
-        </el-form-item>
+<!--        <el-form-item label="地址" prop="address">-->
+<!--          <span class="badge">{{user.address}}</span>-->
+<!--        </el-form-item>-->
         <el-form-item label="接包次数" prop="count">
           <span>{{user.taskCount}}</span>
         </el-form-item>

+ 2 - 2
src/pages/Homepage/BrandCard.vue

@@ -4,9 +4,9 @@
       <span>入驻品牌机构</span>
       <a class="pull-right" style="color: rgba(0, 118, 203, 1); cursor: pointer" @click="goToMoreAgency()">more>></a>
     </div>
-    <div style="height: 96px">
+    <div style="height: 210px">
       <el-row :gutter="15">
-        <el-col v-for="item in residentAgencyList" :key="item.id" :span="6" style="height: 70px">
+        <el-col v-for="item in residentAgencyList" :key="item.id" :span="4" style="height: 90px; margin-bottom: 20px">
           <img :src="item.agencyPhoto==null?defaultValue.image:item.agencyPhoto" :alt="item.evaluationAgencyName" style="width: 70%;height: 100%; cursor: pointer;" @click="goToDetail(item.userId)"/>
         </el-col>
       </el-row>

+ 2 - 2
src/pages/Homepage/Homepage.vue

@@ -41,7 +41,7 @@
       </div>
     </div>
 
-    <div class="home-page container" v-loading="loading">
+    <div class="home-page container" >
       <el-row>
         <el-col :span="19" class="test-type-wrapper">
           <TestMenu :testTypeList="homeData.testTypeList"></TestMenu>
@@ -54,7 +54,7 @@
           </el-row>
         </el-col>
         <el-col :span="5" class="homepage-right-modules">
-          <LoginCard/>
+<!--          <LoginCard/>-->
           <HotCrowd :applicationTypeRank="homeDataNoCache.applicationTypeRank"/>
           <HotAgency :agencyRank="homeDataNoCache.agencyRank"/>
           <HotUser :userRank="homeDataNoCache.userRank"/>

+ 147 - 138
src/pages/HomepageSearch/AgencyList.vue

@@ -44,7 +44,9 @@
               <el-table-column
                 label="头像"
                 width="100">
-                <template slot-scope="scope"><img :src="scope.row.agencyPhoto==null?defaultValue.image:scope.row.agencyPhoto" style="width: 50px; height: 50px;"/>
+                <template slot-scope="scope"><img
+                  :src="scope.row.agencyPhoto==null?defaultValue.image:scope.row.agencyPhoto"
+                  style="width: 50px; height: 50px;"/>
                 </template>
               </el-table-column>
               <el-table-column
@@ -89,150 +91,157 @@
 </template>
 
 <script>
-    import Http from '@/js/http.js';
-    import TopSearch from "../../components/commons/TopSearch";
-    import {storageGet,defaultValue} from '@/js/index.js'
-    import {notify} from "../../constants";
+  import Http from '@/js/http.js';
+  import TopSearch from "../../components/commons/TopSearch";
+  import {storageGet, defaultValue} from '@/js/index.js'
+  import {notify} from "../../constants";
+  import Apis from '@/js/api'
 
-    export default {
-        name: "AgencyList",
-        components: {TopSearch},
-        data() {
-            return {
-                isLogin: false,
-                loading: false,
-                defaultValue: defaultValue,
-                searchVal: '',
-                searchType: '1',
-                searchTypeArr: [
-                    {
-                        "name": "全部",
-                        "value": "all"
-                    },
-                    {
-                        "name": "项目",
-                        "value": "0"
-                    },
-                    {
-                        "name": "机构",
-                        "value": "1"
-                    },
-                    {
-                        "name": "工具",
-                        "value": "2"
-                    },
-                    {
-                        "name": "专家",
-                        "value": "3"
-                    }],
-                curAgencyList: [],
-                activePage: 1,
-                totalElements: 0
-            }
-        },
-        methods: {
-            loadData() {
-                this.showLoading();
-                if (storageGet('user') != null) {
-                    this.isLogin = true;
-                }
-                this.searchVal = this.$route.params.searchVal;
-                this.handleSearchData();
-                this.hideLoading();
-            },
-
-            showLoading () {
-                this.loading = true
-            },
-            hideLoading () {
-                this.loading = false
-            },
-          checkLogin() {
-            this.checkCreateProjectAuth();
+  export default {
+    name: "AgencyList",
+    components: {TopSearch},
+    data() {
+      return {
+        user: {},
+        isLogin: false,
+        loading: false,
+        defaultValue: defaultValue,
+        searchVal: '',
+        searchType: '1',
+        searchTypeArr: [
+          {
+            "name": "全部",
+            "value": "all"
           },
-          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)
-              })
-            }
+          {
+            "name": "项目",
+            "value": "0"
+          },
+          {
+            "name": "机构",
+            "value": "1"
+          },
+          {
+            "name": "工具",
+            "value": "2"
           },
-            handleSearchData() {
-                if (this.searchType == 0) {
-                    // this.$router.push({name: 'Square2.0', params: {searchVal: this.searchVal, searchType: "project"}});
-                } else if (this.searchType == 1) {
-                    let url = '/api/agency/list/more';
-                    let params = {
-                        "keyword": this.searchVal,
-                        "activePage": this.activePage,
-                        "columnFilters": [
-                            {
-                                "field": "type",
-                                "type": "enums",
-                                "enums": this.searchTypeArr,
-                                "value": this.searchType
-                            }
-                        ]
-                    }
-                    Http.post(url, params).then((res) => {
-                        this.curAgencyList = res.data.content;
-                        this.totalElements = res.data.totalElements;
-                    })
-                } else if (this.searchType == 2) {
-                    this.$router.push({name: 'ResourceList', params: {searchVal: this.searchVal}});
-                } else if (this.searchType == 3) {
-                    this.$router.push({name: 'ExpertList', params: {searchVal: this.searchVal}});
-                }
-            },
-            goToDetail(userId) {
-                this.$router.push({
-                    name: 'AgencyDetail',
-                    params: {id: userId, type: 0}
-                })
-            },
-            nextPage() {
-                let url = '/api/agency/list/more';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage": this.activePage,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                }
-                Http.post(url, params).then((res) => {
-                    this.curAgencyList = res.data.content;
-                    this.totalElements = res.data.totalElements;
-                })
-            },
-            gotoHome() {
-                this.$router.push('/home');
-            },
-            handleTypeClick(tab) {
-                this.searchType = tab.name
-            },
-            handlePageChange(index) {
-                this.activePage = index;
-                this.nextPage();
+          {
+            "name": "专家",
+            "value": "3"
+          }],
+        curAgencyList: [],
+        activePage: 1,
+        totalElements: 0
+      }
+    },
+    methods: {
+      loadData() {
+        this.showLoading();
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+        this.searchVal = this.$route.params.searchVal;
+        this.handleSearchData();
+        this.hideLoading();
+      },
+
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
+      checkLogin() {
+        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)
+          })
+        }
+      },
+      handleSearchData() {
+        if (this.searchType == 0) {
+          // this.$router.push({name: 'Square2.0', params: {searchVal: this.searchVal, searchType: "project"}});
+        } else if (this.searchType == 1) {
+          let url = '/api/agency/list/more';
+          let params = {
+            "keyword": this.searchVal,
+            "activePage": this.activePage,
+            "columnFilters": [
+              {
+                "field": "type",
+                "type": "enums",
+                "enums": this.searchTypeArr,
+                "value": this.searchType
+              }
+            ]
+          }
+          Http.post(url, params).then((res) => {
+            this.curAgencyList = res.data.content;
+            this.totalElements = res.data.totalElements;
+          })
+        } else if (this.searchType == 2) {
+          this.$router.push({name: 'ResourceList', params: {searchVal: this.searchVal}});
+        } else if (this.searchType == 3) {
+          this.$router.push({name: 'ExpertList', params: {searchVal: this.searchVal}});
+        }
+      },
+      goToDetail(userId) {
+        this.$router.push({
+          name: 'AgencyDetail',
+          params: {id: userId, type: 0}
+        })
+      },
+      nextPage() {
+        let url = '/api/agency/list/more';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
             }
-        },
-        mounted() {
-            this.loadData();
-        },
+          ]
+        }
+        Http.post(url, params).then((res) => {
+          this.curAgencyList = res.data.content;
+          this.totalElements = res.data.totalElements;
+        })
+      },
+      gotoHome() {
+        this.$router.push('/home');
+      },
+      handleTypeClick(tab) {
+        this.searchType = tab.name
+      },
+      handlePageChange(index) {
+        this.activePage = index;
+        this.nextPage();
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
+      }
+    },
+    mounted() {
+      this.setUserInfo();
+      this.loadData();
     }
+  }
 </script>
-
-<style scoped>
+<style scoped lang="less">
+  @import "../../style/search-nav";
   .item-template {
     height: 80px;
   }
 </style>
+

+ 116 - 107
src/pages/HomepageSearch/AgencyResidentList.vue

@@ -31,7 +31,7 @@
         </el-col>
       </el-row>
     </div>
-    <div class="container" style="margin: 20px auto;">
+    <div class="container" style="margin: 20px auto;" v-loading="loading">
       <div class="create-body">
         <div class="title h2">入驻品牌机构</div>
         <el-collapse accordion style="margin: 0 30px">
@@ -44,7 +44,9 @@
               <el-table-column
                 label="头像"
                 width="100">
-                <template slot-scope="scope"><img :src="scope.row.agencyPhoto==null?defaultValue.image:scope.row.agencyPhoto" style="width: 50px; height: 50px;"/></template>
+                <template slot-scope="scope"><img
+                  :src="scope.row.agencyPhoto==null?defaultValue.image:scope.row.agencyPhoto"
+                  style="width: 50px; height: 50px;"/></template>
               </el-table-column>
               <el-table-column
                 prop="name"
@@ -83,118 +85,125 @@
 </template>
 
 <script>
-    import Http from '@/js/http.js';
-    import TopSearch from "../../components/commons/TopSearch";
-    import {storageGet,defaultValue} from '@/js/index.js'
-    import {notify} from "../../constants";
+  import Http from '@/js/http.js';
+  import TopSearch from "../../components/commons/TopSearch";
+  import {storageGet, defaultValue} from '@/js/index.js'
+  import {notify} from "../../constants";
+  import Apis from '@/js/api';
 
-    export default {
-        name: "AgencyResidentList",
-        props: ['searchVal', 'agencyList'],
-        components: {TopSearch},
-        data() {
-            return {
-                isLogin: false,
-                searchType: '0',
-                loading: false,
-                defaultValue: defaultValue,
-                searchTypeArr: [
-                    {
-                        "name": "入驻机构",
-                        "value": "0"
-                    }],
-                curAgencyList: this.agencyList,
-                activePage: 1,
-                totalElements: 0
+  export default {
+    name: "AgencyResidentList",
+    props: ['searchVal', 'agencyList'],
+    components: {TopSearch},
+    data() {
+      return {
+        user: {},
+        isLogin: false,
+        searchType: '0',
+        loading: false,
+        defaultValue: defaultValue,
+        searchTypeArr: [
+          {
+            "name": "入驻机构",
+            "value": "0"
+          }],
+        curAgencyList: this.agencyList,
+        activePage: 1,
+        totalElements: 0
+      }
+    },
+    methods: {
+      loadData() {
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+        let url = '/api/resident/agency/more';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
             }
-        },
-        methods: {
-            loadData() {
-                if (storageGet('user') != null) {
-                    this.isLogin = true;
-                }
-                let url = '/api/resident/agency/more';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage": this.activePage,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                }
-                Http.post(url, params).then((res) => {
-                    this.curAgencyList = res.data.content;
-                    this.totalElements=res.data.totalElements;
-                })
-            },
-          checkLogin() {
-            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)
-              })
+          ]
+        }
+        Http.post(url, params).then((res) => {
+          this.curAgencyList = res.data.content;
+          this.totalElements = res.data.totalElements;
+        })
+      },
+      checkLogin() {
+        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)
+          })
+        }
+      },
+      handleSearchData() {
+        let url = '/api/resident/agency/more';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
             }
-          },
-            handleSearchData() {
-                let url = '/api/resident/agency/more';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage": this.activePage,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                }
-                Http.post(url, params).then((res) => {
-                    this.curAgencyList = res.data.content;
-                    this.totalElements=res.data.totalElements;
-                })
-            },
-            gotoHome() {
-                this.$router.push('/home');
-            },
-            handleTypeClick(tab) {
-                this.searchType = tab.name
-            },
-            handlePageChange(index) {
-                this.activePage = index;
-                this.handleSearchData();
-            },
-            goToDetail(id) {
-                this.$router.push({
-                    name: 'AgencyDetail',
-                    params: {id: id, type: 1}
-                })
-            },
-            showLoading () {
-                this.loading = true
-            },
-            hideLoading () {
-                this.loading = false
-            },
-        },
-        mounted() {
-            this.loadData();
+          ]
         }
+        Http.post(url, params).then((res) => {
+          this.curAgencyList = res.data.content;
+          this.totalElements = res.data.totalElements;
+        })
+      },
+      gotoHome() {
+        this.$router.push('/home');
+      },
+      handleTypeClick(tab) {
+        this.searchType = tab.name
+      },
+      handlePageChange(index) {
+        this.activePage = index;
+        this.handleSearchData();
+      },
+      goToDetail(id) {
+        this.$router.push({
+          name: 'AgencyDetail',
+          params: {id: id, type: 1}
+        })
+      },
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
+      }
+    },
+    mounted() {
+      this.setUserInfo();
+      this.loadData();
     }
+  }
 </script>
 
-<style scoped>
+<style lang="less">
+  @import "../../style/search-nav";
   .item-template {
     height: 80px;
   }

+ 111 - 95
src/pages/HomepageSearch/CompetitionList.vue

@@ -31,7 +31,7 @@
         </el-col>
       </el-row>
     </div>
-    <div class="container" style="margin: 20px auto;">
+    <div class="container" style="margin: 20px auto;" v-loading="loading">
       <div class="create-body">
         <div class="title h2">众测大赛</div>
         <el-collapse accordion style="margin: 0 30px">
@@ -44,13 +44,15 @@
               <el-table-column
                 label="图标"
                 width="100">
-                <template slot-scope="scope"><img :src="scope.row.image==null?defaultValue.image:scope.row.image" style="width: 50px; height: 50px;"/></template>
+                <template slot-scope="scope"><img :src="scope.row.image==null?defaultValue.image:scope.row.image"
+                                                  style="width: 50px; height: 50px;"/></template>
               </el-table-column>
               <el-table-column
                 label="名称"
                 align="left"
                 width="500">
-                <template slot-scope="scope"><a target="_blank" :href="scope.row.linkUrl" itemscope>{{scope.row.name}}</a></template>
+                <template slot-scope="scope"><a target="_blank" :href="scope.row.linkUrl"
+                                                itemscope>{{scope.row.name}}</a></template>
               </el-table-column>
               <el-table-column
                 prop="unit"
@@ -81,105 +83,119 @@
 </template>
 
 <script>
-    import Http from '@/js/http.js';
-    import TopSearch from "../../components/commons/TopSearch";
-    import {storageGet,defaultValue} from '@/js/index.js'
-    import {notify} from "../../constants";
+  import Http from '@/js/http.js';
+  import TopSearch from "../../components/commons/TopSearch";
+  import {storageGet, defaultValue} from '@/js/index.js'
+  import {notify} from "../../constants";
+  import Apis from '@/js/api';
 
-    export default {
-        name: "CompetitionList",
-        props: ['searchVal', 'competitionList'],
-        components: {TopSearch},
-        data() {
-            return {
-                isLogin: false,
-                // searchVal: '',
-                searchType: '0',
-                defaultValue: defaultValue,
-                searchTypeArr: [
-                    {
-                        "name": "大赛",
-                        "value": "0"
-                    }],
-                curCompetitionList: this.competitionList,
-                activePage: 1,
-                totalElements: 0
-            }
-        },
-        methods: {
-            loadData() {
-                if (storageGet('user') != null) {
-                    this.isLogin = true;
-                }
-                let url = '/api/common/index/competition';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage": this.activePage,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                }
-                Http.post(url, params).then((res) => {
-                    this.curCompetitionList = res.data.content;
-                    this.totalElements=res.data.totalElements;
-                })
-            },
-          checkLogin() {
-            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)
-              })
+  export default {
+    name: "CompetitionList",
+    props: ['searchVal', 'competitionList'],
+    components: {TopSearch},
+    data() {
+      return {
+        user: {},
+        isLogin: false,
+        loading: false,
+        // searchVal: '',
+        searchType: '0',
+        defaultValue: defaultValue,
+        searchTypeArr: [
+          {
+            "name": "大赛",
+            "value": "0"
+          }],
+        curCompetitionList: this.competitionList,
+        activePage: 1,
+        totalElements: 0
+      }
+    },
+    methods: {
+      loadData() {
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+        let url = '/api/common/index/competition';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
             }
-          },
-            handleSearchData() {
-                let url = '/api/common/index/competition';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage": this.activePage,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                }
-                Http.post(url, params).then((res) => {
-                    this.curCompetitionList = res.data.content;
-                })
-            },
-            gotoHome() {
-                this.$router.push('/home');
-            },
-            handleTypeClick(tab) {
-                this.searchType = tab.name
-            },
-            handlePageChange(index) {
-                this.activePage = index;
-                this.handleSearchData();
+          ]
+        }
+        Http.post(url, params).then((res) => {
+          this.curCompetitionList = res.data.content;
+          this.totalElements = res.data.totalElements;
+        })
+      },
+      checkLogin() {
+        this.checkCreateProjectAuth();
+      },
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
+      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)
+          })
+        }
+      },
+      handleSearchData() {
+        let url = '/api/common/index/competition';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
             }
-        },
-        mounted() {
-            this.loadData();
+          ]
         }
+        Http.post(url, params).then((res) => {
+          this.curCompetitionList = res.data.content;
+        })
+      },
+      gotoHome() {
+        this.$router.push('/home');
+      },
+      handleTypeClick(tab) {
+        this.searchType = tab.name
+      },
+      handlePageChange(index) {
+        this.activePage = index;
+        this.handleSearchData();
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
+      }
+    },
+    mounted() {
+      this.setUserInfo();
+      this.loadData();
     }
+  }
 </script>
 
-<style scoped>
+<style lang="less">
+  @import "../../style/search-nav";
   .item-template {
     height: 80px;
   }

+ 122 - 108
src/pages/HomepageSearch/CrowdList.vue

@@ -31,7 +31,7 @@
         </el-col>
       </el-row>
     </div>
-    <div class="container" style="margin: 20px auto;">
+    <div class="container" style="margin: 20px auto;" v-loading="loading">
       <div class="create-body">
         <div class="title h2">众测应用类型</div>
         <template style="color: black">
@@ -65,126 +65,140 @@
             </el-table-column>
           </el-table>
         </template>
-          <el-pagination
-            v-if="curCrowdList&&curCrowdList.length"
-            :page-size="9"
-            layout="prev, pager, next"
-            :total="totalElements"
-            :current-page="activePage"
-            @current-change="handlePageChange"
-            class="pull-right"
-          >
-          </el-pagination>
+        <el-pagination
+          v-if="curCrowdList&&curCrowdList.length"
+          :page-size="9"
+          layout="prev, pager, next"
+          :total="totalElements"
+          :current-page="activePage"
+          @current-change="handlePageChange"
+          class="pull-right"
+        >
+        </el-pagination>
       </div>
     </div>
   </div>
 </template>
 
 <script>
-    import Http from '@/js/http.js';
-    import TopSearch from "../../components/commons/TopSearch";
-    import {storageGet} from '@/js/index.js'
-    import {notify} from "../../constants";
+  import Http from '@/js/http.js';
+  import TopSearch from "../../components/commons/TopSearch";
+  import {storageGet} from '@/js/index.js'
+  import {notify} from "../../constants";
+  import Apis from '@/js/api';
 
-    export default {
-        name: "CrowdList",
-        props: ['searchVal', 'crowdList'],
-        components: {TopSearch},
-        data() {
-            return {
-                isLogin: false,
-                // searchVal: '',
-                searchType: '0',
-                searchTypeArr: [
-                    {
-                        "name": "众测",
-                        "value": "0"
-                    }],
-                curCrowdList: this.crowdList,
-                activePage: 1,
-                totalElements: 0,
+  export default {
+    name: "CrowdList",
+    props: ['searchVal', 'crowdList'],
+    components: {TopSearch},
+    data() {
+      return {
+        user: {},
+        isLogin: false,
+        loading: false,
+        // searchVal: '',
+        searchType: '0',
+        searchTypeArr: [
+          {
+            "name": "众测",
+            "value": "0"
+          }],
+        curCrowdList: this.crowdList,
+        activePage: 1,
+        totalElements: 0,
+      }
+    },
+    methods: {
+      loadData() {
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+        let url = '/api/common/index/application';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
             }
-        },
-        methods: {
-            loadData() {
-                if (storageGet('user') != null) {
-                    this.isLogin = true;
-                }
-                let url = '/api/common/index/application';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage": this.activePage,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                }
-                Http.post(url, params).then((res) => {
-                    this.curCrowdList = res.data.content;
-                    this.totalElements=res.data.totalElements;
-                })
-            },
-          checkLogin() {
-            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)
-              })
+          ]
+        }
+        Http.post(url, params).then((res) => {
+          this.curCrowdList = res.data.content;
+          this.totalElements = res.data.totalElements;
+        })
+      },
+      checkLogin() {
+        this.checkCreateProjectAuth();
+      },
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
+      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)
+          })
+        }
+      },
+      handleSearchData() {
+        let url = '/api/common/index/application';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
             }
-          },
-            handleSearchData() {
-                let url = '/api/common/index/application';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage": this.activePage,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                }
-                Http.post(url, params).then((res) => {
-                    this.curCrowdList = res.data.content;
-                })
-            },
-            gotoHome() {
-                this.$router.push('/home');
-            },
-            handleTypeClick(tab) {
-                this.searchType = tab.name
-            },
-            handlePageChange(index) {
-                this.activePage = index;
-                this.handleSearchData();
-            },
-            goToDetail(code) {
-                this.$router.push({
-                    name: 'CrowdDetail',
-                    params: {code: code}
-                })
-            },
-        },
-        mounted() {
-            this.loadData();
+          ]
         }
+        Http.post(url, params).then((res) => {
+          this.curCrowdList = res.data.content;
+        })
+      },
+      gotoHome() {
+        this.$router.push('/home');
+      },
+      handleTypeClick(tab) {
+        this.searchType = tab.name
+      },
+      handlePageChange(index) {
+        this.activePage = index;
+        this.handleSearchData();
+      },
+      goToDetail(code) {
+        this.$router.push({
+          name: 'CrowdDetail',
+          params: {code: code}
+        })
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
+      }
+    },
+    mounted() {
+      this.setUserInfo();
+      this.loadData();
     }
+  }
 </script>
 
-<style scoped>
+<style lang="less">
+  @import "../../style/search-nav";
   .item-template {
     height: 80px;
   }

+ 1 - 2
src/pages/HomepageSearch/ExpertCard.vue

@@ -1,6 +1,6 @@
 <template>
   <el-card class="expert-card">
-    <el-row>
+    <el-row style="border-bottom: 1px solid #ccc">
       <el-col :span="6">
         <div class="card-img"><img :src="card.photo" style="height: 50px; width: 50px;"/></div>
       </el-col>
@@ -13,7 +13,6 @@
         </div>
       </el-col>
     </el-row>
-    <el-divider></el-divider>
     <div class="card-detail">
       {{card.introduction}}
     </div>

+ 138 - 122
src/pages/HomepageSearch/ExpertList.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="home-wrapper">
+  <div>
     <!--    <TopSearch :searchVal="searchVal" :searchType="searchType" :searchTypeArr="searchTypeArr"/>-->
     <div class="nav" stype="height:500px">
       <!--搜索框-->
@@ -32,7 +32,7 @@
       </el-row>
     </div>
 
-    <div class="container" style="margin: 20px auto;">
+    <div class="container" style="margin: 20px auto;" v-loading="loading">
       <div class="title h2">专家</div>
       <el-row>
         <el-col :span="18" class="">
@@ -58,132 +58,148 @@
 </template>
 
 <script>
-    import Http from '@/js/http.js';
-    import TopSearch from "../../components/commons/TopSearch";
-    import ExpertCard from "./ExpertCard";
-    import {storageGet} from '@/js/index.js'
-    import {notify} from "../../constants";
+  import Http from '@/js/http.js';
+  import TopSearch from "../../components/commons/TopSearch";
+  import ExpertCard from "./ExpertCard";
+  import {storageGet} from '@/js/index.js'
+  import {notify} from "../../constants";
+  import Apis from '@/js/api';
 
-    export default {
-        name: "ExpertList",
-        components: {ExpertCard, TopSearch},
-        data() {
-            return {
-                isLogin: false,
-                searchVal: '',
-                searchType: '3',
-                searchTypeArr: [
-                    {
-                        "name": "全部",
-                        "value": "all"
-                    },
-                    {
-                        "name": "项目",
-                        "value": "0"
-                    },
-                    {
-                    "name": "机构",
-                    "value": "1"
-                },
-                {
-                    "name": "工具",
-                    "value": "2"
-                },
-                    {
-                        "name": "专家",
-                        "value": "3"
-                    }],
-                expertList: [],
-                activePage: 1,
-                totalElements: 0
-            }
-        },
-        methods: {
-            loadData() {
-                if (storageGet('user') != null) {
-                    this.isLogin = true;
-                }
-                this.searchVal = this.$route.params.searchVal;
-                this.handleSearchData();
-            },
-          checkLogin() {
-            this.checkCreateProjectAuth();
+  export default {
+    name: "ExpertList",
+    components: {ExpertCard, TopSearch},
+    data() {
+      return {
+        user: {},
+        isLogin: false,
+        loading: false,
+        searchVal: '',
+        searchType: '3',
+        searchTypeArr: [
+          {
+            "name": "全部",
+            "value": "all"
           },
-          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)
-              })
-            }
+          {
+            "name": "项目",
+            "value": "0"
+          },
+          {
+            "name": "机构",
+            "value": "1"
+          },
+          {
+            "name": "工具",
+            "value": "2"
           },
-            handleSearchData() {
-                if(this.searchType == 0){
-                    this.$router.push({name: 'Square', params: {searchVal: this.searchVal, searchType: "project", currTab: "project"}});
-                }else if(this.searchType == 1){
-                    this.$router.push({name: 'AgencyList', params: {searchVal: this.searchVal}});
-                }else if(this.searchType == 2){
-                    this.$router.push({name: 'ResourceList', params: {searchVal: this.searchVal}});
-                }else if(this.searchType == 3){
-                    let url = '/api/common/index/page';
-                    let params = {
-                        "keyword": this.searchVal,
-                        "activePage": 1,
-                        "columnFilters": [
-                            {
-                                "field": "type",
-                                "type": "enums",
-                                "enums": this.searchTypeArr,
-                                "value": this.searchType
-                            }
-                        ]
-                    }
-                    Http.post(url, params).then((res) => {
-                        this.expertList = res.data.expertPage.content;
-                        this.totalElements = res.data.expertPage.totalElements;
-                    })
-                }
-            },
-            nextPage(){
-                let url = '/api/common/index/page';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage": 1,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                }
-                Http.post(url, params).then((res) => {
-                    this.expertList = res.data.expertPage.content;
-                    this.totalElements = res.data.expertPage.totalElements;
-                })
-            },
-            gotoHome() {
-                this.$router.push('/home');
-            },
-            handleTypeClick(tab) {
-                this.searchType = tab.name
-            },
-            handlePageChange(index) {
-                this.activePage = index;
-                this.nextPage();
+          {
+            "name": "专家",
+            "value": "3"
+          }],
+        expertList: [],
+        activePage: 1,
+        totalElements: 0
+      }
+    },
+    methods: {
+      loadData() {
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+        this.searchVal = this.$route.params.searchVal;
+        this.handleSearchData();
+      },
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
+      checkLogin() {
+        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)
+          })
+        }
+      },
+      handleSearchData() {
+        if (this.searchType == 0) {
+          this.$router.push({
+            name: 'Square',
+            params: {searchVal: this.searchVal, searchType: "project", currTab: "project"}
+          });
+        } else if (this.searchType == 1) {
+          this.$router.push({name: 'AgencyList', params: {searchVal: this.searchVal}});
+        } else if (this.searchType == 2) {
+          this.$router.push({name: 'ResourceList', params: {searchVal: this.searchVal}});
+        } else if (this.searchType == 3) {
+          let url = '/api/common/index/page';
+          let params = {
+            "keyword": this.searchVal,
+            "activePage": 1,
+            "columnFilters": [
+              {
+                "field": "type",
+                "type": "enums",
+                "enums": this.searchTypeArr,
+                "value": this.searchType
+              }
+            ]
+          }
+          Http.post(url, params).then((res) => {
+            this.expertList = res.data.expertPage.content;
+            this.totalElements = res.data.expertPage.totalElements;
+          })
+        }
+      },
+      nextPage() {
+        let url = '/api/common/index/page';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": 1,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
             }
-        },
-        mounted() {
-            this.loadData();
+          ]
         }
+        Http.post(url, params).then((res) => {
+          this.expertList = res.data.expertPage.content;
+          this.totalElements = res.data.expertPage.totalElements;
+        })
+      },
+      gotoHome() {
+        this.$router.push('/home');
+      },
+      handleTypeClick(tab) {
+        this.searchType = tab.name
+      },
+      handlePageChange(index) {
+        this.activePage = index;
+        this.nextPage();
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
+      }
+    },
+    mounted() {
+      this.setUserInfo();
+      this.loadData();
     }
+  }
 </script>
 
-<style scoped>
-
+<style lang="less">
+  @import "../../style/search-nav";
 </style>

+ 145 - 134
src/pages/HomepageSearch/ResourceList.vue

@@ -39,11 +39,12 @@
             ref="multipleTable"
             :data="curResourceList"
             tooltip-effect="dark"
-            style="width: 100%; font-size: 20px; color: black">
+            style="width: 100%; font-size: 20px; color: black" v-loading="loading">
             <el-table-column
               label="图标"
               width="100">
-              <template slot-scope="scope"><img :src="scope.row.photoUrl" style="width: 50px; height: 50px;"/></template>
+              <template slot-scope="scope"><img :src="scope.row.photoUrl" style="width: 50px; height: 50px;"/>
+              </template>
             </el-table-column>
             <el-table-column
               prop="name"
@@ -93,146 +94,156 @@
 </template>
 
 <script>
-    import Http from '@/js/http.js';
-    import TopSearch from "../../components/commons/TopSearch";
-    import {storageGet} from '@/js/index.js'
-    import {notify} from "../../constants";
+  import Http from '@/js/http.js';
+  import TopSearch from "../../components/commons/TopSearch";
+  import {storageGet} from '@/js/index.js'
+  import {notify} from "../../constants";
+  import Apis from '@/js/api';
 
-    export default {
-        name: "ResourceList",
-        components: {TopSearch},
-        data() {
-            return {
-                isLogin: false,
-                loading: false,
-                searchVal: '',
-                curResourceList: [],
-                searchType: '2',
-                searchTypeArr: [
-                    {
-                        "name": "全部",
-                        "value": "all"
-                    },
-                    {
-                        "name": "项目",
-                        "value": "0"
-                    },
-                    {
-                        "name": "机构",
-                        "value": "1"
-                    },
-                    {
-                        "name": "工具",
-                        "value": "2"
-                    },
-                    {
-                        "name": "专家",
-                        "value": "3"
-                    }],
-                activePage: 1,
-                totalElements: 0
-            }
-        },
-        methods: {
-            loadData() {
-                if (storageGet('user') != null) {
-                    this.isLogin = true;
-                }
-                this.searchVal = this.$route.params.searchVal;
-                this.handleSearchData();
-            },
-          checkLogin() {
-            this.checkCreateProjectAuth();
+  export default {
+    name: "ResourceList",
+    components: {TopSearch},
+    data() {
+      return {
+        user: {},
+        isLogin: false,
+        loading: false,
+        searchVal: '',
+        curResourceList: [],
+        searchType: '2',
+        searchTypeArr: [
+          {
+            "name": "全部",
+            "value": "all"
           },
-          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)
-              })
-            }
+          {
+            "name": "项目",
+            "value": "0"
+          },
+          {
+            "name": "机构",
+            "value": "1"
+          },
+          {
+            "name": "工具",
+            "value": "2"
           },
-            handleSearchData() {
+          {
+            "name": "专家",
+            "value": "3"
+          }],
+        activePage: 1,
+        totalElements: 0
+      }
+    },
+    methods: {
+      loadData() {
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+        this.searchVal = this.$route.params.searchVal;
+        this.handleSearchData();
+      },
+      checkLogin() {
+        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)
+          })
+        }
+      },
+      handleSearchData() {
 
-                if(this.searchType == 0){
-                    this.$router.push({name: 'Square', params: {searchVal: this.searchVal, searchType: "project", currTab: "project"}});
-                }else if(this.searchType == 1){
-                    this.$router.push({name: 'AgencyList', params: {searchVal: this.searchVal}});
-                }else if(this.searchType == 2){
-                    let url = '/api/common/index/page';
-                    let params = {
-                        "keyword": this.searchVal,
-                        "activePage": 1,
-                        "columnFilters": [
-                            {
-                                "field": "type",
-                                "type": "enums",
-                                "enums": this.searchTypeArr,
-                                "value": this.searchType
-                            }
-                        ]
-                    };
-                    Http.post(url, params).then((res) => {
-                        this.curResourceList = res.data.resourcePage.content;
-                        this.totalElements = res.data.resourcePage.totalElements;
-                    })
-                }else if(this.searchType == 3){
-                    this.$router.push({name: 'ExpertList', params: {searchVal: this.searchVal}});
-                }
-            },
-            nextPage(){
-                let url = '/api/common/index/page';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage": this.activePage,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                };
-                Http.post(url, params).then((res) => {
-                    this.curResourceList = res.data.resourcePage.content;
-                    this.totalElements = res.data.resourcePage.totalElements;
-                })
-            },
-            gotoHome() {
-                this.$router.push('/home');
-            },
-            handleTypeClick(tab) {
-                this.searchType = tab.name
-            },
-            handlePageChange(index) {
-                this.activePage = index;
-                this.nextPage();
-            },
-            goToDetail(code) {
-                this.$router.push({
-                    name: 'ResourceDetail',
-                    params: {id: code}
-                })
-            },
-            showLoading () {
-                this.loading = true
-            },
-            hideLoading () {
-                this.loading = false
-            },
-        },
-        mounted() {
-            this.loadData();
+        if (this.searchType == 0) {
+          this.$router.push({
+            name: 'Square',
+            params: {searchVal: this.searchVal, searchType: "project", currTab: "project"}
+          });
+        } else if (this.searchType == 1) {
+          this.$router.push({name: 'AgencyList', params: {searchVal: this.searchVal}});
+        } else if (this.searchType == 2) {
+          let url = '/api/common/index/page';
+          let params = {
+            "keyword": this.searchVal,
+            "activePage": 1,
+            "columnFilters": [
+              {
+                "field": "type",
+                "type": "enums",
+                "enums": this.searchTypeArr,
+                "value": this.searchType
+              }
+            ]
+          };
+          Http.post(url, params).then((res) => {
+            this.curResourceList = res.data.resourcePage.content;
+            this.totalElements = res.data.resourcePage.totalElements;
+          })
+        } else if (this.searchType == 3) {
+          this.$router.push({name: 'ExpertList', params: {searchVal: this.searchVal}});
         }
+      },
+      nextPage() {
+        let url = '/api/common/index/page';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
+            }
+          ]
+        };
+        Http.post(url, params).then((res) => {
+          this.curResourceList = res.data.resourcePage.content;
+          this.totalElements = res.data.resourcePage.totalElements;
+        })
+      },
+      gotoHome() {
+        this.$router.push('/home');
+      },
+      handleTypeClick(tab) {
+        this.searchType = tab.name
+      },
+      handlePageChange(index) {
+        this.activePage = index;
+        this.nextPage();
+      },
+      goToDetail(code) {
+        this.$router.push({
+          name: 'ResourceDetail',
+          params: {id: code}
+        })
+      },
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
+      }
+    },
+    mounted() {
+      this.setUserInfo();
+      this.loadData();
     }
+  }
 </script>
 
-<style scoped>
+<style lang="less">
+  @import "../../style/search-nav";
   .item-template {
     height: 80px;
   }

+ 124 - 109
src/pages/HomepageSearch/UserList.vue

@@ -31,7 +31,7 @@
         </el-col>
       </el-row>
     </div>
-    <div class="container" style="margin: 20px auto;">
+    <div class="container" style="margin: 20px auto;" v-loading="loading">
       <div class="create-body">
         <div class="title h2">众测人员</div>
         <el-collapse accordion style="margin: 0 30px">
@@ -44,25 +44,26 @@
               <el-table-column
                 label="头像"
                 width="100">
-                <template slot-scope="scope"><img :src="scope.row.photoUrl==null?defaultValue.image:scope.row.photoUrl" style="width: 50px; height: 50px;"/></template>
+                <template slot-scope="scope"><img :src="scope.row.photoUrl==null?defaultValue.image:scope.row.photoUrl"
+                                                  style="width: 50px; height: 50px;"/></template>
               </el-table-column>
               <el-table-column
                 prop="name"
                 label="名称"
                 align="left"
-                width="200">
+                width="300">
               </el-table-column>
+              <!--              <el-table-column-->
+              <!--                prop="gender"-->
+              <!--                align="left"-->
+              <!--                label="性别">-->
+              <!--              </el-table-column>-->
 <!--              <el-table-column-->
-<!--                prop="gender"-->
+<!--                prop="address"-->
 <!--                align="left"-->
-<!--                label="性别">-->
+<!--                label="省市">-->
 <!--              </el-table-column>-->
               <el-table-column
-                prop="address"
-                align="left"
-                label="省市">
-              </el-table-column>
-              <el-table-column
                 prop="taskCount"
                 align="center"
                 label="接包数量">
@@ -93,112 +94,126 @@
 </template>
 
 <script>
-    import Http from '@/js/http.js';
-    import TopSearch from "../../components/commons/TopSearch";
-    import {storageGet,defaultValue} from '@/js/index.js'
-    import {notify} from "../../constants";
+  import Http from '@/js/http.js';
+  import TopSearch from "../../components/commons/TopSearch";
+  import {storageGet, defaultValue} from '@/js/index.js'
+  import {notify} from "../../constants";
+  import Apis from '@/js/api';
 
-    export default {
-        name: "UserList",
-        props: ['searchVal', 'userList'],
-        components: {TopSearch},
-        data() {
-            return {
-                isLogin: false,
-                id: 0,
-                // searchVal: '',
-                searchType: '0',
-                searchTypeArr: [
-                    {
-                        "name": "众测人员",
-                        "value": "0"
-                    }],
-                curUserList: this.userList,
-                defaultValue: defaultValue,
-                activePage: 1,
-                totalElements: 0
+  export default {
+    name: "UserList",
+    props: ['searchVal', 'userList'],
+    components: {TopSearch},
+    data() {
+      return {
+        user: {},
+        isLogin: false,
+        id: 0,
+        // searchVal: '',
+        searchType: '0',
+        loading: false,
+        searchTypeArr: [
+          {
+            "name": "众测人员",
+            "value": "0"
+          }],
+        curUserList: this.userList,
+        defaultValue: defaultValue,
+        activePage: 1,
+        totalElements: 0
+      }
+    },
+    methods: {
+      loadData() {
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+        let url = '/api/common/index/user/more';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
             }
-        },
-        methods: {
-            loadData() {
-                if (storageGet('user') != null) {
-                    this.isLogin = true;
-                }
-                let url = '/api/common/index/user/more';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage": this.activePage,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                }
-                Http.post(url, params).then((res) => {
-                    this.curUserList = res.data.content;
-                    this.totalElements=res.data.totalElements;
-                })
-            },
-          checkLogin() {
-            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)
-              })
+          ]
+        }
+        Http.post(url, params).then((res) => {
+          this.curUserList = res.data.content;
+          this.totalElements = res.data.totalElements;
+        })
+      },
+      checkLogin() {
+        this.checkCreateProjectAuth();
+      },
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
+      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)
+          })
+        }
+      },
+      handleSearchData() {
+        let url = '/api/common/index/user/more';
+        let params = {
+          "keyword": this.searchVal,
+          "activePage": this.activePage,
+          "columnFilters": [
+            {
+              "field": "type",
+              "type": "enums",
+              "enums": this.searchTypeArr,
+              "value": this.searchType
             }
-          },
-            handleSearchData() {
-                let url = '/api/common/index/user/more';
-                let params = {
-                    "keyword": this.searchVal,
-                    "activePage":  this.activePage,
-                    "columnFilters": [
-                        {
-                            "field": "type",
-                            "type": "enums",
-                            "enums": this.searchTypeArr,
-                            "value": this.searchType
-                        }
-                    ]
-                }
-                Http.post(url, params).then((res) => {
-                    this.curUserList = res.data.content;
-                })
-            },
-            gotoHome() {
-                this.$router.push('/home');
-            },
-            handleTypeClick(tab) {
-                this.searchType = tab.name
-            },
-            handlePageChange(index) {
-                this.activePage = index;
-                this.handleSearchData();
-            },
-            goToDetail(id) {
-                this.$router.push({
-                    name: 'UserDetail',
-                    params: {id: id}
-                })
-            },
-        },
-        mounted() {
-            this.loadData();
+          ]
         }
+        Http.post(url, params).then((res) => {
+          this.curUserList = res.data.content;
+        })
+      },
+      gotoHome() {
+        this.$router.push('/home');
+      },
+      handleTypeClick(tab) {
+        this.searchType = tab.name
+      },
+      handlePageChange(index) {
+        this.activePage = index;
+        this.handleSearchData();
+      },
+      goToDetail(id) {
+        this.$router.push({
+          name: 'UserDetail',
+          params: {id: id}
+        })
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
+      }
+    },
+    mounted() {
+      this.setUserInfo();
+      this.loadData();
     }
+  }
 </script>
 
-<style scoped>
+<style lang="less">
+  @import "../../style/search-nav";
   .item-template {
     height: 80px;
   }

+ 181 - 168
src/pages/Square/PopularProjectAndTaskList.vue

@@ -5,7 +5,7 @@
       <el-row class="search-nav" style="padding: 30px 0 20px 0">
         <el-col :span="6">
           <div class="pull-left" @click="gotoHome" style="cursor: pointer">
-            <img class="logo-img" src="../../assets/img/logo-blue.png" />
+            <img class="logo-img" src="../../assets/img/logo-blue.png"/>
             <span class="logo-title">群智众测平台</span>
           </div>
         </el-col>
@@ -13,11 +13,12 @@
           <div class="search-nav">
             <div id="search-block " class="">
               <el-tabs v-model="searchType" type="card" @tab-click="handleTypeClick">
-                <el-tab-pane v-for="item in tabArr" :label="item.label" :name="item.name" :key="item.label"></el-tab-pane>
+                <el-tab-pane v-for="item in tabArr" :label="item.label" :name="item.name"
+                             :key="item.label"></el-tab-pane>
               </el-tabs>
               <div class="search-input">
                 <el-input placeholder="请输入内容" v-model="searchVal" class="input-with-select">
-                  <el-button class="search-button" slot="append"  type="primary" @click="handleSearchData">搜索</el-button>
+                  <el-button class="search-button" slot="append" type="primary" @click="handleSearchData">搜索</el-button>
                 </el-input>
               </div>
             </div>
@@ -28,19 +29,20 @@
         </el-col>
       </el-row>
       <!--TabNav-->
-      <el-tabs v-model="currTab" @tab-click="handleTabClick" class="square-tab" >
-        <el-tab-pane  v-for="item in menuArr" :name="item.name" :key="item.name">
+      <el-tabs v-model="currTab" @tab-click="handleTabClick" class="square-tab">
+        <el-tab-pane v-for="item in menuArr" :name="item.name" :key="item.name">
           <span slot="label" style="font-size: 18px">{{item.label}}</span>
         </el-tab-pane>
       </el-tabs>
       <div>
       </div>
     </div>
-    <div class="mine-body container" style="text-align: center;">
-      <el-tabs value="myProject" @tab-click="handleTabClick" v-loading="loading">
+    <div class="mine-body container" style="text-align: center;"  v-loading="loading">
+      <el-tabs value="myProject" @tab-click="handleTabClick">
         <el-tab-pane name="myProject" v-if="currTab == 'project'">
           <span v-if="projectAndTaskArr == null || projectAndTaskArr.length == 0"> 暂无项目 </span>
-          <el-row v-if="projectAndTaskArr != null && projectAndTaskArr.length != 0" type="flex" align="middle" justify="center"
+          <el-row v-if="projectAndTaskArr != null && projectAndTaskArr.length != 0" type="flex" align="middle"
+                  justify="center"
                   style="font-size: 14px;">
             <el-col :span="6" type="flex" align="middle" justify="center">项目图片</el-col>
             <el-col :span="6" type="flex" align="middle" justify="center">项目名称</el-col>
@@ -50,12 +52,13 @@
             <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="item.id" :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'">
           <span v-if="projectAndTaskArr == null || projectAndTaskArr.length == 0"> 暂无项目 </span>
-          <el-row v-if="projectAndTaskArr != null && projectAndTaskArr.length != 0" type="flex" align="middle" justify="center"
+          <el-row v-if="projectAndTaskArr != null && projectAndTaskArr.length != 0" type="flex" align="middle"
+                  justify="center"
                   style="font-size: 14px;">
             <el-col :span="5">任务封面</el-col>
             <el-col :span="4">任务名称</el-col>
@@ -74,179 +77,189 @@
 
     <div class="container">
       <el-row>
-          <el-pagination
-            v-if="currTab!=='squareHome'&&projectAndTaskArr&&projectAndTaskArr.length"
-            :page-size="12"
-            layout="prev, pager, next"
-            :total="totalElements"
-            :current-page = "activePage"
-            @current-change="handlePageChange"
-            class="pull-right"
-          >
-          </el-pagination>
+        <el-pagination
+          v-if="currTab!=='squareHome'&&projectAndTaskArr&&projectAndTaskArr.length"
+          :page-size="12"
+          layout="prev, pager, next"
+          :total="totalElements"
+          :current-page="activePage"
+          @current-change="handlePageChange"
+          class="pull-right"
+        >
+        </el-pagination>
       </el-row>
     </div>
   </div>
 </template>
 
 <script>
-    import Http from '@/js/http.js'
-    import Apis from '@/js/api.js'
-    import SearchBar from '../../components/commons/SearchBar'
-    import SquareCard from './SquareCard'
-    import PopularProject from './PopularProject'
-    import PopularTask from './PopularTask'
-    import {notify} from "../../constants"
-    import TaskItem from '../../components/commons/TaskItem'
-    import ProjectItem from '../../components/commons/ProjectItem'
-    import {defaultValue, getRolesPermissions, storageGet} from '@/js/index'
-    import { mapActions ,mapGetters} from 'vuex';
-    export default {
-        name: 'PopularProjectAndTaskList',
-        comments: {TaskItem, ProjectItem},
-        data(){
-            return {
-                loading: false,
-                isLogin: false,
-                searchType:'project',
-                searchVal: '',
-                currTab:'project',
-                tabArr : [
-                    {label:"热门项目",name:"project"},
-                    {label:"热门任务",name:"task"}
-                ],
-                menuArr: [
-                    {label:"热门测试项目",name:"project"},
-                    {label:"热门测试任务",name:"task"}
-                ],
-                projectAndTaskArr:[],
-                activePage:1,
-                totalElements:0,
-                type: ''
-            }
-        },
-        components: {
-            TaskItem,
-            ProjectItem,
-            SearchBar,
-            SquareCard,
-            PopularProject,
-            PopularTask
-        },
-        computed:{
-        },
-        methods:{
-            loadData(){
-                this.showLoading();
-                if (storageGet('user') != null) {
-                    this.isLogin = true;
-                }
-                this.type = this.$route.params.type;
-                if(this.type === "project"){
-                    this.currTab = 'project';
-                    this.getHotProject();
-                }else{
-                    this.currTab = 'task';
-                    this.getHotTask();
-                }
-                this.hideLoading();
-            },
-            getHotProject(){
-                let params = {
-                    "keyword": this.searchVal,//搜索关键字
-                    "activePage": this.activePage,//指定页面
-                    "columnFilters":[]
-                };
-                Http.post(Apis.PROJECT.MORE_HOT_PROJECT, params).then((res) => {
-                    console.log(res.data);
-                    this.projectAndTaskArr = res.data.content;
-                    this.totalElements = res.data.totalElements;
-                })
-            },
-            getHotTask(){
-                let params = {
-                    "keyword": this.searchVal,//搜索关键字
-                    "activePage": this.activePage,//指定页面
-                    "columnFilters":[]
-                };
-                Http.post(Apis.TASK.MORE_HOT_TASK, params).then((res) => {
-                    this.projectAndTaskArr = res.data.content;
-                    this.totalElements = res.data.totalElements;
-                })
-            },
+  import Http from '@/js/http.js'
+  import Apis from '@/js/api.js'
+  import SearchBar from '../../components/commons/SearchBar'
+  import SquareCard from './SquareCard'
+  import PopularProject from './PopularProject'
+  import PopularTask from './PopularTask'
+  import {notify} from "../../constants"
+  import TaskItem from '../../components/commons/TaskItem'
+  import ProjectItem from '../../components/commons/ProjectItem'
+  import {defaultValue, getRolesPermissions, storageGet} from '@/js/index'
+  import {mapActions, mapGetters} from 'vuex';
 
-            gotoHome(){
-                this.$router.push('/home');
-            },
-            handleTabClick(tab){
-                this.currTab = tab.name
-                this.searchType = this.currTab;
-                this.activePage = 1;
-                this.searchVal = '';
-                this.searchData()
-            },
-            handleTabClickSearch(){
-                this.activePage = 1;
-                this.searchData()
-            },
-            searchData(index){
-                if(this.currTab === 'project'){
-                    this.getHotProject();
-                }else{
-                    this.searchType = this.currTab;
-                    this.getHotTask();
-                }
-            },
-            handleTypeClick(tab){
-                this.searchType = tab.name;
-                // this.currTab = this.searchType;
-                this.activePage = 1;
-            },
-          checkLogin() {
-            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)
-              })
-            }
-          },
-            handleSearchData(){
-                console.log("this.searchVal  "  + this.searchVal)
-                this.activePage = 1;
-                if(this.currTab == 'project'){
-                    this.getHotProject();
-                }else{
-                    this.getHotTask();
-                }
-            },
-            handlePageChange(index){
-                this.activePage = index;
-                this.searchData();
-            },
-            showLoading () {
-                this.loading = true
-            },
-            hideLoading () {
-                this.loading = false
-            },
-        },
-        mounted() {
-            this.loadData();
+  export default {
+    name: 'PopularProjectAndTaskList',
+    comments: {TaskItem, ProjectItem},
+    data() {
+      return {
+        loading: false,
+        isLogin: false,
+        searchType: 'project',
+        searchVal: '',
+        currTab: 'project',
+        tabArr: [
+          {label: "热门项目", name: "project"},
+          {label: "热门任务", name: "task"}
+        ],
+        menuArr: [
+          {label: "热门测试项目", name: "project"},
+          {label: "热门测试任务", name: "task"}
+        ],
+        projectAndTaskArr: [],
+        activePage: 1,
+        totalElements: 0,
+        type: ''
+      }
+    },
+    components: {
+      TaskItem,
+      ProjectItem,
+      SearchBar,
+      SquareCard,
+      PopularProject,
+      PopularTask
+    },
+    computed: {},
+    methods: {
+      loadData() {
+        this.showLoading();
+        if (storageGet('user') != null) {
+          this.isLogin = true;
         }
+        this.type = this.$route.params.type;
+        if (this.type === "project") {
+          this.currTab = 'project';
+          this.getHotProject();
+        } else {
+          this.currTab = 'task';
+          this.getHotTask();
+        }
+        this.hideLoading();
+      },
+      getHotProject() {
+        this.showLoading();
+        let params = {
+          "keyword": this.searchVal,//搜索关键字
+          "activePage": this.activePage,//指定页面
+          "columnFilters": []
+        };
+        Http.post(Apis.PROJECT.MORE_HOT_PROJECT, params).then((res) => {
+          console.log(res.data);
+          this.projectAndTaskArr = res.data.content;
+          this.totalElements = res.data.totalElements;
+        })
+        this.hideLoading();
+      },
+      getHotTask() {
+        this.showLoading();
+        let params = {
+          "keyword": this.searchVal,//搜索关键字
+          "activePage": this.activePage,//指定页面
+          "columnFilters": []
+        };
+        Http.post(Apis.TASK.MORE_HOT_TASK, params).then((res) => {
+          this.projectAndTaskArr = res.data.content;
+          this.totalElements = res.data.totalElements;
+        })
+        this.hideLoading();
+      },
+
+      gotoHome() {
+        this.$router.push('/home');
+      },
+      handleTabClick(tab) {
+        this.currTab = tab.name
+        this.searchType = this.currTab;
+        this.activePage = 1;
+        this.searchVal = '';
+        this.searchData()
+      },
+      handleTabClickSearch() {
+        this.activePage = 1;
+        this.searchData()
+      },
+      searchData(index) {
+        if (this.currTab === 'project') {
+          this.getHotProject();
+        } else {
+          this.searchType = this.currTab;
+          this.getHotTask();
+        }
+      },
+      handleTypeClick(tab) {
+        this.searchType = tab.name;
+        // this.currTab = this.searchType;
+        this.activePage = 1;
+      },
+      checkLogin() {
+        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)
+          })
+        }
+      },
+      handleSearchData() {
+        console.log("this.searchVal  " + this.searchVal)
+        this.activePage = 1;
+        if (this.currTab == 'project') {
+          this.getHotProject();
+        } else {
+          this.getHotTask();
+        }
+      },
+      handlePageChange(index) {
+        this.activePage = index;
+        this.searchData();
+      },
+      showLoading() {
+        this.loading = true
+      },
+      hideLoading() {
+        this.loading = false
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
+      }
+    },
+    mounted() {
+      this.setUserInfo();
+      this.loadData();
     }
+  }
 </script>
 
 <style lang="less">
   @import "../../style/search-nav";
+
   .project-task {
     padding: 15px 0;
+
     .el-card {
       border: none;
     }

+ 6 - 0
src/pages/Square/Square2.0.vue

@@ -66,6 +66,7 @@
 
 <script>
   import Http from '@/js/http.js'
+  import Apis from '@/js/api.js'
   import SearchBar from '../../components/commons/SearchBar'
   import SquareCard from './SquareCard'
   import PopularProject from './PopularProject'
@@ -77,6 +78,7 @@
     name: 'Square2.0',
     data(){
       return {
+        user: {},
         isLogin: false,
         searchType:'project',
         searchVal: '',
@@ -219,9 +221,13 @@
       handlePageChange(index){
         this.activePage = index;
         this.searchData();
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
       }
     },
     mounted() {
+      this.setUserInfo();
       this.loadData();
     }
   }

+ 6 - 0
src/pages/Technology/Technology2.0.vue

@@ -62,6 +62,7 @@
 
 <script>
   import Http from '@/js/http.js'
+  import Apis from '@/js/api.js'
   import SearchBar from '../../components/commons/SearchBar'
   import TechnologyCard from './TechnologyCard'
   import TechnologyMG from './TechnologyMG'
@@ -83,6 +84,7 @@
     },
     data(){
       return {
+        loading: false,
         isLogin: false,
         searchVal: '',
         searchType:'',
@@ -174,10 +176,14 @@
       handlePageChange(index){
         this.activePage = index;
         this.loadTechnologyArticles(index);
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
       }
     },
     mounted() {
       this.loadData();
+      this.setUserInfo();
       this.loadHotArticles();
       this.loadTechnologyArticles(1);
     }

+ 5 - 0
src/pages/Technology/TechnologyMore.vue

@@ -78,6 +78,7 @@
     },
     data(){
       return {
+        loading: false,
         isLogin: false,
         searchVal: '',
         searchType:'',
@@ -157,10 +158,14 @@
       handlePageChange(index){
         this.activePage = index;
         this.loadTechnologyArticles(index);
+      },
+      setUserInfo() {
+        this.user = storageGet('user') && storageGet('user').userVO;
       }
     },
     mounted() {
       this.loadData();
+      this.setUserInfo();
       this.loadTechnologyArticles(1);
     }
   }

+ 9 - 9
src/pages/UserCenter/Mine.vue

@@ -37,15 +37,15 @@
                           style="width: 100%;"
                           :picker-options="pickerOptions"></el-date-picker>
         </el-form-item>
-        <el-form-item label="地址" prop="address" style="width: 160%">
-          <provincecity
-            ref="addFormProvince"
-            @selectChange="locationChange"
-            :provinceCode="userForm.location.provinceCode!==''?userForm.location.provinceCode:'3200'"
-            :cityCode="userForm.location.cityCode!==''?userForm.location.cityCode:'3201'"
-          ></provincecity>
-<!--          :isModifyMode="!isModifyMode"-->
-        </el-form-item>
+<!--        <el-form-item label="地址" prop="address" style="width: 160%">-->
+<!--          <provincecity-->
+<!--            ref="addFormProvince"-->
+<!--            @selectChange="locationChange"-->
+<!--            :provinceCode="userForm.location.provinceCode!==''?userForm.location.provinceCode:'3200'"-->
+<!--            :cityCode="userForm.location.cityCode!==''?userForm.location.cityCode:'3201'"-->
+<!--          ></provincecity>-->
+<!--&lt;!&ndash;          :isModifyMode="!isModifyMode"&ndash;&gt;-->
+<!--        </el-form-item>-->
         <el-form-item label="个人能力" style="width: 160%">
           <el-checkbox-group v-model="userForm.personalCompetence">
             <el-checkbox v-for="item in serviceType" :label="item.code" :name="item.code" :key="item.code" >{{item.name}}</el-checkbox>

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

@@ -20,7 +20,7 @@
 
 <script>
   import Http from '@/js/http.js'
-  import {storageGet} from '@/js/index'
+  import {storageGet,logout} from '@/js/index'
   import {notify} from '@/constants/index'
 
   export default {
@@ -33,7 +33,7 @@
           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("请输入正确的邮箱格式"));
+            callback(new Error("请输入正确的邮箱格式,注意去掉前后的空格"));
           } else {
             callback();
           }
@@ -82,13 +82,12 @@
             this.codeTime = 60;
             this.hasVerifyCode = false;
           } else {
-            notify('success', '重新绑定成功');
-            window.alert('密码修改成功,请重新登录');
+            // notify('success', '重新绑定成功');
+            window.alert('邮箱修改成功, 请重新登录');
             logout().then((res) => {
               window.location.href = process.env.LOGIN_URL;
               // this.$router.push('/home')
             })
-            // this.$router.push({path: '/personal/mailBinding'});
           }
         })