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: 18829 【必现】搜索结果-展开更多样式卡,点击多次后客户端闪退
  fix: 18755 0评-搜索结果页中评论数为0的数据未能隐藏评论
  ref |> 解决定位权限弹框提示问题
  图集滑动优化
  频道列表点击已下线视频,未展示内容找不到了缺省页,而是推荐其它视频播放
@@ -151,7 +151,7 @@ export struct CardSourceInfo { @@ -151,7 +151,7 @@ export struct CardSourceInfo {
151 .flexShrink(0) 151 .flexShrink(0)
152 .margin({right: 4}) 152 .margin({right: 4})
153 } 153 }
154 - if (this.getContentDtoBean()?.interactData?.commentNum && this.showCommentNum()) { 154 + if (Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && this.showCommentNum()) {
155 Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) 155 Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`)
156 .fontSize($r("app.float.font_size_11")) 156 .fontSize($r("app.float.font_size_11"))
157 .fontColor($r("app.color.color_B0B0B0")) 157 .fontColor($r("app.color.color_B0B0B0"))
@@ -291,7 +291,7 @@ export struct SearchResultContentComponent { @@ -291,7 +291,7 @@ export struct SearchResultContentComponent {
291 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 291 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
292 } 292 }
293 } else { 293 } else {
294 - if(this.data.get(index + 1).sameContentListSize > 0) { 294 + if(this.data?.get(index + 1)?.sameContentListSize > 0) {
295 Divider() 295 Divider()
296 .width('100%') 296 .width('100%')
297 .color($r('app.color.color_F5F5F5')) 297 .color($r('app.color.color_F5F5F5'))
@@ -129,6 +129,7 @@ export struct EmptyComponent { @@ -129,6 +129,7 @@ export struct EmptyComponent {
129 .fontWeight(FontWeight.Normal) 129 .fontWeight(FontWeight.Normal)
130 .opacity(this.TEXT_OPACITY) 130 .opacity(this.TEXT_OPACITY)
131 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) 131 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
  132 + .fontColor(this.emptyType !== 15 ? '#FFCCCCCC' : '#999999')
132 .onClick((event: ClickEvent) => { 133 .onClick((event: ClickEvent) => {
133 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); 134 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
134 }) 135 })
@@ -36,6 +36,7 @@ export struct DetailVideoListPage { @@ -36,6 +36,7 @@ export struct DetailVideoListPage {
36 @State data: ContentDetailDTO[] = [] 36 @State data: ContentDetailDTO[] = []
37 @State currentIndex: number = 0 37 @State currentIndex: number = 0
38 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 38 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
  39 + @State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
39 @State interactDataList: InteractDataDTO[] = [] 40 @State interactDataList: InteractDataDTO[] = []
40 pageShowTime:number = 0; 41 pageShowTime:number = 0;
41 pageHideTime:number = 0; 42 pageHideTime:number = 0;
@@ -140,6 +141,7 @@ export struct DetailVideoListPage { @@ -140,6 +141,7 @@ export struct DetailVideoListPage {
140 relType: relType 141 relType: relType
141 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 142 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
142 console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) 143 console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
  144 + this.isOffLine = resDTO.data == null ? true : false
143 if (resDTO.data) { 145 if (resDTO.data) {
144 const params: contentListParams = { 146 const params: contentListParams = {
145 contentList: [{ 147 contentList: [{
@@ -202,7 +204,7 @@ export struct DetailVideoListPage { @@ -202,7 +204,7 @@ export struct DetailVideoListPage {
202 build() { 204 build() {
203 if (this.netStatus !== undefined) { 205 if (this.netStatus !== undefined) {
204 EmptyComponent({ 206 EmptyComponent({
205 - emptyType: this.netStatus, emptyButton: true, retry: () => { 207 + emptyType: 1, emptyButton: true, retry: () => {
206 this.getContentDetail(this.contentId, this.relId, this.relType) 208 this.getContentDetail(this.contentId, this.relId, this.relType)
207 } 209 }
208 }) 210 })
@@ -211,6 +213,18 @@ export struct DetailVideoListPage { @@ -211,6 +213,18 @@ export struct DetailVideoListPage {
211 center: { anchor: "__container__", align: VerticalAlign.Center }, 213 center: { anchor: "__container__", align: VerticalAlign.Center },
212 middle: { anchor: "__container__", align: HorizontalAlign.Center } 214 middle: { anchor: "__container__", align: HorizontalAlign.Center }
213 }) 215 })
  216 + } else if (this.isOffLine) {
  217 + EmptyComponent({
  218 + emptyType: 15, emptyButton: true, retry: () => {
  219 + this.getContentDetail(this.contentId, this.relId, this.relType)
  220 + }
  221 + })
  222 + .id('e_empty_content')
  223 + .alignRules({
  224 + center: { anchor: "__container__", align: VerticalAlign.Center },
  225 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  226 + })
  227 + .backgroundColor(Color.Black)
214 } else { 228 } else {
215 Column() { 229 Column() {
216 Swiper(this.swiperController) { 230 Swiper(this.swiperController) {
@@ -11,17 +11,5 @@ @@ -11,17 +11,5 @@
11 "compressNativeLibs": true, 11 "compressNativeLibs": true,
12 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
13 "pages": "$profile:main_pages", 13 "pages": "$profile:main_pages",
14 - "requestPermissions": [  
15 - {  
16 - "name": "ohos.permission.APPROXIMATELY_LOCATION",  
17 - "reason": "$string:location_reason",  
18 - "usedScene": {  
19 - "abilities": [  
20 - "FormAbility"  
21 - ],  
22 - "when": "inuse"  
23 - }  
24 - }  
25 - ]  
26 } 14 }
27 } 15 }
1 -import { LogoutViewModel, PermissionDesComponent } from 'wdComponent'; 1 +import { LogoutViewModel } from 'wdComponent';
2 import { BreakpointConstants } from 'wdConstant'; 2 import { BreakpointConstants } from 'wdConstant';
3 3
4 -import { common } from '@kit.AbilityKit';  
5 import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger, MpaasUpgradeCheck, WindowModel } from 'wdKit'; 4 import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger, MpaasUpgradeCheck, WindowModel } from 'wdKit';
6 import { promptAction, window } from '@kit.ArkUI'; 5 import { promptAction, window } from '@kit.ArkUI';
7 import { UpgradeTipDialog } from "./upgradePage/UpgradeTipDialog" 6 import { UpgradeTipDialog } from "./upgradePage/UpgradeTipDialog"
@@ -20,7 +19,6 @@ struct MainPage { @@ -20,7 +19,6 @@ struct MainPage {
20 private breakpointSystem: BreakpointSystem = new BreakpointSystem() 19 private breakpointSystem: BreakpointSystem = new BreakpointSystem()
21 @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = 20 @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
22 BreakpointConstants.BREAKPOINT_XS; 21 BreakpointConstants.BREAKPOINT_XS;
23 - @State isPermission: boolean = false  
24 upgradeDialogController?: CustomDialogController 22 upgradeDialogController?: CustomDialogController
25 23
26 watchCurrentBreakpoint() { 24 watchCurrentBreakpoint() {
@@ -37,9 +35,6 @@ struct MainPage { @@ -37,9 +35,6 @@ struct MainPage {
37 EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { 35 EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => {
38 LogoutViewModel.clearLoginInfo() 36 LogoutViewModel.clearLoginInfo()
39 }) 37 })
40 - EmitterUtils.receiveEvent(EmitterEventId.LOCATION, () => {  
41 - this.isPermission = true  
42 - })  
43 } 38 }
44 39
45 pageTransition() { 40 pageTransition() {
@@ -114,9 +109,6 @@ struct MainPage { @@ -114,9 +109,6 @@ struct MainPage {
114 build() { 109 build() {
115 Stack({ alignContent: Alignment.Top }) { 110 Stack({ alignContent: Alignment.Top }) {
116 BottomNavigationComponent() 111 BottomNavigationComponent()
117 - if (this.isPermission) {  
118 - PermissionDesComponent()  
119 - }  
120 } 112 }
121 } 113 }
122 } 114 }
@@ -55,6 +55,7 @@ export struct MultiPictureDetailPageComponent { @@ -55,6 +55,7 @@ export struct MultiPictureDetailPageComponent {
55 @Provide showCommentList: boolean = false 55 @Provide showCommentList: boolean = false
56 private scroller: Scroller = new Scroller() 56 private scroller: Scroller = new Scroller()
57 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 57 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
  58 + @State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
58 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 59 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏
59 @State publishCommentModel: publishCommentModel = new publishCommentModel() 60 @State publishCommentModel: publishCommentModel = new publishCommentModel()
60 @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] 61 @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
@@ -113,7 +114,32 @@ export struct MultiPictureDetailPageComponent { @@ -113,7 +114,32 @@ export struct MultiPictureDetailPageComponent {
113 114
114 build() { 115 build() {
115 RelativeContainer() { 116 RelativeContainer() {
116 - this.init() 117 + if (this.contentDetailData.rmhPlatform == 1) {
  118 + this.rmh()
  119 + }
  120 + if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
  121 + this.imgSwiper()
  122 + }
  123 + if (this.netStatus !== undefined) {
  124 + this.noNet()
  125 + }
  126 + if (this.isOffLine) {
  127 + this.offLine()
  128 + }
  129 + Column() {
  130 + if (!this.showDownload) {
  131 + this.NShowDownload()
  132 + }
  133 + if (this.showDownload) {
  134 + this.YShowDownload()
  135 + }
  136 + }
  137 + .zIndex(10)
  138 + .id('e_swiper_bottom')
  139 + .alignRules({
  140 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  141 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  142 + })
117 CommentDialogView({ 143 CommentDialogView({
118 index: $index, 144 index: $index,
119 currentIndex: $currentIndex, 145 currentIndex: $currentIndex,
@@ -130,8 +156,7 @@ export struct MultiPictureDetailPageComponent { @@ -130,8 +156,7 @@ export struct MultiPictureDetailPageComponent {
130 } 156 }
131 157
132 @Builder 158 @Builder
133 - init() {  
134 - if (this.contentDetailData.rmhPlatform == 1) { 159 + rmh() {
135 if (!this.showDownload) { 160 if (!this.showDownload) {
136 Row() { 161 Row() {
137 Row({ space: 8 }) { 162 Row({ space: 8 }) {
@@ -274,9 +299,10 @@ export struct MultiPictureDetailPageComponent { @@ -274,9 +299,10 @@ export struct MultiPictureDetailPageComponent {
274 TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` }) 299 TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
275 )) 300 ))
276 } 301 }
277 -  
278 } 302 }
279 - if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { 303 +
  304 + @Builder
  305 + imgSwiper() {
280 Swiper(this.swiperController) { 306 Swiper(this.swiperController) {
281 ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => { 307 ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
282 Swiper(this.swiperControllerItem) { 308 Swiper(this.swiperControllerItem) {
@@ -289,6 +315,7 @@ export struct MultiPictureDetailPageComponent { @@ -289,6 +315,7 @@ export struct MultiPictureDetailPageComponent {
289 .cachedCount(1) 315 .cachedCount(1)
290 .indicator(false) 316 .indicator(false)
291 .displayCount(1) 317 .displayCount(1)
  318 + .loop(false)
292 .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => { 319 .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => {
293 console.info("onGestureSwipe current offset: " + extraInfo.currentOffset) 320 console.info("onGestureSwipe current offset: " + extraInfo.currentOffset)
294 this.currentOffset = Math.abs(extraInfo.currentOffset) 321 this.currentOffset = Math.abs(extraInfo.currentOffset)
@@ -314,7 +341,7 @@ export struct MultiPictureDetailPageComponent { @@ -314,7 +341,7 @@ export struct MultiPictureDetailPageComponent {
314 .indicator(false) 341 .indicator(false)
315 .displayCount(1) 342 .displayCount(1)
316 .loop(false) 343 .loop(false)
317 - .effectMode(EdgeEffect.None) 344 + .effectMode(EdgeEffect.Spring)
318 .id('e_swiper_content') 345 .id('e_swiper_content')
319 .alignRules({ 346 .alignRules({
320 center: { anchor: "__container__", align: VerticalAlign.Center }, 347 center: { anchor: "__container__", align: VerticalAlign.Center },
@@ -328,20 +355,9 @@ export struct MultiPictureDetailPageComponent { @@ -328,20 +355,9 @@ export struct MultiPictureDetailPageComponent {
328 this.showDownload = !this.showDownload 355 this.showDownload = !this.showDownload
329 }) 356 })
330 } 357 }
331 - if (this.netStatus !== undefined) {  
332 - EmptyComponent({  
333 - emptyType: this.netStatus, emptyButton: true, retry: () => {  
334 - this.getContentDetailData()  
335 - }  
336 - })  
337 - .id('e_empty_content')  
338 - .alignRules({  
339 - center: { anchor: "__container__", align: VerticalAlign.Center },  
340 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
341 - })  
342 - }  
343 - Column() {  
344 - if (!this.showDownload) { 358 +
  359 + @Builder
  360 + NShowDownload() {
345 Column() { 361 Column() {
346 Row() { 362 Row() {
347 Scroll(this.scroller) { 363 Scroll(this.scroller) {
@@ -407,7 +423,9 @@ export struct MultiPictureDetailPageComponent { @@ -407,7 +423,9 @@ export struct MultiPictureDetailPageComponent {
407 } 423 }
408 .scrollable(ScrollDirection.Vertical) 424 .scrollable(ScrollDirection.Vertical)
409 .scrollBarWidth(0) 425 .scrollBarWidth(0)
410 - .height(px2vp(this.titleHeight)) 426 + .constraintSize({
  427 + maxHeight: px2vp(this.titleHeight)
  428 + })
411 .align(Alignment.Bottom) 429 .align(Alignment.Bottom)
412 } 430 }
413 431
@@ -428,7 +446,9 @@ export struct MultiPictureDetailPageComponent { @@ -428,7 +446,9 @@ export struct MultiPictureDetailPageComponent {
428 TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` }) 446 TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
429 )) 447 ))
430 } 448 }
431 - if (this.showDownload) { 449 +
  450 + @Builder
  451 + YShowDownload() {
432 Column() { 452 Column() {
433 Row() { 453 Row() {
434 Flex({ 454 Flex({
@@ -474,19 +494,41 @@ export struct MultiPictureDetailPageComponent { @@ -474,19 +494,41 @@ export struct MultiPictureDetailPageComponent {
474 TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` }) 494 TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` })
475 )) 495 ))
476 } 496 }
  497 +
  498 + @Builder
  499 + noNet() {
  500 + EmptyComponent({
  501 + emptyType: 1, emptyButton: true, retry: () => {
  502 + this.getContentDetailData()
477 } 503 }
478 - .zIndex(10)  
479 - .id('e_swiper_bottom') 504 + })
  505 + .id('e_empty_content')
480 .alignRules({ 506 .alignRules({
481 - bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, 507 + center: { anchor: "__container__", align: VerticalAlign.Center },
  508 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  509 + })
  510 + }
  511 +
  512 + @Builder
  513 + offLine() {
  514 + EmptyComponent({
  515 + emptyType: 15, emptyButton: true, retry: () => {
  516 + this.getContentDetailData
  517 + }
  518 + })
  519 + .id('e_empty_content')
  520 + .alignRules({
  521 + center: { anchor: "__container__", align: VerticalAlign.Center },
482 middle: { anchor: "__container__", align: HorizontalAlign.Center } 522 middle: { anchor: "__container__", align: HorizontalAlign.Center }
483 }) 523 })
  524 + .backgroundColor(Color.Black)
484 } 525 }
485 526
486 getContentDetailData() { 527 getContentDetailData() {
487 try { 528 try {
488 PageRepository.fetchDetailData(this.relId, this.contentId, this.relType) 529 PageRepository.fetchDetailData(this.relId, this.contentId, this.relType)
489 .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 530 .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
  531 + this.isOffLine = resDTO.data == null ? true : false
490 if (!resDTO || !resDTO.data) { 532 if (!resDTO || !resDTO.data) {
491 Logger.error(TAG, 'fetchDetailData is empty'); 533 Logger.error(TAG, 'fetchDetailData is empty');
492 return 534 return