chore: sync latest changes including K unit formatting

main
sp mac bookpro 2605 2026-06-13 11:22:43 +08:00
parent df20870b6b
commit cba88a21b3
9 changed files with 26 additions and 27 deletions

View File

@ -51,7 +51,7 @@ const NAV_GROUPS: Array<{
{ {
label: '商城', label: '商城',
items: [ items: [
{ to: '/points-mall', icon: <CompassOutlined />, label: '积分商城' } { to: '/points-mall', icon: <CompassOutlined />, label: 'Token商城' }
] ]
} }
]; ];

View File

@ -54,10 +54,10 @@ export function usePointsMallPageLogic() {
setCategoryId(cats[0].id); setCategoryId(cats[0].id);
} }
if (meRes.status === 'rejected') { if (meRes.status === 'rejected') {
message.error('获取积分信息失败,请稍后重试'); message.error('获取Token信息失败,请稍后重试');
} }
} catch { } catch {
message.error('获取积分信息失败,请稍后重试'); message.error('获取Token信息失败,请稍后重试');
setOverview({ ...MOCK_OVERVIEW, me: { points: 0, level: 'Lv.0' } }); setOverview({ ...MOCK_OVERVIEW, me: { points: 0, level: 'Lv.0' } });
setCategories(MOCK_OVERVIEW.categories); setCategories(MOCK_OVERVIEW.categories);
} finally { } finally {
@ -148,7 +148,7 @@ export function usePointsMallPageLogic() {
return { ...prev, me: { ...prev.me, points: remainingPoints } }; return { ...prev, me: { ...prev.me, points: remainingPoints } };
}); });
} }
message.success('已冻结积分并预扣库存,请继续填写收件信息'); message.success('已冻结Token并预扣库存,请继续填写收件信息');
} catch (e: any) { } catch (e: any) {
const msg = e?.response?.data?.message || e?.response?.data?.error || e?.message || '兑换失败,请稍后重试'; const msg = e?.response?.data?.message || e?.response?.data?.error || e?.message || '兑换失败,请稍后重试';
message.error(msg); message.error(msg);

View File

@ -22,7 +22,7 @@ export default function ConfirmExchangeModal(props: {
<div className="points-confirm-product-name">{product.name}</div> <div className="points-confirm-product-name">{product.name}</div>
<Space size={8} wrap className="points-confirm-tags"> <Space size={8} wrap className="points-confirm-tags">
<Tag color="processing" className="points-confirm-tag"> <Tag color="processing" className="points-confirm-tag">
{product.pointsPrice.toLocaleString()} {product.pointsPrice.toLocaleString()} Token
</Tag> </Tag>
<Tag color="default" className="points-confirm-tag"> <Tag color="default" className="points-confirm-tag">
{userPoints.toLocaleString()} {userPoints.toLocaleString()}
@ -45,11 +45,11 @@ export default function ConfirmExchangeModal(props: {
</div> </div>
<div className="points-confirm-tip"> <div className="points-confirm-tip">
/ Token/
</div> </div>
<Button type="primary" block disabled={!canAfford || loading} loading={loading} onClick={onConfirm}> <Button type="primary" block disabled={!canAfford || loading} loading={loading} onClick={onConfirm}>
{canAfford ? '确认并继续' : '积分不足'} {canAfford ? '确认并继续' : 'Token不足'}
</Button> </Button>
</div> </div>
)} )}

View File

@ -53,8 +53,8 @@ export default function PointsMallH5Products({ logic }: Props) {
options={[ options={[
{ value: 'popular', label: '热度优先' }, { value: 'popular', label: '热度优先' },
{ value: 'newest', label: '最新上架' }, { value: 'newest', label: '最新上架' },
{ value: 'price_asc', label: '积分从低到高' }, { value: 'price_asc', label: 'Token从低到高' },
{ value: 'price_desc', label: '积分从高到低' } { value: 'price_desc', label: 'Token从高到低' }
]} ]}
/> />
<Select <Select

View File

@ -25,9 +25,9 @@ export default function PointsMallH5Top({ logic }: Props) {
<div className="points-mall-hero h5-points-mall-hero"> <div className="points-mall-hero h5-points-mall-hero">
<div className="points-mall-header h5-points-mall-header"> <div className="points-mall-header h5-points-mall-header">
<div className="points-mall-title-section"> <div className="points-mall-title-section">
<h1 className="page-title stats-page-title h5-page-title"></h1> <h1 className="page-title stats-page-title h5-page-title">Token</h1>
<p className="page-subtitle stats-page-subtitle h5-page-subtitle"> <p className="page-subtitle stats-page-subtitle h5-page-subtitle">
使<br /> API 1 = 1000 使Token<br />Token API
</p> </p>
</div> </div>
<div className="points-mall-balance-card h5-points-mall-balance-card"> <div className="points-mall-balance-card h5-points-mall-balance-card">
@ -36,7 +36,7 @@ export default function PointsMallH5Top({ logic }: Props) {
) : ( ) : (
<div className="points-balance-row h5-points-balance-row"> <div className="points-balance-row h5-points-balance-row">
<div className="points-balance-main"> <div className="points-balance-main">
<div className="points-balance-label"></div> <div className="points-balance-label">Token</div>
<div className="points-balance-value">{userPoints >= 1000 ? `${(userPoints / 1000).toFixed(1)} K` : userPoints.toLocaleString()}</div> <div className="points-balance-value">{userPoints >= 1000 ? `${(userPoints / 1000).toFixed(1)} K` : userPoints.toLocaleString()}</div>
<div className="points-balance-subtext"> <div className="points-balance-subtext">
${typeof totalSpentUSD === 'number' ? totalSpentUSD.toFixed(2) : '--'} ${typeof totalSpentUSD === 'number' ? totalSpentUSD.toFixed(2) : '--'}

View File

@ -49,8 +49,8 @@ export default function PointsMallPageWeb({ logic }: Props) {
<div className="points-mall-hero"> <div className="points-mall-hero">
<div className="points-mall-header"> <div className="points-mall-header">
<div className="points-mall-title-section"> <div className="points-mall-title-section">
<h1 className="page-title stats-page-title"></h1> <h1 className="page-title stats-page-title">Token</h1>
<p className="page-subtitle stats-page-subtitle">使 API 1 = 1000 </p> <p className="page-subtitle stats-page-subtitle">使TokenToken API </p>
</div> </div>
<div className="points-mall-balance-card"> <div className="points-mall-balance-card">
{overviewLoading ? ( {overviewLoading ? (
@ -58,7 +58,7 @@ export default function PointsMallPageWeb({ logic }: Props) {
) : ( ) : (
<div className="points-balance-row"> <div className="points-balance-row">
<div> <div>
<div className="points-balance-label"></div> <div className="points-balance-label">Token</div>
<div className="points-balance-value">{userPoints >= 1000 ? `${(userPoints / 1000).toFixed(1)} K` : userPoints.toLocaleString()}</div> <div className="points-balance-value">{userPoints >= 1000 ? `${(userPoints / 1000).toFixed(1)} K` : userPoints.toLocaleString()}</div>
<div className="points-balance-subtext"> <div className="points-balance-subtext">
${typeof totalSpentUSD === 'number' ? totalSpentUSD.toFixed(2) : '--'} ${typeof totalSpentUSD === 'number' ? totalSpentUSD.toFixed(2) : '--'}
@ -152,8 +152,8 @@ export default function PointsMallPageWeb({ logic }: Props) {
options={[ options={[
{ value: 'popular', label: '热度优先' }, { value: 'popular', label: '热度优先' },
{ value: 'newest', label: '最新上架' }, { value: 'newest', label: '最新上架' },
{ value: 'price_asc', label: '积分从低到高' }, { value: 'price_asc', label: 'Token从低到高' },
{ value: 'price_desc', label: '积分从高到低' }, { value: 'price_desc', label: 'Token从高到低' },
]} ]}
/> />
<Select <Select
@ -197,7 +197,7 @@ export default function PointsMallPageWeb({ logic }: Props) {
<div className="points-mall-product-price-row"> <div className="points-mall-product-price-row">
<div> <div>
<span className="points-mall-product-price">{p.pointsPrice >= 1000 ? `${(p.pointsPrice / 1000).toFixed(1)} K` : Number(p.pointsPrice).toLocaleString()}</span> <span className="points-mall-product-price">{p.pointsPrice >= 1000 ? `${(p.pointsPrice / 1000).toFixed(1)} K` : Number(p.pointsPrice).toLocaleString()}</span>
<span className="points-mall-product-price-label"></span> <span className="points-mall-product-price-label">Token</span>
</div> </div>
<Button <Button
type="primary" type="primary"
@ -205,7 +205,7 @@ export default function PointsMallPageWeb({ logic }: Props) {
disabled={userPoints < p.pointsPrice || exchangeLoading} disabled={userPoints < p.pointsPrice || exchangeLoading}
onClick={() => handleExchangeClick(p)} onClick={() => handleExchangeClick(p)}
> >
{userPoints < p.pointsPrice ? '积分不足' : '兑换'} {userPoints < p.pointsPrice ? 'Token不足' : '兑换'}
</Button> </Button>
</div> </div>
<div className="points-mall-product-footer"> <div className="points-mall-product-footer">

View File

@ -13,7 +13,7 @@ export const MOCK_OVERVIEW: PointsMallOverview = {
banners: [{ id: 'b1', title: '本期活动', subtitle: 'Up to 25% Off', imageUrl: '', linkUrl: '' }], banners: [{ id: 'b1', title: '本期活动', subtitle: 'Up to 25% Off', imageUrl: '', linkUrl: '' }],
promoEntries: [ promoEntries: [
{ id: 'p1', title: '促销活动', subtitle: '本周精选', linkUrl: '' }, { id: 'p1', title: '促销活动', subtitle: '本周精选', linkUrl: '' },
{ id: 'p2', title: '积分任务', subtitle: '快速涨积分', linkUrl: '' } { id: 'p2', title: 'Token任务', subtitle: '快速涨Token', linkUrl: '' }
] ]
}; };

View File

@ -23,7 +23,6 @@ export default function StatsPageWeb({ logic }: { logic: StatsPageLogic }) {
<h1 className="page-title stats-page-title"></h1> <h1 className="page-title stats-page-title"></h1>
<p className="page-subtitle stats-page-subtitle"> <p className="page-subtitle stats-page-subtitle">
使 使
1 1000
</p> </p>
</div> </div>
<div className="stats-page-summary-card"> <div className="stats-page-summary-card">

View File

@ -6,9 +6,9 @@ export default function StatsPointsCard({ logic }: { logic: StatsPageLogic }) {
return ( return (
<div className="points-integration-section"> <div className="points-integration-section">
<Card <Card
title="消费与积分" title="消费与Token"
className="points-integration-card" className="points-integration-card"
extra={<Tag bordered={false} className="stats-soft-tag">1 USD = 1000 </Tag>} extra={<Tag bordered={false} className="stats-soft-tag">1 USD = 1000 Token</Tag>}
> >
<div className="points-integration-row"> <div className="points-integration-row">
<div className="points-integration-item"> <div className="points-integration-item">
@ -22,7 +22,7 @@ export default function StatsPointsCard({ logic }: { logic: StatsPageLogic }) {
<div className="points-integration-item"> <div className="points-integration-item">
<div className="points-integration-label"> <div className="points-integration-label">
<GiftOutlined className="stats-tone-brand-text" /> <GiftOutlined className="stats-tone-brand-text" />
Token
</div> </div>
<div className="points-integration-value">{logic.formatPoints(logic.totalPoints)}</div> <div className="points-integration-value">{logic.formatPoints(logic.totalPoints)}</div>
<div className="points-integration-desc"></div> <div className="points-integration-desc"></div>
@ -30,10 +30,10 @@ export default function StatsPointsCard({ logic }: { logic: StatsPageLogic }) {
<div className="points-integration-item"> <div className="points-integration-item">
<div className="points-integration-label"> <div className="points-integration-label">
<BarChartOutlined className="stats-tone-success-text" /> <BarChartOutlined className="stats-tone-success-text" />
Token
</div> </div>
<div className="points-integration-value">1:1000</div> {/* <div className="points-integration-value">1:1000</div>
<div className="points-integration-desc"> 1 1000 </div> <div className="points-integration-desc"> 1 1000 Token</div> */}
</div> </div>
</div> </div>
</Card> </Card>