预算配置

This commit is contained in:
2023-02-09 22:46:38 +08:00
parent 7a7884abf5
commit 432b4f9815
8 changed files with 79 additions and 43 deletions

View File

@@ -1,7 +1,11 @@
const app = getApp()
Page({
data: {
progress: 89,
sumToday:0,
sumBalance:0,
sumBudget:0,
sumUsed:0,
progress:0,
todayList: []
},
onLoad: function (options) {
@@ -13,6 +17,16 @@ Page({
this.setData({todayList})
}
})
app.$api.getBudgetIndex().then(res => {
if (res.data){
let sumToday = res.data.sumToday
let sumBalance = res.data.sumBalance
let sumBudget = res.data.sumBudget
let sumUsed = res.data.sumUsed
let progress = Math.floor(res.data.sumUsed / res.data.sumBudget * 10000) / 100
this.setData({sumToday,sumBalance,sumBudget,sumUsed,progress})
}
})
if (wx.canIUse('hideHomeButton')) {
wx.hideHomeButton()
}