PlayerBottomView.ets 2.54 KB
import { WDPlayerController } from 'wdPlayer/Index';
import { PlayerTitleView } from './PlayerTitleView'
import { PlayerProgressView } from './PlayerProgressView'
import { PlayerCommentView } from './PlayerCommentView'
import { PlayerTimeSeekView } from './PlayerTimeSeekView'
import { OperRowListView } from '../../../../../wdComponent/src/main/ets/components/view/OperRowListView'
import {
  publishCommentModel
} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
import { ContentDetailDTO } from 'wdBean/Index';
import { WindowModel } from 'wdKit/Index';

@Component
export struct PlayerBottomView {
  private playerController?: WDPlayerController;
  @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  @Consume showComment?: boolean
  @Consume isOpenDetail?: boolean
  @Consume isDragging?: boolean
  @Consume contentDetailData: ContentDetailDTO
  @State publishCommentModel: publishCommentModel = new publishCommentModel()

  aboutToAppear(): void {
    this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
    this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
    this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
    this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
    this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
    this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
    this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
    this.publishCommentModel.commentContent = ''
  }

  build() {
    Column() {
      PlayerTitleView()
      PlayerProgressView({ playerController: this.playerController })
      if (this.showComment) {
        // PlayerCommentView()
        OperRowListView({
          pageComponentType: 1,
          styleType: 3,
          componentType: 4,
          operationButtonList: ['comment',],
          contentDetailData: this.contentDetailData,
          publishCommentModel: this.publishCommentModel,
          showCommentIcon: false,
          onBack: () => {
            WindowModel.shared.setWindowLayoutFullScreen(false)
            WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
          }
        })
          .padding({
            bottom: -this.bottomSafeHeight + 'px'
          })
      }
    }
    .alignItems(HorizontalAlign.Start)
    .position({ x: 0, y: '100%' })
    .markAnchor({ y: '100%' })
  }
}