首页热门下载修复

dev_2022-04-07
Jo 3 years ago
parent c5442b6a48
commit 015d1946c3
  1. 1
      src/libs/route/addRoutes.js
  2. 29
      src/pages/index/list/index.vue
  3. 2
      src/pages/stat/list/index.vue

@ -16,7 +16,6 @@ function createRoute(data){
newRoutes.push({
name: e.path,
path: e.path,
path: () => import(`@/pages/${e.path}.vue`),
meta
})
}

@ -5,7 +5,7 @@
<div class="search-wrap">
<div class="search">
<input ref="keyword" v-model="keyword" type="text" placeholder="请输入关键词">
<img v-if="keyword" src="../../../assets/img/remove-gray.png" alt="" class="remove" @click="keyword = ''">
<img v-if="keyword" src="../../../assets/img/remove-gray.png" alt="" class="remove" @click="clearKeyword">
<img class="icon-wrap" src="../../../assets/img/search-gray.png" alt="">
</div>
<div class="hot" v-if="hotData.length">
@ -205,11 +205,15 @@ export default {
...mapState('user', [
'schoolId'
]),
...mapState('auth', [
'routes'
])
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
if (!this.keyword) this.listData = []
this.$refs.keyword.focus()
this.initData()
},500)
@ -220,10 +224,14 @@ export default {
},
methods: {
getData(){
this.$post(`${this.api.getTableByCondition}?showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
if (this.keyword) {
this.$post(`${this.api.getTableByCondition}?showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(res => {
this.listData = res.data.records
this.total = res.data.total
}).catch(res => {})
} else {
this.listData = []
}
},
//
getHot(){
@ -292,10 +300,18 @@ export default {
window.open(route.href)
}
},
clearKeyword() {
this.keyword = ''
this.listData = []
},
toData(row){
// ,
if(this.token){
this.$router.push(`/data?typeId=${row.categoryTwoId}`)
if (this.routes.find(e => e.path === '/data/list')) {
this.$router.push(`/data?typeId=${row.categoryTwoId}`)
} else {
this.keyword = row.categoryTwo
}
}else{
let route = this.$router.resolve({
path: '/login'
@ -304,7 +320,6 @@ export default {
}
},
toPart(i){
console.log(i)
this.active = i
document.querySelector(`#part${i}`).scrollIntoView()
}

@ -16,7 +16,7 @@
<p class="surplus">
<span class="name">账号数量</span>
<template v-if="item.accountNum > 1000">
<span></span>
<span></span>
</template>
<template v-else>
<span class="num">{{item.accountNum}}</span>

Loading…
Cancel
Save