fix(admin): 修复恢复启用订单兑换时 orderId 闭包失效及 H5 页面重试机制

- 修复任务详情页和订单详情页中 statusMutation 闭包提前捕获空 orderId 导致恢复启用请求未发出的问题,改为动态从 query.data 解析最新的 orderId
- 订单详情页统一切换为 App.useApp 提供的 modal/message 实例,保证异步弹窗与提示稳定渲染
- H5 买家领取页面在暂停或关闭等异常状态卡片中增加【重新检测状态】按钮,客服恢复启用后买家可一键重新加载最新状态
- 验证方式:前端类型检查(0 error)、单测 132 项全通及前端 Vite 重新构建成功
This commit is contained in:
yml2213
2026-10-10 18:46:49 +08:00
parent 6971002579
commit 3f2bb3f09a
3 changed files with 39 additions and 9 deletions
+24 -1
View File
@@ -1,10 +1,11 @@
import {
ExclamationCircleOutlined,
LoadingOutlined,
ReloadOutlined,
StopOutlined,
WarningOutlined,
} from '@ant-design/icons'
import { Card, Empty, Spin } from 'antd'
import { Button, Card, Empty, Spin } from 'antd'
import QRCode from 'qrcode'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useParams } from 'react-router'
@@ -255,17 +256,39 @@ export default function ClaimPage() {
<WarningOutlined style={{ fontSize: 48, color: '#faad14' }} />
<h3 style={{ marginTop: 16 }}>订单兑换已暂停</h3>
<p style={{ color: '#64748b' }}>{errorMessage}</p>
<Button
icon={<ReloadOutlined />}
style={{ marginTop: 16 }}
onClick={() => void loadDetail()}
>
重新检测状态
</Button>
</>
) : errorMessage.includes('关闭') || errorMessage.includes('退款') ? (
<>
<StopOutlined style={{ fontSize: 48, color: '#94a3b8' }} />
<h3 style={{ marginTop: 16 }}>订单不可兑换</h3>
<p style={{ color: '#64748b' }}>{errorMessage}</p>
<Button
icon={<ReloadOutlined />}
style={{ marginTop: 16 }}
onClick={() => void loadDetail()}
>
重新检测状态
</Button>
</>
) : (
<>
<ExclamationCircleOutlined className="claim-large-icon claim-icon-error" />
<p>{errorMessage}</p>
<Button
type="primary"
icon={<ReloadOutlined />}
style={{ marginTop: 16 }}
onClick={() => void loadDetail()}
>
重新加载
</Button>
</>
)}
</Card>