wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix |> 修复直播结束页面,不存在人民号信息时,有人民号头像边框问题
  fix |> 修复从直播详情返回后,列表上上直播中动画消失问题
  fix seek后滑块会回退
  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 }
@@ -72,7 +72,7 @@ export struct PlayUIComponent { @@ -72,7 +72,7 @@ export struct PlayUIComponent {
72 72
73 aboutToDisappear(): void { 73 aboutToDisappear(): void {
74 if (this.contentDetailData.liveInfo?.liveState == 'running') { 74 if (this.contentDetailData.liveInfo?.liveState == 'running') {
75 - lottie.destroy('live_status_wait') 75 + // lottie.destroy('live_status_wait')
76 } 76 }
77 } 77 }
78 78
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) {
@@ -136,16 +136,17 @@ export struct PlayerEndView { @@ -136,16 +136,17 @@ export struct PlayerEndView {
136 .height(254) 136 .height(254)
137 .backgroundColor('#999999') 137 .backgroundColor('#999999')
138 .borderRadius(4) 138 .borderRadius(4)
139 -  
140 - Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)  
141 - .width(80)  
142 - .height(80)  
143 - .borderRadius(40)  
144 - .borderWidth(1)  
145 - .borderColor(Color.White)  
146 - .borderStyle(BorderStyle.Solid)  
147 - .position({ x: '50%', y: 0 })  
148 - .markAnchor({ x: '50%', y: '50%' }) 139 + if (this.contentDetailData.rmhInfo != null) {
  140 + Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
  141 + .width(80)
  142 + .height(80)
  143 + .borderRadius(40)
  144 + .borderWidth(1)
  145 + .borderColor(Color.White)
  146 + .borderStyle(BorderStyle.Solid)
  147 + .position({ x: '50%', y: 0 })
  148 + .markAnchor({ x: '50%', y: '50%' })
  149 + }
149 } 150 }
150 .width(307) 151 .width(307)
151 .padding({ top: 40 }) 152 .padding({ top: 40 })
@@ -35,7 +35,8 @@ export struct PlayerTitleComponent { @@ -35,7 +35,8 @@ export struct PlayerTitleComponent {
35 } 35 }
36 aboutToDisappear(): void { 36 aboutToDisappear(): void {
37 if (this.contentDetailData.liveInfo?.liveState == 'running') { 37 if (this.contentDetailData.liveInfo?.liveState == 'running') {
38 - lottie.destroy('live_status_wait') 38 + ///lottieView身上已经有单独不展示时处理销毁,不用单独在销毁了,会影响展现组件列表上相同名称的动画展示
  39 + // lottie.destroy('live_status_wait')
39 } 40 }
40 } 41 }
41 42
@@ -19,10 +19,13 @@ export struct PlayerFullScreenView { @@ -19,10 +19,13 @@ export struct PlayerFullScreenView {
19 private timer: number = -1 19 private timer: number = -1
20 @State upProVal: string = '' 20 @State upProVal: string = ''
21 @State duration: string = DateTimeUtils.secondToTime(this.videoDuration) 21 @State duration: string = DateTimeUtils.secondToTime(this.videoDuration)
22 - @State startX:number = 0  
23 - @State endX:number = 0  
24 - @State panDirection:number = 1 //1左滑 2右滑  
25 - private panDistance:number = 0 22 + @State startX: number = 0
  23 + @State endX: number = 0
  24 + @State panDirection: number = 1 //1左滑 2右滑
  25 + private panDistance: number = 0
  26 + private touchDownX: number = 0
  27 + private touchUpX: number = 0
  28 + @State isTouched: boolean = false
26 29
27 getTitle() { 30 getTitle() {
28 return this.contentDetailData?.newsTitle 31 return this.contentDetailData?.newsTitle
@@ -156,11 +159,14 @@ export struct PlayerFullScreenView { @@ -156,11 +159,14 @@ export struct PlayerFullScreenView {
156 159
157 PlayerProgressFullScreenView({ playerController: this.playerController }).layoutWeight(1) 160 PlayerProgressFullScreenView({ playerController: this.playerController }).layoutWeight(1)
158 .onTouch((event?: TouchEvent) => { 161 .onTouch((event?: TouchEvent) => {
  162 +
159 if (event) { 163 if (event) {
160 if (event.type === TouchType.Down) { 164 if (event.type === TouchType.Down) {
  165 + // console.info(`cj2024 onTouch Down x=${event?.tiltX}`)
161 clearInterval(this.timer) 166 clearInterval(this.timer)
162 } 167 }
163 if (event.type === TouchType.Up) { 168 if (event.type === TouchType.Up) {
  169 + // console.info(`cj2024 onTouch Up x=${event?.tiltX}`)
164 this.restartTimer(); 170 this.restartTimer();
165 } 171 }
166 } 172 }
@@ -202,7 +208,7 @@ export struct PlayerFullScreenView { @@ -202,7 +208,7 @@ export struct PlayerFullScreenView {
202 .margin({ top: 73, bottom: 73 }) 208 .margin({ top: 73, bottom: 73 })
203 // .backgroundColor('#FF0000') 209 // .backgroundColor('#FF0000')
204 .onClick(() => { 210 .onClick(() => {
205 - Logger.warn(`cj2024 onClick showOperator=${this.showOperator}`) 211 + Logger.warn(`cj2024 onClick showOperator=${this.showOperator}`)
206 if (!this.isDragging) { 212 if (!this.isDragging) {
207 if (this.showOperator == false) { 213 if (this.showOperator == false) {
208 this.restartTimer(); 214 this.restartTimer();
@@ -241,7 +247,8 @@ export struct PlayerFullScreenView { @@ -241,7 +247,8 @@ export struct PlayerFullScreenView {
241 this.endX = event.offsetX 247 this.endX = event.offsetX
242 } 248 }
243 this.panDirection = this.endX - this.startX > 0 ? 2 : 1 249 this.panDirection = this.endX - this.startX > 0 ? 2 : 1
244 - Logger.warn(`cj2024 pan end panDirection = ${this.panDirection} this.progressVal = ${this.progressVal} dir=${this.endX - this.startX}`) 250 + Logger.warn(`cj2024 pan end panDirection = ${this.panDirection} this.progressVal = ${this.progressVal} dir=${this.endX -
  251 + this.startX}`)
245 if (Math.abs(this.endX - this.startX) < 100) { 252 if (Math.abs(this.endX - this.startX) < 100) {
246 this.panDistance = 1 253 this.panDistance = 1
247 } else { 254 } else {
@@ -254,7 +261,7 @@ export struct PlayerFullScreenView { @@ -254,7 +261,7 @@ export struct PlayerFullScreenView {
254 this.progressVal = 0 261 this.progressVal = 0
255 } 262 }
256 } else { 263 } else {
257 - if (this.progressVal <100) { 264 + if (this.progressVal < 100) {
258 this.progressVal += this.panDistance 265 this.progressVal += this.panDistance
259 } else { 266 } else {
260 this.progressVal = 100 267 this.progressVal = 100
@@ -285,7 +292,11 @@ export struct PlayerFullScreenView { @@ -285,7 +292,11 @@ export struct PlayerFullScreenView {
285 .width('100%') 292 .width('100%')
286 .height('100%') 293 .height('100%')
287 .onChange((value: number, mode: SliderChangeMode) => { 294 .onChange((value: number, mode: SliderChangeMode) => {
  295 + // if (this.isTouched) {
  296 + // return
  297 + // }
288 this.progressVal = value 298 this.progressVal = value
  299 + // console.log('cj2024 onChange slider value:', value)
289 if (mode === SliderChangeMode.Moving) { 300 if (mode === SliderChangeMode.Moving) {
290 this.isDragging = true 301 this.isDragging = true
291 } 302 }
@@ -293,20 +304,33 @@ export struct PlayerFullScreenView { @@ -293,20 +304,33 @@ export struct PlayerFullScreenView {
293 this.isDragging = false 304 this.isDragging = false
294 this.playerController?.setSeekTime(this.progressVal, SliderChangeMode.End); 305 this.playerController?.setSeekTime(this.progressVal, SliderChangeMode.End);
295 } 306 }
296 -  
297 - console.log('Transparent slider value:', value)  
298 }) 307 })
299 }.margin({ top: 73, bottom: 73 }) 308 }.margin({ top: 73, bottom: 73 })
300 .onTouch((event?: TouchEvent) => { 309 .onTouch((event?: TouchEvent) => {
  310 + // console.log(`cj2024 onTouch isDragging = ${this.isDragging}`)
  311 + if (this.isDragging) {
  312 + return
  313 + }
301 if (event) { 314 if (event) {
302 if (event.type === TouchType.Down) { 315 if (event.type === TouchType.Down) {
  316 + // console.info(`cj2024 onTouch Down x=${event?.touches[0].x}`)
  317 + if (event?.touches.length > 0) {
  318 + this.touchDownX = event?.touches[0].x
  319 + }
303 clearInterval(this.timer) 320 clearInterval(this.timer)
304 } 321 }
305 if (event.type === TouchType.Up) { 322 if (event.type === TouchType.Up) {
  323 + // console.info(`cj2024 onTouch Up x=${event?.touches[0].x}`)
  324 + if (event?.touches.length > 0) {
  325 + this.touchUpX = event?.touches[0].x
  326 + this.isTouched = this.touchUpX == this.touchDownX ? true : false
  327 + }
306 if (this.showOperator == false) { 328 if (this.showOperator == false) {
307 this.restartTimer(); 329 this.restartTimer();
308 } else { 330 } else {
309 - this.showOperator = false 331 + if (this.isTouched) {
  332 + this.showOperator = false
  333 + }
310 } 334 }
311 } 335 }
312 } 336 }
@@ -341,9 +341,12 @@ export class WDPlayerController { @@ -341,9 +341,12 @@ export class WDPlayerController {
341 // 100 / 1000)); 341 // 100 / 1000));
342 } 342 }
343 if (mode === SliderChangeMode.End) { 343 if (mode === SliderChangeMode.End) {
  344 + // Logger.warn(`cj2024 seekTime = ${value}`)
  345 + // Logger.warn(`cj2024 duration = ${this.duration}`)
344 this.seekTime = Math.floor(value * this.duration / 100); 346 this.seekTime = Math.floor(value * this.duration / 100);
  347 + // Logger.warn(`cj2024 seekTime = ${this.seekTime}`)
345 this.currentPlayTime = this.seekTime 348 this.currentPlayTime = this.seekTime
346 - this.avPlayer?.seek(this.seekTime); 349 + this.avPlayer?.seek(this.seekTime,media.SeekMode.SEEK_CLOSEST);
347 } 350 }
348 } 351 }
349 async setSeekMicroSecondsTime(value: number) { 352 async setSeekMicroSecondsTime(value: number) {