From 39deeb7774c70513e9805ac50a61bef4ce8ead21 Mon Sep 17 00:00:00 2001 From: dzq Date: Tue, 20 May 2025 15:45:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=80=BB=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E9=87=91=E9=A2=9D=E7=BB=9F=E8=AE=A1=E5=B9=B6=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=95=8C=E9=9D=A2=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在商店统计接口中新增`orderAmountSum`字段,用于显示总订单金额。同时调整欢迎页面的布局,增加总金额的显示,并优化卡片的内边距和宽度。 --- src/api/shop/stats.ts | 2 ++ src/views/welcome/index.vue | 17 +++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/api/shop/stats.ts b/src/api/shop/stats.ts index a583dc9..01659b1 100644 --- a/src/api/shop/stats.ts +++ b/src/api/shop/stats.ts @@ -48,6 +48,8 @@ export interface StatsDTO { goodsCount: number; /** 订单数量 */ orderCount: number; + /** 总订单金额 */ + orderAmountSum: number; /** 总柜子数量 */ cabinetCount: number; /** 总格口数量 */ diff --git a/src/views/welcome/index.vue b/src/views/welcome/index.vue index 19cf7c9..ce603f7 100644 --- a/src/views/welcome/index.vue +++ b/src/views/welcome/index.vue @@ -18,7 +18,8 @@ const todoItems = [ const shopData = ref([ { name: '商店', value: 0 }, { name: '商品', value: 0 }, - { name: '订单', value: 0 } + { name: '订单', value: 0 }, + { name: '总金额', value: 0 } ]); const deviceData = ref([ @@ -39,7 +40,8 @@ onMounted(async () => { shopData.value = [ { name: '商店', value: data.shopCount }, { name: '商品', value: data.goodsCount }, - { name: '订单', value: data.orderCount } + { name: '订单', value: data.orderCount }, + { name: '总金额', value: data.orderAmountSum } ]; deviceData.value = [ { name: '总柜子', value: data.cabinetCount }, @@ -92,8 +94,8 @@ onMounted(async () => { - - + +
{{ item.value }}
{{ item.name }}
@@ -113,7 +115,7 @@ onMounted(async () => {
- +
{{ item.value }}
{{ item.name }}
@@ -351,14 +353,17 @@ onMounted(async () => { .goods-right { width: 150px; } + .goods-count { - width: 45px; + width: 45px; } } + .order-container { .goods-right { width: 250px; } + .goods-count { width: 60px; }