Files
cardtest/pages/myBalance/myBalance_list/myBalance_list.js
zhangmanman 8f7cc986c2 [更新]
2021-08-13 13:30:35 +08:00

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);
}
}
})