diff --git a/src/views/home/home.vue b/src/views/home/home.vue index ed71035..f8046b8 100644 --- a/src/views/home/home.vue +++ b/src/views/home/home.vue @@ -658,7 +658,7 @@ export default { } } ], - color: "#409eff", + color: ["#409eff", "#FFC83A", "#F98B26"], yAxis: [ { type: "value", @@ -677,9 +677,22 @@ export default { ], series: [ { - data: data, + name: '订单金额', type: "bar", - barWidth: time.length <= 7 ? "50%" : "30%" + barWidth: time.length <= 7 ? "30%" : "20%", + data: data.map(item => item.orderAmount), + }, + { + name: '实收金额', + type: "bar", + barWidth: time.length <= 7 ? "30%" : "20%", + data: data.map(item => item.actualAmount), + }, + { + name: '优惠金额', + type: "bar", + barWidth: time.length <= 7 ? "30%" : "20%", + data: data.map(item => item.discountAmount), } ] }); @@ -737,7 +750,13 @@ export default { try { this.saleLoading = true; const res = await dateAmount(this.saleActive); - const data = res.total.map(item => item.amount); + const data = res.total.map(item => { + return { + orderAmount: item.orderAmount, + actualAmount: item.actualAmount, + discountAmount: item.discountAmount + } + }); const time = res.total.map(item => item.tradeDay); this.initSaleChart(time, data); setTimeout(() => {