diff --git a/pkg_product/views/heritage/index.vue b/pkg_product/views/heritage/index.vue index 65a0fec..80a60a9 100644 --- a/pkg_product/views/heritage/index.vue +++ b/pkg_product/views/heritage/index.vue @@ -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) {