TabLiveItemComponent.ets 2.44 KB
@Component
export struct TabLiveItemComponent {
  item: string = ''

  aboutToAppear(): void {

  }

  build() {
    Column() {
      Row() {
        Image('https://img0.baidu.com/it/u=4105778329,1297102594&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500')
          .borderRadius(90)
          .width(24)
          .height(24)
        Text('人民日报直播频道')
          .maxLines(1)
          .textOverflow({ overflow: TextOverflow.Ellipsis })
          .fontSize('14fp')
          .fontWeight(400)
          .fontColor('#222222')
          .margin({ left: 8 })
        Text('嘉宾')
          .maxLines(1)
          .textOverflow({ overflow: TextOverflow.Ellipsis })
          .fontSize('11fp')
          .fontWeight(400)
          .fontColor('#968562')
          .backgroundColor('#F1EFEB')
          .padding({
            left: 4,
            top: 1,
            right: 4,
            bottom: 1
          })
          .borderRadius(2)
          .margin({ left: 8 })
        Text('1小时前')
          .maxLines(1)
          .textOverflow({ overflow: TextOverflow.Ellipsis })
          .fontSize('12fp')
          .fontWeight(400)
          .fontColor('#999999')
          .margin({ left: 8 })
        Blank()
        Text('置顶')
          .maxLines(1)
          .textOverflow({ overflow: TextOverflow.Ellipsis })
          .fontSize('11fp')
          .fontWeight(400)
          .fontColor('#ED2800')
          .backgroundColor('#F1EFEB')
          .padding({
            left: 4,
            top: 1,
            right: 4,
            bottom: 1
          })
          .borderRadius(2)
          .margin({ left: 8 })
      }
      .width('100%')

      Text('国务院新闻办公室将于7月25日上午10时举行国务院政策例行吹风会,请应急管理部副部长、水利部副部长王道席和自然资源部、水利部、应急管理部、中国气象局、国家消防救援局有关负责人介绍防汛抗旱工作情况,并答记者问。')
        .fontSize('14fp')
        .fontWeight(400)
        .fontColor('#222222')
        .margin({
          left: 32,
          top: 6
        })

      Image('https://t7.baidu.com/it/u=3690528415,706188365&fm=193&f=GIF')
        .height(174)
        .width(310)
        .aspectRatio(310 / 174)
        .objectFit(ImageFit.Auto)
        .borderRadius(4)
        .margin({
          left: 32,
          top: 8
        })
    }.margin({
      left:15,
      top:15,
      right:15
    })
  }

  aboutToDisappear(): void {

  }
}