behindDivider.ets 2.86 KB
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants, CompStyle } from 'wdConstant/Index';

@Component
export struct behindDivider {
  @ObjectLink compDTO: CompDTO
  @State nextCompDTO: CompDTO = new CompDTO
  @State compIndex: number = 0;

  build() {
    if (
      this.compDTO.compStyle === CompStyle.Card_09 ||
        this.compDTO.compStyle === CompStyle.Zh_Single_Column_09 ||
        this.compDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
        this.compDTO.compStyle === CompStyle.Zh_Single_Row_06
    ) {
      if (this.compDTO.compStyle === this.nextCompDTO.compStyle) {
        Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
      } else {
        Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
      }
    } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
      // if (this.compIndex === 0) {
      //   Divider().strokeWidth(1).color('#f5f5f5').width('120%').margin({left: -6})
      // } else {
      //   Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
      // }
      Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
    } else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
      // 大专题
      // if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
      //   Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
      // } else {
        Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
      // }
    } else if (this.compDTO.compType === 'appStyle'
      || this.compDTO.compStyle === CompStyle.Zh_Single_Row_01
      || this.compDTO.compStyle === CompStyle.Zh_Single_Row_02
      || this.compDTO.compStyle === CompStyle.Zh_Single_Row_03
      || this.compDTO.compStyle === CompStyle.Card_Comp_Adv
      || this.compDTO.compStyle === CompStyle.Zh_Single_Column_02
      || this.compDTO.compStyle === CompStyle.Zh_Single_Column_04
    ) {
      if (
        this.nextCompDTO.compStyle === CompStyle.Card_09 ||
          this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10 ||
          this.nextCompDTO.compStyle === CompStyle.Zh_Single_Column_09 ||
          this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
          this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06 ||
          this.nextCompDTO.compStyle === CompStyle.Zh_Single_Column_12
      ) {
        Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
      } else {
        Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
      }
    } else {
      Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
    }
  }
}