From e1cf0e4456d12764ef5e54bd69a67fa1e066b6d7 Mon Sep 17 00:00:00 2001 From: allen <> Date: Sat, 3 Aug 2024 17:11:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=90=E8=90=A5=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=AE=9E=E6=97=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/components/OperationDataCard.vue | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/views/mall/home/components/OperationDataCard.vue b/src/views/mall/home/components/OperationDataCard.vue index b905203b..a69571a4 100644 --- a/src/views/mall/home/components/OperationDataCard.vue +++ b/src/views/mall/home/components/OperationDataCard.vue @@ -53,10 +53,18 @@ const data = reactive({ /** 查询订单数据 */ const getOrderData = async () => { const orderCount = await TradeStatisticsApi.getOrderCount() - data.orderUndelivered.value = orderCount.undelivered - data.orderAfterSaleApply.value = orderCount.afterSaleApply - data.orderWaitePickUp.value = orderCount.pickUp - data.withdrawAuditing.value = orderCount.auditingWithdraw + if (orderCount.undelivered != null) { + data.orderUndelivered.value = orderCount.undelivered + } + if (orderCount.afterSaleApply != null) { + data.orderAfterSaleApply.value = orderCount.afterSaleApply + } + if (orderCount.pickUp != null) { + data.orderWaitePickUp.value = orderCount.pickUp + } + if (orderCount.auditingWithdraw != null) { + data.withdrawAuditing.value = orderCount.auditingWithdraw + } } /** 查询商品数据 */ @@ -83,6 +91,13 @@ const handleClick = (routerName: string) => { router.push({ name: routerName }) } +/** 激活时 */ +onActivated(() => { + getOrderData() + getProductData() + getWalletRechargeData() +}) + /** 初始化 **/ onMounted(() => { getOrderData()