From 8d3b15bea274091050fbdb9f4d6edc034077ae4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Fri, 9 Dec 2022 11:34:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index.vue | 50 +++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/src/views/index.vue b/src/views/index.vue index 2451860..0dbde71 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -40,12 +40,10 @@
{{ summaryTodayList.orderCount }}
-
-
今日交易额
+
+
今日交易额
{{ summaryTodayList.totalPrice }}
- - @@ -123,7 +121,7 @@ export default { res.data.forEach((e) => { totalPricedata.push(e.totalPrice); }); - var numberdata = []; + var numberdata = []; res.data.forEach((e) => { numberdata.push(e.count); }); @@ -143,6 +141,7 @@ export default { color: "#ddd", }, }, + backgroundColor: "rgba(255,255,255,1)", padding: [5, 10], textStyle: { @@ -150,6 +149,11 @@ export default { }, extraCssText: "box-shadow: 0 0 5px rgba(0,0,0,0.3)", }, + legend: { + right: 20, + orient: "vertical", + data: ["订单数量", "订单金额"], + }, xAxis: { type: "category", data: timedata, @@ -230,7 +234,7 @@ export default { }, itemStyle: { normal: { - color: "#6194f9", + color: "#87B1F7", }, }, lineStyle: { @@ -257,11 +261,11 @@ export default { [ { offset: 0, - color: "#d6e3fd", + color: "#D6F5E9", }, { offset: 1, - color: "#d6e3fd", + color: "#D6F5E9", }, ], false @@ -270,7 +274,7 @@ export default { }, itemStyle: { normal: { - color: "#6194f9", + color: "#57D1A0", }, }, lineStyle: { @@ -285,7 +289,7 @@ export default { } else { } }); - getWeekGoodsTradeTrend ().then((res) => { + getWeekGoodsTradeTrend().then((res) => { if (res.code == 200) { var timedata = []; res.data.forEach((e) => { @@ -295,10 +299,14 @@ export default { res.data.forEach((e) => { numberdata.push(e.count); }); - var totalPricedata = []; + var totalPricedata = []; res.data.forEach((e) => { totalPricedata.push(e.totalPrice); }); + var moneydata = []; + res.data.forEach((e) => { + numberdata.push(e.count); + }); var chartDom = document.getElementById("main"); var myChart = echarts.init(chartDom); var option; @@ -315,6 +323,7 @@ export default { color: "#ddd", }, }, + backgroundColor: "rgba(255,255,255,1)", padding: [5, 10], textStyle: { @@ -322,6 +331,11 @@ export default { }, extraCssText: "box-shadow: 0 0 5px rgba(0,0,0,0.3)", }, + legend: { + right: 20, + orient: "vertical", + data: ["订单数量", "订单金额"], + }, xAxis: { type: "category", data: timedata, @@ -389,11 +403,11 @@ export default { [ { offset: 0, - color: "rgba(216, 244, 247,1)", + color: "#d6e3fd", }, { offset: 1, - color: "rgba(216, 244, 247,1)", + color: "#d6e3fd", }, ], false @@ -402,7 +416,7 @@ export default { }, itemStyle: { normal: { - color: "#58c8da", + color: "#87B1F7", }, }, lineStyle: { @@ -429,11 +443,11 @@ export default { [ { offset: 0, - color: "rgba(216, 244, 247,1)", + color: "#D6F5E9", }, { offset: 1, - color: "rgba(216, 244, 247,1)", + color: "#D6F5E9", }, ], false @@ -442,7 +456,7 @@ export default { }, itemStyle: { normal: { - color: "#58c8da", + color: "#57D1A0", }, }, lineStyle: { @@ -580,7 +594,7 @@ export default { margin-bottom: 20px; border-radius: 0.4em; font-weight: 700; - background: hsla(0,0%,92.2%,.5333333333333333); + background: hsla(0, 0%, 92.2%, 0.5333333333333333); padding: 20px; .goodsinfo { margin-top: 5px;