陈剑华

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

@@ -65,7 +65,7 @@ export struct ZhCarouselLayout01 { @@ -65,7 +65,7 @@ export struct ZhCarouselLayout01 {
65 Logger.info(TAG, 65 Logger.info(TAG,
66 `aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`); 66 `aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`);
67 let list: number[] = [] 67 let list: number[] = []
68 - for (let i = 1; i <= this.compDTO?.operDataList?.length; i++) { 68 + for (let i = 1; i <= this.filterAtv()?.length; i++) {
69 list.push(i); 69 list.push(i);
70 } 70 }
71 this.data = new MyDataSource(list) 71 this.data = new MyDataSource(list)
@@ -84,17 +84,23 @@ export struct ZhCarouselLayout01 { @@ -84,17 +84,23 @@ export struct ZhCarouselLayout01 {
84 } 84 }
85 } 85 }
86 86
  87 + filterAtv() {
  88 + return this.compDTO.operDataList.filter(((item: ContentDTO) => {
  89 + return !item.linkUrl.includes('/h/atv')
  90 + }))
  91 + }
  92 +
87 build() { 93 build() {
88 94
89 if (this.compDTO?.operDataList?.length) { 95 if (this.compDTO?.operDataList?.length) {
90 if (this.compDTO?.operDataList.length > 1) { 96 if (this.compDTO?.operDataList.length > 1) {
91 Stack() { 97 Stack() {
92 Swiper() { 98 Swiper() {
93 - ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => { 99 + ForEach(this.filterAtv(), (item: ContentDTO, index: number) => {
94 CarouselLayout01CardView({ 100 CarouselLayout01CardView({
95 item: item, 101 item: item,
96 - length: this.compDTO.operDataList.length,  
97 - showPicBorderRadius: this.compDTO.operDataList.length == 1 102 + length: this.filterAtv().length,
  103 + showPicBorderRadius: this.filterAtv().length == 1
98 }) 104 })
99 .onClick((event: ClickEvent) => { 105 .onClick((event: ClickEvent) => {
100 InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) 106 InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
@@ -172,13 +178,13 @@ export struct ZhCarouselLayout01 { @@ -172,13 +178,13 @@ export struct ZhCarouselLayout01 {
172 .width(CommonConstants.FULL_WIDTH) 178 .width(CommonConstants.FULL_WIDTH)
173 } else { 179 } else {
174 CarouselLayout01CardView({ 180 CarouselLayout01CardView({
175 - item: this.compDTO.operDataList[0], 181 + item: this.filterAtv()[0],
176 length: 1, 182 length: 1,
177 - showPicBorderRadius: this.compDTO.operDataList.length == 1 183 + showPicBorderRadius: this.filterAtv().length == 1
178 }) 184 })
179 .onClick((event: ClickEvent) => { 185 .onClick((event: ClickEvent) => {
180 - InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)  
181 - ProcessUtils.processPage(this.compDTO.operDataList[0]) 186 + InfomationCardClick.track(this.compDTO, this.filterAtv()[0], this.pageId, this.pageName)
  187 + ProcessUtils.processPage(this.filterAtv()[0])
182 }) 188 })
183 .padding({ 189 .padding({
184 left: 10, 190 left: 10,