陈剑华

feat: 17989 轮播图卡-音频专题数据展示交互问题

1 -import { CompDTO } from 'wdBean'; 1 +import { CompDTO, ContentDTO } from 'wdBean';
2 import { CommonConstants, CompStyle } from 'wdConstant/Index'; 2 import { CommonConstants, CompStyle } from 'wdConstant/Index';
3 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 3 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
4 import PageModel from '../viewmodel/PageModel'; 4 import PageModel from '../viewmodel/PageModel';
@@ -35,10 +35,20 @@ export struct CompParser { @@ -35,10 +35,20 @@ export struct CompParser {
35 @ObjectLink compDTO: CompDTO 35 @ObjectLink compDTO: CompDTO
36 @State compIndex: number = 0; 36 @State compIndex: number = 0;
37 @State private pageModel: PageModel = new PageModel(); 37 @State private pageModel: PageModel = new PageModel();
  38 + @State audioItems: ContentDTO[] = [];
  39 + @State noneAudioItems: ContentDTO[] = [];
  40 +
  41 + aboutToAppear(): void {
  42 + // 轮播图屏蔽音频类型稿件
  43 + if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
  44 + this.audioItems = this.compDTO.operDataList.filter(item => item.appStyle === '13')
  45 + this.noneAudioItems = this.compDTO.operDataList.filter(item => item.appStyle !== '13')
  46 + this.compDTO.operDataList = this.noneAudioItems;
  47 + }
  48 + }
38 49
39 build() { 50 build() {
40 Column() { 51 Column() {
41 -  
42 this.componentBuilder(); 52 this.componentBuilder();
43 } 53 }
44 } 54 }
@@ -54,8 +64,10 @@ export struct CompParser { @@ -54,8 +64,10 @@ export struct CompParser {
54 LabelComponent({ compDTO: this.compDTO }) 64 LabelComponent({ compDTO: this.compDTO })
55 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 65 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
56 } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { 66 } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
57 - ZhCarouselLayout01({ compDTO: this.compDTO })  
58 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 67 + if (this.compDTO.operDataList.length > this.audioItems.length) {
  68 + ZhCarouselLayout01({ compDTO: this.compDTO })
  69 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  70 + }
59 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && 71 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
60 this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" 72 this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
61 73