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: 1)无网络进入直播预告和直播列表页,未显示无网络缺省图
  fix(时间轴专题):骨架图顶部适配
@@ -648,7 +648,7 @@ export struct DynamicDetailComponent { @@ -648,7 +648,7 @@ export struct DynamicDetailComponent {
648 { 648 {
649 contentId: this.contentDetailData?.newsId + '', 649 contentId: this.contentDetailData?.newsId + '',
650 contentType: this.contentDetailData?.newsType + '', 650 contentType: this.contentDetailData?.newsType + '',
651 - contentRelId: this.contentDetailData?.reLInfo?.relId + '', 651 + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
652 } 652 }
653 ] 653 ]
654 } 654 }
@@ -95,7 +95,7 @@ export struct ImageAndTextPageComponent { @@ -95,7 +95,7 @@ export struct ImageAndTextPageComponent {
95 if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) { 95 if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) {
96 Row() { 96 Row() {
97 Row() { 97 Row() {
98 - if (this.newsStatusOfUser?.likeStatus === '1') { 98 + if (this.newsStatusOfUser?.likeStatus == '1') {
99 Image(this.contentDetailData?.likesStyle === 1 ? $r('app.media.ic_like_check') : 99 Image(this.contentDetailData?.likesStyle === 1 ? $r('app.media.ic_like_check') :
100 (this.contentDetailData?.likesStyle === 2 ? $r('app.media.icon_prayer_active') : 100 (this.contentDetailData?.likesStyle === 2 ? $r('app.media.icon_prayer_active') :
101 $r('app.media.icon_candle_active'))) 101 $r('app.media.icon_candle_active')))
@@ -112,7 +112,7 @@ export struct ImageAndTextPageComponent { @@ -112,7 +112,7 @@ export struct ImageAndTextPageComponent {
112 if (this.likeNum > 0) { 112 if (this.likeNum > 0) {
113 Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum)) 113 Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum))
114 .fontSize(16) 114 .fontSize(16)
115 - .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') 115 + .fontColor(this.newsStatusOfUser?.likeStatus == '1' ? '#ED2800' : '#999999')
116 .fontWeight(500) 116 .fontWeight(500)
117 .margin({ left: 5 }) 117 .margin({ left: 5 })
118 } 118 }
@@ -343,7 +343,7 @@ export struct ImageAndTextPageComponent { @@ -343,7 +343,7 @@ export struct ImageAndTextPageComponent {
343 { 343 {
344 contentId: this.contentDetailData?.newsId + '', 344 contentId: this.contentDetailData?.newsId + '',
345 contentType: this.contentDetailData?.newsType + '', 345 contentType: this.contentDetailData?.newsType + '',
346 - contentRelId: this.contentDetailData?.reLInfo?.relId + '', 346 + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
347 } 347 }
348 ] 348 ]
349 } 349 }
@@ -367,7 +367,7 @@ export struct ImageAndTextPageComponent { @@ -367,7 +367,7 @@ export struct ImageAndTextPageComponent {
367 return 367 return
368 } 368 }
369 const params: postExecuteLikeParams = { 369 const params: postExecuteLikeParams = {
370 - status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1', 370 + status: this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1',
371 contentId: this.contentDetailData?.newsId + '', 371 contentId: this.contentDetailData?.newsId + '',
372 contentType: this.contentDetailData?.newsType + '', 372 contentType: this.contentDetailData?.newsType + '',
373 } 373 }
@@ -375,7 +375,7 @@ export struct ImageAndTextPageComponent { @@ -375,7 +375,7 @@ export struct ImageAndTextPageComponent {
375 console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',) 375 console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',)
376 if (this.newsStatusOfUser) { 376 if (this.newsStatusOfUser) {
377 //内容点赞、取消点赞Tracking 1点赞 0取消点赞 377 //内容点赞、取消点赞Tracking 1点赞 0取消点赞
378 - TrackingContent.like(this.newsStatusOfUser?.likeStatus === '1', TrackConstants.PageName.My, TrackConstants.PageName.My) 378 + TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
379 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' 379 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
380 this.queryContentInteractCount() 380 this.queryContentInteractCount()
381 } 381 }
@@ -395,6 +395,7 @@ export struct ImageAndTextPageComponent { @@ -395,6 +395,7 @@ export struct ImageAndTextPageComponent {
395 }] 395 }]
396 } 396 }
397 PageRepository.getContentInteract(params).then(res => { 397 PageRepository.getContentInteract(params).then(res => {
  398 + console.error(TAG, 'res', JSON.stringify(res))
398 if (res.data) { 399 if (res.data) {
399 this.interactData = res.data[0] 400 this.interactData = res.data[0]
400 this.likeNum = Number(res.data[0]?.likeNum) || 0 401 this.likeNum = Number(res.data[0]?.likeNum) || 0
@@ -17,6 +17,7 @@ import { CommentDialogView } from './CommentDialogView'; @@ -17,6 +17,7 @@ import { CommentDialogView } from './CommentDialogView';
17 17
18 const TAG: string = 'SpacialTopicPageComponent' 18 const TAG: string = 'SpacialTopicPageComponent'
19 19
  20 +//专题详情页
20 @Component 21 @Component
21 export struct SpacialTopicPageComponent { 22 export struct SpacialTopicPageComponent {
22 webviewControl: BridgeWebViewControl = new BridgeWebViewControl() 23 webviewControl: BridgeWebViewControl = new BridgeWebViewControl()
@@ -38,6 +39,7 @@ export struct SpacialTopicPageComponent { @@ -38,6 +39,7 @@ export struct SpacialTopicPageComponent {
38 @State operationButtonList: string[] = ['comment', 'collect', 'share'] 39 @State operationButtonList: string[] = ['comment', 'collect', 'share']
39 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 40 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
40 @State isNetConnected: boolean = true 41 @State isNetConnected: boolean = true
  42 + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
41 43
42 private trySendData2H5() { 44 private trySendData2H5() {
43 if (!this.webPrepared || !this.dataPrepared) { 45 if (!this.webPrepared || !this.dataPrepared) {
@@ -189,7 +191,7 @@ export struct SpacialTopicPageComponent { @@ -189,7 +191,7 @@ export struct SpacialTopicPageComponent {
189 }).padding({ bottom: 200 }) 191 }).padding({ bottom: 200 })
190 } else { 192 } else {
191 if (!this.isPageEnd) { 193 if (!this.isPageEnd) {
192 - detailedSkeleton().padding({ bottom: this.bottomSafeHeight }) 194 + detailedSkeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight })
193 } 195 }
194 } 196 }
195 //底部交互区 197 //底部交互区
1 import { ContentDTO, LiveRoomDataBean } from 'wdBean'; 1 import { ContentDTO, LiveRoomDataBean } from 'wdBean';
2 import { ProcessUtils } from 'wdRouter'; 2 import { ProcessUtils } from 'wdRouter';
3 import PageViewModel from '../../viewmodel/PageViewModel'; 3 import PageViewModel from '../../viewmodel/PageViewModel';
4 -import { DateTimeUtils, LazyDataSource, Logger } from 'wdKit/Index'; 4 +import { DateTimeUtils, LazyDataSource, Logger, NetworkUtil } from 'wdKit/Index';
5 import { router } from '@kit.ArkUI'; 5 import { router } from '@kit.ArkUI';
6 import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType'; 6 import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType';
7 import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; 7 import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
8 import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; 8 import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
9 -import { EmptyComponent } from '../view/EmptyComponent'; 9 +import { EmptyComponent, WDViewDefaultType } from '../view/EmptyComponent';
10 import { ErrorComponent } from '../view/ErrorComponent'; 10 import { ErrorComponent } from '../view/ErrorComponent';
11 import LoadMoreLayout from '../page/LoadMoreLayout'; 11 import LoadMoreLayout from '../page/LoadMoreLayout';
12 import { LottieView } from '../../components/lottie/LottieView'; 12 import { LottieView } from '../../components/lottie/LottieView';
13 import dataPreferences from '@ohos.data.preferences'; 13 import dataPreferences from '@ohos.data.preferences';
14 import { BusinessError } from '@ohos.base'; 14 import { BusinessError } from '@ohos.base';
15 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 15 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  16 +import { channelSkeleton } from '../skeleton/channelSkeleton';
16 17
17 const TAG: string = 'LiveMorePage'; 18 const TAG: string = 'LiveMorePage';
18 19
@@ -41,12 +42,13 @@ struct LiveMorePage { @@ -41,12 +42,13 @@ struct LiveMorePage {
41 @State private hasMore: boolean = true 42 @State private hasMore: boolean = true
42 @State private currentPage: number = 1 43 @State private currentPage: number = 1
43 @State private isLoading: boolean = false 44 @State private isLoading: boolean = false
44 - @State viewType: ViewType = ViewType.LOADING  
45 private scroller: Scroller = new Scroller() 45 private scroller: Scroller = new Scroller()
46 @State liveRoomList: LiveRoomDataBean[] = [] 46 @State liveRoomList: LiveRoomDataBean[] = []
47 // 点击过的数据 47 // 点击过的数据
48 @State clickDatas: Array<string> = [] 48 @State clickDatas: Array<string> = []
49 @State loadImg: boolean = false; 49 @State loadImg: boolean = false;
  50 + @State viewType: ViewType = ViewType.LOADING
  51 + emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
50 52
51 async aboutToAppear(): Promise<void> { 53 async aboutToAppear(): Promise<void> {
52 await this.getPreferencesFromStorage() 54 await this.getPreferencesFromStorage()
@@ -63,15 +65,14 @@ struct LiveMorePage { @@ -63,15 +65,14 @@ struct LiveMorePage {
63 this.TabbarNormal() 65 this.TabbarNormal()
64 if (this.viewType == ViewType.LOADING) { 66 if (this.viewType == ViewType.LOADING) {
65 this.LoadingLayout() 67 this.LoadingLayout()
66 - } else if (this.viewType == ViewType.ERROR) {  
67 - ErrorComponent()  
68 - .onTouch(() => {  
69 - if (this.viewType === ViewType.ERROR) {  
70 - this.getData()  
71 - }  
72 - })  
73 - } else if (this.viewType == ViewType.EMPTY) {  
74 - EmptyComponent() 68 + } else if (this.viewType == ViewType.EMPTY || this.viewType == ViewType.ERROR) {
  69 + EmptyComponent({
  70 + emptyType: this.emptyType,
  71 + emptyButton: true,
  72 + retry: () => {
  73 + this.getData()
  74 + }
  75 + })
75 } else { 76 } else {
76 CustomPullToRefresh({ 77 CustomPullToRefresh({
77 alldata: this.data, 78 alldata: this.data,
@@ -91,13 +92,15 @@ struct LiveMorePage { @@ -91,13 +92,15 @@ struct LiveMorePage {
91 .padding({ 92 .padding({
92 left: $r('app.float.card_comp_pagePadding_lf'), 93 left: $r('app.float.card_comp_pagePadding_lf'),
93 right: $r('app.float.card_comp_pagePadding_lf'), 94 right: $r('app.float.card_comp_pagePadding_lf'),
94 - top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight) 95 + top: px2vp(this.topSafeHeight),
  96 + bottom: px2vp(this.bottomSafeHeight)
95 }) 97 })
96 98
97 } 99 }
98 100
99 @Builder 101 @Builder
100 LoadingLayout() { 102 LoadingLayout() {
  103 + channelSkeleton()
101 } 104 }
102 105
103 @Builder 106 @Builder
@@ -208,6 +211,7 @@ struct LiveMorePage { @@ -208,6 +211,7 @@ struct LiveMorePage {
208 /*导航栏*/ 211 /*导航栏*/
209 @Builder 212 @Builder
210 TabbarNormal() { 213 TabbarNormal() {
  214 +
211 RelativeContainer() { 215 RelativeContainer() {
212 //标题栏目 216 //标题栏目
213 Image($r('app.media.icon_arrow_left')) 217 Image($r('app.media.icon_arrow_left'))
@@ -223,7 +227,7 @@ struct LiveMorePage { @@ -223,7 +227,7 @@ struct LiveMorePage {
223 router.back() 227 router.back()
224 }) 228 })
225 229
226 - Text(this.title)// .height('42lpx') 230 + Text(this.title)
227 .maxLines(1) 231 .maxLines(1)
228 .id("title") 232 .id("title")
229 .fontSize('18vp') 233 .fontSize('18vp')
@@ -298,6 +302,18 @@ struct LiveMorePage { @@ -298,6 +302,18 @@ struct LiveMorePage {
298 } 302 }
299 return 303 return
300 } 304 }
  305 +
  306 + // 检测网络
  307 + let netStatus = NetworkUtil.isNetConnected()
  308 + if (!netStatus) {
  309 +
  310 + this.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork
  311 + this.viewType = ViewType.ERROR
  312 +
  313 + return
  314 + }
  315 +
  316 +
301 this.isLoading = true 317 this.isLoading = true
302 try { 318 try {
303 const liveReviewDTO = await PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize) 319 const liveReviewDTO = await PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize)
@@ -319,17 +335,12 @@ struct LiveMorePage { @@ -319,17 +335,12 @@ struct LiveMorePage {
319 this.resolveEnd(true, resolve) 335 this.resolveEnd(true, resolve)
320 if (liveReviewDTO.list.length == 0 && this.currentPage == 1) { 336 if (liveReviewDTO.list.length == 0 && this.currentPage == 1) {
321 this.viewType = ViewType.EMPTY 337 this.viewType = ViewType.EMPTY
  338 + this.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent
322 } 339 }
323 } catch (exception) { 340 } catch (exception) {
324 this.resolveEnd(false, resolve) 341 this.resolveEnd(false, resolve)
325 } 342 }
326 - // PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then(async (liveReviewDTO) => {  
327 - // // this.operDataList = []  
328 - // // this.operDataList.push(...liveReviewDTO.list)  
329 - // this.data.push(...liveReviewDTO.list)  
330 - //  
331 - // // this.getAppointmentInfo()  
332 - // }) 343 +
333 } 344 }
334 345
335 private resolveEnd(isTop: boolean, resolve?: (value: string | PromiseLike<string>) => void) { 346 private resolveEnd(isTop: boolean, resolve?: (value: string | PromiseLike<string>) => void) {
@@ -341,7 +352,9 @@ struct LiveMorePage { @@ -341,7 +352,9 @@ struct LiveMorePage {
341 } 352 }
342 } 353 }
343 if (this.currentPage == 1 && !isTop) { 354 if (this.currentPage == 1 && !isTop) {
  355 +
344 this.viewType = ViewType.ERROR 356 this.viewType = ViewType.ERROR
  357 + this.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent
345 } else { 358 } else {
346 this.viewType = ViewType.LOADED 359 this.viewType = ViewType.LOADED
347 } 360 }
1 -import { EmptyComponent } from '../view/EmptyComponent'  
2 -  
3 -@Entry  
4 -@Component  
5 -export struct DefaultPage {  
6 - @State type: number = 15  
7 -  
8 - retry() {  
9 - console.log('daj点击了重试')  
10 - }  
11 -  
12 - build() {  
13 - Row() {  
14 - EmptyComponent({  
15 - emptyType: this.type,  
16 - retry: () => {  
17 - this.retry()  
18 - }  
19 - })  
20 - // .height('612lpx')  
21 - // .width('100%')  
22 - }  
23 - }  
24 -}  
@@ -96,17 +96,11 @@ export struct EmptyComponent { @@ -96,17 +96,11 @@ export struct EmptyComponent {
96 } 96 }
97 } 97 }
98 98
99 - onPageShow(): void {  
100 - this.createTimer()  
101 - }  
102 99
103 aboutToAppear(): void { 100 aboutToAppear(): void {
104 this.createTimer() 101 this.createTimer()
105 } 102 }
106 103
107 - onPageHide(): void {  
108 - this.destroyTimer()  
109 - }  
110 104
111 aboutToDisappear() { 105 aboutToDisappear() {
112 this.destroyTimer() 106 this.destroyTimer()
@@ -43,6 +43,7 @@ export struct DetailPlayShortVideoPage { @@ -43,6 +43,7 @@ export struct DetailPlayShortVideoPage {
43 @Consume @Watch("showCommentListChanged") showCommentList: boolean 43 @Consume @Watch("showCommentListChanged") showCommentList: boolean
44 @Consume displayDirection: DisplayDirection 44 @Consume displayDirection: DisplayDirection
45 @Consume @Watch('videoStatusChange') switchVideoStatus: boolean 45 @Consume @Watch('videoStatusChange') switchVideoStatus: boolean
  46 + @State isPlay: boolean = true // 视频手动播放暂停
46 @Consume @Watch('pageShowChange') pageShow: number 47 @Consume @Watch('pageShowChange') pageShow: number
47 @Consume windowWidth: number 48 @Consume windowWidth: number
48 @Consume windowHeight: number 49 @Consume windowHeight: number
@@ -61,7 +62,7 @@ export struct DetailPlayShortVideoPage { @@ -61,7 +62,7 @@ export struct DetailPlayShortVideoPage {
61 async pageShowChange() { 62 async pageShowChange() {
62 if (this.currentIndex === this.index) { 63 if (this.currentIndex === this.index) {
63 this.queryNewsInfoOfUser() 64 this.queryNewsInfoOfUser()
64 - if (this.switchVideoStatus) { 65 + if (this.switchVideoStatus && this.isPlay) {
65 await this.playerController.play() 66 await this.playerController.play()
66 this.imageVisible = false 67 this.imageVisible = false
67 } 68 }
@@ -74,7 +75,7 @@ export struct DetailPlayShortVideoPage { @@ -74,7 +75,7 @@ export struct DetailPlayShortVideoPage {
74 */ 75 */
75 async videoStatusChange() { 76 async videoStatusChange() {
76 if (this.currentIndex === this.index) { 77 if (this.currentIndex === this.index) {
77 - if (this.switchVideoStatus) { 78 + if (this.switchVideoStatus && this.isPlay) {
78 await this.playerController.play() 79 await this.playerController.play()
79 this.imageVisible = false 80 this.imageVisible = false
80 } else { 81 } else {
@@ -183,14 +184,6 @@ export struct DetailPlayShortVideoPage { @@ -183,14 +184,6 @@ export struct DetailPlayShortVideoPage {
183 } 184 }
184 if (this.contentDetailData.newsType == 1) { 185 if (this.contentDetailData.newsType == 1) {
185 this.PageName = TrackConstants.PageName.VideoDetail // 点播 186 this.PageName = TrackConstants.PageName.VideoDetail // 点播
186 - } else if (this.contentDetailData.newsType == 2) {  
187 - this.PageName = TrackConstants.PageName.Live_Detail // 直播  
188 - } else if (this.contentDetailData.newsType == 5) {  
189 - this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页  
190 - } else if (this.contentDetailData.newsType == 8) {  
191 - this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页  
192 - } else if (this.contentDetailData.newsType == 9) {  
193 - this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页  
194 } else if (this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) { 187 } else if (this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {
195 this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频 188 this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频
196 } 189 }
@@ -268,6 +261,13 @@ export struct DetailPlayShortVideoPage { @@ -268,6 +261,13 @@ export struct DetailPlayShortVideoPage {
268 .layoutWeight(1) 261 .layoutWeight(1)
269 .onClick(() => { 262 .onClick(() => {
270 this.playerController?.switchPlayOrPause(); 263 this.playerController?.switchPlayOrPause();
  264 + this.playerController.onStatusChange = (status: number) => {
  265 + if (status === PlayerConstants.STATUS_PAUSE) {
  266 + this.isPlay = false
  267 + } else if(status === PlayerConstants.STATUS_START) {
  268 + this.isPlay = true
  269 + }
  270 + }
271 }) 271 })
272 272
273 // 显示评论且非全屏模式(视频频道无评论showComment=false) 273 // 显示评论且非全屏模式(视频频道无评论showComment=false)
@@ -140,8 +140,6 @@ export struct VideoChannelDetail { @@ -140,8 +140,6 @@ export struct VideoChannelDetail {
140 // navigationBarColor: '#000000', 140 // navigationBarColor: '#000000',
141 // navigationBarContentColor: '#ffffff' 141 // navigationBarContentColor: '#ffffff'
142 }) 142 })
143 - // WindowModel.shared.setWindowLayoutFullScreen(true)  
144 - // WindowModel.shared.setWindowSystemBarEnable([])  
145 } 143 }
146 144
147 /** 145 /**
@@ -156,8 +154,6 @@ export struct VideoChannelDetail { @@ -156,8 +154,6 @@ export struct VideoChannelDetail {
156 // navigationBarContentColor: '#0xE5FFFFFF' 154 // navigationBarContentColor: '#0xE5FFFFFF'
157 155
158 }) 156 })
159 - // WindowModel.shared.setWindowLayoutFullScreen(false)  
160 - // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])  
161 } 157 }
162 158
163 onBackPress(): boolean | void { 159 onBackPress(): boolean | void {