const util = require('../../../utils/util.js'); Page({ data: { activeTab:1, viewDate:{ year:util.getNowFormatDate('yyyy'), month:util.getNowFormatDate('MM') }, dateList:[], pageIndex:1, noMore:false }, onLoad: function (options) { let nowDate=util.getNowFormatDate('yyyy-MM') this.getList() }, onShow: function () { }, // 页面上拉触底事件的处理函数 onReachBottom: function () { this.getList(true) }, getList(type){ let that=this,data={}; data.addType=that.data.activeTab; data.pageIndex=that.data.pageIndex; data.pageSize=15; data.crtYear=this.data.viewDate.year; data.crtMonth=this.data.viewDate.month; util.ajax({ func: "v2/user/userCoin/list", method:'post', data: data, load:false }, function (res) { if (res.code==0) { res.data.list.forEach(el => { el.date_time=util.formatDate(el.crtTime,'',false); }); that.setData({dateList:type?[...that.data.dateList,...res.data.list]:res.data.list,noMore:res.data.list.length