35 lines
998 B
JavaScript
35 lines
998 B
JavaScript
const app = getApp();
|
|
Page({
|
|
data: {
|
|
incomeList: [
|
|
{"name":"薪资","money":"89310.00"},
|
|
{"name":"红包","money":"0.23"}
|
|
]
|
|
},
|
|
onLoad: function (options) {
|
|
app.$api.getSettings().then(setting => {
|
|
let incomeList = setting.data.INCOME_SETTING;
|
|
app.$api.getSettingsIncome().then(res => {
|
|
let result = res.data;
|
|
incomeList.forEach(item => {
|
|
let money = 0
|
|
if (result[item.id]){
|
|
money = result[item.id];
|
|
}
|
|
if (!money){
|
|
money = 0
|
|
}
|
|
item.money = money;
|
|
})
|
|
console.log(incomeList);
|
|
this.setData({incomeList})
|
|
});
|
|
});
|
|
},
|
|
handleClick() {
|
|
wx.navigateTo({
|
|
url : "../edit/index?isAccount=0&isIncome=1&isAdd=1"
|
|
})
|
|
}
|
|
});
|