wangliang_wd

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

... ... @@ -66,6 +66,7 @@ export struct AppointmentListUI {
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
hasMore:this.hasMore,
customList:()=>{
this.ListLayout()
},
... ... @@ -73,7 +74,6 @@ export struct AppointmentListUI {
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading){
this.getNewPageData()
... ... @@ -82,8 +82,10 @@ export struct AppointmentListUI {
},
onLoadMore:(resolve)=> {
if (!this.isLoading) {
this.curPageNum++
this.isLoading = true
this.getNewPageData()
if(resolve) resolve('刷新成功')
}
}
})
... ... @@ -143,6 +145,8 @@ export struct AppointmentListUI {
this.isLoading = true
if (this.hasMore) {
MinePageDatasModel.getAppointmentListData("20", `${this.curPageNum}`, getContext(this)).then((value) => {
if (this.curPageNum) this.data.clear()
if (!this.data || value.list.length == 0) {
this.hasMore = false
} else {
... ... @@ -156,10 +160,11 @@ export struct AppointmentListUI {
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
if (this.data.totalCount() < value.totalCount) {
this.curPageNum++
if(this.count < 5){
this.getNewPageData()
if (20 < value.totalCount ) {
if (value.list.length === 20) {
this.hasMore = true
}else {
this.hasMore = false
}
} else {
this.hasMore = false
... ...