AdvCardParser.ets 1.87 KB
import { CompStyle } from 'wdConstant';
import { CompDTO } from 'wdBean';
import { CardAdvThreeImageComponent } from './CardAdvThreeImageComponent';
import { CardAdvSmallImageComponent } from './CardAdvSmallImageComponent';
import { CardAdvLongImageComponent } from './CardAdvLongImageComponent';
import { CardAdvBigImageComponent } from './CardAdvBigImageComponent';
import { CardAdvVideoComponent } from './CardAdvVideoComponent';
import { CardAdvGanMiComponent } from './CardAdvGanMiComponent';
import { CardAdvVideoExComponent } from './CardAdvVideoExComponent';

/**
 * @Description: 广告稿件解析类
 * @Author:
 * @Email: liyubing@wondertek.com.cn
 * @CreateDate:
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
@Component
export struct AdvCardParser {
  @State compDTO: CompDTO = {} as CompDTO;

  build() {
    this.contentBuilder(this.compDTO);
  }

  @Builder
  contentBuilder(compDTO: CompDTO) {
    if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_5) { //三图广告
      CardAdvThreeImageComponent({ compDTO })
    } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_6) { //小图广告
      CardAdvSmallImageComponent({ compDTO })
    } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_7 ||
      compDTO.matInfo.advSubType === CompStyle.Card_Adv_12) { // 长通栏广告 和 顶部长通栏广告
      CardAdvLongImageComponent({ compDTO })
    } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_8) { //大图广告
      CardAdvBigImageComponent({ compDTO })
    } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_9) { //视频广告
      CardAdvVideoComponent({ compDTO })
    } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_10) { //展会广告
      CardAdvVideoExComponent({ compDTO })
    } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_11) { //冠名广告
      CardAdvGanMiComponent({ compDTO })
    }
  }
}