51 lines
1.0 KiB
JavaScript
51 lines
1.0 KiB
JavaScript
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
accounts : '' //账户列表
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad (options) {
|
|
// 获取账变记录
|
|
this.accountInfo(options.type, options.id);
|
|
},
|
|
|
|
/**
|
|
* 账变记录
|
|
*/
|
|
accountInfo(type, id, page) {
|
|
wx.$api.user.profitsNext(type, id, page).then(res=>{
|
|
this.setData({
|
|
accounts : res.data
|
|
})
|
|
}).catch(err => {});
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {
|
|
// 获取账变记录
|
|
this.accountInfo();
|
|
},
|
|
|
|
/**
|
|
* 上拉加载
|
|
*/
|
|
onReachBottom(){
|
|
this.setData({
|
|
lodingStats: true
|
|
})
|
|
let pageNumber = this.data.page.current
|
|
if(this.data.page.has_more){
|
|
pageNumber++
|
|
// 获取账变记录
|
|
this.accountInfo('', '', pageNumber);
|
|
}
|
|
}
|
|
}) |