收入支出显示修复

This commit is contained in:
2023-02-09 23:52:18 +08:00
parent 432b4f9815
commit 87a1b4ce18
4 changed files with 8 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
const app = getApp(); const app = getApp();
Page({ Page({
data: { data: {
sumYearAmnt: 0,
payList: [] payList: []
}, },
onLoad: function (options) { onLoad: function (options) {
@@ -21,8 +22,8 @@ Page({
} }
item.money = money; item.money = money;
}) })
console.log(payList); let sumYearAmnt = result[-1];
this.setData({payList}) this.setData({payList,sumYearAmnt})
}); });
}); });
}, },

View File

@@ -4,7 +4,7 @@
<view data-type="count" class="inline_box font_big">年度总支出</view> <view data-type="count" class="inline_box font_big">年度总支出</view>
</view> </view>
<view class="pay_look"> <view class="pay_look">
<text class="center_look font_big">{{ 7000.23 }}</text> <text class="center_look font_big">{{ sumYearAmnt ? sumYearAmnt : 0 }}</text>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -1,6 +1,7 @@
const app = getApp(); const app = getApp();
Page({ Page({
data: { data: {
sumYearAmnt: 0,
incomeList: [] incomeList: []
}, },
onShow() { onShow() {
@@ -18,8 +19,8 @@ Page({
} }
item.money = money; item.money = money;
}) })
console.log(incomeList); let sumYearAmnt = result[-1];
this.setData({incomeList}) this.setData({incomeList,sumYearAmnt})
}); });
}); });
}, },

View File

@@ -4,7 +4,7 @@
<view data-type="count" class="inline_box font_big">年度总收入</view> <view data-type="count" class="inline_box font_big">年度总收入</view>
</view> </view>
<view class="pay_look"> <view class="pay_look">
<text class="center_look font_big">{{ 89310.23 }}</text> <text class="center_look font_big">{{ sumYearAmnt ? sumYearAmnt : 0 }}</text>
</view> </view>
</view> </view>
</view> </view>