diff --git a/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx b/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx index 0aceadea..2341e036 100644 --- a/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx +++ b/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx @@ -64,6 +64,7 @@ export default function DouyuFulfillmentPage() { const [platform, setPlatform] = useState('wechat') const [system, setSystem] = useState('android') const [qrImage, setQrImage] = useState('') + const [bindingQrExpanded, setBindingQrExpanded] = useState(false) const [nowMs, setNowMs] = useState(0) const autoStartRef = useRef('') @@ -138,6 +139,10 @@ export default function DouyuFulfillmentPage() { }).then(setQrImage) }, [live?.qrUrl]) + useEffect(() => { + setBindingQrExpanded(false) + }, [live?.bindConfirmed, live?.bindReadyForConfirm, live?.qrUrl]) + useEffect(() => { const tick = () => setNowMs(Date.now()) tick() @@ -172,6 +177,17 @@ export default function DouyuFulfillmentPage() { if (!expiresAt || Number.isNaN(expiresAt)) return 0 return Math.max(0, Math.floor((expiresAt - nowMs) / 1000)) }, [live?.qrExpiresAt, nowMs]) + const canRevealBindingQr = Boolean( + live?.qrUrl && (live.bindReadyForConfirm || live.bindConfirmed), + ) + const showBindingQr = Boolean(live?.qrUrl && (!canRevealBindingQr || bindingQrExpanded)) + const bindingDescription = + live?.message || + (live?.bindReadyForConfirm + ? '已识别游戏角色,请核对并确认绑定。' + : live?.bindConfirmed + ? '角色绑定已完成,等待运营处理。' + : '请使用微信扫描下方二维码,按提示选择和平精英角色。二维码仅用于本次订单。') async function submitProfile() { if (!roleName.trim()) { @@ -334,12 +350,19 @@ export default function DouyuFulfillmentPage() { type={live?.bindConfirmed ? 'success' : 'info'} showIcon message={STATUS_LABELS[task.status] || '等待处理'} - description={ - live?.message || - '请使用微信扫描下方二维码,按提示选择和平精英角色。二维码仅用于本次订单。' - } + description={bindingDescription} /> + {canRevealBindingQr ? ( + + ) : null} + {!live?.qrUrl && task.status !== 'completed' ? (

游戏角色绑定二维码

@@ -360,7 +383,7 @@ export default function DouyuFulfillmentPage() {
) : null} - {live?.qrUrl && !live.bindConfirmed ? ( + {live?.qrUrl && showBindingQr ? (

游戏角色绑定二维码

diff --git a/apps/frontend/src/styles/client.css b/apps/frontend/src/styles/client.css index 481686db..6f2d48da 100644 --- a/apps/frontend/src/styles/client.css +++ b/apps/frontend/src/styles/client.css @@ -2957,6 +2957,25 @@ background: #343c4a; } +.customer-auth-page.is-douyu .customer-binding-qr-toggle.ant-btn { + align-self: flex-end; + height: 34px; + padding-inline: 12px; + color: #b8c1cf; + border-color: #3f495a; + border-radius: 8px; + background: transparent; + font-size: 13px; + box-shadow: none; +} + +.customer-auth-page.is-douyu .customer-binding-qr-toggle.ant-btn:hover, +.customer-auth-page.is-douyu .customer-binding-qr-toggle.ant-btn:focus-visible { + color: #fff; + border-color: #64748b; + background: #2a313d; +} + .customer-auth-page.is-douyu .customer-auth-hero { min-height: 148px; align-items: flex-start;