王士厅

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

1 import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' 1 import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
2 -import { Logger, PublicDialogManager } from 'wdKit/Index' 2 +import { Logger, PublicDialogManager, WindowModel } from 'wdKit/Index'
3 import { TrackConstants } from 'wdTracking/Index' 3 import { TrackConstants } from 'wdTracking/Index'
4 import { OperRowListView } from '../../view/OperRowListView' 4 import { OperRowListView } from '../../view/OperRowListView'
5 import { publishCommentModel } from '../model/PublishCommentModel' 5 import { publishCommentModel } from '../model/PublishCommentModel'
@@ -10,8 +10,8 @@ const TAG = "CommentListDialogView" @@ -10,8 +10,8 @@ const TAG = "CommentListDialogView"
10 /// 评论列表弹框 10 /// 评论列表弹框
11 @Component 11 @Component
12 export struct CommentListDialogView { 12 export struct CommentListDialogView {
13 - @State windowWidth: number = AppStorage.get<number>('windowWidth') || 0  
14 - @State windowHeight: number = AppStorage.get<number>('windowHeight') || 0 13 + @State windowWidth: number = WindowModel.shared.getWindowClass().getWindowProperties()?.windowRect.width
  14 + @State windowHeight: number = WindowModel.shared.getWindowClass().getWindowProperties()?.windowRect.height
15 @Link showCommentList: boolean 15 @Link showCommentList: boolean
16 @Link contentDetailData: ContentDetailDTO // 详情页传 16 @Link contentDetailData: ContentDetailDTO // 详情页传
17 @Link pageInfo: PageInfoDTO // 专题页传 17 @Link pageInfo: PageInfoDTO // 专题页传
@@ -24,12 +24,13 @@ export struct CommentListDialogView { @@ -24,12 +24,13 @@ export struct CommentListDialogView {
24 @State isPad:boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"?true:false 24 @State isPad:boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"?true:false
25 25
26 aboutToAppear(): void { 26 aboutToAppear(): void {
27 - if (this.isPad) {  
28 - this.maxHeight = this.windowHeight * 0.6  
29 - }else { 27 + // if (this.isPad) {
  28 + // this.maxHeight = this.windowHeight * 0.6
  29 + // }else {
  30 + // this.maxHeight = this.windowHeight - this.windowWidth * 9 / 16
  31 + // }
30 this.maxHeight = this.windowHeight - this.windowWidth * 9 / 16 32 this.maxHeight = this.windowHeight - this.windowWidth * 9 / 16
31 } 33 }
32 - }  
33 34
34 build() { 35 build() {
35 Row() { 36 Row() {
@@ -46,8 +46,10 @@ export struct DetailPlayShortVideoPage { @@ -46,8 +46,10 @@ export struct DetailPlayShortVideoPage {
46 @Consume @Watch('videoStatusChange') switchVideoStatus: boolean 46 @Consume @Watch('videoStatusChange') switchVideoStatus: boolean
47 @State isPlay: boolean = true // 视频手动播放暂停 47 @State isPlay: boolean = true // 视频手动播放暂停
48 @Consume @Watch('pageShowChange') pageShow: number 48 @Consume @Watch('pageShowChange') pageShow: number
49 - @Consume windowWidth: number  
50 - @Consume windowHeight: number 49 + // @Consume windowWidth: number
  50 + @State windowWidth: number = WindowModel.shared.getWindowClass().getWindowProperties()?.windowRect.width
  51 + // @Consume windowHeight: number
  52 + @State windowHeight: number = WindowModel.shared.getWindowClass().getWindowProperties()?.windowRect.height
51 @Consume topSafeHeight: number 53 @Consume topSafeHeight: number
52 @Consume showComment: boolean // 是否显示底部评论,首页视频频道传false 54 @Consume showComment: boolean // 是否显示底部评论,首页视频频道传false
53 @State imageVisible: boolean = true 55 @State imageVisible: boolean = true