王士厅

fix: 折叠屏--直播预告稿件详情页面,上方展示的大图被过度拉近,导致直播的文字信息展示不完整

@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 "app": { 2 "app": {
3 "bundleName": "com.peopledailychina.hosactivity", 3 "bundleName": "com.peopledailychina.hosactivity",
4 "vendor": "$string:app_vendor", 4 "vendor": "$string:app_vendor",
5 - "versionCode": 7393,  
6 - "versionName": "7.3.9.3", 5 + "versionCode": 7394,
  6 + "versionName": "7.3.9.4",
7 "icon": "$media:app_icon", 7 "icon": "$media:app_icon",
8 "label": "$string:app_name" 8 "label": "$string:app_name"
9 } 9 }
1 import { ContentDetailDTO, LiveRoomItemBean } from 'wdBean/Index'; 1 import { ContentDetailDTO, LiveRoomItemBean } from 'wdBean/Index';
2 -import { Logger, StringUtils } from 'wdKit/Index'; 2 +import { Logger, StringUtils, WindowModel } from 'wdKit/Index';
3 import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; 3 import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
4 import { PlayUIComponent } from './PlayUIComponent'; 4 import { PlayUIComponent } from './PlayUIComponent';
5 import { PictureLoading } from '../../vertical/PictureLoading'; 5 import { PictureLoading } from '../../vertical/PictureLoading';
@@ -7,6 +7,7 @@ import { TrackConstants } from 'wdTracking/Index'; @@ -7,6 +7,7 @@ import { TrackConstants } from 'wdTracking/Index';
7 import { LiveDetailPageLogic } from '../../../viewModel/LiveDetailPageLogic'; 7 import { LiveDetailPageLogic } from '../../../viewModel/LiveDetailPageLogic';
8 import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index'; 8 import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
9 import { LiveMessageOptType } from 'wdBean/src/main/ets/bean/live/LiveRoomBean'; 9 import { LiveMessageOptType } from 'wdBean/src/main/ets/bean/live/LiveRoomBean';
  10 +import { window } from '@kit.ArkUI';
10 11
11 const TAG: string = 'TopPlayComponent' 12 const TAG: string = 'TopPlayComponent'
12 13
@@ -42,6 +43,11 @@ export struct TopPlayComponent { @@ -42,6 +43,11 @@ export struct TopPlayComponent {
42 @Prop @Watch("liveIMControlMessageChange") lastLiveControl: LiveRoomItemBean = {} as LiveRoomItemBean // IM 控制消息 43 @Prop @Watch("liveIMControlMessageChange") lastLiveControl: LiveRoomItemBean = {} as LiveRoomItemBean // IM 控制消息
43 ///是否是手动点击暂停,手动暂停的,页面重新出现时,不自动恢复播放 44 ///是否是手动点击暂停,手动暂停的,页面重新出现时,不自动恢复播放
44 manualClickPauseOrPlay: boolean = false 45 manualClickPauseOrPlay: boolean = false
  46 + private windowClass?: window.Window
  47 + private screenWidth: number = 0
  48 + @State isZDP: boolean = false // 是否折叠屏 默认false
  49 + @State windowWidth: number = AppStorage.get<number>('windowWidth') || 0
  50 +
45 pageShowChange() { 51 pageShowChange() {
46 if (this.manualClickPauseOrPlay) { 52 if (this.manualClickPauseOrPlay) {
47 return 53 return
@@ -81,6 +87,21 @@ export struct TopPlayComponent { @@ -81,6 +87,21 @@ export struct TopPlayComponent {
81 } 87 }
82 } 88 }
83 this.updateData() 89 this.updateData()
  90 +
  91 + this.windowClass = WindowModel.shared.getWindowClass(); // 获取应用主窗口
  92 + this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width
  93 + console.log('ENewspaperPageComponent this.screenWidth', this.screenWidth)
  94 + // 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
  95 + this.isZDP = this.screenWidth > 2000 ? true : false
  96 + this.resizeWindow()
  97 + }
  98 +
  99 + resizeWindow() {
  100 + this.windowClass?.on('windowSizeChange', () => {
  101 + this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width || this.windowWidth
  102 + // 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
  103 + this.isZDP = this.screenWidth > 2000 ? true : false
  104 + });
84 } 105 }
85 106
86 /** 107 /**
@@ -242,13 +263,14 @@ export struct TopPlayComponent { @@ -242,13 +263,14 @@ export struct TopPlayComponent {
242 } else { 263 } else {
243 // 直播房间图 264 // 直播房间图
244 Image(this.previewUrl) 265 Image(this.previewUrl)
245 - .objectFit(ImageFit.Cover) 266 + .objectFit(this.isZDP ? ImageFit.Contain : ImageFit.Fill)
246 .alt($r('app.media.live_room_image_fail')) 267 .alt($r('app.media.live_room_image_fail'))
247 .visibility(this.isWait || this.isEnd ? Visibility.Visible : 268 .visibility(this.isWait || this.isEnd ? Visibility.Visible :
248 Visibility.None)// .contrast(this.isEnd ? 0.4 : 1) 269 Visibility.None)// .contrast(this.isEnd ? 0.4 : 1)
249 .blur(this.isEnd ? 20 : 0) 270 .blur(this.isEnd ? 20 : 0)
250 .width('100%') 271 .width('100%')
251 272
  273 +
252 if (this.liveDetailPageLogic.showPad) { 274 if (this.liveDetailPageLogic.showPad) {
253 // 有垫片 275 // 有垫片
254 if (this.liveDetailPageLogic.padImageUri.length > 0) { 276 if (this.liveDetailPageLogic.padImageUri.length > 0) {