Showing
6 changed files
with
82 additions
and
51 deletions
| @@ -44,7 +44,7 @@ export struct CarderInteraction { | @@ -44,7 +44,7 @@ export struct CarderInteraction { | ||
| 44 | 44 | ||
| 45 | build() { | 45 | build() { |
| 46 | Row() { | 46 | Row() { |
| 47 | - if(this.contentDTO.shareFlag === '1'){ | 47 | + if(this.contentDetailData?.shareInfo?.shareOpen === 1){ |
| 48 | Row() { | 48 | Row() { |
| 49 | Image($r('app.media.CarderInteraction_share')) | 49 | Image($r('app.media.CarderInteraction_share')) |
| 50 | .width(18) | 50 | .width(18) |
| @@ -60,14 +60,9 @@ export struct CarderInteraction { | @@ -60,14 +60,9 @@ export struct CarderInteraction { | ||
| 60 | }) | 60 | }) |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | - if(this.contentDTO.rmhInfo != null){ | ||
| 64 | - if(this.contentDTO.shareInfo != null && 1 == this.contentDTO.shareInfo.shareOpen && 1 == this.contentDTO.rmhInfo.cnShareControl){ | 63 | + if(this.contentDetailData?.openComment == 1){ |
| 65 | this.commentLayout() | 64 | this.commentLayout() |
| 66 | } | 65 | } |
| 67 | - }else{ | ||
| 68 | - this.commentLayout() | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | this.builderLike() | 66 | this.builderLike() |
| 72 | } | 67 | } |
| 73 | .width('100%') | 68 | .width('100%') |
| @@ -14,15 +14,16 @@ export struct LottieView { | @@ -14,15 +14,16 @@ export struct LottieView { | ||
| 14 | private politeChickyController: CanvasRenderingContext2D = | 14 | private politeChickyController: CanvasRenderingContext2D = |
| 15 | new CanvasRenderingContext2D(); // CanvasRenderingContext2D对象 | 15 | new CanvasRenderingContext2D(); // CanvasRenderingContext2D对象 |
| 16 | private animateItem: AnimationItem | null = null; // 初始化loadAnimation接口的返回对象 | 16 | private animateItem: AnimationItem | null = null; // 初始化loadAnimation接口的返回对象 |
| 17 | + @Prop title: string | ||
| 17 | 18 | ||
| 18 | // 页面隐藏销毁动画 | 19 | // 页面隐藏销毁动画 |
| 19 | - onPageHide(): void { | ||
| 20 | - this.animateItem?.destroy() | ||
| 21 | - | ||
| 22 | - if (this.onComplete) { | ||
| 23 | - this.animateItem?.removeEventListener('complete', this.onComplete) | ||
| 24 | - } | ||
| 25 | - } | 20 | + // onPageHide(): void { |
| 21 | + // this.animateItem?.destroy() | ||
| 22 | + // | ||
| 23 | + // if (this.onComplete) { | ||
| 24 | + // this.animateItem?.removeEventListener('complete', this.onComplete) | ||
| 25 | + // } | ||
| 26 | + // } | ||
| 26 | 27 | ||
| 27 | /** | 28 | /** |
| 28 | * 加载动画 | 29 | * 加载动画 |
| @@ -31,7 +32,7 @@ export struct LottieView { | @@ -31,7 +32,7 @@ export struct LottieView { | ||
| 31 | loadAnimation() { | 32 | loadAnimation() { |
| 32 | // 销毁动画,减少缓存 | 33 | // 销毁动画,减少缓存 |
| 33 | if (this.animateItem !== null) { | 34 | if (this.animateItem !== null) { |
| 34 | - this.animateItem.destroy(); | 35 | + this.animateItem.destroy(this.name); |
| 35 | this.animateItem = null; | 36 | this.animateItem = null; |
| 36 | } | 37 | } |
| 37 | 38 | ||
| @@ -54,6 +55,32 @@ export struct LottieView { | @@ -54,6 +55,32 @@ export struct LottieView { | ||
| 54 | 55 | ||
| 55 | } | 56 | } |
| 56 | 57 | ||
| 58 | + aboutToAppear(): void { | ||
| 59 | + // console.error('XXXXZZZZ', '-------aboutToAppear-------' + this.title) | ||
| 60 | + //lottie?.play() | ||
| 61 | + | ||
| 62 | + // if(this.init){ | ||
| 63 | + // if(this.animateItem = null){ | ||
| 64 | + // this.loadAnimation(); | ||
| 65 | + // } | ||
| 66 | + // } | ||
| 67 | + | ||
| 68 | + | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + aboutToDisappear(): void { | ||
| 72 | + // console.error('XXXXZZZZ', '-------aboutToDisappear-------' + this.title) | ||
| 73 | + // if(this.init){ | ||
| 74 | + // lottie?.destroy(this.name) | ||
| 75 | + // | ||
| 76 | + // if (this.onComplete) { | ||
| 77 | + // this.animateItem?.removeEventListener('complete', this.onComplete) | ||
| 78 | + // } | ||
| 79 | + // this.animateItem = null; | ||
| 80 | + // // } | ||
| 81 | + | ||
| 82 | + } | ||
| 83 | + | ||
| 57 | build() { | 84 | build() { |
| 58 | Stack({ alignContent: Alignment.TopStart }) { | 85 | Stack({ alignContent: Alignment.TopStart }) { |
| 59 | Canvas(this.politeChickyController) | 86 | Canvas(this.politeChickyController) |
| @@ -65,9 +92,13 @@ export struct LottieView { | @@ -65,9 +92,13 @@ export struct LottieView { | ||
| 65 | this.onReady(this.animateItem) | 92 | this.onReady(this.animateItem) |
| 66 | } | 93 | } |
| 67 | }) | 94 | }) |
| 68 | - .onClick(() => { | ||
| 69 | - this.animateItem?.play() | 95 | + .onDisAppear(() => { |
| 96 | + lottie.destroy(this.name) | ||
| 97 | + this.animateItem = null; | ||
| 98 | + }).onAppear(()=>{ | ||
| 99 | + this.loadAnimation(); | ||
| 70 | }) | 100 | }) |
| 101 | + | ||
| 71 | } | 102 | } |
| 72 | } | 103 | } |
| 73 | } | 104 | } |
| @@ -31,7 +31,7 @@ let preferenceTheme: dataPreferences.Preferences | null = null | @@ -31,7 +31,7 @@ let preferenceTheme: dataPreferences.Preferences | null = null | ||
| 31 | @Component | 31 | @Component |
| 32 | struct LiveMorePage { | 32 | struct LiveMorePage { |
| 33 | @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); | 33 | @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); |
| 34 | - topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; | 34 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; |
| 35 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 35 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 36 | type: number = 1; | 36 | type: number = 1; |
| 37 | pageSize: number = 20; | 37 | pageSize: number = 20; |
| @@ -46,11 +46,9 @@ struct LiveMorePage { | @@ -46,11 +46,9 @@ struct LiveMorePage { | ||
| 46 | @State liveRoomList: LiveRoomDataBean[] = [] | 46 | @State liveRoomList: LiveRoomDataBean[] = [] |
| 47 | // 点击过的数据 | 47 | // 点击过的数据 |
| 48 | @State clickDatas: Array<string> = [] | 48 | @State clickDatas: Array<string> = [] |
| 49 | - | ||
| 50 | @State loadImg: boolean = false; | 49 | @State loadImg: boolean = false; |
| 51 | 50 | ||
| 52 | - | ||
| 53 | - async aboutToAppear() : Promise<void>{ | 51 | + async aboutToAppear(): Promise<void> { |
| 54 | await this.getPreferencesFromStorage() | 52 | await this.getPreferencesFromStorage() |
| 55 | this.loadImg = await onlyWifiLoadImg(); | 53 | this.loadImg = await onlyWifiLoadImg(); |
| 56 | this.getLivMoreClickPreference() | 54 | this.getLivMoreClickPreference() |
| @@ -60,16 +58,9 @@ struct LiveMorePage { | @@ -60,16 +58,9 @@ struct LiveMorePage { | ||
| 60 | } | 58 | } |
| 61 | 59 | ||
| 62 | build() { | 60 | build() { |
| 63 | - // Navigation() { | ||
| 64 | - // //滑动区域 | ||
| 65 | - // this.ListLayout() | ||
| 66 | - // } | ||
| 67 | - // .titleMode(NavigationTitleMode.Mini) | ||
| 68 | - // .title('直播列表') | ||
| 69 | 61 | ||
| 70 | Column() { | 62 | Column() { |
| 71 | this.TabbarNormal() | 63 | this.TabbarNormal() |
| 72 | - | ||
| 73 | if (this.viewType == ViewType.LOADING) { | 64 | if (this.viewType == ViewType.LOADING) { |
| 74 | this.LoadingLayout() | 65 | this.LoadingLayout() |
| 75 | } else if (this.viewType == ViewType.ERROR) { | 66 | } else if (this.viewType == ViewType.ERROR) { |
| @@ -96,15 +87,13 @@ struct LiveMorePage { | @@ -96,15 +87,13 @@ struct LiveMorePage { | ||
| 96 | }) | 87 | }) |
| 97 | } | 88 | } |
| 98 | } | 89 | } |
| 90 | + .height('100%') | ||
| 99 | .padding({ | 91 | .padding({ |
| 100 | left: $r('app.float.card_comp_pagePadding_lf'), | 92 | left: $r('app.float.card_comp_pagePadding_lf'), |
| 101 | right: $r('app.float.card_comp_pagePadding_lf'), | 93 | right: $r('app.float.card_comp_pagePadding_lf'), |
| 102 | - bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 103 | - }) | ||
| 104 | - .margin({bottom:px2vp(this.bottomSafeHeight)}) | ||
| 105 | - .onClick(() => { | ||
| 106 | - ProcessUtils.processPage(this.contentDTO) | 94 | + top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight) |
| 107 | }) | 95 | }) |
| 96 | + | ||
| 108 | } | 97 | } |
| 109 | 98 | ||
| 110 | @Builder | 99 | @Builder |
| @@ -133,7 +122,7 @@ struct LiveMorePage { | @@ -133,7 +122,7 @@ struct LiveMorePage { | ||
| 133 | } | 122 | } |
| 134 | .scrollBar(BarState.Off) | 123 | .scrollBar(BarState.Off) |
| 135 | .edgeEffect(EdgeEffect.None) | 124 | .edgeEffect(EdgeEffect.None) |
| 136 | - .cachedCount(8) | 125 | + .cachedCount(3) |
| 137 | .height('calc(100% - 44vp)') | 126 | .height('calc(100% - 44vp)') |
| 138 | .onReachEnd(() => { | 127 | .onReachEnd(() => { |
| 139 | Logger.debug(TAG, "触底了"); | 128 | Logger.debug(TAG, "触底了"); |
| @@ -160,9 +149,10 @@ struct LiveMorePage { | @@ -160,9 +149,10 @@ struct LiveMorePage { | ||
| 160 | .margin({ top: 16, bottom: 8 }) | 149 | .margin({ top: 16, bottom: 8 }) |
| 161 | .alignSelf(ItemAlign.Start) | 150 | .alignSelf(ItemAlign.Start) |
| 162 | .fontColor(this.isClicked(item.objectId) ? $r('app.color.color_848484') : $r('app.color.color_222222')) | 151 | .fontColor(this.isClicked(item.objectId) ? $r('app.color.color_848484') : $r('app.color.color_222222')) |
| 152 | + | ||
| 163 | Stack() { | 153 | Stack() { |
| 164 | if (item.fullColumnImgUrls && item.fullColumnImgUrls.length > 0) { | 154 | if (item.fullColumnImgUrls && item.fullColumnImgUrls.length > 0) { |
| 165 | - Image(this.loadImg?item.fullColumnImgUrls[0].url:'') | 155 | + Image(this.loadImg ? item.fullColumnImgUrls[0].url : '') |
| 166 | .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | 156 | .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) |
| 167 | .width('100%') | 157 | .width('100%') |
| 168 | .aspectRatio(16 / 9) | 158 | .aspectRatio(16 / 9) |
| @@ -246,7 +236,6 @@ struct LiveMorePage { | @@ -246,7 +236,6 @@ struct LiveMorePage { | ||
| 246 | }) | 236 | }) |
| 247 | } | 237 | } |
| 248 | .height(44) | 238 | .height(44) |
| 249 | - .margin({top:this.topSafeHeight+'px'}) | ||
| 250 | .width('100%') | 239 | .width('100%') |
| 251 | } | 240 | } |
| 252 | 241 | ||
| @@ -260,24 +249,25 @@ struct LiveMorePage { | @@ -260,24 +249,25 @@ struct LiveMorePage { | ||
| 260 | lottieHeight: 14, | 249 | lottieHeight: 14, |
| 261 | autoplay: true, | 250 | autoplay: true, |
| 262 | loop: true, | 251 | loop: true, |
| 252 | + title: item.newsTitle | ||
| 263 | }) | 253 | }) |
| 264 | .margin({ | 254 | .margin({ |
| 265 | right: '2vp' | 255 | right: '2vp' |
| 266 | }) | 256 | }) |
| 257 | + | ||
| 267 | Text('直播中') | 258 | Text('直播中') |
| 268 | .fontSize('12vp') | 259 | .fontSize('12vp') |
| 269 | .fontWeight(400) | 260 | .fontWeight(400) |
| 270 | .fontColor(Color.White) | 261 | .fontColor(Color.White) |
| 271 | - .textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 }) | 262 | + .textShadow({ |
| 263 | + radius: 2, | ||
| 264 | + color: 'rgba(0,0,0,0.3)', | ||
| 265 | + offsetX: 0, | ||
| 266 | + offsetY: 2 | ||
| 267 | + }) | ||
| 272 | .margin({ | 268 | .margin({ |
| 273 | right: '5vp' | 269 | right: '5vp' |
| 274 | }) | 270 | }) |
| 275 | - // Divider() | ||
| 276 | - // .vertical(true) | ||
| 277 | - // .strokeWidth(1) | ||
| 278 | - // .height('12vp') | ||
| 279 | - // .margin({ top: 2, bottom: 2 }) | ||
| 280 | - // .color(Color.White) | ||
| 281 | 271 | ||
| 282 | Image($r('app.media.icon_comp_line_live')).height('11vp').width('1.5vp') | 272 | Image($r('app.media.icon_comp_line_live')).height('11vp').width('1.5vp') |
| 283 | 273 | ||
| @@ -285,7 +275,12 @@ struct LiveMorePage { | @@ -285,7 +275,12 @@ struct LiveMorePage { | ||
| 285 | Text(this.getLiveRoomNumber(item)) | 275 | Text(this.getLiveRoomNumber(item)) |
| 286 | .fontSize('12vp') | 276 | .fontSize('12vp') |
| 287 | .fontWeight(400) | 277 | .fontWeight(400) |
| 288 | - .textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 }) | 278 | + .textShadow({ |
| 279 | + radius: 2, | ||
| 280 | + color: 'rgba(0,0,0,0.3)', | ||
| 281 | + offsetX: 0, | ||
| 282 | + offsetY: 2 | ||
| 283 | + }) | ||
| 289 | .fontColor(Color.White) | 284 | .fontColor(Color.White) |
| 290 | .margin({ | 285 | .margin({ |
| 291 | left: '5vp' | 286 | left: '5vp' |
| @@ -422,7 +417,7 @@ struct LiveMorePage { | @@ -422,7 +417,7 @@ struct LiveMorePage { | ||
| 422 | const arr: Array<string> = [] | 417 | const arr: Array<string> = [] |
| 423 | arr.push(...this.clickDatas) | 418 | arr.push(...this.clickDatas) |
| 424 | preferenceTheme.put('liveMorePage', arr).then(() => { | 419 | preferenceTheme.put('liveMorePage', arr).then(() => { |
| 425 | - Logger.debug(TAG,"Succeeded in putting value of 'startup'."); | 420 | + Logger.debug(TAG, "Succeeded in putting value of 'startup'."); |
| 426 | }).catch((err: BusinessError) => { | 421 | }).catch((err: BusinessError) => { |
| 427 | Logger.debug(TAG, "Failed to put value of 'startup'. code =" + err.code + ", message =" + err.message); | 422 | Logger.debug(TAG, "Failed to put value of 'startup'. code =" + err.code + ", message =" + err.message); |
| 428 | }) | 423 | }) |
| @@ -31,7 +31,8 @@ const TAG: string = 'ReserveMorePage'; | @@ -31,7 +31,8 @@ const TAG: string = 'ReserveMorePage'; | ||
| 31 | struct ReserveMorePage { | 31 | struct ReserveMorePage { |
| 32 | @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); | 32 | @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); |
| 33 | private reserveList: ReserveItemBean[] = [] | 33 | private reserveList: ReserveItemBean[] = [] |
| 34 | - topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; | 34 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; |
| 35 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 35 | type: number = 2; | 36 | type: number = 2; |
| 36 | pageSize: number = 20; | 37 | pageSize: number = 20; |
| 37 | title: string = '直播预告' | 38 | title: string = '直播预告' |
| @@ -78,10 +79,13 @@ struct ReserveMorePage { | @@ -78,10 +79,13 @@ struct ReserveMorePage { | ||
| 78 | this.currentPage = 1 | 79 | this.currentPage = 1 |
| 79 | this.getData(resolve) | 80 | this.getData(resolve) |
| 80 | }, | 81 | }, |
| 81 | - }) | 82 | + }).backgroundColor($r('app.color.color_F5F5F5')) |
| 82 | } | 83 | } |
| 83 | 84 | ||
| 84 | - }.backgroundColor($r('app.color.color_F5F5F5')) | 85 | + }.height('100%').backgroundColor('#FFFFFF').padding({ |
| 86 | + top: px2vp(this.topSafeHeight), | ||
| 87 | + bottom: px2vp(this.bottomSafeHeight) | ||
| 88 | + }) | ||
| 85 | 89 | ||
| 86 | } | 90 | } |
| 87 | 91 | ||
| @@ -306,8 +310,7 @@ struct ReserveMorePage { | @@ -306,8 +310,7 @@ struct ReserveMorePage { | ||
| 306 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 310 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 307 | }) | 311 | }) |
| 308 | } | 312 | } |
| 309 | - .height(vp2px(44) + this.topSafeHeight + 'px') | ||
| 310 | - .padding({ top: this.topSafeHeight + 'px' }) | 313 | + .height(44) |
| 311 | .width('100%').backgroundColor('#FFFFFF') | 314 | .width('100%').backgroundColor('#FFFFFF') |
| 312 | 315 | ||
| 313 | } | 316 | } |
| @@ -156,6 +156,7 @@ export struct OperRowListView { | @@ -156,6 +156,7 @@ export struct OperRowListView { | ||
| 156 | this.likeBean['contentRelId'] = this.contentDetailData?.reLInfo?.relId + '' | 156 | this.likeBean['contentRelId'] = this.contentDetailData?.reLInfo?.relId + '' |
| 157 | } | 157 | } |
| 158 | console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) | 158 | console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) |
| 159 | + console.info(TAG, 'this.contentDetailData.shareInfo.shareOpen', JSON.stringify(this.contentDetailData.shareInfo.shareOpen)) | ||
| 159 | console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) | 160 | console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) |
| 160 | console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList)) | 161 | console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList)) |
| 161 | 162 | ||
| @@ -384,6 +385,7 @@ export struct OperRowListView { | @@ -384,6 +385,7 @@ export struct OperRowListView { | ||
| 384 | */ | 385 | */ |
| 385 | @Builder | 386 | @Builder |
| 386 | builderShare() { | 387 | builderShare() { |
| 388 | + if(this.contentDetailData?.shareInfo?.shareOpen == 1) { | ||
| 387 | Column() { | 389 | Column() { |
| 388 | Image(this.styleType == 1 ? $r('app.media.iv_live_comment_share') : | 390 | Image(this.styleType == 1 ? $r('app.media.iv_live_comment_share') : |
| 389 | $r('app.media.iv_live_comment_share_white')) | 391 | $r('app.media.iv_live_comment_share_white')) |
| @@ -401,6 +403,7 @@ export struct OperRowListView { | @@ -401,6 +403,7 @@ export struct OperRowListView { | ||
| 401 | .borderRadius(18) | 403 | .borderRadius(18) |
| 402 | .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) | 404 | .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) |
| 403 | } | 405 | } |
| 406 | + } | ||
| 404 | 407 | ||
| 405 | handleStyle() { | 408 | handleStyle() { |
| 406 | if (this.styleType == 1) { | 409 | if (this.styleType == 1) { |
| @@ -208,13 +208,17 @@ export struct PlayerRightView { | @@ -208,13 +208,17 @@ export struct PlayerRightView { | ||
| 208 | build() { | 208 | build() { |
| 209 | Column() { | 209 | Column() { |
| 210 | this.userBuilderView() | 210 | this.userBuilderView() |
| 211 | + if (this.contentDetailData?.openLikes == 1) { | ||
| 211 | this.likeBuilderView() | 212 | this.likeBuilderView() |
| 213 | + } | ||
| 212 | this.collectBuilderView() | 214 | this.collectBuilderView() |
| 213 | - if (this.contentDetailData.openComment == 1) { | 215 | + if (this.contentDetailData?.openComment == 1) { |
| 214 | this.commentBuilderView() | 216 | this.commentBuilderView() |
| 215 | } | 217 | } |
| 218 | + if(this.contentDetailData?.shareInfo?.shareOpen == 1) { | ||
| 216 | this.shareBuilderView() | 219 | this.shareBuilderView() |
| 217 | } | 220 | } |
| 221 | + } | ||
| 218 | // .backgroundColor(Color.Blue) | 222 | // .backgroundColor(Color.Blue) |
| 219 | // .height('100%') | 223 | // .height('100%') |
| 220 | .width(58) | 224 | .width(58) |
-
Please register or login to post a comment