From 5f413ed0d939ed91ea66ca2224b65ffba60ba6dc Mon Sep 17 00:00:00 2001 From: shidongli Date: Fri, 9 Dec 2022 10:55:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=20=20=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index.vue | 92 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 90 insertions(+), 2 deletions(-) diff --git a/src/views/index.vue b/src/views/index.vue index 016d26d..2451860 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -119,7 +119,11 @@ export default { res.data.forEach((e) => { timedata.push(e.clickDate); }); - var numberdata = []; + var totalPricedata = []; + res.data.forEach((e) => { + totalPricedata.push(e.totalPrice); + }); + var numberdata = []; res.data.forEach((e) => { numberdata.push(e.count); }); @@ -235,13 +239,53 @@ export default { }, }, }, + { + name: "订单金额", + type: "line", + smooth: true, + showSymbol: false, + symbol: "circle", + symbolSize: 6, + data: totalPricedata, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 0, + color: "#d6e3fd", + }, + { + offset: 1, + color: "#d6e3fd", + }, + ], + false + ), + }, + }, + itemStyle: { + normal: { + color: "#6194f9", + }, + }, + lineStyle: { + normal: { + width: 3, + }, + }, + }, ], }; option && myChart.setOption(option); } else { } }); - getWeekGoodsTradeTrend().then((res) => { + getWeekGoodsTradeTrend ().then((res) => { if (res.code == 200) { var timedata = []; res.data.forEach((e) => { @@ -250,6 +294,10 @@ export default { var numberdata = []; res.data.forEach((e) => { numberdata.push(e.count); + }); + var totalPricedata = []; + res.data.forEach((e) => { + totalPricedata.push(e.totalPrice); }); var chartDom = document.getElementById("main"); var myChart = echarts.init(chartDom); @@ -363,6 +411,46 @@ export default { }, }, }, + { + name: "订单金额", + type: "line", + smooth: true, + showSymbol: false, + symbol: "circle", + symbolSize: 6, + data: totalPricedata, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 0, + color: "rgba(216, 244, 247,1)", + }, + { + offset: 1, + color: "rgba(216, 244, 247,1)", + }, + ], + false + ), + }, + }, + itemStyle: { + normal: { + color: "#58c8da", + }, + }, + lineStyle: { + normal: { + width: 3, + }, + }, + }, ], }; option && myChart.setOption(option);