Fix:2711 【非遗文化】非遗列表页面搜索功能需要对轮播区域生效

This commit is contained in:
linxi
2024-11-27 15:14:10 +08:00
parent 80ba906630
commit 3cc41c3c34
+7 -3
View File
@@ -102,7 +102,8 @@ export default {
contents: [], contents: [],
recommendList: [], recommendList: [],
keyword: '', keyword: '',
categoryId: '' categoryId: '',
cacheList: []
} }
}, },
onLoad(opts) { onLoad(opts) {
@@ -112,11 +113,13 @@ export default {
methods: { methods: {
searchClick() { searchClick() {
this.getRecommend() this.getRecommend()
this.contents = this.cacheList.filter(e => e.name.indexOf(this.keyword) > -1)
}, },
getIchData() { getIchData() {
getIch(this.id).then(res => { getIch(this.id).then(res => {
this.ichData = res.data this.ichData = res.data
this.contents = res.data.categories[0] && res.data.categories[0].contents || [] this.cacheList = res.data.categories[0] && res.data.categories[0].contents || []
this.contents = this.cacheList
this.categoryId = res.data.categories[0].ichCategoryId this.categoryId = res.data.categories[0].ichCategoryId
this.getRecommend() this.getRecommend()
}) })
@@ -133,7 +136,8 @@ export default {
}, },
handleTab(index, item) { handleTab(index, item) {
this.actived = index this.actived = index
this.contents = item.contents this.cacheList = item.contents
this.contents = this.cacheList
this.categoryId = item.ichCategoryId this.categoryId = item.ichCategoryId
this.getRecommend() this.getRecommend()
}, },