refactor(huya): 协作台账 failed 状态展示名「兑换失败」→「抢购失败」(枚举值不变)

This commit is contained in:
yml2213
2026-10-16 22:09:21 +08:00
parent fdc57752dc
commit 6ef74c8e45
5 changed files with 29 additions and 28 deletions
+8 -8
View File
@@ -51,12 +51,12 @@ const STATUS_META: Record<HuyaCollabStatus, { label: string; color: string }> =
scripted: { label: '已上脚本', color: 'purple' },
// 抢购成功(枚举值仍是 done):从「已上脚本」查到兑换记录 → 自动进这一步
done: { label: '抢购成功', color: 'success' },
// 旁路终态:抢购后查兑换记录没查到这一单的礼包
failed: { label: '兑换失败', color: 'red' },
// 旁路终态:抢购后查兑换记录没查到这一单的礼包(枚举值仍是 failed)
failed: { label: '抢购失败', color: 'red' },
void: { label: '已作废', color: 'error' },
};
/** 判定结论的配色(生命周期时间线用) */
/** 判定结论的配色(生命周期时间线用):与「业务状态名」分开,这里说的是"兑换记录里查到没有" */
const VERDICT_META: Record<string, { label: string; color: string }> = {
success: { label: '兑换成功', color: 'success' },
failed: { label: '兑换失败', color: 'error' },
@@ -70,11 +70,11 @@ const STATUS_ORDER_OPTIONS: { value: HuyaCollabStatus; label: string }[] = [
{ value: 'recharged', label: '已充值' },
{ value: 'scripted', label: '已上脚本' },
{ value: 'done', label: '抢购成功' },
{ value: 'failed', label: '兑换失败' },
{ value: 'failed', label: '抢购失败' },
{ value: 'void', label: '已作废' },
];
/** 「回退」能选的目标:只在流程链里选(要进「已作废 / 兑换失败」走「改状态」或「作废」入口) */
/** 「回退」能选的目标:只在流程链里选(要进「已作废 / 抢购失败」走「改状态」或「作废」入口) */
const FLOW_STATUS_OPTIONS = STATUS_ORDER_OPTIONS.filter(
(option) => option.value !== 'failed' && option.value !== 'void',
);
@@ -1172,7 +1172,7 @@ export default function HuyaCollabPage() {
return (
<Space direction="vertical" size={12} style={{ width: '100%' }}>
{/* 卡片用 flex 平分:状态多了一个「兑换失败」,固定 span=4 会换行参差不齐 */}
{/* 卡片用 flex 平分:状态多了一个「抢购失败」,固定 span=4 会换行参差不齐 */}
<Row gutter={12}>
<Col flex="1"><Card size="small"><Statistic title="全部" value={summary?.total ?? 0} /></Card></Col>
<Col flex="1">
@@ -1505,7 +1505,7 @@ export default function HuyaCollabPage() {
)}
<Button icon={<SwapOutlined />} disabled={busy}
onClick={() => {
// 默认给「下一步」,终点态(抢购成功 / 已作废 / 兑换失败)退回当前状态,让人自己挑
// 默认给「下一步」,终点态(抢购成功 / 已作废 / 抢购失败)退回当前状态,让人自己挑
setRollbackTarget(detail.next_status ?? detail.status);
setStatusReason('');
setStatusAction({ order: detail, mode: 'set' });
@@ -1557,7 +1557,7 @@ export default function HuyaCollabPage() {
</Button>
)}
<Text type="secondary" style={{ fontSize: 12 }}>
每次查询都会追加一条快照(只追加、不修改);「已上脚本」的单会按结论自动改成「抢购成功」或「兑换失败」。
每次查询都会追加一条快照(只追加、不修改);「已上脚本」的单会按结论自动改成「抢购成功」或「抢购失败」。
</Text>
</Space>
{!detail.has_cookie && (