Showing
9 changed files
with
105 additions
and
37 deletions
| @@ -45,13 +45,18 @@ export struct CardMediaInfo { | @@ -45,13 +45,18 @@ export struct CardMediaInfo { | ||
| 45 | .mediaLogo() | 45 | .mediaLogo() |
| 46 | Text('回看') | 46 | Text('回看') |
| 47 | .mediaText() | 47 | .mediaText() |
| 48 | - } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo | ||
| 49 | - ?.replayUri) { | ||
| 50 | - // Image($r('app.media.card_live')) | ||
| 51 | - // .mediaLogo() | ||
| 52 | - Text('直播结束') | ||
| 53 | - .mediaText() | 48 | + }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo |
| 49 | + ?.replayUri){ | ||
| 50 | + Text('已结束') | ||
| 51 | + .mediaText() | ||
| 54 | } | 52 | } |
| 53 | + // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo | ||
| 54 | + // ?.replayUri) { | ||
| 55 | + // // Image($r('app.media.card_live')) | ||
| 56 | + // // .mediaLogo() | ||
| 57 | + // Text('直播结束') | ||
| 58 | + // .mediaText() | ||
| 59 | + // } | ||
| 55 | } | 60 | } |
| 56 | } else if (this.contentDTO.objectType === '9') { | 61 | } else if (this.contentDTO.objectType === '9') { |
| 57 | // 显示组图;图片数量 | 62 | // 显示组图;图片数量 |
| @@ -48,8 +48,8 @@ export struct MessageListUI { | @@ -48,8 +48,8 @@ export struct MessageListUI { | ||
| 48 | this.msgData.forEach((item) => { | 48 | this.msgData.forEach((item) => { |
| 49 | if (item.title == "预约消息") { | 49 | if (item.title == "预约消息") { |
| 50 | if (value.subscribeInfo != null) { | 50 | if (value.subscribeInfo != null) { |
| 51 | - if (value.subscribeInfo.title) { | ||
| 52 | - item.desc = value.subscribeInfo.title | 51 | + if (value.subscribeInfo.message) { |
| 52 | + item.desc = value.subscribeInfo.message | ||
| 53 | } | 53 | } |
| 54 | if (value.subscribeInfo.time) { | 54 | if (value.subscribeInfo.time) { |
| 55 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.subscribeInfo.time)+"") | 55 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.subscribeInfo.time)+"") |
| @@ -63,8 +63,8 @@ export struct MessageListUI { | @@ -63,8 +63,8 @@ export struct MessageListUI { | ||
| 63 | item.unReadCount = value.activeCount | 63 | item.unReadCount = value.activeCount |
| 64 | } | 64 | } |
| 65 | if (value.activeInfo != null) { | 65 | if (value.activeInfo != null) { |
| 66 | - if (value.activeInfo.title) { | ||
| 67 | - item.desc = value.activeInfo.title | 66 | + if (value.activeInfo.message) { |
| 67 | + item.desc = value.activeInfo.message | ||
| 68 | } | 68 | } |
| 69 | if (value.activeInfo.time) { | 69 | if (value.activeInfo.time) { |
| 70 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "") | 70 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "") |
| @@ -72,8 +72,8 @@ export struct MessageListUI { | @@ -72,8 +72,8 @@ export struct MessageListUI { | ||
| 72 | } | 72 | } |
| 73 | }/*else if (item.title == "系统消息") { | 73 | }/*else if (item.title == "系统消息") { |
| 74 | if (value.systemInfo != null) { | 74 | if (value.systemInfo != null) { |
| 75 | - if (value.systemInfo.title) { | ||
| 76 | - item.desc = value.systemInfo.title | 75 | + if (value.systemInfo.message) { |
| 76 | + item.desc = value.systemInfo.message | ||
| 77 | } | 77 | } |
| 78 | if (value.systemInfo.time) { | 78 | if (value.systemInfo.time) { |
| 79 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.systemInfo.time) + "") | 79 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.systemInfo.time) + "") |
| @@ -84,11 +84,13 @@ export struct SubscribeListChildComponent{ | @@ -84,11 +84,13 @@ export struct SubscribeListChildComponent{ | ||
| 84 | 84 | ||
| 85 | }.backgroundColor($r('app.color.white')) | 85 | }.backgroundColor($r('app.color.white')) |
| 86 | .borderRadius("8lpx") | 86 | .borderRadius("8lpx") |
| 87 | + .height("336lpx") | ||
| 87 | .width("100%") | 88 | .width("100%") |
| 88 | .padding({left:"23lpx",right:"23lpx"}) | 89 | .padding({left:"23lpx",right:"23lpx"}) |
| 89 | } | 90 | } |
| 90 | .backgroundColor($r('app.color.color_F5F5F5')) | 91 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 91 | .width("100%") | 92 | .width("100%") |
| 93 | + .height("423lpx") | ||
| 92 | .padding({left:"31lpx",right:"31lpx"}) | 94 | .padding({left:"31lpx",right:"31lpx"}) |
| 93 | .alignItems(HorizontalAlign.Center) | 95 | .alignItems(HorizontalAlign.Center) |
| 94 | } | 96 | } |
| 1 | -import { LazyDataSource, StringUtils } from 'wdKit/Index'; | 1 | +import { LazyDataSource, NetworkUtil, StringUtils } from 'wdKit/Index'; |
| 2 | import { Remark, SubscribeMessageModel, | 2 | import { Remark, SubscribeMessageModel, |
| 3 | WDMessageCenterMessageType } from '../../../../model/InteractMessageModel'; | 3 | WDMessageCenterMessageType } from '../../../../model/InteractMessageModel'; |
| 4 | import MinePageDatasModel from '../../../../model/MinePageDatasModel'; | 4 | import MinePageDatasModel from '../../../../model/MinePageDatasModel'; |
| @@ -21,6 +21,8 @@ export struct SubscribeMessageComponent{ | @@ -21,6 +21,8 @@ export struct SubscribeMessageComponent{ | ||
| 21 | curPageNum: number = 1; | 21 | curPageNum: number = 1; |
| 22 | @State isGetRequest: boolean = false | 22 | @State isGetRequest: boolean = false |
| 23 | private scroller: Scroller = new Scroller(); | 23 | private scroller: Scroller = new Scroller(); |
| 24 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 25 | + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | ||
| 24 | 26 | ||
| 25 | aboutToAppear() { | 27 | aboutToAppear() { |
| 26 | this.getNewPageData() | 28 | this.getNewPageData() |
| @@ -32,9 +34,27 @@ export struct SubscribeMessageComponent{ | @@ -32,9 +34,27 @@ export struct SubscribeMessageComponent{ | ||
| 32 | CustomTitleUI({ titleName: "预约消息" }) | 34 | CustomTitleUI({ titleName: "预约消息" }) |
| 33 | if (this.count == 0) { | 35 | if (this.count == 0) { |
| 34 | if (this.isGetRequest == true) { | 36 | if (this.isGetRequest == true) { |
| 35 | - EmptyComponent({ emptyType: 5 }) | ||
| 36 | - .height('100%') | ||
| 37 | - .width('100%') | 37 | + if(this.isConnectNetwork){ |
| 38 | + EmptyComponent({ emptyType: 5 }) | ||
| 39 | + .height('100%') | ||
| 40 | + .width('100%') | ||
| 41 | + }else{ | ||
| 42 | + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | ||
| 43 | + this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 44 | + if(this.isConnectNetwork){ | ||
| 45 | + this.curPageNum = 1; | ||
| 46 | + this.hasMore = true | ||
| 47 | + this.isGetRequest = false | ||
| 48 | + this.data.clear() | ||
| 49 | + | ||
| 50 | + if (!this.isLoading) { | ||
| 51 | + this.getNewPageData() | ||
| 52 | + } | ||
| 53 | + } | ||
| 54 | + },}) | ||
| 55 | + .layoutWeight(1) | ||
| 56 | + .width('100%') | ||
| 57 | + } | ||
| 38 | } | 58 | } |
| 39 | } else { | 59 | } else { |
| 40 | CustomPullToRefresh({ | 60 | CustomPullToRefresh({ |
| @@ -60,6 +80,8 @@ export struct SubscribeMessageComponent{ | @@ -60,6 +80,8 @@ export struct SubscribeMessageComponent{ | ||
| 60 | } | 80 | } |
| 61 | } | 81 | } |
| 62 | }) | 82 | }) |
| 83 | + .width('100%') | ||
| 84 | + .margin({bottom:px2vp(this.bottomSafeHeight)}) | ||
| 63 | } | 85 | } |
| 64 | } | 86 | } |
| 65 | .backgroundColor($r('app.color.color_F9F9F9')) | 87 | .backgroundColor($r('app.color.color_F9F9F9')) |
| @@ -94,7 +116,7 @@ export struct SubscribeMessageComponent{ | @@ -94,7 +116,7 @@ export struct SubscribeMessageComponent{ | ||
| 94 | } | 116 | } |
| 95 | } | 117 | } |
| 96 | }.width('100%') | 118 | }.width('100%') |
| 97 | - .cachedCount(4) | 119 | + .height("100%") |
| 98 | .scrollBar(BarState.Off) | 120 | .scrollBar(BarState.Off) |
| 99 | .layoutWeight(1) | 121 | .layoutWeight(1) |
| 100 | } | 122 | } |
| @@ -38,16 +38,30 @@ struct PeopleShipHomePage { | @@ -38,16 +38,30 @@ struct PeopleShipHomePage { | ||
| 38 | @State attentionOpacity: boolean = false | 38 | @State attentionOpacity: boolean = false |
| 39 | @Provide topHeight: number = 286 | 39 | @Provide topHeight: number = 286 |
| 40 | @State isLoading: boolean = true | 40 | @State isLoading: boolean = true |
| 41 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 41 | 42 | ||
| 42 | build() { | 43 | build() { |
| 43 | Stack({ alignContent: Alignment.TopStart }) { | 44 | Stack({ alignContent: Alignment.TopStart }) { |
| 44 | - // 顶部图片 | ||
| 45 | - Image($r('app.media.home_page_bg')) | ||
| 46 | - .width('100%') | ||
| 47 | - .height('120vp') | ||
| 48 | - .objectFit(ImageFit.Fill) | ||
| 49 | - .backgroundColor(Color.White) | ||
| 50 | - .visibility(this.isLoading ? Visibility.None : Visibility.Visible) | 45 | + Stack({ alignContent: Alignment.Top }){ |
| 46 | + // 顶部图片 | ||
| 47 | + Image($r('app.media.home_page_bg')) | ||
| 48 | + .width('100%') | ||
| 49 | + .height('120vp') | ||
| 50 | + .objectFit(ImageFit.Fill) | ||
| 51 | + .backgroundColor(Color.White) | ||
| 52 | + .visibility(this.isLoading ? Visibility.None : Visibility.Visible) | ||
| 53 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 54 | + | ||
| 55 | + Row() | ||
| 56 | + .height(px2vp(this.topSafeHeight)) | ||
| 57 | + .width("100%") | ||
| 58 | + .backgroundColor($r('app.color.white')) | ||
| 59 | + .visibility(this.attentionOpacity ? 1 : 0) | ||
| 60 | + .opacity(this.topOpacity ) | ||
| 61 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + | ||
| 51 | 65 | ||
| 52 | Column(){ | 66 | Column(){ |
| 53 | // 头部返回 | 67 | // 头部返回 |
| @@ -109,7 +123,7 @@ struct PeopleShipHomePage { | @@ -109,7 +123,7 @@ struct PeopleShipHomePage { | ||
| 109 | }) | 123 | }) |
| 110 | } | 124 | } |
| 111 | 125 | ||
| 112 | - } | 126 | + }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) |
| 113 | .alignItems(HorizontalAlign.Start) | 127 | .alignItems(HorizontalAlign.Start) |
| 114 | .justifyContent(FlexAlign.Start) | 128 | .justifyContent(FlexAlign.Start) |
| 115 | .width('100%') | 129 | .width('100%') |
| @@ -36,6 +36,7 @@ struct MineHomePage { | @@ -36,6 +36,7 @@ struct MineHomePage { | ||
| 36 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 36 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 37 | @State isCommentEnter:string = ""; | 37 | @State isCommentEnter:string = ""; |
| 38 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | 38 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() |
| 39 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 39 | 40 | ||
| 40 | onPageShow(): void { | 41 | onPageShow(): void { |
| 41 | this.getUserInfo() | 42 | this.getUserInfo() |
| @@ -52,10 +53,21 @@ struct MineHomePage { | @@ -52,10 +53,21 @@ struct MineHomePage { | ||
| 52 | build() { | 53 | build() { |
| 53 | if(this.isConnectNetwork){ | 54 | if(this.isConnectNetwork){ |
| 54 | Stack({ alignContent: Alignment.Top }){ | 55 | Stack({ alignContent: Alignment.Top }){ |
| 55 | - Image($r('app.media.title_bg')) | ||
| 56 | - .width('100%') | ||
| 57 | - .height('355lpx') | ||
| 58 | - .objectFit(ImageFit.Cover) | 56 | + Stack({ alignContent: Alignment.Top }){ |
| 57 | + Image($r('app.media.title_bg')) | ||
| 58 | + .width('100%') | ||
| 59 | + .height('355lpx') | ||
| 60 | + .objectFit(ImageFit.Cover) | ||
| 61 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 62 | + | ||
| 63 | + Row() | ||
| 64 | + .height(px2vp(this.topSafeHeight)) | ||
| 65 | + .width("100%") | ||
| 66 | + .backgroundColor($r('app.color.white')) | ||
| 67 | + .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 68 | + .opacity(this.tileOpacity ) | ||
| 69 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 70 | + } | ||
| 59 | 71 | ||
| 60 | Column(){ | 72 | Column(){ |
| 61 | Stack({ alignContent: Alignment.Top }){ | 73 | Stack({ alignContent: Alignment.Top }){ |
| @@ -262,7 +274,7 @@ struct MineHomePage { | @@ -262,7 +274,7 @@ struct MineHomePage { | ||
| 262 | .scrollBar(BarState.Off) | 274 | .scrollBar(BarState.Off) |
| 263 | .width('100%') | 275 | .width('100%') |
| 264 | .layoutWeight(1) | 276 | .layoutWeight(1) |
| 265 | - } | 277 | + }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) |
| 266 | }.width('100%') | 278 | }.width('100%') |
| 267 | .layoutWeight(1) | 279 | .layoutWeight(1) |
| 268 | }else{ | 280 | }else{ |
| @@ -385,10 +397,10 @@ struct MineHomePage { | @@ -385,10 +397,10 @@ struct MineHomePage { | ||
| 385 | this.editUserInfo() | 397 | this.editUserInfo() |
| 386 | }) | 398 | }) |
| 387 | } | 399 | } |
| 388 | - .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 389 | .height('84lpx') | 400 | .height('84lpx') |
| 390 | .width('100%') | 401 | .width('100%') |
| 391 | .backgroundColor($r('app.color.white')) | 402 | .backgroundColor($r('app.color.white')) |
| 403 | + .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 392 | .opacity(this.tileOpacity ) | 404 | .opacity(this.tileOpacity ) |
| 393 | 405 | ||
| 394 | } | 406 | } |
| @@ -15,6 +15,7 @@ const TAG = "OtherNormalUserHomePage" | @@ -15,6 +15,7 @@ const TAG = "OtherNormalUserHomePage" | ||
| 15 | struct OtherNormalUserHomePage { | 15 | struct OtherNormalUserHomePage { |
| 16 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 16 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 17 | @Watch('change') @State curUserId: string = '-1'; | 17 | @Watch('change') @State curUserId: string = '-1'; |
| 18 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 18 | 19 | ||
| 19 | onPageShow() { | 20 | onPageShow() { |
| 20 | this.curUserId = this.params?.['userId']; | 21 | this.curUserId = this.params?.['userId']; |
| @@ -52,10 +53,21 @@ struct OtherNormalUserHomePage { | @@ -52,10 +53,21 @@ struct OtherNormalUserHomePage { | ||
| 52 | build() { | 53 | build() { |
| 53 | if(this.isConnectNetwork){ | 54 | if(this.isConnectNetwork){ |
| 54 | Stack({ alignContent: Alignment.Top }){ | 55 | Stack({ alignContent: Alignment.Top }){ |
| 55 | - Image($r('app.media.title_bg')) | ||
| 56 | - .width('100%') | ||
| 57 | - .height('355lpx') | ||
| 58 | - .objectFit(ImageFit.Cover) | 56 | + Stack({ alignContent: Alignment.Top }){ |
| 57 | + Image($r('app.media.title_bg')) | ||
| 58 | + .width('100%') | ||
| 59 | + .height('355lpx') | ||
| 60 | + .objectFit(ImageFit.Cover) | ||
| 61 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 62 | + | ||
| 63 | + Row() | ||
| 64 | + .height(px2vp(this.topSafeHeight)) | ||
| 65 | + .width("100%") | ||
| 66 | + .backgroundColor($r('app.color.white')) | ||
| 67 | + .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 68 | + .opacity(this.tileOpacity ) | ||
| 69 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 70 | + } | ||
| 59 | 71 | ||
| 60 | Column(){ | 72 | Column(){ |
| 61 | Stack({ alignContent: Alignment.Top }){ | 73 | Stack({ alignContent: Alignment.Top }){ |
| @@ -229,7 +241,7 @@ struct OtherNormalUserHomePage { | @@ -229,7 +241,7 @@ struct OtherNormalUserHomePage { | ||
| 229 | .scrollBar(BarState.Off) | 241 | .scrollBar(BarState.Off) |
| 230 | .width('100%') | 242 | .width('100%') |
| 231 | .layoutWeight(1) | 243 | .layoutWeight(1) |
| 232 | - } | 244 | + }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) |
| 233 | }.width('100%') | 245 | }.width('100%') |
| 234 | .layoutWeight(1) | 246 | .layoutWeight(1) |
| 235 | }else{ | 247 | }else{ |
-
Please register or login to post a comment