隐藏ID的显示
This commit is contained in:
@@ -40,6 +40,7 @@ export default function PayPage() {
|
||||
const [msg, setMsg] = useState('');
|
||||
const [showBindPhone, setShowBindPhone] = useState(false);
|
||||
const [wxSessionKey, setWxSessionKey] = useState<string | null>(null);
|
||||
const [orderNo, setOrderNo] = useState('');
|
||||
|
||||
const refreshPayReadiness = useCallback(async () => {
|
||||
try {
|
||||
@@ -72,6 +73,16 @@ export default function PayPage() {
|
||||
refreshPayReadiness();
|
||||
}, [refreshPayReadiness]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!orderId) {
|
||||
setOrderNo('');
|
||||
return;
|
||||
}
|
||||
request<{ orderNo?: string }>('USER_H5', `/trade/orders/${orderId}`)
|
||||
.then((order) => setOrderNo(order.orderNo || ''))
|
||||
.catch(() => setOrderNo(''));
|
||||
}, [orderId]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isWechatEnv()) return;
|
||||
handleWechatAuthCallback()
|
||||
@@ -181,7 +192,7 @@ export default function PayPage() {
|
||||
)}
|
||||
|
||||
{msg && <p className="pay-wechat-auth-msg">{msg}</p>}
|
||||
<p className="label-md text-muted" style={{ marginTop: 24 }}>订单号 {orderId}</p>
|
||||
{orderNo && <p className="label-md text-muted" style={{ marginTop: 24 }}>订单号 {orderNo}</p>}
|
||||
</div>
|
||||
<div className="page-actions">
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user