PlayerCommentView.ets 1.12 KB
import router from '@ohos.router';
import { ContentDetailDTO } from 'wdBean/Index';

@Component
export struct PlayerCommentView {
  @Consume showComment?: boolean
  @Consume isOpenDetail?: boolean
  @Consume contentDetailData: ContentDetailDTO
  @State comment: string = '';

  build() {
    Row() {
      Image($r('app.media.ic_back'))
        .width(24)
        .height(24)
        .aspectRatio(1)
        .onClick(() => {
          router.back();
        })

      if (this.contentDetailData.openComment == 1) {
        TextInput({ placeholder: '说两句...', text: this.comment })
          .placeholderColor('#999999')
          .placeholderFont({ size: 14 })
          .fontColor(Color.White)
          .fontSize(14)
          .maxLines(1)
          .layoutWeight(1)
          .backgroundColor('#1a1a1a')
          .borderRadius(2)
          .height(30)
          .margin({ left: 12 })
      }

    }
    .backgroundColor(Color.Black)
    .alignItems(VerticalAlign.Center)
    .padding({
      left: 16,
      right: 16,
      top: 11,
      bottom: 11
    })
    .visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
  }
}