caohuahui

头图卡

  1 +import { CommonConstants } from 'wdConstant';
  2 +import { CompDTO } from '../repository/bean/CompDTO';
  3 +import { CompUtils } from '../utils/CompUtils';
  4 +
  5 +@Component
  6 +export struct HeadPictureCardComponent {
  7 + @State compDTO: CompDTO = {} as CompDTO
  8 +
  9 + build() {
  10 + Stack() {
  11 + Image(this.compDTO.backgroundImgUrl)
  12 + .width(CommonConstants.FULL_WIDTH)
  13 + .height(CommonConstants.FULL_HEIGHT)
  14 + Row()
  15 + .width(CommonConstants.FULL_WIDTH)
  16 + .height(59)
  17 + .linearGradient({
  18 + colors:[
  19 + ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
  20 + ]
  21 + })
  22 + Row() {
  23 + Text(CompUtils.getLabelTitle(this.compDTO.extraData))
  24 + .width(CommonConstants.FULL_WIDTH)
  25 + .height(CommonConstants.FULL_HEIGHT)
  26 + .fontColor(Color.White)
  27 + .fontSize($r('app.float.normal_text_size'))
  28 + .fontWeight(FontWeight.Bold)
  29 + }
  30 + .height(25)
  31 + .margin({left: 12, bottom: 10, right: 12})
  32 + }
  33 + .alignContent(Alignment.Bottom)
  34 + }
  35 +}