公司小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.1 KiB

import {post} from '@/common/api.js'
import WalletRecord from '@/common/WalletRecord.js'
export default class RzAndFyData{
allCount = 0;
amountrecord = [];
pagecount = 0;
pageindex = 0;
maxPageCount = 100;
clear(){
this.pageindex = 0;
this.amountrecord = [];
this.allCount = 0;
}
async getNextPage(url){
if(this.allCount != 0 && this.amountrecord.length == this.allCount){
///数据已经拿完了
return;
}
var nextindex = this.pageindex + 1;
uni.showLoading({
})
var res = await post(url,{
pageindex : nextindex,
pagecount : this.maxPageCount,
});
uni.hideLoading()
var Define = getApp().globalData.Define;
var info = Define.onNetMessage(res);
if(info == null){
return;
}
console.log("入账或者分佣数据信息:",info);
for(var key in info){
var rss = info[key];
if(key == 'amountrecord'){
for(var i = 0;i<rss.length;i++){
var rs = rss[i];
var item = new WalletRecord();
for(var k in rs){
item[k] = rs[k];
}
this.amountrecord.push(item);
}
}else{
this[key] = rss;
}
}
}
}