陈剑华

fix: 18091 健康频道>轮播图卡配置为投票活动交互问题

... ... @@ -65,7 +65,7 @@ export struct ZhCarouselLayout01 {
Logger.info(TAG,
`aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`);
let list: number[] = []
for (let i = 1; i <= this.compDTO?.operDataList?.length; i++) {
for (let i = 1; i <= this.filterAtv()?.length; i++) {
list.push(i);
}
this.data = new MyDataSource(list)
... ... @@ -84,17 +84,23 @@ export struct ZhCarouselLayout01 {
}
}
filterAtv() {
return this.compDTO.operDataList.filter(((item: ContentDTO) => {
return !item.linkUrl.includes('/h/atv')
}))
}
build() {
if (this.compDTO?.operDataList?.length) {
if (this.compDTO?.operDataList.length > 1) {
Stack() {
Swiper() {
ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => {
ForEach(this.filterAtv(), (item: ContentDTO, index: number) => {
CarouselLayout01CardView({
item: item,
length: this.compDTO.operDataList.length,
showPicBorderRadius: this.compDTO.operDataList.length == 1
length: this.filterAtv().length,
showPicBorderRadius: this.filterAtv().length == 1
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
... ... @@ -172,13 +178,13 @@ export struct ZhCarouselLayout01 {
.width(CommonConstants.FULL_WIDTH)
} else {
CarouselLayout01CardView({
item: this.compDTO.operDataList[0],
item: this.filterAtv()[0],
length: 1,
showPicBorderRadius: this.compDTO.operDataList.length == 1
showPicBorderRadius: this.filterAtv().length == 1
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)
ProcessUtils.processPage(this.compDTO.operDataList[0])
InfomationCardClick.track(this.compDTO, this.filterAtv()[0], this.pageId, this.pageName)
ProcessUtils.processPage(this.filterAtv()[0])
})
.padding({
left: 10,
... ...