From 3944c961d97e1ea9b9cda728a5e2709468eb87d5 Mon Sep 17 00:00:00 2001 From: linxi Date: Wed, 27 Nov 2024 09:13:56 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A2695=20=E3=80=90=E9=9D=9E=E9=81=97?= =?UTF-8?q?=E6=96=87=E5=8C=96=E3=80=91=E9=9D=9E=E9=81=97=E6=9C=AA=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=8E=A8=E8=8D=90=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg_product/views/heritage/index.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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) {