[更新]
This commit is contained in:
51
pages/myBalance/myBalance_list/myBalance_list.js
Normal file
51
pages/myBalance/myBalance_list/myBalance_list.js
Normal file
@@ -0,0 +1,51 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user