Showing
1 changed file
with
23 additions
and
4 deletions
| 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'; |
| @@ -22,6 +22,7 @@ export struct SubscribeMessageComponent{ | @@ -22,6 +22,7 @@ export struct SubscribeMessageComponent{ | ||
| 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 | 24 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 25 | + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | ||
| 25 | 26 | ||
| 26 | aboutToAppear() { | 27 | aboutToAppear() { |
| 27 | this.getNewPageData() | 28 | this.getNewPageData() |
| @@ -33,9 +34,27 @@ export struct SubscribeMessageComponent{ | @@ -33,9 +34,27 @@ export struct SubscribeMessageComponent{ | ||
| 33 | CustomTitleUI({ titleName: "预约消息" }) | 34 | CustomTitleUI({ titleName: "预约消息" }) |
| 34 | if (this.count == 0) { | 35 | if (this.count == 0) { |
| 35 | if (this.isGetRequest == true) { | 36 | if (this.isGetRequest == true) { |
| 36 | - EmptyComponent({ emptyType: 5 }) | ||
| 37 | - .height('100%') | ||
| 38 | - .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 | + } | ||
| 39 | } | 58 | } |
| 40 | } else { | 59 | } else { |
| 41 | CustomPullToRefresh({ | 60 | CustomPullToRefresh({ |
-
Please register or login to post a comment