yangchenggong1_wd

fix:bug[17461] 无网络时进入我的预约下,鸿蒙版显示的缺省图与安卓不一致

@@ -2,7 +2,7 @@ import { AppointmentListChildComponent } from './AppointmentListChildComponent'; @@ -2,7 +2,7 @@ import { AppointmentListChildComponent } from './AppointmentListChildComponent';
2 import { CustomTitleUI } from '../../reusable/CustomTitleUI' 2 import { CustomTitleUI } from '../../reusable/CustomTitleUI'
3 import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; 3 import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
4 import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'; 4 import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem';
5 -import { LazyDataSource, StringUtils } from 'wdKit'; 5 +import { LazyDataSource, NetworkUtil, StringUtils } from 'wdKit';
6 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 6 import MinePageDatasModel from '../../../model/MinePageDatasModel';
7 import { EmptyComponent } from '../../view/EmptyComponent'; 7 import { EmptyComponent } from '../../view/EmptyComponent';
8 import { Action, ContentDTO } from 'wdBean/Index'; 8 import { Action, ContentDTO } from 'wdBean/Index';
@@ -23,6 +23,7 @@ export struct AppointmentListUI { @@ -23,6 +23,7 @@ export struct AppointmentListUI {
23 curPageNum: number = 1; 23 curPageNum: number = 1;
24 @State isGetRequest: boolean = false 24 @State isGetRequest: boolean = false
25 private scroller: Scroller = new Scroller(); 25 private scroller: Scroller = new Scroller();
  26 + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
26 27
27 aboutToAppear() { 28 aboutToAppear() {
28 this.getNewPageData() 29 this.getNewPageData()
@@ -34,13 +35,29 @@ export struct AppointmentListUI { @@ -34,13 +35,29 @@ export struct AppointmentListUI {
34 CustomTitleUI({ titleName: "我的预约" }) 35 CustomTitleUI({ titleName: "我的预约" })
35 if (this.count == 0) { 36 if (this.count == 0) {
36 if (this.isGetRequest == true) { 37 if (this.isGetRequest == true) {
37 - EmptyComponent({ emptyType: 10 })  
38 - .height('100%')  
39 - .width('100%') 38 + if(this.isConnectNetwork){
  39 + EmptyComponent({ emptyType: 10 })
  40 + .height('100%')
  41 + .width('100%')
  42 + }else{
  43 + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
  44 + this.isConnectNetwork = NetworkUtil.isNetConnected()
  45 + if(this.isConnectNetwork){
  46 + this.curPageNum = 1;
  47 + this.hasMore = true
  48 + this.isGetRequest = false
  49 + this.data.clear()
  50 +
  51 + if (!this.isLoading) {
  52 + this.getNewPageData()
  53 + }
  54 + }
  55 + },})
  56 + .layoutWeight(1)
  57 + .width('100%')
  58 + }
40 } 59 }
41 -  
42 } else { 60 } else {
43 -  
44 CustomPullToRefresh({ 61 CustomPullToRefresh({
45 alldata:this.data, 62 alldata:this.data,
46 scroller:this.scroller, 63 scroller:this.scroller,