diff --git a/web/src/components/dashboard/StatsCards.jsx b/web/src/components/dashboard/StatsCards.jsx index ae614eb5..0199e498 100644 --- a/web/src/components/dashboard/StatsCards.jsx +++ b/web/src/components/dashboard/StatsCards.jsx @@ -18,8 +18,10 @@ For commercial licensing, please contact support@quantumnous.com */ import React from 'react'; -import { Card, Avatar, Skeleton } from '@douyinfe/semi-ui'; +import { Card, Avatar, Skeleton, Tag } from '@douyinfe/semi-ui'; import { VChart } from '@visactor/react-vchart'; +import { useNavigate } from 'react-router-dom'; +import { useTranslation } from 'react-i18next'; const StatsCards = ({ groupedStatsData, @@ -28,6 +30,8 @@ const StatsCards = ({ CARD_PROPS, CHART_CONFIG }) => { + const navigate = useNavigate(); + const { t } = useTranslation(); return (
@@ -72,7 +76,19 @@ const StatsCards = ({
- {(loading || (item.trendData && item.trendData.length > 0)) && ( + {item.title === t('当前余额') ? ( + { + e.stopPropagation(); + navigate('/console/topup'); + }} + > + {t('充值')} + + ) : (loading || (item.trendData && item.trendData.length > 0)) && (
{/* 收益展示区域 */} -
- {/* 主要收益卡片 - 待使用收益 */} - -
-
- - {t('待使用收益')} -
- -
-
- {renderQuota(userState?.user?.aff_quota || 0)} -
-
+ {/* 标题和按钮 */} +
+
+ {t('收益统计')} + +
- {/* 统计数据网格 */} -
- -
- - {t('总收益')} -
-
- {renderQuota(userState?.user?.aff_history_quota || 0)} -
-
+ {/* 统计数据 */} +
+ {/* 待使用收益 */} +
+
+ {renderQuota(userState?.user?.aff_quota || 0)} +
+
+ + {t('待使用收益')} +
+
- -
- - {t('邀请人数')} -
-
- {userState?.user?.aff_count || 0} {t('人')} -
-
-
+ {/* 总收益 */} +
+
+ {renderQuota(userState?.user?.aff_history_quota || 0)} +
+
+ + {t('总收益')} +
+
-
+ {/* 邀请人数 */} +
+
+ {userState?.user?.aff_count || 0} +
+
+ + {t('邀请人数')} +
+
+
+
+
+ } + > {/* 邀请链接部分 */} } /> -
+ {/* 奖励说明 */} + {t('奖励说明')} } @@ -133,27 +156,27 @@ const InvitationCard = ({
- + {t('邀请好友注册,好友充值后您可获得相应奖励')}
- + {t('通过划转功能将奖励额度转入到您的账户余额中')}
- + {t('邀请的好友越多,获得的奖励越多')}
-
+ ); }; diff --git a/web/src/hooks/dashboard/useDashboardStats.jsx b/web/src/hooks/dashboard/useDashboardStats.jsx index 1e0a4f32..e3e9c944 100644 --- a/web/src/hooks/dashboard/useDashboardStats.jsx +++ b/web/src/hooks/dashboard/useDashboardStats.jsx @@ -52,7 +52,6 @@ export const useDashboardStats = ( value: renderQuota(userState?.user?.quota), icon: , avatarColor: 'blue', - onClick: () => navigate('/console/topup'), trendData: [], trendColor: '#3b82f6' }, diff --git a/web/src/i18n/locales/en.json b/web/src/i18n/locales/en.json index c8e3f484..003aaf33 100644 --- a/web/src/i18n/locales/en.json +++ b/web/src/i18n/locales/en.json @@ -855,7 +855,6 @@ "邀请人数": "Number of people invited", "兑换码充值": "Redemption code recharge", "奖励说明": "Reward description", - "人": "", "选择支付方式": "Select payment method", "处理中": "Processing", "账户充值": "Account recharge", diff --git a/web/src/index.css b/web/src/index.css index 17b75a10..4788b28f 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -683,59 +683,6 @@ html.dark .with-pastel-balls::before { mix-blend-mode: screen; } -/* ==================== 卡片马卡龙模糊球(温暖色系) ==================== */ -.with-pastel-balls-warm { - position: relative; - overflow: hidden; - /* 温暖色系变量(明亮模式) */ - --pb1: #ffe4b5; - /* 桃杏 */ - --pb2: #d4ffdd; - /* 薄荷绿 */ - --pb3: #ffecb3; - /* 浅金 */ - --pb4: #e8f5e8; - /* 淡绿 */ - --pb-opacity: 0.55; -} - -.with-pastel-balls-warm::before { - content: ''; - position: absolute; - inset: 0; - pointer-events: none; - z-index: 0; - background: - radial-gradient(circle at -5% -10%, var(--pb1) 0%, transparent 60%), - radial-gradient(circle at 105% -10%, var(--pb2) 0%, transparent 55%), - radial-gradient(circle at 5% 110%, var(--pb3) 0%, transparent 55%), - radial-gradient(circle at 105% 110%, var(--pb4) 0%, transparent 50%); - opacity: var(--pb-opacity); -} - -.with-pastel-balls-warm>* { - position: relative; - z-index: 1; -} - -/* 暗黑模式下更柔和的色彩和透明度 */ -html.dark .with-pastel-balls-warm { - --pb1: #ffe4b5; - /* 桃杏 */ - --pb2: #d4ffdd; - /* 薄荷绿 */ - --pb3: #ffecb3; - /* 浅金 */ - --pb4: #e8f5e8; - /* 淡绿 */ - --pb-opacity: 0.36; -} - -/* 暗黑模式下用更柔和的混合模式 */ -html.dark .with-pastel-balls-warm::before { - mix-blend-mode: screen; -} - /* ==================== 表格卡片滚动设置 ==================== */ .table-scroll-card { display: flex; @@ -814,4 +761,9 @@ html.dark .with-pastel-balls-warm::before { flex: 1; overflow: auto; min-height: 0; +} + +/* ==================== semi-ui 组件自定义样式 ==================== */ +.semi-card-header { + padding: 10px !important; } \ No newline at end of file