| xqd
@@ -90,28 +90,38 @@ Page({
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function () {
|
|
|
- wx.showLoading({
|
|
|
- title: 'loading',
|
|
|
- })
|
|
|
var that = this
|
|
|
- wx.request({
|
|
|
- url: that.data.next_page_url,
|
|
|
- data:{
|
|
|
- userid: that.data.userid,
|
|
|
- username: that.data.username,
|
|
|
- batch: that.data.batch,
|
|
|
- province: that.data.province,
|
|
|
- class: that.data.class
|
|
|
- },
|
|
|
- method:'POST',
|
|
|
- success:function(res){
|
|
|
- that.setData({
|
|
|
- paidInfo: [...that.data.paidInfo.concat(res.data.data.major.data)],
|
|
|
- next_page_url: res.data.data.major.next_page_url
|
|
|
- })
|
|
|
- wx.hideLoading()
|
|
|
- }
|
|
|
- })
|
|
|
+ if (that.data.next_page_url){
|
|
|
+ wx.showLoading({
|
|
|
+ title: 'loading',
|
|
|
+ })
|
|
|
+
|
|
|
+ wx.request({
|
|
|
+ url: that.data.next_page_url,
|
|
|
+ data: {
|
|
|
+ userid: that.data.userid,
|
|
|
+ username: that.data.username,
|
|
|
+ batch: that.data.batch,
|
|
|
+ province: that.data.province,
|
|
|
+ class: that.data.class
|
|
|
+ },
|
|
|
+ method: 'POST',
|
|
|
+ success: function (res) {
|
|
|
+ that.setData({
|
|
|
+ paidInfo: [...that.data.paidInfo.concat(res.data.data.major.data)],
|
|
|
+ next_page_url: res.data.data.major.next_page_url
|
|
|
+ })
|
|
|
+ wx.hideLoading()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ wx.showToast({
|
|
|
+ title: '已经没有更多了',
|
|
|
+ icon:'none',
|
|
|
+ duration:1000
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/**
|