|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="wrap" :class="{index: !keyword, result: keyword}"> |
|
|
|
|
<div class="wrap index" :class="{result: keyword}"> |
|
|
|
|
<img class="screen" src="@/assets/img/index/index0.png" alt="首页"> |
|
|
|
|
<div class="banner"> |
|
|
|
|
<video class="video" ref="video" autoplay muted loop> |
|
|
|
@ -7,7 +7,7 @@ |
|
|
|
|
您的浏览器不支持 video 标签。 |
|
|
|
|
</video> |
|
|
|
|
<div class="banner-inner"> |
|
|
|
|
<div class="banner-title" v-if="!keyword">准确,多元,海量数据</div> |
|
|
|
|
<div class="banner-title">准确,多元,海量数据</div> |
|
|
|
|
<div class="search-wrap"> |
|
|
|
|
<div class="search"> |
|
|
|
|
<input ref="keyword" v-model="keyword" type="text" placeholder="请输入关键词"> |
|
|
|
@ -25,7 +25,7 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="list-wrap" v-if="keyword"> |
|
|
|
|
<div class="tips"> |
|
|
|
|
<p class="result"><img src="@/assets/img/index/search.png" alt=""> 搜索结果</p> |
|
|
|
|
<p class="result-title"><img src="@/assets/img/index/search.png" alt=""> 搜索结果</p> |
|
|
|
|
<p class="num">搜索完成,共有{{total}}个结果匹配</p> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -381,15 +381,13 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 获取热门下载数据 |
|
|
|
|
getHot(){ |
|
|
|
|
this.$get(this.api.queryDatabaseInfo).then(res => { |
|
|
|
|
let list = res.data |
|
|
|
|
list.map(n => n.download) |
|
|
|
|
this.$get(this.api.queryDatabaseInfo).then(({ data }) => { |
|
|
|
|
// 根据下载量排序 |
|
|
|
|
list.sort((a,b) => { |
|
|
|
|
return b.download - a.download |
|
|
|
|
data.sort((a,b) => { |
|
|
|
|
return b.downloads - a.downloads |
|
|
|
|
}) |
|
|
|
|
// 只展示前三条 |
|
|
|
|
this.hotData = list.slice(0,3) |
|
|
|
|
this.hotData = data.slice(0,3) |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
initData(){ |
|
|
|
@ -410,7 +408,7 @@ export default { |
|
|
|
|
// 登录了才能查看数据,否则直接跳转到登录页 |
|
|
|
|
if(this.token){ |
|
|
|
|
if (this.routes.find(e => e.path === '/data/list')) { |
|
|
|
|
this.$router.push(`/data?typeId=${row.categoryTwoId}`) |
|
|
|
|
this.$router.push(`/data?typeId=${row.secondId}`) |
|
|
|
|
} else { |
|
|
|
|
this.keyword = row.categoryTwo |
|
|
|
|
} |
|
|
|
@ -702,12 +700,11 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
&.result{ |
|
|
|
|
.banner{ |
|
|
|
|
padding: 46px 0; |
|
|
|
|
} |
|
|
|
|
.tips{ |
|
|
|
|
margin-bottom: 22px; |
|
|
|
|
.result{ |
|
|
|
|
.result-title{ |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
margin: 30px 0 10px; |
|
|
|
|
font-size: 17px; |
|
|
|
|
color: $main-color; |
|
|
|
|