Fix:2695 【非遗文化】非遗未显示推荐数据

This commit is contained in:
linxi
2024-11-27 09:13:56 +08:00
parent 338c63d634
commit 3944c961d9
+7 -5
View File
@@ -101,7 +101,8 @@ export default {
actived: 0,
contents: [],
recommendList: [],
keyword: ''
keyword: '',
categoryId: ''
}
},
onLoad(opts) {
@@ -116,23 +117,24 @@ export default {
getIch(this.id).then(res => {
this.ichData = res.data
this.contents = res.data.categories[0] && res.data.categories[0].contents || []
this.categoryId = res.data.categories[0].ichCategoryId
this.getRecommend()
})
},
getRecommend() {
const params = {
ichDataId: this.ichData.id,
keyword: this.keyword
keyword: this.keyword,
categoryId: this.categoryId
}
getIchRecommend(params).then(res => {
this.recommendList = res.data.filter(e => {
return this.contents.map(el => el.ichContentId).includes(e.id)
}) || []
this.recommendList = res.data
})
},
handleTab(index, item) {
this.actived = index
this.contents = item.contents
this.categoryId = item.ichCategoryId
this.getRecommend()
},
toDetails(id) {