refactor(claim): 删除自建皮肤领取页,路径式 /claim/<token> 复用现成领取页 + 物品图片
**删掉上一轮自建的领取页** - `pages/claim-skin/*`、`services/claim-skin.ts`、`types/claim-skin.ts`、`tests/claim-skin.test.ts` 及其样式(client.css 里 `.claim-skin-*` 整段 254 行) - 后台我加的展示项:「皮肤自动发货」筛选项、执行器标签、「买家提交信息」卡片 **路径式链接复用现成领取页** - `utils/claim-path.ts`(中性命名 `isClaimPath` / `resolveClaimToken`)+ 单测 - `App.tsx`:pathname 命中 `/claim/<token>` → 独立 BrowserRouter 渲染**现成的 `ClaimPage`** (页面零复制零改动:它只用 `useParams`,不读 hash);`#/claim/:token` 仍走主站 HashRouter, 两者互不影响,且有用例断言 hash 入口不命中路径判定 **物品图片** - 后端领取详情的 `product.imageUrl` 接上(内部 SKU 在 `spec_json.code` / `sku_code` / `sku_name` 哪个字段都能回退找到图,映射不到返回空串) - 领取页新增 `ClaimProductImage`:居中大图(宽度 min(220px,62%)、圆角 16px), 空值或加载失败都降级虚线占位块,不出现破图 `npm run check`:前端 128 / 128 全绿(去掉旧用例 17 个、新增路径与图片用例)
This commit is contained in:
@@ -361,33 +361,6 @@ export default function AdminTaskDetailPage() {
|
||||
</Card>
|
||||
) : null}
|
||||
|
||||
{/* 皮肤自动发货:买家在领取页提交的游戏账号是发货依据,单独成卡,避免被领取链接卡片挤掉 */}
|
||||
{resolvedDetail.claimSubmission ? (
|
||||
<Card title="买家提交信息">
|
||||
<Space direction="vertical" size={4}>
|
||||
<Typography.Text type="secondary">
|
||||
买家在领取页填写的游戏账号(发货依据,属买家隐私,请勿外传)
|
||||
</Typography.Text>
|
||||
<Space wrap size={8}>
|
||||
<Typography.Text strong style={{ fontSize: 15 }}>
|
||||
{resolvedDetail.claimSubmission.gameAccount}
|
||||
</Typography.Text>
|
||||
<Typography.Text
|
||||
type="secondary"
|
||||
copyable={{ text: resolvedDetail.claimSubmission.gameAccount }}
|
||||
>
|
||||
复制
|
||||
</Typography.Text>
|
||||
</Space>
|
||||
{resolvedDetail.claimSubmission.submittedAt ? (
|
||||
<Typography.Text type="secondary">
|
||||
提交时间:{formatAdminDateTime(resolvedDetail.claimSubmission.submittedAt)}
|
||||
</Typography.Text>
|
||||
) : null}
|
||||
</Space>
|
||||
</Card>
|
||||
) : null}
|
||||
|
||||
{resolvedDetail.task.executorKey === 'manual_dispatch' ||
|
||||
resolvedDetail.operations.canCompleteManualDispatch ||
|
||||
resolvedDetail.manualDispatch ? (
|
||||
@@ -883,9 +856,6 @@ function resolveTaskExecutorDisplay(value: unknown) {
|
||||
if (executorKey === 'kuaishou_feifei') {
|
||||
return { label: '飞飞(已下线)', color: 'default' }
|
||||
}
|
||||
if (executorKey === 'douyin_mashida_skin') {
|
||||
return { label: '皮肤自动发货', color: 'magenta' }
|
||||
}
|
||||
if (executorKey === 'manual_dispatch') {
|
||||
return { label: '人工履约', color: 'orange' }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user