预算配置
This commit is contained in:
@@ -181,27 +181,19 @@ function initLineChart2(canvas, width, height, dpr) {
|
||||
chart.setOption(option);
|
||||
return chart;
|
||||
}
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
// 指定选择区间起始值
|
||||
start: '2000-01-01 00:00:00',
|
||||
end: '2030-09-09 12:12:12',
|
||||
showDateVisible:false,
|
||||
showDate:'2022-01',
|
||||
accountList: [
|
||||
{"id":1,"title":"电脑","type":"income","dateTime":"01-06","from":"银行卡","money":"4500.00"},
|
||||
{"id":2,"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"35.00"},
|
||||
{"id":1,"title":"电脑","type":"income","dateTime":"01-06","from":"银行卡","money":"4500.00"},
|
||||
{"id":2,"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"35.00"},
|
||||
{"id":1,"title":"电脑","type":"income","dateTime":"01-06","from":"银行卡","money":"4500.00"},
|
||||
{"id":2,"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"35.00"},
|
||||
{"id":1,"title":"电脑","type":"income","dateTime":"01-06","from":"银行卡","money":"4500.00"},
|
||||
{"id":2,"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"35.00"},
|
||||
{"id":1,"title":"电脑","type":"income","dateTime":"01-06","from":"银行卡","money":"4500.00"},
|
||||
{"id":2,"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"35.00"},
|
||||
{"id":1,"title":"电脑","type":"income","dateTime":"01-06","from":"银行卡","money":"4500.00"},
|
||||
{"id":2,"title":"狗粮","type":"expend","dateTime":"01-06","from":"支付宝","money":"35.00"},
|
||||
],
|
||||
showDate:app.$utils.formatDateMonth(new Date()),
|
||||
accountList: [],
|
||||
sumExpend: 0,
|
||||
sumIncome: 0,
|
||||
sumTransfer: 0,
|
||||
sumRepayment: 0,
|
||||
payTypeList: [
|
||||
{"title":"数码产品","type":"expend","progress":"80","money":"4500.00"},
|
||||
{"title":"房贷","type":"expend","progress":"20","money":"35.00"},
|
||||
@@ -258,15 +250,25 @@ Page({
|
||||
ecLine2: {
|
||||
onInit: initLineChart2
|
||||
}
|
||||
},
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
onShow: function () {
|
||||
this.updateView();
|
||||
if (wx.canIUse('hideHomeButton')) {
|
||||
wx.hideHomeButton()
|
||||
}
|
||||
},
|
||||
updateView(){
|
||||
app.$api.listBillByAMonth({'rangeDate':this.data.showDate}).then(res => {
|
||||
if (res.data){
|
||||
let accountList = res.data.accountList
|
||||
let sumExpend = res.data.sumExpend
|
||||
let sumIncome = res.data.sumIncome
|
||||
let sumTransfer = res.data.sumTransfer
|
||||
let sumRepayment = res.data.sumRepayment
|
||||
this.setData({accountList,sumExpend,sumIncome,sumTransfer,sumRepayment})
|
||||
}
|
||||
})
|
||||
},
|
||||
showPicker(e) {
|
||||
const { mode } = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
@@ -283,12 +285,12 @@ Page({
|
||||
onConfirm(e) {
|
||||
const { value } = e.detail;
|
||||
const { mode } = this.data;
|
||||
console.log('confim', value);
|
||||
this.setData({
|
||||
[mode]: value
|
||||
// [`${mode}Text`]: value,
|
||||
});
|
||||
this.hidePicker();
|
||||
this.updateView()
|
||||
this.hidePicker()
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
<t-tabs defaultValue="{{0}}" t-class="custom-tabs" theme="card">
|
||||
<t-tab-panel label="总览" value="0" class="tab_content">
|
||||
<view class="space_box font_big">
|
||||
<text class="t-color-expend">支出\n {{1203.00}}</text>
|
||||
<text class="t-color-income">收入\n {{1203.00}}</text>
|
||||
<text class="t-color-transfer">转账\n {{1203.00}}</text>
|
||||
<text class="t-color-repayment">还款\n {{1203.00}}</text>
|
||||
<text class="t-color-expend">支出\n {{sumExpend}}</text>
|
||||
<text class="t-color-income">收入\n {{sumIncome}}</text>
|
||||
<text class="t-color-transfer">转账\n {{sumTransfer}}</text>
|
||||
<text class="t-color-repayment">还款\n {{sumRepayment}}</text>
|
||||
</view>
|
||||
<view class="padding_box">
|
||||
<t-divider dashed content="账单明细"/>
|
||||
@@ -15,18 +15,18 @@
|
||||
<view wx:if="{{accountList != null && accountList.length > 0}}">
|
||||
<t-cell-group theme="card">
|
||||
<t-cell wx:for="{{accountList}}" wx:key="index"
|
||||
title="{{item.title}}"
|
||||
description="{{item.dateTime}} • {{item.from}}"
|
||||
title="{{item.moneyName}}"
|
||||
description="{{item.date}} • {{item.accountName}}"
|
||||
align="top"
|
||||
image="/image/bill/4.png"
|
||||
image="{{item.moneyIcon}}"
|
||||
note="{{item.money}}"
|
||||
class="t-cell-{{item.type}}"
|
||||
class="t-cell-{{item.billType}}"
|
||||
url="{{'/pages/bill/index?id=' + item.id}}"
|
||||
/>
|
||||
</t-cell-group>
|
||||
</view>
|
||||
<view wx:else class="empty-view" >
|
||||
<t-empty icon="chart-bubble" description="今日还未记账" />
|
||||
<t-empty icon="chart-bubble" description="本月无账单记录" />
|
||||
</view>
|
||||
</t-tab-panel>
|
||||
<t-tab-panel label="支出分类" value="1">
|
||||
|
||||
Reference in New Issue
Block a user