浏览代码

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

wangJJ 5 年之前
父节点
当前提交
aa342ef7fb

+ 0 - 50
src/components/Mine.vue

@@ -1,56 +1,6 @@
 <template>
   <div class="mine-container">
     <div id="myChart" style="width: 100%;height: 200px;padding-top: 40px"></div>
-    <!--<div class="mine-top-wrapper">-->
-    <!--<el-row :gutter="0" style="height:100%">-->
-    <!--<el-col :span="16">-->
-    <!--<div class="advertise-imgs">-->
-    <!--<img-->
-    <!--src="http://sinastorage.com/storage.miaosha.sina.com.cn/products/201903/e496d11b3d74cf660c286fbd5ab8d0bb.png"-->
-    <!--&gt;-->
-    <!--</div>-->
-    <!--</el-col>-->
-    <!--<el-col :span="8">-->
-    <!--<div class="user-banner">-->
-    <!--<p class="head">-->
-    <!--<a href="javascript:;" class="login-link">-->
-    <!--<img :src="user == null || user.userVO.photoUrl == null?defaultValue.image:user.userVO.photoUrl"-->
-    <!--class="user-img">-->
-    <!--<span class="vertify hide"></span>-->
-    <!--</a>-->
-    <!--</p>-->
-    <!--<div class="username_box">-->
-    <!--<div class="username_icon username_"></div>-->
-    <!--<span class="username">{{user == null?'...':user.userVO.name}}</span>-->
-    <!--</div>-->
-    <!--&lt;!&ndash;<p class="name">&ndash;&gt;-->
-    <!--&lt;!&ndash;<a href="javascript:;" class="login-btn btn btn-medium btn-info">登录</a>&ndash;&gt;-->
-    <!--&lt;!&ndash;<a&ndash;&gt;-->
-    <!--&lt;!&ndash;href="https://login.sina.com.cn/signup/signup?entry=tech"&ndash;&gt;-->
-    <!--&lt;!&ndash;class="register-btn btn btn-medium btn-info"&ndash;&gt;-->
-    <!--&lt;!&ndash;target="_blank"&ndash;&gt;-->
-    <!--&lt;!&ndash;&gt;注册</a>&ndash;&gt;-->
-    <!--&lt;!&ndash;</p>&ndash;&gt;-->
-    <!--&lt;!&ndash;<p class="scores">&ndash;&gt;-->
-    <!--&lt;!&ndash;<a href="/rule/merit" target="_blank">&ndash;&gt;-->
-    <!--&lt;!&ndash;积分&ndash;&gt;-->
-    <!--&lt;!&ndash;<em class="num1">{{user.score}}</em>&ndash;&gt;-->
-    <!--&lt;!&ndash;</a>&ndash;&gt;-->
-    <!--&lt;!&ndash;<span class="line">|</span>&ndash;&gt;-->
-    <!--&lt;!&ndash;<a href="/rule/merit" target="_blank">&ndash;&gt;-->
-    <!--&lt;!&ndash;威望&ndash;&gt;-->
-    <!--&lt;!&ndash;<em class="num2">{{user.prestige}}</em>&ndash;&gt;-->
-    <!--&lt;!&ndash;</a>&ndash;&gt;-->
-    <!--&lt;!&ndash;</p>&ndash;&gt;-->
-    <!--<p>-->
-    <!--<router-link :to="{ name: 'AuthenticationIndex'}">-->
-    <!--<div class="btn btn-medium">实名认证</div>-->
-    <!--</router-link>-->
-    <!--</p>-->
-    <!--</div>-->
-    <!--</el-col>-->
-    <!--</el-row>-->
-    <!--</div>-->
     <div class="mine-body" style="text-align: center;">
       <el-tabs value="myProject" @tab-click="handleTabClick" v-loading="loading" style="width: 90%;margin-left: 5%">
         <el-tab-pane name="unFinishedTask">

+ 1 - 0
src/components/cheat/ProjectAdd.vue

@@ -135,6 +135,7 @@
             </el-form-item>
             <el-form-item type="file" prop="file" label="Excel文件">
               <el-upload
+                style="width: 400px"
                 v-if="isModifyMode"
                 drag
                 class="upload-demo"

+ 19 - 42
src/components/commons/Header2.0.vue

@@ -3,10 +3,16 @@
     <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">{{city}}</span>
+          <span style="line-height: 34px" v-if="!city">{{city}}</span>
+          <span style="line-height: 34px" v-else>暂无</span>
         </div>
         <div class="nav-list pull-right">
           <ul>
+            <li>
+              <a @click="gotoHome" style="cursor: pointer">首页</a>
+            </li>
+            &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
+            <li>
             <li v-if="isLogin">
               <el-dropdown>
                 <span class="el-dropdown-link">
@@ -27,35 +33,6 @@
                       </el-link>
                     </router-link>
                   </el-dropdown-item>
-<!--                  <el-dropdown-item v-if="user.authStatus.text == '审核通过' &&  !this.user.personalAuthVO && this.user.agencyVO">-->
-<!--                    <router-link :to="{ name: 'Agency',params:{userId:user.userVO.id}}">-->
-<!--                      <el-link icon="el-icon-edit" :underline="false">-->
-<!--                        修改机构信息-->
-<!--                      </el-link>-->
-<!--                    </router-link>-->
-<!--                  </el-dropdown-item>-->
-<!--                  <el-dropdown-item v-if="user.authStatus.text == '未实名认证' && !rolesPermissions.isSystemAdministrator">-->
-<!--                    <router-link :to="{ name: 'AuthenticationIndex'}">-->
-<!--                      <el-link type="info" icon="el-icon-warning-outline" :underline="false">-->
-<!--                        未实名认证-->
-<!--                      </el-link>-->
-<!--                    </router-link>-->
-<!--                  </el-dropdown-item>-->
-<!--                  <el-dropdown-item v-if="user.authStatus.text == '认证审核中'" @click.native="handleClickAuthChecking()">-->
-<!--                    <el-link type="warning" icon="el-icon-loading" :underline="false">-->
-<!--                      认证审核中-->
-<!--                    </el-link>-->
-<!--                  </el-dropdown-item>-->
-<!--                  <el-dropdown-item @click.native="handleClickAuthPass()" v-if="user.authStatus.text == '审核通过'">-->
-<!--                    <el-link type="primary" icon="el-icon-check" :underline="false">-->
-<!--                      已认证-->
-<!--                    </el-link>-->
-<!--                  </el-dropdown-item>-->
-<!--                  <el-dropdown-item @click.native="handleClickAuthReject()" v-if="user.authStatus.text == '审核未通过'">-->
-<!--                    <el-link type="danger" icon="el-icon-close" :underline="false">-->
-<!--                      认证失败-->
-<!--                    </el-link>-->
-<!--                  </el-dropdown-item>-->
                   <el-dropdown-item divided @click.native="userLogout()">登出</el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
@@ -76,18 +53,18 @@
                 </a>
               </router-link>
             </li>
-            <span v-if="isLogin">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</span>
-            <li>
-              <a @click="gotoHome" style="cursor: pointer">首页</a>
-            </li>
-            &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
-            <li>
-              <a href="#">机构入驻</a>
-            </li>
-            &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
-            <li>
-              <a href="#">客服中心</a>
-            </li>
+<!--            <span v-if="isLogin">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</span>-->
+<!--            <li>-->
+<!--              <a @click="gotoHome" style="cursor: pointer">首页</a>-->
+<!--            </li>-->
+<!--            &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;-->
+<!--            <li>-->
+<!--              <a href="#">机构入驻</a>-->
+<!--            </li>-->
+<!--            &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;-->
+<!--            <li>-->
+<!--              <a href="#">客服中心</a>-->
+<!--            </li>-->
           </ul>
         </div>
     </div>

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

@@ -48,7 +48,7 @@
                     Http.get(`/api/user/${this.user.id}`).then(res => {
                         res.roleList.forEach(function(item) {
                             if(item.indexOf("part") != -1){
-                                this.$router.push("/project/create")
+                                this.$router.push('/project/create');
                             }
                         })
                         notify('warning', '请先认证成为发包用户');

+ 5 - 2
src/components/commons/ProjectItem.vue

@@ -8,14 +8,17 @@
       </el-col>
       <el-col :span="6" type="flex" align="middle" justify="center">{{project.name}}</el-col>
       <!--<el-col :span="4">{{project.id}}</el-col>-->
-      <el-col :span="6" type="flex" align="middle" justify="center">
+      <el-col :span="3" type="flex" align="middle" justify="center">
         <span style="font-size: 10px;"
               v-bind:class="['badge']"
         >{{project.platform}}</span>
       </el-col>
-      <el-col :span="2" type="flex" align="middle" justify="center">
+      <el-col :span="3" type="flex" align="middle" justify="center">
         <div class="badge">¥{{project.budget}}</div>
       </el-col>
+      <el-col :span="3" type="flex" align="middle" justify="center">
+        <div>{{project.joinCount}}</div>
+      </el-col>
       <el-col :span="4" type="flex" align="middle" justify="center">
         <el-badge v-if="project.needHandle" is-dot class="item">
           <span class="btn btn-small btn-info" @click="goToProjectDetail(project.id)">查看详情</span>

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

@@ -45,9 +45,9 @@
 <!--              </el-input>-->
 <!--              <span v-if="!isModifyMode">{{project.valuationStandard}}</span>-->
 <!--            </el-form-item>-->
-            <el-form-item v-if="!isModifyMode" size="small" label="状态" prop="status">
-              <span v-if="!isModifyMode">{{project.status==1?'等待接收':(project.status==2?'已被接收':(project.status==3?'项目已提交':'项目已结束'))}}</span>
-            </el-form-item>
+<!--            <el-form-item v-if="!isModifyMode" size="small" label="状态" prop="status">-->
+<!--              <span v-if="!isModifyMode">{{project.statusVO?project.statusVO.text:''}}</span>-->
+<!--            </el-form-item>-->
             <el-form-item size="small" label="区域管理员" prop="institution" v-if="project.institution">
               <span v-if="!isModifyMode">{{project.institution}}</span>
             </el-form-item>
@@ -909,7 +909,7 @@ export default {
         }
       }).catch((error) => {
         this.hideLoading()
-        notify('error', error.data)
+        // notify('error', error.data)
       })
     },
 

+ 1 - 0
src/js/api.js

@@ -12,6 +12,7 @@ export default {
     SUBMIT_PROJECT: '/api/project/{projectId}/status/committed',
     END_PROJECT: '/api/project/{projectId}/status/finished',
     MORE_HOT_PROJECT: '/api/square/hotProject/list',
+    CROWD_PROJECT: '/api/common/index/crowd/project/{code}',
   },
   TASK: {
     GET_TASK: '/api/project/{projectId}/task/{taskId}/',

+ 201 - 0
src/pages/DetailPage/CrowdDetail.vue

@@ -0,0 +1,201 @@
+<template>
+  <div>
+    <div class="nav" stype="height:500px">
+      <!--搜索框-->
+      <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" />
+            <span class="logo-title">群智众测平台</span>
+          </div>
+        </el-col>
+        <el-col :span="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-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-input>
+              </div>
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="6">
+          <el-button type="primary pull-right" class="releaseBtn" @click="checkLogin()">免费发布众测需求</el-button>
+        </el-col>
+      </el-row>
+      <div>
+      </div>
+    </div>
+    <div class="mine-body" style="text-align: center;">
+      <el-tabs value="myProject" v-loading="loading" style="width: 90%;margin-left: 5%">
+        <el-tab-pane name="myProject" v-if="currTab == 'project'">
+          <span v-if="projectList == null || projectList.length == 0"> 暂无项目 </span>
+          <el-row v-if="projectList != null && projectList.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>
+            <el-col :span="3" type="flex" align="middle" justify="center">应用类型</el-col>
+            <el-col :span="3" type="flex" align="middle" justify="center">项目预算</el-col>
+            <el-col :span="3" type="flex" align="middle" justify="center">参与人数</el-col>
+            <el-col :span="4" type="flex" align="middle" justify="center">操作</el-col>
+          </el-row>
+          <project-item v-if="(projectList != null || projectList.length > 0 )"
+                                    v-for="(item,index) in projectList" :key="index" :projectItem="item"/>
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+
+    <div class="container">
+      <el-row>
+        <el-col :span="18" class="project-task">
+          <el-pagination
+            v-if="currTab!=='squareHome'&&projectList&&projectList.length"
+            :page-size="10"
+            layout="prev, pager, next"
+            :total="totalElements"
+            :current-page = "activePage"
+            @current-change="handlePageChange"
+            class="pull-right"
+          >
+          </el-pagination>
+        </el-col>
+      </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 {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(){
+                if(!this.isLogin){
+                    console.log("请登录后访问");
+                    notify('warning','请登录后访问');
+                }else{
+                    console.log("已登录");
+                    this.$router.push('/project/create');
+                }
+            },
+            handleSearchData(){
+                this.getCrowdProject();
+            },
+            handlePageChange(index){
+                this.activePage = index;
+                this.getCrowdProject();
+            },
+            showLoading () {
+                this.loading = true
+            },
+            hideLoading () {
+                this.loading = false
+            },
+        },
+        mounted() {
+            this.loadData();
+        }
+    }
+</script>
+
+<style lang="less">
+  @import "../../style/search-nav";
+  .project-task {
+    padding: 15px 0;
+    .el-card {
+      border: none;
+    }
+  }
+
+  .popular-modules {
+    padding: 15px 0 15px 15px;
+  }
+
+
+  .mine-container {
+    padding: 0 80px 40px 80px;
+  }
+
+  .mine-top-wrapper {
+    height: 350px;
+    background-color: #fff;
+  }
+
+  [class*="el-col-"] {
+    height: 100%;
+  }
+
+  .advertise-imgs {
+    height: 100%;
+  }
+
+  .advertise-imgs img {
+    width: 100%;
+    height: 100%;
+  }
+
+  .user-banner {
+    text-align: center;
+    display: inline-table;
+    height: 100%;
+    width: 100%;
+    margin-top: 40px;
+  }
+
+</style>

+ 37 - 2
src/pages/DetailPage/ResourceDetail.vue

@@ -9,15 +9,36 @@
           <!--          <span  class="badge">{{resource.photo}}</span>-->
           <img :src="resource.photo" style="width: 50px; height: 50px;"/>
         </el-form-item>
-        <el-form-item label="类型" prop="count" v-if="!type">
+        <el-form-item label="资源描述" prop="description" v-if="!description">
+          <span>{{resource.description}}</span>
+        </el-form-item>
+        <el-form-item label="类型" prop="type" v-if="!type">
           <span>{{resource.type}}</span>
         </el-form-item>
+
+        <el-form-item label="使用场景" prop="scene" v-if="!scene">
+          <span>{{resource.scene}}</span>
+        </el-form-item>
+        <el-form-item label="收费标准" prop="standard" v-if="!standard">
+          <span>{{resource.standard}}{{resource.unit}}</span>
+        </el-form-item>
+        <el-form-item label="注册日期" prop="startTime" v-if="!startTime">
+          <span>{{$moment(resource.startTime).format("YYYY-MM-DD HH:mm:ss")}}</span>
+        </el-form-item>
+
         <el-form-item label="数量" prop="quantity">
           <span>{{resource.quantity}}</span>
         </el-form-item>
         <el-form-item label="状态" prop="state">
           <span class="badge">{{resource.state}}</span>
         </el-form-item>
+        <el-form-item label="单位" prop="unit">
+          <span>{{resource.unitWork}}</span>
+        </el-form-item>
+
+        <el-form-item label="其他说明" prop="remarks" v-if="!remarks">
+          <span>{{resource.remarks}}</span>
+        </el-form-item>
         <el-form-item>
           <div class="btn btn-medium" @click="back()">返回</div>
         </el-form-item>
@@ -46,7 +67,14 @@
                     photo: '',
                     type: '',
                     quantity: 0,
-                    state: 0
+                    state: 0,
+                    unit: '',
+                    description:'',
+                    standard:'',
+                    startTime:'',
+                    scene:'',
+                    remarks:'',
+                    unitWork:'',
                 },
             }
         },
@@ -72,6 +100,13 @@
                     this.resource.type = res.data.type
                     this.resource.state = res.data.state
                     this.resource.quantity = res.data.quantity
+                    this.resource.unit = res.data.unit
+                    this.resource.description = res.data.description
+                    this.resource.standard = res.data.standard
+                    this.resource.startTime = res.data.startTime
+                    this.resource.scene = res.data.scene
+                    this.resource.remarks = res.data.remarks
+                    this.resource.unitWork = res.data.unitWork
                     this.hideLoading()
                 }).catch((error) => {
                     this.hideLoading()

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

@@ -44,7 +44,7 @@
           <TestCard :applicationTypeList="homeData.applicationTypeList"></TestCard>
         </el-col>
         <el-col :span="5"  class="homepage-right-modules">
-          <LoginCard v-if="!this.isLogin"/>
+          <LoginCard/>
           <HotCrowd :applicationTypeRank="homeDataNoCache.applicationTypeRank"/>
           <HotAgency :agencyRank="homeDataNoCache.agencyRank"/>
           <HotUser :userRank="homeDataNoCache.userRank"/>

+ 24 - 3
src/pages/Homepage/LoginCard.vue

@@ -1,7 +1,9 @@
 <template>
   <el-card class="login-card">
     <div class="login-welcome">
-      <img src="../../assets/img/logo-project.png" alt="welcome-img" class="pull-left welcome-img">
+      <img v-if="this.user.userVO.photo != null && this.user.userVO.photo != ''" :src="this.user.userVO.photo" alt="welcome-img" class="pull-left welcome-img">
+      <img v-else src="../../assets/img/logo-project.png" alt="welcome-img" class="pull-left welcome-img">
+
       <div style="margin-left: 46px">
         <div class="welcome-title">
           hi,欢迎使用群智众测平台
@@ -11,8 +13,8 @@
         </div>
       </div>
       <div class="welcome-btn">
-        <a :href="loginUrl"><el-button type="primary" size="mini" class="pull-left login-btn" >登录</el-button></a>
-        <el-button type="danger" size="mini" class="pull-right cancel-btn">取消</el-button>
+        <a :href="loginUrl"><el-button type="primary" size="mini" class="pull-left login-btn" v-if="!isLogin">登录</el-button></a>
+        <el-button type="danger" size="mini" class="pull-right cancel-btn" v-if="isLogin"  @click.native="userLogout()">登出</el-button>
       </div>
     </div>
   </el-card>
@@ -21,14 +23,33 @@
 <script>
   import Http from '@/js/http.js'
   import Apis from '@/js/api.js'
+  import {storageGet} from '@/js/index.js'
   export default {
     name: "LoginCard",
     data(){
         return {
+            isLogin: false,
             user: {},
             loginUrl: process.env.LOGIN_URL,
         }
     },
+    methods: {
+        loadData() {
+            this.showLoading();
+            if (storageGet('user') != null) {
+                this.isLogin = true;
+                this.user = storageGet('user');
+            }
+        },
+        userLogout () {
+            this.isLogin = false
+            logout().then((res) => {
+                location.reload();
+                this.$router.push('/home')
+            })
+
+        },
+    }
   }
 </script>
 

+ 15 - 2
src/pages/HomepageSearch/CrowdList.vue

@@ -42,7 +42,7 @@
             style="width: 100%; font-size: 20px; color: black">
             <el-table-column
               label="图标"
-              width="400">
+              width="200">
               <template slot-scope="scope"><img :src="scope.row.image" style="width: 50px; height: 50px;"/></template>
             </el-table-column>
             <el-table-column
@@ -56,6 +56,13 @@
               align="center"
               label="项目数量">
             </el-table-column>
+            <el-table-column
+              align="center"
+              label="操作">
+              <template slot-scope="scope">
+                <div class="btn btn-small btn-info" @click="goToDetail(scope.row.code)">查看详情</div>
+              </template>
+            </el-table-column>
           </el-table>
         </template>
           <el-pagination
@@ -157,7 +164,13 @@
             handlePageChange(index) {
                 this.activePage = index;
                 this.handleSearchData();
-            }
+            },
+            goToDetail(code) {
+                this.$router.push({
+                    name: 'CrowdDetail',
+                    params: {code: code}
+                })
+            },
         },
         mounted() {
             this.loadData();

+ 2 - 2
src/pages/HomepageSearch/ResourceList.vue

@@ -49,7 +49,7 @@
               prop="name"
               label="名称"
               align="left"
-              width="300">
+              width="250">
             </el-table-column>
             <el-table-column
               prop="type"
@@ -78,7 +78,7 @@
         <el-collapse accordion style="margin: 0 30px">
           <el-pagination
             v-if="curResourceList&&curResourceList.length"
-            :page-size="3"
+            :page-size="10"
             layout="prev, pager, next"
             :total="totalElements"
             :current-page="activePage"

+ 73 - 56
src/pages/Square/PopularProjectAndTaskList.vue

@@ -38,52 +38,37 @@
     </div>
     <div class="mine-body" style="text-align: center;">
       <el-tabs value="myProject" @tab-click="handleTabClick" v-loading="loading" style="width: 90%;margin-left: 5%">
-        <el-tab-pane name="myProject">
+        <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"
                   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>
-            <el-col :span="6" type="flex" align="middle" justify="center">应用类型</el-col>
-            <el-col :span="2" type="flex" align="middle" justify="center">项目预算</el-col>
+            <el-col :span="3" type="flex" align="middle" justify="center">应用类型</el-col>
+            <el-col :span="3" type="flex" align="middle" justify="center">项目预算</el-col>
+            <el-col :span="3" type="flex" align="middle" justify="center">参与人数</el-col>
             <el-col :span="4" type="flex" align="middle" justify="center">操作</el-col>
           </el-row>
-          <project-item v-if="(projectAndTaskArr != null || projectAndTaskArr.length > 0 ) || currTab == 'project'"
+          <project-item v-if="(projectAndTaskArr != null || projectAndTaskArr.length > 0 )"
                                     v-for="(item,index) in projectAndTaskArr" :key="index" :projectItem="item"/>
-          <task-item v-if="(projectAndTaskArr != null || projectAndTaskArr.length > 0 ) || currTab == 'task'"
-                         v-for="(item,index) in projectAndTaskArr" :key="index" :projectItem="item"/>
-<!--          <div v-if="projectAndTaskArr != null || projectAndTaskArr.length > 0"-->
-<!--                        v-for="(item,index) in projectAndTaskArr" :key="index" :projectItem="item">-->
+        </el-tab-pane>
 
-<!--          <template>-->
-<!--            <div class="project-item-container">-->
-<!--              <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">-->
-<!--                <el-col :span="6" type="flex" align="middle" justify="center">-->
-<!--                  <el-badge :value="item.statusVO.text" class="item" :type="item.statusVO.style">-->
-<!--                    <img class="project-cover" src="@/assets/img/home_ban1.jpg">-->
-<!--                  </el-badge>-->
-<!--                </el-col>-->
-<!--                <el-col :span="6" type="flex" align="middle" justify="center">{{item.name}}</el-col>-->
-<!--                &lt;!&ndash;<el-col :span="4">{{project.id}}</el-col>&ndash;&gt;-->
-<!--                <el-col :span="6" type="flex" align="middle" justify="center">-->
-<!--        <span style="font-size: 10px;"-->
-<!--              v-bind:class="['badge']"-->
-<!--        >{{item.platform}}</span>-->
-<!--                </el-col>-->
-<!--                <el-col :span="2" type="flex" align="middle" justify="center">-->
-<!--                  <div class="badge">¥{{item.budget}}</div>-->
-<!--                </el-col>-->
-<!--                <el-col :span="4" type="flex" align="middle" justify="center">-->
-<!--                  <el-badge v-if="item.needHandle" is-dot class="item">-->
-<!--                    <span class="btn btn-small btn-info" @click="goToProjectDetail(item.id)">查看详情</span>-->
-<!--                  </el-badge>-->
-<!--                  <span v-if="!item.needHandle" class="btn btn-small btn-info" @click="goToProjectDetail(item.id)">查看详情</span>-->
-<!--                </el-col>-->
-<!--              </el-row>-->
-<!--            </div>-->
-<!--          </template>-->
-<!--          </div>-->
+        <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"
+                  style="font-size: 14px;">
+            <el-col :span="5">任务封面</el-col>
+            <el-col :span="4">任务名称</el-col>
+            <el-col :span="4">测试类型</el-col>
+            <el-col :span="4">任务预算</el-col>
+            <el-col :span="4">领取人数</el-col>
+            <el-col :span="3">操作</el-col>
+          </el-row>
+          <task-item v-if="(projectAndTaskArr != null || projectAndTaskArr.length > 0 )"
+                     v-for="(item,index2) in projectAndTaskArr" :key="index2" :task="item"/>
         </el-tab-pane>
+
+
       </el-tabs>
     </div>
 
@@ -134,6 +119,7 @@
         comments: {TaskItem, ProjectItem},
         data(){
             return {
+                loading: false,
                 isLogin: false,
                 searchType:'project',
                 searchVal: '',
@@ -147,13 +133,13 @@
                     {label:"热门测试任务",name:"task"}
                 ],
                 projectAndTaskArr:[],
-                type: 0,
                 activePage:1,
                 totalElements:0,
                 type: ''
             }
         },
         components: {
+            TaskItem,
             ProjectItem,
             SearchBar,
             SquareCard,
@@ -164,6 +150,7 @@
         },
         methods:{
             loadData(){
+                this.showLoading();
                 if (storageGet('user') != null) {
                     this.isLogin = true;
                 }
@@ -175,26 +162,29 @@
                     this.currTab = 'task';
                     this.getHotTask();
                 }
+                this.hideLoading();
             },
             getHotProject(){
                 let params = {
-                    "keyword": this.keyword,//搜索关键字
+                    "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.keyword,//搜索关键字
+                    "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;
                 })
             },
 
@@ -235,27 +225,23 @@
                 }
             },
             handleSearchData(){
-                let url = '/api/square/search/list';
-                let params = {
-                    "keyword": this.searchVal,//搜索关键字
-                    "activePage": this.activePage,//指定页面
-                    "columnFilters":
-                        [
-                            {
-                                "type": this.searchType // 查询项目就是project,任务就是task
-                            }
-                        ]
-                };
-                Http.post(url,params).then((res)=>{
-                    this.currTab = this.searchType;
-                    this.projectAndTaskArr = res.data.content;
-                    this.totalElements=res.data.totalElements;
-                })
+                console.log("this.searchVal  "  + this.searchVal)
+                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();
@@ -276,4 +262,35 @@
     padding: 15px 0 15px 15px;
   }
 
+
+  .mine-container {
+    padding: 0 80px 40px 80px;
+  }
+
+  .mine-top-wrapper {
+    height: 350px;
+    background-color: #fff;
+  }
+
+  [class*="el-col-"] {
+    height: 100%;
+  }
+
+  .advertise-imgs {
+    height: 100%;
+  }
+
+  .advertise-imgs img {
+    width: 100%;
+    height: 100%;
+  }
+
+  .user-banner {
+    text-align: center;
+    display: inline-table;
+    height: 100%;
+    width: 100%;
+    margin-top: 40px;
+  }
+
 </style>

+ 9 - 0
src/router/index.js

@@ -346,6 +346,15 @@ export default new Router({
       }
     },
     {
+      path: '/crowd/detail',
+      name: 'CrowdDetail',
+      component: resolve => require(['@/pages/DetailPage/CrowdDetail.vue'], resolve),
+      meta: {
+        title: '',
+        requireAuth: false,
+      }
+    },
+    {
       path: '/agency/detail',
       name: 'AgencyDetail',
       component: resolve => require(['@/pages/DetailPage/AgencyDetail.vue'], resolve),