This commit is contained in:
zhangmanman
2021-08-13 13:30:35 +08:00
parent 540d76bdb8
commit 8f7cc986c2
46 changed files with 1582 additions and 1056 deletions

View File

@@ -8,22 +8,6 @@ Page({
type : "balance ", //卡类型
number : '', //账户余额
accounts : '', //账户列表
screenArray : [
{
channel: 'all',
name: '全部'
},
{
channel: 'in',
name: '入账'
},
{
channel: 'out',
name: '出账'
}
], //账变记录筛选数组
screenChannel: '', //账变记录筛选数组标识
screenIndex : 0, //账变记录筛选index
page : {}, //分页信息
lodingStats : false, //加载状态
},
@@ -31,47 +15,41 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {},
onLoad (options) {
// 获取余额数量
wx.$api.user.logs().then(res=>{
this.setData({
number : res.data.account.balance
})
}).catch(err => {});
},
/**
* 生命周期函数--监听页面显示
*/
onShow () {
// 获取账变记录
// 获取收益订单记录
this.accountInfo();
},
/**
* 账变记录
* 收益订单记录
*/
accountInfo(page) {
wx.$api.user.logs(this.data.type, this.data.screenChannel, page).then(res=>{
wx.$api.user.profits(page).then(res=>{
console.log(res.data.data)
let listArr = this.data.accounts,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
this.setData({
number : res.data.account.balance,
accounts : newData,
page : res.data.page
})
}).catch(err => {});
},
/**
* 筛选账变记录-条件
*/
screenBind(e) {
this.setData({
screenIndex : e.detail.value,
screenChannel: this.data.screenArray[e.detail.value].channel
})
// 获取账变记录
this.accountInfo();
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/