From 97b753ffefcb24ce2bf4108272e332173b164212 Mon Sep 17 00:00:00 2001 From: cn-derekdu Date: Wed, 16 Sep 2026 10:17:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(wallet):=20=E7=A7=AF=E5=88=86=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E7=B1=BB=E5=9E=8B=E6=A0=87=E7=AD=BE=20-=20=E6=94=B9?= =?UTF-8?q?=E7=94=A8=20StatusBadge=20=E4=BF=AE=E6=AD=A3=E6=98=8E=E4=BA=AE?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E4=B8=8B=E7=9A=84=E4=B8=8D=E5=8F=AF=E8=AF=BB?= =?UTF-8?q?=E9=85=8D=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/wallet/index.tsx | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/web/src/pages/wallet/index.tsx b/web/src/pages/wallet/index.tsx index 14194cf1c..bcfe794cb 100644 --- a/web/src/pages/wallet/index.tsx +++ b/web/src/pages/wallet/index.tsx @@ -1,6 +1,7 @@ import { useEffect, useMemo, useRef, useState, type ReactNode } from "react"; import { AlipayCircleFilled, WechatFilled } from "@ant-design/icons"; -import { App, Button, Grid, Input, Modal, QRCode, Skeleton, Table, Tag } from "antd"; +import { App, Button, Grid, Input, Modal, QRCode, Skeleton, Table } from "antd"; +import { StatusBadge } from "@/components/ui/base/badges/status-badge"; import { SegmentedControl } from "@/components/ui/base/segmented-control"; import type { ColumnsType } from "antd/es/table"; import { motion, useReducedMotion } from "motion/react"; @@ -612,26 +613,24 @@ function CreditDelta({ value }: { value: number }) { function LedgerTypeTag({ type }: { type: CreditLedgerEntry["type"] }) { const meta = ledgerTypeMeta(type); - return ( - - {meta.label} - - ); + // 用项目 StatusBadge 而不是 antd Tag:Tag 的 default/error 配色在本项目主题下不可读。 + return ; } function ledgerTypeMeta(type: CreditLedgerEntry["type"]) { + // tone 走 StatusBadge 的语义色,明暗主题都自适应;不再用 antd Tag 的 default 配色。 const values = { - redeem: { label: "兑换充值", tagColor: "default", icon: , iconClass: "bg-foreground/8 text-foreground/70" }, - payment_topup: { label: "在线充值", tagColor: "success", icon: , iconClass: "bg-emerald-500/10 text-emerald-600 dark:text-emerald-300" }, - admin_grant: { label: "管理员充值", tagColor: "default", icon: , iconClass: "bg-foreground/8 text-foreground/70" }, - consume: { label: "模型消费", tagColor: "error", icon: , iconClass: "bg-rose-500/10 text-rose-600 dark:text-rose-300" }, - reserve: { label: "积分冻结", tagColor: "warning", icon: , iconClass: "bg-amber-500/10 text-amber-600 dark:text-amber-300" }, - refund: { label: "消费退款", tagColor: "warning", icon: , iconClass: "bg-amber-500/10 text-amber-600 dark:text-amber-300" }, - admin_adjustment: { label: "管理员调账", tagColor: "default", icon: , iconClass: "bg-foreground/8 text-foreground/70" }, - signup_bonus: { label: "注册奖励", tagColor: "default", icon: , iconClass: "bg-foreground/8 text-foreground/70" }, - checkin_bonus: { label: "签到奖励", tagColor: "default", icon: , iconClass: "bg-foreground/8 text-foreground/70" }, + redeem: { label: "兑换充值", tone: "neutral", icon: , iconClass: "bg-foreground/8 text-foreground/70" }, + payment_topup: { label: "在线充值", tone: "success", icon: , iconClass: "bg-emerald-500/10 text-emerald-600 dark:text-emerald-300" }, + admin_grant: { label: "管理员充值", tone: "neutral", icon: , iconClass: "bg-foreground/8 text-foreground/70" }, + consume: { label: "模型消费", tone: "error", icon: , iconClass: "bg-rose-500/10 text-rose-600 dark:text-rose-300" }, + reserve: { label: "积分冻结", tone: "warning", icon: , iconClass: "bg-amber-500/10 text-amber-600 dark:text-amber-300" }, + refund: { label: "消费退款", tone: "warning", icon: , iconClass: "bg-amber-500/10 text-amber-600 dark:text-amber-300" }, + admin_adjustment: { label: "管理员调账", tone: "neutral", icon: , iconClass: "bg-foreground/8 text-foreground/70" }, + signup_bonus: { label: "注册奖励", tone: "neutral", icon: , iconClass: "bg-foreground/8 text-foreground/70" }, + checkin_bonus: { label: "签到奖励", tone: "neutral", icon: , iconClass: "bg-foreground/8 text-foreground/70" }, } as const; - return values[type] || { label: "其他积分变动", tagColor: "default", icon: , iconClass: "bg-foreground/8 text-foreground/70" }; + return values[type] || { label: "其他积分变动", tone: "neutral", icon: , iconClass: "bg-foreground/8 text-foreground/70" }; } function ledgerTitle(entry: CreditLedgerEntry) {