ChartItemCompereComponent.ets 1.35 KB
import { ContentDetailDTO, LiveRoomItemBean } from 'wdBean/Index'
import { DisplayUtils } from 'wdKit'

@Component
export struct ChartItemCompereComponent {
  @Consume hostInputedComment: LiveRoomItemBean
  aboutToAppear(): void {
  }

  build() {
    ListItem() {
      Column() {
        Row() {
          Image(this.hostInputedComment.senderUserAvatarUrl)
            .alt($r('app.media.default_head'))
            .borderRadius(10)
            .width(20)
            .height(20)
            .margin({ right: 8 })

          Text(this.hostInputedComment.senderUserName)
            .fontSize(14)
            .fontColor('#FFFFFFFF')
            .margin({ right: 8 })

          Text(' 主持人 ')
            .fontSize(11)
            .backgroundColor('#FFFFC63F')
            .fontColor('#FFFFFFFF')
            .padding({ top: 2, bottom: 2, left: 4, right: 4 })
            .borderRadius(4)
        }
        .margin({ bottom: 8 })
        .justifyContent(FlexAlign.Start)

        Text(this.hostInputedComment.text).lineHeight(22).fontColor('#FFFFFFFF').fontSize(14)
      }
      .backgroundColor('#4D000000')
      .borderRadius(3)
      .padding({
        top: 6,
        bottom: 6,
        left: 8,
        right: 8
      })
      .width(DisplayUtils.getDeviceWidth() - 32)
      .margin({ left: 16, bottom: 4, right:16 })
      .alignItems(HorizontalAlign.Start)
    }

  }
}