HeadPictureCardComponent.ets 1011 Bytes
import { CompDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { CompUtils } from '../utils/CompUtils';

@Component
export struct HeadPictureCardComponent {
  @State compDTO: CompDTO = {} as CompDTO

  build() {
    Stack() {
      Image(this.compDTO.backgroundImgUrl)
        .width(CommonConstants.FULL_WIDTH)
        .height(CommonConstants.FULL_HEIGHT)
      Row()
        .width(CommonConstants.FULL_WIDTH)
        .height(59)
        .linearGradient({
          colors:[
            ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
          ]
        })
      Row() {
        Text(CompUtils.getLabelTitle(this.compDTO.extraData))
          .width(CommonConstants.FULL_WIDTH)
          .height(CommonConstants.FULL_HEIGHT)
          .fontColor(Color.White)
          .fontSize($r('app.float.normal_text_size'))
          .fontWeight(FontWeight.Bold)
      }
      .height(25)
      .margin({left: 12, bottom: 10, right: 12})
    }
    .alignContent(Alignment.Bottom)
  }
}