fix(claim): 领取页展示游戏角色名,并说明乐玩免扫码场景

持久化 affiliate_dash roleName/gameChannel;免扫码授权时明确提示,有绑定链接时提交前仍可显示二维码。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-09-15 12:39:47 +08:00
co-authored by Cursor
parent 8eef95fe97
commit 8e0cb7e295
6 changed files with 88 additions and 25 deletions
@@ -324,6 +324,8 @@ export type AffiliateDashFlow = {
/** 是否已在 affiliate-dash 侧完成绑定(bind-result.bound) */
bound: boolean
boundAccount: string
/** 绑定角色昵称(乐玩/DLC 返回) */
roleName: string
gameChannel: string
submitStatus: string
consumeStatus: string
@@ -337,6 +339,10 @@ export function normalizeAffiliateDashFlow(value: unknown): AffiliateDashFlow {
const source =
value && typeof value === 'object' && !Array.isArray(value) ? (value as JsonObject) : {}
const raw = source.raw && typeof source.raw === 'object' ? (source.raw as JsonObject) : null
const rawResult =
raw && raw.result && typeof raw.result === 'object' ? (raw.result as JsonObject) : null
return {
flowType: 'affiliate_dash',
sku: String(source.sku || '').trim(),
@@ -358,11 +364,16 @@ export function normalizeAffiliateDashFlow(value: unknown): AffiliateDashFlow {
bindMismatch: Boolean(source.bindMismatch),
bound: Boolean(source.bound),
boundAccount: String(source.boundAccount || '').trim(),
gameChannel: String(source.gameChannel || '').trim(),
roleName: String(
source.roleName || rawResult?.role_name || raw?.role_name || '',
).trim(),
gameChannel: String(
source.gameChannel || rawResult?.game_channel || raw?.game_channel || '',
).trim(),
submitStatus: String(source.submitStatus || '').trim(),
consumeStatus: String(source.consumeStatus || 'pending').trim(),
lastSyncedAt: source.lastSyncedAt || null,
raw: source.raw && typeof source.raw === 'object' ? source.raw : null,
raw,
mock:
source.mock && typeof source.mock === 'object'
? {