图标统计调整
This commit is contained in:
@@ -27,6 +27,9 @@ Page({
|
||||
this.setData({dateRange,dateRangeText})
|
||||
},
|
||||
onShow() {
|
||||
this.updateList()
|
||||
},
|
||||
updateList() {
|
||||
app.$api.listBillByAccount({
|
||||
sid:this.data.sid,
|
||||
dateRange:this.data.dateRangeText,
|
||||
@@ -55,6 +58,7 @@ Page({
|
||||
dateRange: value,
|
||||
dateRangeText: valueText
|
||||
});
|
||||
this.updateList()
|
||||
},
|
||||
|
||||
showDialog() {
|
||||
|
||||
@@ -1,128 +1,51 @@
|
||||
const app = getApp();
|
||||
import * as echarts from '../../ec-canvas/echarts';
|
||||
let pieData = [];
|
||||
let pieChart;
|
||||
let line1Chart;
|
||||
let line1Data = [];
|
||||
let line2Chart;
|
||||
let line2Data = [];
|
||||
function initPieChart(canvas, width, height, dpr) {
|
||||
if (pieData.length <= 0){
|
||||
return;
|
||||
}
|
||||
const chart = echarts.init(canvas, null, {
|
||||
pieChart = echarts.init(canvas, null, {
|
||||
width: 400,
|
||||
height: 250,
|
||||
devicePixelRatio: dpr // new
|
||||
});
|
||||
canvas.setChart(chart);
|
||||
var option = {
|
||||
backgroundColor: "#3C4043",
|
||||
series: [{
|
||||
label: {
|
||||
normal: {
|
||||
fontSize: 14
|
||||
}
|
||||
},
|
||||
type: 'pie',
|
||||
center: ['50%', '50%'],
|
||||
radius: ['0%', '70%'],
|
||||
data: pieData
|
||||
}]
|
||||
};
|
||||
chart.setOption(option);
|
||||
chart.on('click', 'series.pie', function(param) {
|
||||
console.log(param);
|
||||
canvas.setChart(pieChart);
|
||||
let option = app.$utils.getPieOption(pieData);
|
||||
pieChart.setOption(option);
|
||||
pieChart.on('click', 'series.pie', function(param) {
|
||||
wx.navigateTo({
|
||||
url: "./group/index?expendId=" + param.data.sId + '&rangeDate=' + param.data.sDate
|
||||
})
|
||||
});
|
||||
return chart;
|
||||
return pieChart
|
||||
}
|
||||
|
||||
function initLineChart1(canvas, width, height, dpr) {
|
||||
const chart = echarts.init(canvas, null, {
|
||||
line1Chart = echarts.init(canvas, null, {
|
||||
width: 400,
|
||||
height: 300,
|
||||
devicePixelRatio: dpr // new
|
||||
});
|
||||
canvas.setChart(chart);
|
||||
var option = {
|
||||
legend: {
|
||||
data: ['支出', '收入', '转账','还款'],
|
||||
top: 20,
|
||||
left: 'center',
|
||||
backgroundColor: 'white',
|
||||
z: 100
|
||||
},
|
||||
grid: {
|
||||
containLabel: true
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'axis'
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
show: false
|
||||
},
|
||||
yAxis: {
|
||||
x: 'center',
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
}
|
||||
},
|
||||
series: line1Data
|
||||
};
|
||||
chart.setOption(option);
|
||||
return chart;
|
||||
canvas.setChart(line1Chart);
|
||||
let option = app.$utils.getDayLineOption(line1Data);
|
||||
line1Chart.setOption(option);
|
||||
return line1Chart;
|
||||
}
|
||||
function initLineChart2(canvas, width, height, dpr) {
|
||||
const chart = echarts.init(canvas, null, {
|
||||
line2Chart = echarts.init(canvas, null, {
|
||||
width: 400,
|
||||
height: 300,
|
||||
devicePixelRatio: dpr // new
|
||||
});
|
||||
canvas.setChart(chart);
|
||||
var option = {
|
||||
legend: {
|
||||
data: ['支出', '收入', '转账','还款'],
|
||||
top: 20,
|
||||
left: 'center',
|
||||
backgroundColor: 'white',
|
||||
z: 100
|
||||
},
|
||||
grid: {
|
||||
containLabel: true
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'axis'
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
show: false
|
||||
},
|
||||
yAxis: {
|
||||
x: 'center',
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
}
|
||||
// show: false
|
||||
},
|
||||
series: line2Data
|
||||
};
|
||||
chart.setOption(option);
|
||||
return chart;
|
||||
canvas.setChart(line2Chart);
|
||||
let option = app.$utils.getMonthLineOption(line2Data);
|
||||
line2Chart.setOption(option);
|
||||
return line2Chart;
|
||||
}
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
// 指定选择区间起始值
|
||||
start: '2000-01-01 00:00:00',
|
||||
end: '2030-09-09 12:12:12',
|
||||
showDateVisible:false,
|
||||
@@ -172,6 +95,8 @@ Page({
|
||||
});
|
||||
})
|
||||
}
|
||||
let option = app.$utils.getPieOption(pieData);
|
||||
pieChart.setOption(option);
|
||||
this.setData({payTypeList})
|
||||
}
|
||||
})
|
||||
@@ -228,6 +153,10 @@ Page({
|
||||
smooth: true,
|
||||
data: res.data.lineMonthRepayment
|
||||
})
|
||||
let line1Option = app.$utils.getDayLineOption(line1Data);
|
||||
line1Chart.setOption(line1Option);
|
||||
let line2Option = app.$utils.getDayLineOption(line2Data);
|
||||
line2Chart.setOption(line2Option);
|
||||
}
|
||||
})
|
||||
app.$api.listBillByAMonth({'rangeDate':this.data.showDate}).then(res => {
|
||||
@@ -273,9 +202,8 @@ Page({
|
||||
[mode]: value
|
||||
// [`${mode}Text`]: value,
|
||||
});
|
||||
// this.updateView()
|
||||
this.updateView()
|
||||
this.hidePicker()
|
||||
wx.redirectTo({url:"./index?rangeDate=" + this.data.showDate})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -44,24 +44,21 @@
|
||||
/>
|
||||
</t-cell-group>
|
||||
</view>
|
||||
<view wx:else class="empty-view" >
|
||||
<t-empty icon="chart-bubble" description="本月无账单记录" />
|
||||
</view>
|
||||
<t-empty wx:else icon="chart-bubble" description="本月无账单记录" />
|
||||
<view class="placeholder"/>
|
||||
</view>
|
||||
</t-tab-panel>
|
||||
<t-tab-panel label="趋势" value="2">
|
||||
<t-tab-panel label="当月趋势" value="2">
|
||||
<view class="chart-box">
|
||||
<view class="chart_title">本月</view>
|
||||
<ec-canvas id="mychart-dom-line1" canvas-id="mychart-line1" ec="{{ ecLine1 }}"></ec-canvas>
|
||||
</view>
|
||||
<view class="chart-box2">
|
||||
<view class="chart-title2">近6月</view>
|
||||
</t-tab-panel>
|
||||
<t-tab-panel label="近6月趋势" value="3">
|
||||
<view class="chart-box">
|
||||
<ec-canvas id="mychart-dom-line2" canvas-id="mychart-line2" ec="{{ ecLine2 }}"></ec-canvas>
|
||||
<view class="chart-chart-bottom"></view>
|
||||
</view>
|
||||
</t-tab-panel>
|
||||
<t-tab-panel label="排行" value="3">
|
||||
<t-tab-panel label="排行" value="4">
|
||||
<t-tabs defaultValue="{{0}}" t-class="custom-tabs" theme="card">
|
||||
<t-tab-panel label="支出" value="0">
|
||||
<view class="tabs_crevice"/>
|
||||
|
||||
@@ -2,29 +2,11 @@
|
||||
width:100%;
|
||||
height:500rpx;
|
||||
position: absolute;
|
||||
top: 78rpx;
|
||||
top: 200rpx;
|
||||
bottom: 0;
|
||||
left: -20rpx;
|
||||
right: 0;
|
||||
}
|
||||
.chart-box2 {
|
||||
width:100%;
|
||||
height:500rpx;
|
||||
position: absolute;
|
||||
top: 498rpx;
|
||||
left: -20rpx;
|
||||
right: 0;
|
||||
}
|
||||
.chart_title{
|
||||
margin-top: 18rpx;
|
||||
margin-left: 25rpx;
|
||||
color: orange;
|
||||
}
|
||||
.chart-title2{
|
||||
margin-top: 50rpx;
|
||||
margin-left: 25rpx;
|
||||
color: orange;
|
||||
}
|
||||
ec-canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
Reference in New Issue
Block a user