import { BasicConstant, authStore } from '@itcast/basic'
import { commentModel } from '../model/VideoCommentModel'

@Preview
@Component
export struct CommentChildView {
  @Prop model:commentModel;
  @State isShowMoreComment:boolean = false;

  build() {
    Column() {
      Row() {
        Row({ space: 10 }) {
          Image(BasicConstant.urlHtml + this.model.photo)
            .alt($r('app.media.userPhoto_default'))
            .width(34).height(34)
            .borderRadius(3.4)
          Text(this.model.user_status == 1 ? this.model.name : '账号已注销')
            .fontSize(16).fontColor('#333333')
            .height('100%')
            .alignSelf(ItemAlign.Start)
        }
        .margin({ left: 10, right: authStore.getUser().uuid == this.model.user_uuid ? 35 : 65 })
        .layoutWeight(1)//权重自定义
        .justifyContent(FlexAlign.Start)
      }.width('100%').height(40).margin({top:15}).alignItems(VerticalAlign.Center)
      Column() {
        Text(this.model.content)
          .fontSize(15).fontColor('#666666')
        Text(this.model.create_date)
          .margin({top:5})
          .fontSize(14)
          .fontColor('#999999')
      }.margin({left:50}).alignItems(HorizontalAlign.Start).width('calc(100% - 70vp)')
    }
  }
}
