diff --git a/apps/backend/src/services/claim/kuaishou-cloud-claim-service.ts b/apps/backend/src/services/claim/kuaishou-cloud-claim-service.ts index 09de4030..5a6576e3 100644 --- a/apps/backend/src/services/claim/kuaishou-cloud-claim-service.ts +++ b/apps/backend/src/services/claim/kuaishou-cloud-claim-service.ts @@ -224,6 +224,7 @@ async function submitAffiliateDashClaimUid( orderNo: flow.orderNo, gameAccount: expectedUid, }) + const alreadyBound = Boolean(bindResult.bound) const nextFlow = { ...flow, bindUuid: bindResult.bindUuid, @@ -231,10 +232,13 @@ async function submitAffiliateDashClaimUid( qrUrl: bindResult.qrUrl, gameAccount: expectedUid, expectedGameAccount: expectedUid, - // 重新绑定:清空旧绑定状态,等待用户用新账号扫码完成新绑定。 - bound: false, - boundAccount: '', - gameChannel: '', + // 乐玩「已授权免扫码」会直接 bound=true;否则清空等待扫码。 + bound: alreadyBound, + boundAccount: alreadyBound + ? String(bindResult.gameAccount || expectedUid || '').trim() + : '', + roleName: alreadyBound ? String(bindResult.roleName || '').trim() : '', + gameChannel: alreadyBound ? String(bindResult.gameChannel || '').trim() : '', bindMismatch: false, } @@ -516,6 +520,7 @@ function clearAffiliateDashBindSnapshot( expectedGameAccount: gameAccount || flow.expectedGameAccount, bound: false, boundAccount: '', + roleName: '', gameChannel: '', bindMismatch: false, } @@ -570,7 +575,12 @@ async function refreshAffiliateDashBindState(task: TaskRow): Promise @@ -55,7 +59,9 @@ export function AffiliateDashClaimPanel({

{canSubmit - ? '账号绑定成功,确认无误后提交发货' + ? skipScanAuthorized + ? '账号已在平台授权,确认无误后提交发货(无需再次扫码)' + : '账号绑定成功,确认无误后提交发货' : bindMismatch ? '绑定账号与填写 UID 不一致,请核对 UID 后用正确账号重新绑定' : bound @@ -107,7 +113,13 @@ export function AffiliateDashClaimPanel({ showIcon icon={} message={`已绑定账号:${displayBoundAccount}`} - description={affiliateDash.gameChannel ? `渠道:${affiliateDash.gameChannel}` : undefined} + description={[ + roleName ? `游戏角色:${roleName}` : '', + gameChannel ? `渠道:${gameChannel}` : '', + skipScanAuthorized ? '该账号此前已授权,本次免扫码' : '', + ] + .filter(Boolean) + .join(' · ') || undefined} style={{ marginBottom: 16 }} /> ) : null} @@ -135,7 +147,7 @@ export function AffiliateDashClaimPanel({ > Q区用Q扫 - {qrCodeDataUrl ? ( + {hasBindQr ? ( 绑定二维码 ) : ( - + <> + + {hasBindQr ? ( +

+ + 如需换号可重新扫码绑定 + + 绑定二维码 +
+ ) : null} + )} ) @@ -176,6 +202,11 @@ export function AffiliateDashClaimPanel({ export function AffiliateDashResultStep({ snapshot }: { snapshot: ClaimSnapshot }) { const affiliateDash = snapshot.affiliateDash const success = Boolean(affiliateDash && !snapshot.isRedeemFailed) + const roleName = String(affiliateDash?.roleName || '').trim() + const gameChannel = String(affiliateDash?.gameChannel || '').trim() + const boundAccount = String( + affiliateDash?.boundAccount || affiliateDash?.gameAccount || '', + ).trim() return ( @@ -193,10 +224,9 @@ export function AffiliateDashResultStep({ snapshot }: { snapshot: ClaimSnapshot
- + + +
diff --git a/apps/frontend/src/pages/claim/ClaimPage.tsx b/apps/frontend/src/pages/claim/ClaimPage.tsx index 874c4dcb..819c924e 100644 --- a/apps/frontend/src/pages/claim/ClaimPage.tsx +++ b/apps/frontend/src/pages/claim/ClaimPage.tsx @@ -67,7 +67,15 @@ export default function ClaimPage() { if (expectedUid) { setUidInput(expectedUid) } - await generateQRCode(String(nextDetail.affiliateDash?.bindUrl || '').trim()) + const bindUrl = String(nextDetail.affiliateDash?.bindUrl || '').trim() + const qrUrl = String(nextDetail.affiliateDash?.qrUrl || '').trim() + if (bindUrl) { + await generateQRCode(bindUrl) + } else if (qrUrl) { + setQrCodeDataUrl(qrUrl) + } else { + setQrCodeDataUrl('') + } }, [generateQRCode], ) diff --git a/apps/frontend/src/pages/claim/claim-snapshot.ts b/apps/frontend/src/pages/claim/claim-snapshot.ts index 0dc52ce8..8881452c 100644 --- a/apps/frontend/src/pages/claim/claim-snapshot.ts +++ b/apps/frontend/src/pages/claim/claim-snapshot.ts @@ -193,6 +193,9 @@ function resolveProgressText(options: { if (!options.isAffiliateDashReadyToSubmit) { return '绑定账号确认中,请稍候' } + if (!(options.affiliateDash?.bindUrl || options.affiliateDash?.qrUrl)) { + return '账号已授权,请确认提交发货' + } return '已绑定,请提交发货' } return '当前领取流程不可用' diff --git a/apps/frontend/src/types/claim.ts b/apps/frontend/src/types/claim.ts index 04ce8296..8ea056eb 100644 --- a/apps/frontend/src/types/claim.ts +++ b/apps/frontend/src/types/claim.ts @@ -183,6 +183,7 @@ export interface ClaimAffiliateDashFlowInfo { bindMismatch: boolean bound: boolean boundAccount: string + roleName: string gameChannel: string submitStatus: string consumeStatus: string