From 848b21bacd06c45ee16d8522acbce800df57b3a6 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期一, 31 三月 2025 18:32:50 +0800
Subject: [PATCH] fix: 四期需求

---
 packages/components/src/views/Mine/Dashboard.vue |   43 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/packages/components/src/views/Mine/Dashboard.vue b/packages/components/src/views/Mine/Dashboard.vue
index 2091d85..90f4cec 100644
--- a/packages/components/src/views/Mine/Dashboard.vue
+++ b/packages/components/src/views/Mine/Dashboard.vue
@@ -3,49 +3,55 @@
     <NutGridItem>
       <div class="pro-statistics-wrapper">
         <div class="pro-statistics-title">绱鏀舵</div>
-        <div class="pro-statistics-content">{{ toThousand(8888) }}</div>
+        <div class="pro-statistics-content">
+          {{ toThousand(topStatistics?.accumulatedReceipts ?? 0) }}
+        </div>
       </div>
     </NutGridItem>
     <NutGridItem>
       <div class="pro-statistics-wrapper">
         <div class="pro-statistics-title">鏄ㄦ棩鏀舵</div>
-        <div class="pro-statistics-content">{{ toThousand(8888) }}</div>
+        <div class="pro-statistics-content">
+          {{ toThousand(topStatistics?.receiptsYesterday ?? 0) }}
+        </div>
       </div>
     </NutGridItem>
     <NutGridItem>
       <div class="pro-statistics-wrapper">
         <div class="pro-statistics-title">绱鏀剁泭</div>
-        <div class="pro-statistics-content">{{ toThousand(8888) }}</div>
+        <div class="pro-statistics-content">
+          {{ toThousand(topStatistics?.accumulatedIncome ?? 0) }}
+        </div>
       </div>
     </NutGridItem>
     <NutGridItem>
       <div class="pro-statistics-wrapper">
         <div class="pro-statistics-title">绱涓嬪崟</div>
-        <div class="pro-statistics-content">{{ 8888 }}</div>
+        <div class="pro-statistics-content">{{ topStatistics?.accumulatedOrders ?? 0 }}</div>
       </div>
     </NutGridItem>
     <NutGridItem>
       <div class="pro-statistics-wrapper">
         <div class="pro-statistics-title">鏄ㄦ棩涓嬪崟</div>
-        <div class="pro-statistics-content">{{ 8888 }}</div>
+        <div class="pro-statistics-content">{{ topStatistics?.ordersNumYesterday ?? 0 }}</div>
       </div>
     </NutGridItem>
     <NutGridItem>
       <div class="pro-statistics-wrapper">
         <div class="pro-statistics-title">鏄ㄦ棩鎴愬姛</div>
-        <div class="pro-statistics-content">{{ 8888 }}</div>
+        <div class="pro-statistics-content">{{ topStatistics?.yesterdaySuccess ?? 0 }}</div>
       </div>
     </NutGridItem>
     <NutGridItem>
       <div class="pro-statistics-wrapper">
         <div class="pro-statistics-title">绱鐢ㄦ埛</div>
-        <div class="pro-statistics-content">{{ 8888 }}</div>
+        <div class="pro-statistics-content">{{ topStatistics?.accumulatedUsers ?? 0 }}</div>
       </div>
     </NutGridItem>
     <NutGridItem>
       <div class="pro-statistics-wrapper">
         <div class="pro-statistics-title">鏄ㄦ棩娲昏穬</div>
-        <div class="pro-statistics-content">{{ 8888 }}</div>
+        <div class="pro-statistics-content">{{ topStatistics?.yesterdayActiveUsers ?? 0 }}</div>
       </div>
     </NutGridItem>
   </NutGrid>
@@ -54,8 +60,29 @@
 <script setup lang="ts">
 import { Grid as NutGrid, GridItem as NutGridItem } from '@nutui/nutui-taro';
 import { toThousand } from '../../utils';
+import { useQuery } from '@tanstack/vue-query';
+import { useLifeRechargeContext, TopStatisticsOutput } from '@life-payment/core-vue';
+import { computed } from 'vue';
 
 defineOptions({
   name: 'Dashboard',
 });
+
+const { blLifeRecharge } = useLifeRechargeContext();
+
+const { data: topStatistics } = useQuery({
+  queryKey: ['lifePayServices/getTopStatistics', blLifeRecharge.accountModel.userChannles],
+  queryFn: async () => {
+    return await blLifeRecharge.services.getTopStatistics(
+      {
+        channleId: '',
+      },
+      {
+        showLoading: false,
+      }
+    );
+  },
+  placeholderData: () => ({} as TopStatisticsOutput),
+  enabled: computed(() => blLifeRecharge.accountModel.userChannles.length > 0),
+});
 </script>

--
Gitblit v1.9.1