From b0ff82599ac66fc095e1c4eb203433807b3fc7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Wed, 15 Jul 2026 03:46:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(shop):=20=E6=96=B0=E5=A2=9EDashboard?= =?UTF-8?q?=E5=BE=85=E4=BB=98=E6=AC=BE=E8=AE=A2=E5=8D=95=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=8F=8A=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Dashboard待处理事项新增“待付款订单”项,使用statusFilter=0查询 - 点击待付款订单跳转至/shop/shopOrder?tab=unpaid页面 - shopOrder页面恢复“待付款”标签页,validTabs列表包含unpaid - shopOrder页面根据路由query初始化活动标签,支持unpaid选项 - 新增dot-gold样式用于待付款订单高亮显示 - 订单数量接口新增待付款订单数获取及异常处理逻辑 - 调整组件中待处理事项列表,支持待付款订单数据响应式更新 --- .workbuddy/memory/2026-07-15.md | 7 +++++++ src/views/shop/dashboard/index.vue | 19 ++++++++++++++++++- src/views/shop/shopOrder/index.vue | 4 ++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.workbuddy/memory/2026-07-15.md b/.workbuddy/memory/2026-07-15.md index 8237cca..63bca3b 100644 --- a/.workbuddy/memory/2026-07-15.md +++ b/.workbuddy/memory/2026-07-15.md @@ -11,3 +11,10 @@ - Dashboard 中"订单总数"/"总营业额"跳转链接改为 `/shop/shopOrder?tab=all`,"待发货订单"改为 `?tab=undelivered`,"退款申请"改为 `?tab=refunded`。 - shopOrder 页面读取 `route.query.tab` 初始化 `activeKey`,无效值回退到 `'undelivered'`。 - 文件:`src/views/shop/dashboard/index.vue`、`src/views/shop/shopOrder/index.vue` + +## Dashboard 待处理事项新增"待付款订单" + +- 在待发货订单上方新增"待付款订单"统计项,使用 `statusFilter=0` 查询,点击跳转 `/shop/shopOrder?tab=unpaid`。 +- shopOrder 页面取消注释"待付款"tab,`validTabs` 加入 `unpaid`。 +- 新增 `dot-gold` 样式。 +- 文件:`src/views/shop/dashboard/index.vue`、`src/views/shop/shopOrder/index.vue` diff --git a/src/views/shop/dashboard/index.vue b/src/views/shop/dashboard/index.vue index 2857d4f..7cdaa99 100644 --- a/src/views/shop/dashboard/index.vue +++ b/src/views/shop/dashboard/index.vue @@ -288,14 +288,16 @@ const coreStats = computed(() => [ ]); // 待处理事项数据 +const pendingPaymentCount = ref(0); const pendingShipmentCount = ref(0); const pendingRefundCount = ref(0); const couponUsedCount = computed(() => statisticsStore.safeCouponUsedCount); // 待处理事项(使用computed确保响应式更新) const todoItems = computed(() => [ + { label: '待付款订单', value: pendingPaymentCount.value, to: '/shop/shopOrder?tab=unpaid', tagColor: 'gold', dotColor: 'dot-gold', urgent: pendingPaymentCount.value > 0 }, { label: '待发货订单', value: pendingShipmentCount.value, to: '/shop/shopOrder?tab=undelivered', tagColor: 'blue', dotColor: 'dot-blue', urgent: pendingShipmentCount.value > 0 }, - { label: '退款申请', value: pendingRefundCount.value, to: '/shop/shopOrder?tab=refunded', tagColor: 'orange', dotColor: 'dot-orange', urgent: pendingRefundCount.value > 0 }, + // { label: '退款申请', value: pendingRefundCount.value, to: '/shop/shopOrder?tab=refunded', tagColor: 'orange', dotColor: 'dot-orange', urgent: pendingRefundCount.value > 0 }, // { label: '优惠券使用', value: couponUsedCount.value, to: '/market/coupon', tagColor: 'cyan', dotColor: 'dot-cyan', urgent: false }, ]); @@ -375,6 +377,20 @@ const loadData = async () => { ]); // 获取待处理事项数据 + try { + // 获取待付款订单数(type=0商城订单, statusFilter=0待付款) + const paymentResult = await pageShopOrder({ + type: 0, + statusFilter: 0, + page: 1, + limit: 1 + }); + pendingPaymentCount.value = paymentResult?.count || 0; + } catch (e) { + console.warn('获取待付款订单数失败:', e); + pendingPaymentCount.value = 0; + } + try { // 获取待发货订单数(type=0商城订单, statusFilter=1待发货) const shipmentResult = await pageShopOrder({ @@ -511,6 +527,7 @@ onUnmounted(() => { .todo-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; } .dot-orange { background: #f97316; } .dot-blue { background: #3b82f6; } +.dot-gold { background: #faad14; } .dot-cyan { background: #06b6d4; } .dot-purple { background: #a855f7; } .todo-content { flex: 1; display: flex; align-items: center; } diff --git a/src/views/shop/shopOrder/index.vue b/src/views/shop/shopOrder/index.vue index 88b0e53..4418283 100644 --- a/src/views/shop/shopOrder/index.vue +++ b/src/views/shop/shopOrder/index.vue @@ -36,10 +36,10 @@ + - @@ -431,7 +431,7 @@ const loading = ref(true); // 激活的标签(支持从路由参数初始化,如 /shop/shopOrder?tab=all) const route = useRoute(); - const validTabs = ['all', 'undelivered', 'unreceived', 'completed', 'refunded', 'cancelled']; + const validTabs = ['all', 'unpaid', 'undelivered', 'unreceived', 'completed', 'refunded', 'cancelled']; const tabFromQuery = route.query.tab as string; const activeKey = ref( validTabs.includes(tabFromQuery) ? tabFromQuery : 'undelivered'