|
@@ -23,11 +23,19 @@
|
|
|
<div class="hot_clearHis" @click="clearHotHis">清除历史记录</div>
|
|
|
</div>
|
|
|
<!-- 热点列表 -->
|
|
|
- <div class="hot_list" :style="`height:${hotHisList.length === 0 ? '540px' : '450px'}`">
|
|
|
+
|
|
|
+ <div class="hot_listNone" v-show="hotListShowData.length === 0">
|
|
|
+ 暂无内容
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-show="hotListShowData.length !== 0" class="hot_list"
|
|
|
+ :style="`height:${hotHisList.length === 0 ? '540px' : '450px'}`">
|
|
|
<div class="hot_listRow" @click="openHot(item)" v-for="item in hotListShowData" :key="item.sid">{{
|
|
|
item.title?.split('&')[0]
|
|
|
}}</div>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
@@ -173,6 +181,11 @@ export default {
|
|
|
}, 100);
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ this.hotListShowData = [...this.hotList]
|
|
|
+ this.hotTxt = ''
|
|
|
+ let dom = document.querySelector('.hot_list')
|
|
|
+ if (dom) dom.scrollTop = 0
|
|
|
}
|
|
|
},
|
|
|
acList(val) {
|
|
@@ -204,7 +217,14 @@ export default {
|
|
|
this.hotTxt = val
|
|
|
this.hotHisList.unshift(val)
|
|
|
setHotHis(this.hotHisList)
|
|
|
- this.hotListShowData = this.hotList.filter(v => v.title.includes(this.hotTxt))
|
|
|
+ this.hotListShowData = this.hotList.filter(v => v.title.split("&")[0].includes(this.hotTxt))
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ let dom = document.querySelector('.hot_list')
|
|
|
+ if (dom) dom.scrollTop = 0
|
|
|
+
|
|
|
+ }, 20);
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
clearHotHis() {
|
|
@@ -217,14 +237,20 @@ export default {
|
|
|
if (this.hotTxt.trim() === '') {
|
|
|
this.hotListShowData = [...this.hotList]
|
|
|
} else {
|
|
|
- this.hotListShowData = this.hotList.filter(v => v.title.includes(this.hotTxt))
|
|
|
+ this.hotListShowData = this.hotList.filter(v => v.title.split("&")[0].includes(this.hotTxt))
|
|
|
this.hotHisList = this.hotHisList.filter(v => v !== this.hotTxt)
|
|
|
this.hotHisList.unshift(this.hotTxt)
|
|
|
if (this.hotHisList.length > 14) this.hotHisList.length = 14
|
|
|
setHotHis(this.hotHisList)
|
|
|
}
|
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ let dom = document.querySelector('.hot_list')
|
|
|
+ if (dom) dom.scrollTop = 0
|
|
|
|
|
|
+ }, 20);
|
|
|
+ })
|
|
|
|
|
|
|
|
|
|
|
@@ -585,6 +611,16 @@ export default {
|
|
|
background: transparent;
|
|
|
}
|
|
|
|
|
|
+ .hot_listNone {
|
|
|
+ width: 100%;
|
|
|
+ height: 450px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 20px;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
.hot_list {
|
|
|
padding-right: 15px;
|
|
|
margin-top: 28px;
|