// 本时生活 Page({ /** * 页面的初始数据 */ data: { accounts : [], //列表 page : {}, //分页信息 lodingStats : false, //加载状态 }, /** * 生命周期函数--监听页面加载 */ onLoad (options) { }, /** * 生命周期函数--监听页面显示 */ onShow () { // 获取提现列表 this.recordInfo(); }, /** * 提现列表 */ recordInfo(page) { wx.$api.user.withdrawsList(page).then(res=>{ let listArr = this.data.accounts, newData = [] if(page == 1 || page == undefined) listArr = [] newData = listArr.concat(res.data.data) this.setData({ accounts : newData, page : res.data.page }) }) }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { // 获取提现列表 this.recordInfo(); }, /** * 上拉加载 */ onReachBottom(){ this.setData({ lodingStats: true }) let pageNumber = this.data.page.current if(this.data.page.has_more){ pageNumber++ // 获取提现列表 this.recordInfo(pageNumber); } } })