From 0886e91fdfe3b5528f80d2b6742083aa11d16ebb Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 02 四月 2025 15:54:15 +0800
Subject: [PATCH] fix: 四期bug
---
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..06d6b0a 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(
+ {
+ channleList: blLifeRecharge.accountModel.userChannles.map((x) => x.channlesNum),
+ },
+ {
+ showLoading: false,
+ }
+ );
+ },
+ placeholderData: () => ({} as TopStatisticsOutput),
+ enabled: computed(() => blLifeRecharge.accountModel.isBackClientUser),
+});
</script>
--
Gitblit v1.9.1