|
|
@@ -69,7 +69,13 @@ Page({ |
|
|
|
* 页面上拉触底事件的处理函数 |
|
|
|
*/ |
|
|
|
onReachBottom() { |
|
|
|
|
|
|
|
if(this.data.userPage.page*this.data.userPage.limit<this.data.total){ |
|
|
|
this.data.userPage.page++ |
|
|
|
this.setData({ |
|
|
|
userPage:this.data.userPage |
|
|
|
}) |
|
|
|
this.westreamActivity() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
@@ -95,20 +101,19 @@ Page({ |
|
|
|
} |
|
|
|
api_westreamActivity(data).then(res=>{ |
|
|
|
let list =[] |
|
|
|
if(this.data.userPage.page==1){ |
|
|
|
list =res.data.records |
|
|
|
}else{ |
|
|
|
list = [...this.data.list,...res.data.records] |
|
|
|
} |
|
|
|
|
|
|
|
let total = res.data.total |
|
|
|
list = list.reduce((pre,item)=>{ |
|
|
|
res.data.records = res.data.records.reduce((pre,item)=>{ |
|
|
|
return [...pre,{ |
|
|
|
...item, |
|
|
|
activityBeginTime:this.formatDate(item.activityBeginTime), |
|
|
|
activityEndTime:this.formatDate(item.activityEndTime) |
|
|
|
}] |
|
|
|
},[]) |
|
|
|
if(this.data.userPage.page==1){ |
|
|
|
list =res.data.records |
|
|
|
}else{ |
|
|
|
list = [...this.data.list,...res.data.records] |
|
|
|
} |
|
|
|
let total = res.data.total |
|
|
|
this.setData({ |
|
|
|
total, |
|
|
|
list, |