wangliang_wd

feat:优化我的预约列表展示

@@ -66,6 +66,7 @@ export struct AppointmentListUI { @@ -66,6 +66,7 @@ export struct AppointmentListUI {
66 CustomPullToRefresh({ 66 CustomPullToRefresh({
67 alldata:this.data, 67 alldata:this.data,
68 scroller:this.scroller, 68 scroller:this.scroller,
  69 + hasMore:this.hasMore,
69 customList:()=>{ 70 customList:()=>{
70 this.ListLayout() 71 this.ListLayout()
71 }, 72 },
@@ -73,7 +74,6 @@ export struct AppointmentListUI { @@ -73,7 +74,6 @@ export struct AppointmentListUI {
73 this.curPageNum = 1; 74 this.curPageNum = 1;
74 this.hasMore = true 75 this.hasMore = true
75 this.isGetRequest = false 76 this.isGetRequest = false
76 - this.data.clear()  
77 77
78 if (!this.isLoading){ 78 if (!this.isLoading){
79 this.getNewPageData() 79 this.getNewPageData()
@@ -82,8 +82,10 @@ export struct AppointmentListUI { @@ -82,8 +82,10 @@ export struct AppointmentListUI {
82 }, 82 },
83 onLoadMore:(resolve)=> { 83 onLoadMore:(resolve)=> {
84 if (!this.isLoading) { 84 if (!this.isLoading) {
  85 + this.curPageNum++
85 this.isLoading = true 86 this.isLoading = true
86 this.getNewPageData() 87 this.getNewPageData()
  88 + if(resolve) resolve('刷新成功')
87 } 89 }
88 } 90 }
89 }) 91 })
@@ -143,6 +145,8 @@ export struct AppointmentListUI { @@ -143,6 +145,8 @@ export struct AppointmentListUI {
143 this.isLoading = true 145 this.isLoading = true
144 if (this.hasMore) { 146 if (this.hasMore) {
145 MinePageDatasModel.getAppointmentListData("20", `${this.curPageNum}`, getContext(this)).then((value) => { 147 MinePageDatasModel.getAppointmentListData("20", `${this.curPageNum}`, getContext(this)).then((value) => {
  148 + if (this.curPageNum) this.data.clear()
  149 +
146 if (!this.data || value.list.length == 0) { 150 if (!this.data || value.list.length == 0) {
147 this.hasMore = false 151 this.hasMore = false
148 } else { 152 } else {
@@ -156,10 +160,11 @@ export struct AppointmentListUI { @@ -156,10 +160,11 @@ export struct AppointmentListUI {
156 }) 160 })
157 this.data.notifyDataReload() 161 this.data.notifyDataReload()
158 this.count = this.data.totalCount() 162 this.count = this.data.totalCount()
159 - if (this.data.totalCount() < value.totalCount) {  
160 - this.curPageNum++  
161 - if(this.count < 5){  
162 - this.getNewPageData() 163 + if (20 < value.totalCount ) {
  164 + if (value.list.length === 20) {
  165 + this.hasMore = true
  166 + }else {
  167 + this.hasMore = false
163 } 168 }
164 } else { 169 } else {
165 this.hasMore = false 170 this.hasMore = false