PlayerCommentView.ets
940 Bytes
import router from '@ohos.router';
@Component
export struct PlayerCommentView {
@Consume showComment?: boolean
@Consume isOpenDetail?: boolean
@State comment: string = '';
build() {
Row() {
Image($r('app.media.ic_back'))
.width(24)
.height(24)
.aspectRatio(1)
.onClick(() => {
router.back();
})
TextInput({ placeholder: '说两句...', text: this.comment })
.placeholderColor(Color.White)
.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)
}
}