|
|
@@ -1,20 +1,47 @@
|
|
|
<template>
|
|
|
<div class="home-wrapper">
|
|
|
- <SearchBar :tabArr="tabArr" :menuArr="menuArr"></SearchBar>
|
|
|
+ <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">
|
|
|
+ <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 ">
|
|
|
+ <el-tabs v-model="searchType" type="card" @tab-click="handleTypeClick">
|
|
|
+ <el-tab-pane v-for="item in searchTypeArr" v-if="item.value!=='all'" :label="item.name" :name="item.value" :key="item.value"></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">免费发布众测需求</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <!--TabNav-->
|
|
|
+ <el-tabs v-model="currTab" @tab-click="handleTabClick" class="square-tab">
|
|
|
+ <el-tab-pane v-for="item in homeTabArr.menuArr1" :label="item.label" :name="item.name" :key="item.name"></el-tab-pane>
|
|
|
+ <el-tab-pane v-for="item in homeTabArr.menuArr2" :label="item.label" :name="item.name" :key="item.name"></el-tab-pane>
|
|
|
+ <el-tab-pane v-for="item in homeTabArr.menuArr3" :label="item.label" :name="item.name" :key="item.name"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="home-page container">
|
|
|
<el-row>
|
|
|
<el-col :span="19" class="test-type-wrapper">
|
|
|
<TestMenu :testTypeList="getHomeData.testTypeList"></TestMenu>
|
|
|
-
|
|
|
-<!-- <vue-waterfall-easy :imgsArr="homeData.applicationTypeList">-->
|
|
|
-<!--<!– <div class="img-info" slot-scope="props">–>-->
|
|
|
-<!--<!– <p class="some-info">第{{props.index+1}}张图片</p>–>-->
|
|
|
-<!--<!– <p class="some-info">{{props.value.info}}</p>–>-->
|
|
|
-<!--<!– </div>–>-->
|
|
|
-<!--<!– <TestCard :application="props" slot-scope="props" class="img-info"></TestCard>–>-->
|
|
|
-<!-- </vue-waterfall-easy>-->
|
|
|
<TestCard></TestCard>
|
|
|
-
|
|
|
</el-col>
|
|
|
<el-col :span="5" class="homepage-right-modules">
|
|
|
<LoginCard/>
|
|
|
@@ -38,6 +65,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ // import commonData from '../../constants/tabMenu'
|
|
|
import SearchBar from '../../components/commons/SearchBar'
|
|
|
import TestMenu from './TestMenu'
|
|
|
import LoginCard from './LoginCard'
|
|
|
@@ -52,9 +80,9 @@
|
|
|
import PopularProject from '../Square/PopularProject'
|
|
|
import Http from '@/js/http.js'
|
|
|
import {mapActions,mapGetters} from 'vuex'
|
|
|
- // import vueWaterfallEasy from 'vue-waterfall-easy'
|
|
|
import Waterfall from 'vue-waterfall/lib/waterfall'
|
|
|
import WaterfallSlot from 'vue-waterfall/lib/waterfall-slot'
|
|
|
+ // console.log(commonData);
|
|
|
export default {
|
|
|
name: 'Homepage',
|
|
|
components: {
|
|
|
@@ -76,20 +104,36 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- tabArr: [
|
|
|
- {label: "项目", name: "project"},
|
|
|
- {label: "工具", name: "tool"},
|
|
|
- {label: "机构", name: "institution"},
|
|
|
- {label: "专家", name: "expert"}
|
|
|
- ],
|
|
|
- menuArr:{
|
|
|
+ searchType:'0',
|
|
|
+ searchTypeArr:[
|
|
|
+ {
|
|
|
+ "name": "全部",
|
|
|
+ "value": "all"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "项目",
|
|
|
+ "value": "0"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "工具",
|
|
|
+ "value": "1"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "机构",
|
|
|
+ "value": "2"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "专家",
|
|
|
+ "value": "3"
|
|
|
+ }],
|
|
|
+ searchVal: '',
|
|
|
+ homeTabArr:{
|
|
|
menuArr1: [
|
|
|
{label: "首页", name: "homepage"},
|
|
|
{label: "众测广场", name: "square"},
|
|
|
{label: "众测技术", name: "technology"}
|
|
|
],
|
|
|
menuArr2:[
|
|
|
- // {label: "|", name: "segmentation"},
|
|
|
{label: "科技服务", name: "monograph"},
|
|
|
{label: "服务互联网", name: "Internet"},
|
|
|
{label: "集成电路", name: "integratedCircuit"},
|
|
|
@@ -98,7 +142,6 @@
|
|
|
{label: "更多", name: "more"}
|
|
|
],
|
|
|
menuArr3:[
|
|
|
- // {label: "|", name: "segmentation"},
|
|
|
{label: "找机构", name: "findInstitution"},
|
|
|
{label: "找专家", name: "finfExpert"},
|
|
|
{label: "更多", name: "findMore"},
|
|
|
@@ -858,11 +901,12 @@
|
|
|
"imageUrl": "http://mooctest-crowd-service.oss-cn-hangzhou.aliyuncs.com/Partner/mooctest.png"
|
|
|
}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ currTab:'homepage'
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
- ...mapActions(['setActiveTab','setHomeData']),
|
|
|
+ ...mapActions(['setHomeData']),
|
|
|
loadData(){
|
|
|
this.homeData.applicationTypeList.map((item)=>{
|
|
|
item.height = (item.testTypeList.length / 2) * 24 + 100;
|
|
|
@@ -872,19 +916,46 @@
|
|
|
// Http.get('/api/common/index/info').then((res)=>{
|
|
|
// this.setHomeData(res.data);
|
|
|
// })
|
|
|
+ },
|
|
|
+ handleTabClick(tab){
|
|
|
+ this.currTab = tab.name
|
|
|
+ },
|
|
|
+ handleTypeClick(tab){
|
|
|
+ this.searchType = tab.name
|
|
|
+ },
|
|
|
+ handleSearchData(){
|
|
|
+ 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)=>{
|
|
|
+ console.log(res);
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
...mapGetters(['getHomeData']),
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.setActiveTab('homepage');
|
|
|
+ console.log(this.homeTabArr);
|
|
|
this.loadData();
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less">
|
|
|
+<style lang="less">
|
|
|
+ @import "../../style/search-nav";
|
|
|
+
|
|
|
.home-wrapper {
|
|
|
/deep/ .square-tab .el-tabs__item {
|
|
|
font-size: 16px !important;
|