Fix:2649 【非遗文化】【推荐】没有根据类目的切换进行联动变更

This commit is contained in:
modendeveloper
2024-11-24 14:49:18 +08:00
parent 909f462aa1
commit c484d20cb2
+5 -2
View File
@@ -1,7 +1,7 @@
<template>
<view class="heritage">
<view class="search-top">
<swiper class="swiper" disable-touch="true" touchable="false" :autoplay="ichData.banners.length > 1" :current="current">
<swiper class="swiper" disable-touch="true" touchable="false" :autoplay="ichData.banners && ichData.banners.length > 1" circular :current="current">
<swiper-item class="search-bg" v-for="(item, index) in ichData.banners" :key="index" @click="toDetails(item.ichContentId)">
<image class="search-bg" :src="item.image" autoplay mode="aspectFit|aspectFill|widthFix" lazy-load="false"></image>
@@ -125,12 +125,15 @@ export default {
keyword: this.keyword
}
getIchRecommend(params).then(res => {
this.recommendList = res.data || []
this.recommendList = res.data.filter(e => {
return this.contents.map(el => el.ichContentId).includes(e.id)
}) || []
})
},
handleTab(index, item) {
this.actived = index
this.contents = item.contents
this.getRecommend()
},
toDetails(id) {
uni.navigateTo({