|
|
@@ -267,7 +267,6 @@ export default {
|
|
|
dataList: []
|
|
|
},
|
|
|
loading: false,
|
|
|
- search: '', // 当前输入框的值
|
|
|
keyword: '', // 当前输入框的值
|
|
|
searchType: '1',
|
|
|
isFocus: false, // 是否聚焦
|
|
|
@@ -284,10 +283,10 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
isHistorySearch() {
|
|
|
- return this.isFocus && !this.search
|
|
|
+ return this.isFocus && !this.keyword
|
|
|
},
|
|
|
isSearchList() {
|
|
|
- return this.isFocus && this.search
|
|
|
+ return this.isFocus && this.keyword
|
|
|
},
|
|
|
isSearch() {
|
|
|
return this.isFocus
|
|
|
@@ -349,35 +348,25 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- /* this.dataList.push(
|
|
|
- {
|
|
|
- contentId: 111,
|
|
|
- title: 'aaa',
|
|
|
- coverUrl: 'bbb',
|
|
|
- excerpt: 'ccc'
|
|
|
- }
|
|
|
- )
|
|
|
- this.totalSize = this.dataList.length*/
|
|
|
-
|
|
|
// 随机生成搜索历史tag式样
|
|
|
const n = RandomUtil.getRandomNumber(0, 5)
|
|
|
const exist =
|
|
|
this.historySearchList.filter(value => {
|
|
|
- return value.name === this.search
|
|
|
+ return value.name === this.keyword
|
|
|
}).length !== 0
|
|
|
if (!exist) {
|
|
|
- this.historySearchList.push({ name: this.search, type: this.types[n] })
|
|
|
+ this.historySearchList.push({ name: this.keyword, type: this.types[n] })
|
|
|
Store.saveHistory(this.historySearchList)
|
|
|
}
|
|
|
this.history = this.historySearchList.length !== 0
|
|
|
} else {
|
|
|
this.videoSearch = true
|
|
|
this.wenshuSearch = false
|
|
|
- this.videoQueryWrapper(this.search, this.currentPage)
|
|
|
+ this.videoQueryWrapper(this.keyword, this.currentPage)
|
|
|
}
|
|
|
},
|
|
|
- closeHandler(search) {
|
|
|
- this.historySearchList.splice(this.historySearchList.indexOf(search), 1)
|
|
|
+ closeHandler(keyword) {
|
|
|
+ this.historySearchList.splice(this.historySearchList.indexOf(keyword), 1)
|
|
|
Store.saveHistory(this.historySearchList)
|
|
|
clearTimeout(this.searchBoxTimeout)
|
|
|
if (this.historySearchList.length === 0) {
|
|
|
@@ -388,7 +377,7 @@ export default {
|
|
|
Store.removeAllHistory()
|
|
|
},
|
|
|
onGetWenshuDetail(val) {
|
|
|
- getWenshuDetail(val).then(resp => {
|
|
|
+ getWenshuDetail(val, this.keyword).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
|
this.wenshuDetail = resp.data
|
|
|
}
|