wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  ref |> 调整竖屏直播结束页面已关注样式
  ref |> 横屏直播详情无回放时,不展示参与人数
  ref |> 优化竖屏直播结束页面布局
  ref |> 调整竖屏直播结束页面布局
  fix: 号主:甘肃发布,动态视频详情页点击视频,先闪一下获取内容失败,再继续播放视频
  fix |> 修复稿件详情页评论区域滚动到可视区域的问题
  fix |> 17456 无网络号主作品列表缺省图鸿蒙与安卓不一致
  fix: 19083 一多适配--折叠屏,金刚位应等分展示
  fix |> 消息偶现闪退,增加非空判断
  fix: 20451 金刚位-缺少下分割线
  ref |> 调整竖屏直播结束背景样式
  fix: 20455 大专题卡-引用稿件无评论评数,来源右侧多个
  fix |> 17457 无网络时进入协议节目鸿蒙与安卓显示不一致
  fix: 直播预约卡大图border
@@ -65,7 +65,6 @@ export struct ImageAndTextPageComponent { @@ -65,7 +65,6 @@ export struct ImageAndTextPageComponent {
65 @State reachEndIncreament: number = 0 65 @State reachEndIncreament: number = 0
66 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 66 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
67 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 67 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
68 - @State isScrollTop: boolean = true  
69 @State offsetY: number = 0 68 @State offsetY: number = 0
70 @State executedStartTime: number = new Date().getTime() 69 @State executedStartTime: number = new Date().getTime()
71 private screenHeight: number = 0 70 private screenHeight: number = 0
@@ -208,8 +207,9 @@ export struct ImageAndTextPageComponent { @@ -208,8 +207,9 @@ export struct ImageAndTextPageComponent {
208 207
209 .onAreaChange((oldValue: Area, newValue: Area) => { 208 .onAreaChange((oldValue: Area, newValue: Area) => {
210 this.info = newValue 209 this.info = newValue
211 - // console.log(TAG, "总页面滑动偏移量", this.scroller.currentOffset().yOffset)  
212 - // console.log(TAG, "总页面滑动偏移量111", newValue.globalPosition.y as number) 210 + // console.log(TAG, ">>>>>当前页面滚动位置:", this.scroller.currentOffset().yOffset)
  211 + // console.log(TAG, ">>>>>当前评论区位置:", newValue.globalPosition.y as number)
  212 + // console.log(TAG, ">>>>>当前屏幕宽度和底部高度:", this.screenHeight,this.bottomHeight)
213 this.checkToScrollCommentArea() 213 this.checkToScrollCommentArea()
214 }) 214 })
215 // .onMeasureSize() 215 // .onMeasureSize()
@@ -467,7 +467,7 @@ export struct ImageAndTextPageComponent { @@ -467,7 +467,7 @@ export struct ImageAndTextPageComponent {
467 * 查询点赞、收藏数量 467 * 查询点赞、收藏数量
468 */ 468 */
469 queryContentInteractCount() { 469 queryContentInteractCount() {
470 - console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData)) 470 + // console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
471 471
472 const params: contentInteractParams = { 472 const params: contentInteractParams = {
473 contentId: this.contentDetailData?.newsId + '', 473 contentId: this.contentDetailData?.newsId + '',
@@ -504,16 +504,16 @@ export struct ImageAndTextPageComponent { @@ -504,16 +504,16 @@ export struct ImageAndTextPageComponent {
504 504
505 private pageScrollToCommonent() { 505 private pageScrollToCommonent() {
506 const info = componentUtils.getRectangleById('comment'); 506 const info = componentUtils.getRectangleById('comment');
507 - console.log(TAG, "点击滑动页面", JSON.stringify(info))  
508 //评论区当前位置 507 //评论区当前位置
509 - let currentCommonentOffSetY = this.info?.globalPosition.y as number 508 + let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
  509 + // 当前页面滚动位置
  510 + let currentScrollOffSetY = this.scroller.currentOffset().yOffset
510 let offSetY = 0 511 let offSetY = 0
511 if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) { 512 if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
512 - offSetY = currentCommonentOffSetY-200 513 + offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400
513 } 514 }
514 -  
515 // 定位到评论区域 515 // 定位到评论区域
516 - if (this.isScrollTop) { 516 + if (!this.showMainText) {
517 this.scroller.scrollTo({ 517 this.scroller.scrollTo({
518 xOffset: 0, 518 xOffset: 0,
519 yOffset: offSetY, 519 yOffset: offSetY,
@@ -522,11 +522,10 @@ export struct ImageAndTextPageComponent { @@ -522,11 +522,10 @@ export struct ImageAndTextPageComponent {
522 } else { 522 } else {
523 this.scroller.scrollEdge(Edge.Top) 523 this.scroller.scrollEdge(Edge.Top)
524 } 524 }
525 - this.isScrollTop = !this.isScrollTop  
526 } 525 }
527 526
528 aboutToAppear() { 527 aboutToAppear() {
529 - Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据'); 528 + // Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
530 this.getDetail() 529 this.getDetail()
531 this.screenHeight = DisplayUtils.getDeviceHeight() 530 this.screenHeight = DisplayUtils.getDeviceHeight()
532 this.initAnimationConfig(); 531 this.initAnimationConfig();
@@ -576,8 +575,7 @@ export struct ImageAndTextPageComponent { @@ -576,8 +575,7 @@ export struct ImageAndTextPageComponent {
576 // 需要评论区位置,调用前 请确保它有值 575 // 需要评论区位置,调用前 请确保它有值
577 return 576 return
578 } 577 }
579 - let offSetY = this.info?.globalPosition.y as number -60  
580 - Logger.debug(TAG, "即将滚动至yOffset: " + offSetY) 578 + let offSetY = this.info?.globalPosition.y as number -70
581 if (offSetY >= (this.screenHeight-this.bottomHeight) ) { 579 if (offSetY >= (this.screenHeight-this.bottomHeight) ) {
582 this.showMainText = false 580 this.showMainText = false
583 }else { 581 }else {
@@ -139,6 +139,38 @@ export struct CardSourceInfo { @@ -139,6 +139,38 @@ export struct CardSourceInfo {
139 return parseInt(date) < twoDaysAgo.getTime() 139 return parseInt(date) < twoDaysAgo.getTime()
140 } 140 }
141 141
  142 + showDot() {
  143 + // return (this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
  144 + // this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
  145 + // (this.getContentDtoBean()?.interactData?.commentNum
  146 + // // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''
  147 + // || (this.contentDTO.isSearch || this.contentDTO.isCollection ||
  148 + // !this.contentDTO.isSearch && DateTimeUtils.getCommentTime
  149 + // (Number
  150 + // .parseFloat(this
  151 + // .contentDTO.publishTime))
  152 + // .indexOf
  153 + // ('-') === -1)
  154 + // )
  155 + let flag = false;
  156 + if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) {
  157 + if (this.showTime() && !this.isEllipsisActive) {
  158 + flag = true
  159 + } else if (!this.isEllipsisActive) {
  160 + if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 &&
  161 + this.showCommentNum()) {
  162 + flag = true;
  163 + } else if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) {
  164 + flag = true;
  165 + }
  166 + } else if (this.contentDTO?.author&&this.contentDTO?.author.length > 0) {
  167 + flag = true;
  168 + }
  169 + }
  170 +
  171 + return flag;
  172 + }
  173 +
142 build() { 174 build() {
143 Column(){ 175 Column(){
144 Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) { 176 Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) {
@@ -161,18 +193,7 @@ export struct CardSourceInfo { @@ -161,18 +193,7 @@ export struct CardSourceInfo {
161 } 193 }
162 194
163 // 点 195 // 点
164 - if ((this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&  
165 - this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&  
166 - (this.getContentDtoBean()?.interactData?.commentNum  
167 - // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != ''  
168 - || (this.contentDTO.isSearch || this.contentDTO.isCollection ||  
169 - !this.contentDTO.isSearch && DateTimeUtils.getCommentTime  
170 - (Number  
171 - .parseFloat(this  
172 - .contentDTO.publishTime))  
173 - .indexOf  
174 - ('-') === -1)  
175 - )) { 196 + if (this.showDot()) {
176 197
177 Image($r("app.media.point")) 198 Image($r("app.media.point"))
178 .width(11) 199 .width(11)
@@ -54,7 +54,7 @@ export struct behindDivider { @@ -54,7 +54,7 @@ export struct behindDivider {
54 Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) 54 Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
55 } 55 }
56 } else { 56 } else {
57 - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 57 + Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
58 } 58 }
59 } 59 }
60 } 60 }
@@ -23,9 +23,11 @@ export struct LiveBigImage01Component { @@ -23,9 +23,11 @@ export struct LiveBigImage01Component {
23 @State clicked: boolean = false; 23 @State clicked: boolean = false;
24 index: number = 0 24 index: number = 0
25 @State isLoadingAttention: boolean = false 25 @State isLoadingAttention: boolean = false
  26 + @State curRouter: string = ''
26 27
27 async aboutToAppear() { 28 async aboutToAppear() {
28 const curRouter = router.getState().name; 29 const curRouter = router.getState().name;
  30 + this.curRouter = curRouter;
29 this.clicked = hasClicked(this.contentDTO.objectId, curRouter) 31 this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
30 this.loadImg = await onlyWifiLoadImg(); 32 this.loadImg = await onlyWifiLoadImg();
31 } 33 }
@@ -38,7 +40,7 @@ export struct LiveBigImage01Component { @@ -38,7 +40,7 @@ export struct LiveBigImage01Component {
38 .aspectRatio(16 / 9) 40 .aspectRatio(16 / 9)
39 .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : $r('app.color.color_33A3A3A3')) 41 .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : $r('app.color.color_33A3A3A3'))
40 .objectFit(ImageFit.Contain) 42 .objectFit(ImageFit.Contain)
41 - .borderWidth(0.5) 43 + .borderWidth(this.curRouter !== 'ReserveMorePage' ? 0.5 : 0)
42 .borderColor($r('app.color.color_0D000000')) 44 .borderColor($r('app.color.color_0D000000'))
43 .borderRadius({ 45 .borderRadius({
44 topLeft: '4vp', 46 topLeft: '4vp',
@@ -30,8 +30,7 @@ export struct ZhGridLayout03 { @@ -30,8 +30,7 @@ export struct ZhGridLayout03 {
30 30
31 build() { 31 build() {
32 GridRow({ 32 GridRow({
33 - columns: { sm: listSize, md: 8 },  
34 - breakpoints: { value: ['320vp', '520vp', '840vp'] } 33 + columns: listSize,
35 }) { 34 }) {
36 ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { 35 ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
37 GridCol() { 36 GridCol() {
@@ -103,7 +103,7 @@ struct InteractMessagePage { @@ -103,7 +103,7 @@ struct InteractMessagePage {
103 Row(){ 103 Row(){
104 Text('共获') 104 Text('共获')
105 .fontSize(18).height(40).align(Alignment.Bottom) 105 .fontSize(18).height(40).align(Alignment.Bottom)
106 - Text(this.likeNum.toString()) 106 + Text(this.likeNum?.toString())
107 .fontSize(40) 107 .fontSize(40)
108 .fontColor(Color.Red) 108 .fontColor(Color.Red)
109 .fontFamily('BebasNeue') 109 .fontFamily('BebasNeue')
1 -import { Logger} from 'wdKit' 1 +import { Logger, ToastUtils} from 'wdKit'
2 import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' 2 import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
3 import { 3 import {
4 ContentDTO, 4 ContentDTO,
@@ -49,7 +49,10 @@ export struct PeopleShipHomeArticleListComponent { @@ -49,7 +49,10 @@ export struct PeopleShipHomeArticleListComponent {
49 // LoadingComponent() 49 // LoadingComponent()
50 this.LoadingLayout() 50 this.LoadingLayout()
51 } else if (this.viewType == 2) { 51 } else if (this.viewType == 2) {
52 - ErrorComponent() 52 + Column(){
  53 + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%')
  54 + }.width('100%')
  55 + .height('100%')
53 }else if(this.viewType == 4){ 56 }else if(this.viewType == 4){
54 Column(){ 57 Column(){
55 EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%') 58 EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%')
@@ -201,6 +204,7 @@ export struct PeopleShipHomeArticleListComponent { @@ -201,6 +204,7 @@ export struct PeopleShipHomeArticleListComponent {
201 this.isLoading = false 204 this.isLoading = false
202 if (this.arr.length == 0) { 205 if (this.arr.length == 0) {
203 this.viewType = 2 206 this.viewType = 2
  207 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
204 } 208 }
205 } 209 }
206 } 210 }
@@ -258,7 +258,7 @@ export struct PlayUIComponent { @@ -258,7 +258,7 @@ export struct PlayUIComponent {
258 .fontWeight(400) 258 .fontWeight(400)
259 .fontColor(Color.White) 259 .fontColor(Color.White)
260 260
261 - if (this.liveRoomDataBean.pv > 0) { 261 + if (this.liveRoomDataBean.pv > 0 && !StringUtils.isEmpty(this.liveUrl)) {
262 Image($r('app.media.icon_live_player_status_end')) 262 Image($r('app.media.icon_live_player_status_end'))
263 .width(12) 263 .width(12)
264 .height(12) 264 .height(12)
@@ -82,6 +82,8 @@ export struct PlayerEndView { @@ -82,6 +82,8 @@ export struct PlayerEndView {
82 } 82 }
83 83
84 build() { 84 build() {
  85 + Stack() {
  86 + Image(($r('app.media.live_detail_end_bg')))
85 Column() { 87 Column() {
86 Text('直播已结束').fontWeight(500) 88 Text('直播已结束').fontWeight(500)
87 .fontSize(20) 89 .fontSize(20)
@@ -89,6 +91,19 @@ export struct PlayerEndView { @@ -89,6 +91,19 @@ export struct PlayerEndView {
89 .padding({ bottom: 40, top: 120 }) 91 .padding({ bottom: 40, top: 120 })
90 92
91 Stack() { 93 Stack() {
  94 + if (this.contentDetailData.rmhInfo != null) {
  95 + Row() {
  96 + Image($r("app.media.live_end_BG_l"))
  97 + .width(307/2.0)
  98 + .height(254)
  99 + Image($r("app.media.live_end_BG_r"))
  100 + .width(307/2.0)
  101 + .height(254)
  102 + }
  103 + // .width(307)
  104 + // .height(254)
  105 + // .backgroundColor(Color.Red)
  106 + }
92 Column() { 107 Column() {
93 if (this.contentDetailData.rmhInfo != null) { 108 if (this.contentDetailData.rmhInfo != null) {
94 Text(this.contentDetailData?.rmhInfo?.rmhName) 109 Text(this.contentDetailData?.rmhInfo?.rmhName)
@@ -102,22 +117,26 @@ export struct PlayerEndView { @@ -102,22 +117,26 @@ export struct PlayerEndView {
102 .fontColor('#B2FFFFFF') 117 .fontColor('#B2FFFFFF')
103 .padding({ top: 8 }) 118 .padding({ top: 8 })
104 } 119 }
  120 +
  121 + Stack() {
105 Row() { 122 Row() {
106 Column() { 123 Column() {
107 - Text(this.duration).fontWeight(600).fontSize(24).fontColor(Color.White)  
108 - Text('直播时长').fontWeight(400).fontSize(13).fontColor(Color.White) 124 + Text(this.duration).fontWeight(600).fontSize(20).fontColor(Color.White)
  125 + Text('直播时长').fontWeight(400).fontSize(12).fontColor(Color.White)
109 } 126 }
110 127
111 - Text('').width(1).height(32).margin({ left: 36, right: 36 }).backgroundColor('#33FFFFFF') 128 + Blank().width(1).height(32).margin({ left: 36, right: 36 })
112 Column() { 129 Column() {
113 Text(NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean?.pv || '')) 130 Text(NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean?.pv || ''))
114 .fontWeight(600) 131 .fontWeight(600)
115 - .fontSize(24) 132 + .fontSize(20)
116 .fontColor(Color.White) 133 .fontColor(Color.White)
117 - Text('观看人数').fontWeight(400).fontSize(13).fontColor(Color.White) 134 + Text('观看人数').fontWeight(400).fontSize(12).fontColor(Color.White)
118 } 135 }
119 } 136 }
120 .padding({ top: this.contentDetailData.rmhInfo == null ? 26 : 16 }) 137 .padding({ top: this.contentDetailData.rmhInfo == null ? 26 : 16 })
  138 + Text('').width(1).height(32).margin({ left: 36, right: 36,top:this.contentDetailData.rmhInfo == null ? 26 : 16 }).backgroundColor('#33FFFFFF')
  139 + }
121 if (this.contentDetailData.rmhInfo != null) { 140 if (this.contentDetailData.rmhInfo != null) {
122 Row() { 141 Row() {
123 Text(this.followStatus == '0' ? '关注' : '已关注') 142 Text(this.followStatus == '0' ? '关注' : '已关注')
@@ -130,7 +149,7 @@ export struct PlayerEndView { @@ -130,7 +149,7 @@ export struct PlayerEndView {
130 left: 122, 149 left: 122,
131 right: 122 150 right: 122
132 }) 151 })
133 - .backgroundColor(this.followStatus == '0' ? '#FFED2800' : Color.Grey) 152 + .backgroundColor(this.followStatus == '0' ? '#FFED2800' : '#CCCCCC')
134 .borderRadius(4) 153 .borderRadius(4)
135 .onClick(() => { 154 .onClick(() => {
136 this.handleAccention() 155 this.handleAccention()
@@ -141,16 +160,16 @@ export struct PlayerEndView { @@ -141,16 +160,16 @@ export struct PlayerEndView {
141 } 160 }
142 .width(307) 161 .width(307)
143 .height(this.contentDetailData.rmhInfo == null ? 100 : 254) 162 .height(this.contentDetailData.rmhInfo == null ? 100 : 254)
144 - .backgroundColor('#999999') 163 + .backgroundColor(this.contentDetailData.rmhInfo == null ? '#12ffffff' : '')
145 .borderRadius(4) 164 .borderRadius(4)
146 if (this.contentDetailData.rmhInfo != null) { 165 if (this.contentDetailData.rmhInfo != null) {
147 Image(this.contentDetailData.rmhInfo?.rmhHeadUrl) 166 Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
148 .width(80) 167 .width(80)
149 .height(80) 168 .height(80)
150 .borderRadius(40) 169 .borderRadius(40)
151 - .borderWidth(1)  
152 - .borderColor(Color.White)  
153 - .borderStyle(BorderStyle.Solid) 170 + // .borderWidth(1)
  171 + // .borderColor(Color.White)
  172 + // .borderStyle(BorderStyle.Solid)
154 .position({ x: '50%', y: 0 }) 173 .position({ x: '50%', y: 0 })
155 .markAnchor({ x: '50%', y: '50%' }) 174 .markAnchor({ x: '50%', y: '50%' })
156 } 175 }
@@ -181,6 +200,12 @@ export struct PlayerEndView { @@ -181,6 +200,12 @@ export struct PlayerEndView {
181 } 200 }
182 .height('100%') 201 .height('100%')
183 .width('100%') 202 .width('100%')
  203 + // .align(Alignment.Center)
  204 + .justifyContent(FlexAlign.Center)
  205 + }
  206 + .height('100%')
  207 + .width('100%')
  208 +
184 209
185 } 210 }
186 } 211 }
@@ -100,7 +100,7 @@ export struct DetailVideoListPage { @@ -100,7 +100,7 @@ export struct DetailVideoListPage {
100 aboutToAppear() { 100 aboutToAppear() {
101 // 在视频详情页 101 // 在视频详情页
102 this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; 102 this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || '';
103 - console.info(`cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) 103 + // console.info(`cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
104 if (this.peopleShipHomeCreatorId) { 104 if (this.peopleShipHomeCreatorId) {
105 // 从人民号号主传过来的 105 // 从人民号号主传过来的
106 this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); 106 this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId);
@@ -112,6 +112,10 @@ export struct DetailVideoListPage { @@ -112,6 +112,10 @@ export struct DetailVideoListPage {
112 } 112 }
113 113
114 async getPeopleShipHomeDetail(peopleShipHomeCreatorId: string) { 114 async getPeopleShipHomeDetail(peopleShipHomeCreatorId: string) {
  115 + // 注册监听网络连接
  116 + this.netStatus = undefined
  117 + let netStatus = NetworkUtil.isNetConnected()
  118 + if (netStatus) {
115 this.openFullScreen(); 119 this.openFullScreen();
116 const action: Action = router.getParams() as Action; 120 const action: Action = router.getParams() as Action;
117 if (action) { 121 if (action) {
@@ -120,10 +124,14 @@ export struct DetailVideoListPage { @@ -120,10 +124,14 @@ export struct DetailVideoListPage {
120 this.relId = action.params.extra.relId || ''; 124 this.relId = action.params.extra.relId || '';
121 this.relType = action.params.extra.relType || ''; 125 this.relType = action.params.extra.relType || '';
122 } 126 }
123 - console.info(`cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`)  
124 - await this.getContentDetail(this.contentId, this.relId, this.relType) 127 + // console.info(TAG, `cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`)
  128 + await this.getRmhContentDetail(this.contentId, this.relId, this.relType)
125 this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false)); 129 this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
126 } 130 }
  131 + } else {
  132 + // 无网络
  133 + this.netStatus = 1
  134 + }
127 } 135 }
128 136
129 aboutToDisappear(): void { 137 aboutToDisappear(): void {
@@ -249,8 +257,8 @@ export struct DetailVideoListPage { @@ -249,8 +257,8 @@ export struct DetailVideoListPage {
249 relId: relId, 257 relId: relId,
250 relType: relType 258 relType: relType
251 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 259 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
252 - console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))  
253 - this.isOffLine = resDTO.data == null ? true : false 260 + // console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
  261 + // this.isOffLine = resDTO.data == null ? true : false
254 if (resDTO.data) { 262 if (resDTO.data) {
255 const params: contentListParams = { 263 const params: contentListParams = {
256 contentList: [{ 264 contentList: [{
@@ -288,7 +296,7 @@ export struct DetailVideoListPage { @@ -288,7 +296,7 @@ export struct DetailVideoListPage {
288 pageSize: pageSize, 296 pageSize: pageSize,
289 refreshTime: refreshTime 297 refreshTime: refreshTime
290 }).then(async (resDTO: ResponseDTO<PeopleShipNextListDTO>) => { 298 }).then(async (resDTO: ResponseDTO<PeopleShipNextListDTO>) => {
291 - console.log(TAG, 'cj2024 getRmhPublishNexts:', JSON.stringify(resDTO.data)) 299 + // console.log(TAG, 'cj2024 getRmhPublishNexts:', JSON.stringify(resDTO.data))
292 this.isOffLine = resDTO.data == null ? true : false 300 this.isOffLine = resDTO.data == null ? true : false
293 if (resDTO.data && resDTO.data.list && resDTO.data.list.length > 0) { 301 if (resDTO.data && resDTO.data.list && resDTO.data.list.length > 0) {
294 const params: contentListParams = { 302 const params: contentListParams = {
@@ -321,7 +329,7 @@ export struct DetailVideoListPage { @@ -321,7 +329,7 @@ export struct DetailVideoListPage {
321 refreshCnt: 1 329 refreshCnt: 1
322 }).then(async res => { 330 }).then(async res => {
323 if (res.data) { 331 if (res.data) {
324 - console.log(TAG, 'cj2024 queryVideoList:', JSON.stringify(res.data)) 332 + // console.log(TAG, 'cj2024 queryVideoList:', JSON.stringify(res.data))
325 await this.getContentInteract(res.data) 333 await this.getContentInteract(res.data)
326 this.data = this.data.concat(res.data) 334 this.data = this.data.concat(res.data)
327 // console.log('视频列表===', JSON.stringify(res.data)) 335 // console.log('视频列表===', JSON.stringify(res.data))
1 import { CommonConstants } from 'wdConstant'; 1 import { CommonConstants } from 'wdConstant';
2 import { Logger } from 'wdKit'; 2 import { Logger } from 'wdKit';
  3 +import { router } from '@kit.ArkUI';
3 4
4 const TAG = 'EmptyComponent'; 5 const TAG = 'EmptyComponent';
5 6
@@ -19,11 +20,15 @@ export const enum WDViewDefaultType { @@ -19,11 +20,15 @@ export const enum WDViewDefaultType {
19 @Preview 20 @Preview
20 @Component 21 @Component
21 export struct EmptyComponent { 22 export struct EmptyComponent {
  23 + // private emptySize: SizeOptions = {};
22 @State emptyWidth: string | number = CommonConstants.FULL_PARENT; 24 @State emptyWidth: string | number = CommonConstants.FULL_PARENT;
23 @State emptyHeight: string | number = CommonConstants.FULL_PARENT; 25 @State emptyHeight: string | number = CommonConstants.FULL_PARENT;
24 - @State emptyType: number = WDViewDefaultType.WDViewDefaultType_NoNetwork; // 缺省图类型,传枚举 26 + @State emptyType: number = WDViewDefaultType.WDViewDefaultType_Default; // 缺省图类型,传枚举
25 @State emptyButton: boolean = false 27 @State emptyButton: boolean = false
  28 + @State isBlack: boolean = false // 背景是否为黑色 默认白色
26 @State timeNum: number = 10 29 @State timeNum: number = 10
  30 + ///占位图上是否显示返回按钮
  31 + @State showBackButton: boolean = true
27 /** 32 /**
28 * The empty image width percentage setting. 33 * The empty image width percentage setting.
29 */ 34 */
@@ -39,13 +44,27 @@ export struct EmptyComponent { @@ -39,13 +44,27 @@ export struct EmptyComponent {
39 /** 44 /**
40 * The empty data text opacity. 45 * The empty data text opacity.
41 */ 46 */
42 - readonly TEXT_OPACITY: number = 0.4;  
43 - private timer: number = -1 47 + readonly TEXT_OPACITY: number = 1.0;
44 retry: () => void = () => { 48 retry: () => void = () => {
45 } 49 }
46 50
47 build() { 51 build() {
  52 + Stack({alignContent:Alignment.Bottom}) {
48 this.noProgrammeData(); 53 this.noProgrammeData();
  54 +
  55 + if (this.showBackButton) {
  56 + Image($r("app.media.icon_arrow_left_white"))
  57 + .width(24)
  58 + .height(24)
  59 + .onClick(() => {
  60 + router.back();
  61 + })
  62 + .position({
  63 + bottom: 15,
  64 + left: 16
  65 + })
  66 + }
  67 + }
49 } 68 }
50 69
51 /** 70 /**
@@ -64,17 +83,18 @@ export struct EmptyComponent { @@ -64,17 +83,18 @@ export struct EmptyComponent {
64 .fontWeight(FontWeight.Normal) 83 .fontWeight(FontWeight.Normal)
65 .opacity(this.TEXT_OPACITY) 84 .opacity(this.TEXT_OPACITY)
66 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) 85 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
  86 + .fontColor('#666666')
67 .onClick((event: ClickEvent) => { 87 .onClick((event: ClickEvent) => {
68 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); 88 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
69 }) 89 })
70 90
71 if (this.isShowButton()) { 91 if (this.isShowButton()) {
72 - if (this.emptyType !== 15) { 92 + if (this.emptyType !== 15 && !this.isBlack) {
73 Button('点击重试') 93 Button('点击重试')
74 .type(ButtonType.Normal) 94 .type(ButtonType.Normal)
75 .width(80) 95 .width(80)
76 .height(28) 96 .height(28)
77 - .backgroundColor('#fffffff') 97 + .backgroundColor(Color.White)
78 .fontColor('#FF666666') 98 .fontColor('#FF666666')
79 .border({ width: 1 }) 99 .border({ width: 1 })
80 .borderColor('#FFEDEDED') 100 .borderColor('#FFEDEDED')
@@ -106,7 +126,9 @@ export struct EmptyComponent { @@ -106,7 +126,9 @@ export struct EmptyComponent {
106 } 126 }
107 .justifyContent(FlexAlign.Center) 127 .justifyContent(FlexAlign.Center)
108 .width(this.emptyWidth) 128 .width(this.emptyWidth)
  129 + .layoutWeight(1)
109 .height(this.emptyHeight) 130 .height(this.emptyHeight)
  131 +
110 } 132 }
111 133
112 buildNoDataTip(): string { 134 buildNoDataTip(): string {
@@ -120,7 +142,7 @@ export struct EmptyComponent { @@ -120,7 +142,7 @@ export struct EmptyComponent {
120 142
121 buildNoDataTipImage(): Resource | string { 143 buildNoDataTipImage(): Resource | string {
122 Logger.info(TAG, "buildNoDataTip"); 144 Logger.info(TAG, "buildNoDataTip");
123 - let imageString: Resource | string = "" 145 + let imageString: Resource | string = $r('app.media.icon_no_net1')
124 if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { 146 if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
125 imageString = $r('app.media.icon_no_net1') 147 imageString = $r('app.media.icon_no_net1')
126 } 148 }
@@ -128,7 +150,7 @@ export struct EmptyComponent { @@ -128,7 +150,7 @@ export struct EmptyComponent {
128 } 150 }
129 151
130 isShowButton() { 152 isShowButton() {
131 - if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) { 153 + if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15 && this.emptyButton) {
132 return true 154 return true
133 } else { 155 } else {
134 return false 156 return false