王士厅

fix: 人民日报在平板上竖屏使用, 播放视频页面, 点击评论, 视频画面会变的非常小,原因是获取的主窗口宽高有问题

import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
import { Logger, PublicDialogManager } from 'wdKit/Index'
import { Logger, PublicDialogManager, WindowModel } from 'wdKit/Index'
import { TrackConstants } from 'wdTracking/Index'
import { OperRowListView } from '../../view/OperRowListView'
import { publishCommentModel } from '../model/PublishCommentModel'
... ... @@ -10,8 +10,8 @@ const TAG = "CommentListDialogView"
/// 评论列表弹框
@Component
export struct CommentListDialogView {
@State windowWidth: number = AppStorage.get<number>('windowWidth') || 0
@State windowHeight: number = AppStorage.get<number>('windowHeight') || 0
@State windowWidth: number = WindowModel.shared.getWindowClass().getWindowProperties()?.windowRect.width
@State windowHeight: number = WindowModel.shared.getWindowClass().getWindowProperties()?.windowRect.height
@Link showCommentList: boolean
@Link contentDetailData: ContentDetailDTO // 详情页传
@Link pageInfo: PageInfoDTO // 专题页传
... ... @@ -24,11 +24,12 @@ export struct CommentListDialogView {
@State isPad:boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"?true:false
aboutToAppear(): void {
if (this.isPad) {
this.maxHeight = this.windowHeight * 0.6
}else {
this.maxHeight = this.windowHeight - this.windowWidth * 9 / 16
}
// if (this.isPad) {
// this.maxHeight = this.windowHeight * 0.6
// }else {
// this.maxHeight = this.windowHeight - this.windowWidth * 9 / 16
// }
this.maxHeight = this.windowHeight - this.windowWidth * 9 / 16
}
build() {
... ...
... ... @@ -46,8 +46,10 @@ export struct DetailPlayShortVideoPage {
@Consume @Watch('videoStatusChange') switchVideoStatus: boolean
@State isPlay: boolean = true // 视频手动播放暂停
@Consume @Watch('pageShowChange') pageShow: number
@Consume windowWidth: number
@Consume windowHeight: number
// @Consume windowWidth: number
@State windowWidth: number = WindowModel.shared.getWindowClass().getWindowProperties()?.windowRect.width
// @Consume windowHeight: number
@State windowHeight: number = WindowModel.shared.getWindowClass().getWindowProperties()?.windowRect.height
@Consume topSafeHeight: number
@Consume showComment: boolean // 是否显示底部评论,首页视频频道传false
@State imageVisible: boolean = true
... ...