RmhTitle.ets 1.57 KB
/**
 * 这里是人民号动态中的顶部信息:人民号logo,名字,描述,关注等
 */
import { RmhInfoDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';

@Entry
@Component
export struct RmhTitle {
  @Prop rmhInfo: RmhInfoDTO

  build() {
    Flex() {
      Stack() {
        Image(this.rmhInfo.rmhHeadUrl)
          .width(36)
          .height(36).borderRadius(50)
        Image(this.rmhInfo.authIcon)
          .width(14)
          .height(14)
          .borderRadius(50)
      }
      .margin({ right: 8 })
      .alignContent(Alignment.BottomEnd)
      .flexShrink(0)

      Column() {
        Text(this.rmhInfo.rmhName)
          .fontSize($r('app.float.font_size_13'))
          .fontColor($r('app.color.color_222222'))
          .fontWeight(600)
          .alignSelf(ItemAlign.Start)
        Text(this.rmhInfo.rmhDesc)
          .fontSize($r("app.float.font_size_12"))
          .fontColor($r("app.color.color_B0B0B0"))
          .maxLines(1)
          .alignSelf(ItemAlign.Start)
          .textOverflow({ overflow: TextOverflow.Ellipsis })
      }

      Blank()
      if (this.rmhInfo.cnIsAttention) {
        Row() {
          Image($r('app.media.rmh_follow'))
            .width(16)
            .height(16)
          Text('关注')
            .fontSize($r('app.float.font_size_13'))
            .fontColor($r('app.color.color_ED2800'))
        }
        .flexShrink(0)
        .alignSelf(ItemAlign.Center)
        .onClick(() => {
          // TODO 调用关注接口
        })
      }
    }
    .width(CommonConstants.FULL_WIDTH)
    .margin({ bottom: 10 })
  }
}