| xqd
@@ -27,6 +27,7 @@ Page({
|
|
|
showPayButton: true,
|
|
|
showPaidInfo: false,
|
|
|
paidInfo:[],
|
|
|
+ next_page_url:'',
|
|
|
},
|
|
|
|
|
|
/**
|
| xqd
@@ -89,7 +90,28 @@ 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()
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|
| xqd
@@ -182,13 +204,14 @@ Page({
|
|
|
console.log('已付费')
|
|
|
console.log(res.data)
|
|
|
that.setData({
|
|
|
- paidInfo:[...res.data.data.major],
|
|
|
- major_count:res.data.data.count,
|
|
|
+ paidInfo:[...res.data.data.major.data],
|
|
|
+ major_count:res.data.data.major.total,
|
|
|
showFreeInfo: false,
|
|
|
showPayButton: false,
|
|
|
showPaidInfo: true,
|
|
|
+ next_page_url:res.data.data.major.next_page_url
|
|
|
})
|
|
|
- console.log(that.data.paidInfo)
|
|
|
+ console.log(that.data)
|
|
|
}
|
|
|
})
|
|
|
}
|
| xqd
@@ -198,13 +221,14 @@ Page({
|
|
|
} else {
|
|
|
console.log('已付费')
|
|
|
that.setData({
|
|
|
- paidInfo: [...res.data.data.major],
|
|
|
- major_count: res.data.data.count,
|
|
|
+ paidInfo: [...res.data.data.major.data],
|
|
|
+ major_count: res.data.data.major.total,
|
|
|
showFreeInfo: false,
|
|
|
showPayButton: false,
|
|
|
showPaidInfo: true,
|
|
|
+ next_page_url: res.data.data.major.next_page_url
|
|
|
})
|
|
|
- console.log(that.data.paidInfo)
|
|
|
+ console.log(that.data)
|
|
|
}
|
|
|
}
|
|
|
})
|