优化(半自动履约): 精简虎牙扫码与绑定确认流程
This commit is contained in:
@@ -90,6 +90,16 @@ describe('虎牙角色比对', () => {
|
|||||||
assert.match(result.message, /区服/)
|
assert.match(result.message, /区服/)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('平台系统不一致时禁止确认', () => {
|
||||||
|
const result = compareBindingRole(task('落地盒子怪cc', '4212063544', '苹果Q区'), {
|
||||||
|
bindGameRole: '落地盒子怪cc',
|
||||||
|
bindGameRoleToken: HUYA_ROLE_TOKEN,
|
||||||
|
bindGameChannel: '安卓(android) · QQ',
|
||||||
|
})
|
||||||
|
assert.equal(result.verdict, 'mismatch')
|
||||||
|
assert.match(result.message, /区服/)
|
||||||
|
})
|
||||||
|
|
||||||
it('平台区服无法解析时判 unknown', () => {
|
it('平台区服无法解析时判 unknown', () => {
|
||||||
const result = compareBindingRole(task('落地盒子怪cc', '4212063544', '安卓Q区'), {
|
const result = compareBindingRole(task('落地盒子怪cc', '4212063544', '安卓Q区'), {
|
||||||
bindGameRole: '落地盒子怪cc',
|
bindGameRole: '落地盒子怪cc',
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
CheckCircleFilled,
|
CheckCircleFilled,
|
||||||
|
CopyOutlined,
|
||||||
ExclamationCircleOutlined,
|
ExclamationCircleOutlined,
|
||||||
LoadingOutlined,
|
LoadingOutlined,
|
||||||
QrcodeOutlined,
|
QrcodeOutlined,
|
||||||
ReloadOutlined,
|
ReloadOutlined,
|
||||||
} from '@ant-design/icons'
|
} from '@ant-design/icons'
|
||||||
import { App, Alert, Button, Image, Input, Modal, Select, Space, Spin } from 'antd'
|
import { App, Alert, Button, Image, Input, Select, Space, Spin } from 'antd'
|
||||||
import QRCode from 'qrcode'
|
import QRCode from 'qrcode'
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
||||||
import { useLocation, useNavigate, useParams } from 'react-router'
|
import { useLocation, useNavigate, useParams } from 'react-router'
|
||||||
@@ -82,7 +83,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
const [huyaChallengeLoading, setHuyaChallengeLoading] = useState(false)
|
const [huyaChallengeLoading, setHuyaChallengeLoading] = useState(false)
|
||||||
const [bindingInfo, setBindingInfo] = useState<CustomerBindingInfo | null>(null)
|
const [bindingInfo, setBindingInfo] = useState<CustomerBindingInfo | null>(null)
|
||||||
const [bindingLoading, setBindingLoading] = useState(false)
|
const [bindingLoading, setBindingLoading] = useState(false)
|
||||||
const [bindingConfirmOpen, setBindingConfirmOpen] = useState(false)
|
|
||||||
const [bindingSecondsLeft, setBindingSecondsLeft] = useState(0)
|
const [bindingSecondsLeft, setBindingSecondsLeft] = useState(0)
|
||||||
const [bindingQrImage, setBindingQrImage] = useState('')
|
const [bindingQrImage, setBindingQrImage] = useState('')
|
||||||
const [profileRoleName, setProfileRoleName] = useState('')
|
const [profileRoleName, setProfileRoleName] = useState('')
|
||||||
@@ -94,7 +94,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
const lastBindingRefreshAtRef = useRef(0)
|
const lastBindingRefreshAtRef = useRef(0)
|
||||||
const resettingBindingRef = useRef(false)
|
const resettingBindingRef = useRef(false)
|
||||||
const hydratingBindingRef = useRef(false)
|
const hydratingBindingRef = useRef(false)
|
||||||
const autoOpenedRoleRef = useRef('')
|
|
||||||
const redirectingRef = useRef(false)
|
const redirectingRef = useRef(false)
|
||||||
const weiboBindingSyncRef = useRef(false)
|
const weiboBindingSyncRef = useRef(false)
|
||||||
// Connector 重启或会话被回收后,绑定/确认接口会返回 huya_native_session_not_found。
|
// Connector 重启或会话被回收后,绑定/确认接口会返回 huya_native_session_not_found。
|
||||||
@@ -188,11 +187,9 @@ export default function CustomerFulfillmentPage({
|
|||||||
setSmsCountdown(0)
|
setSmsCountdown(0)
|
||||||
setHuyaChallenge(null)
|
setHuyaChallenge(null)
|
||||||
setBindingInfo(null)
|
setBindingInfo(null)
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
startingBindingRef.current = false
|
startingBindingRef.current = false
|
||||||
lastBindingRefreshAtRef.current = 0
|
lastBindingRefreshAtRef.current = 0
|
||||||
hydratingBindingRef.current = false
|
hydratingBindingRef.current = false
|
||||||
autoOpenedRoleRef.current = ''
|
|
||||||
weiboBindingSyncRef.current = false
|
weiboBindingSyncRef.current = false
|
||||||
setBindingSessionExpired(false)
|
setBindingSessionExpired(false)
|
||||||
setBindingLoadError('')
|
setBindingLoadError('')
|
||||||
@@ -365,7 +362,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (isConnectorSessionExpired(error)) {
|
if (isConnectorSessionExpired(error)) {
|
||||||
setBindingSessionExpired(true)
|
setBindingSessionExpired(true)
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 非会话错误不要静默:二维码区域会展示可重试的错误,避免一直转圈。
|
// 非会话错误不要静默:二维码区域会展示可重试的错误,避免一直转圈。
|
||||||
@@ -441,20 +437,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
selectedTask?.platform,
|
selectedTask?.platform,
|
||||||
])
|
])
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!bindingDecision?.canConfirmBinding) return
|
|
||||||
const key = `${selectedTask.id}:${
|
|
||||||
bindingInfo?.pendingBindGameRoleToken ||
|
|
||||||
bindingInfo?.bindGameRoleToken ||
|
|
||||||
selectedTask.pendingBindGameRoleToken ||
|
|
||||||
selectedTask.bindGameRoleToken ||
|
|
||||||
''
|
|
||||||
}`
|
|
||||||
if (autoOpenedRoleRef.current === key) return
|
|
||||||
autoOpenedRoleRef.current = key
|
|
||||||
setBindingConfirmOpen(true)
|
|
||||||
}, [bindingDecision, bindingInfo, selectedTask?.id])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const url = bindingInfo?.qrUrl
|
const url = bindingInfo?.qrUrl
|
||||||
if (!url) {
|
if (!url) {
|
||||||
@@ -497,7 +479,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
setBindingSessionExpired(false)
|
setBindingSessionExpired(false)
|
||||||
setBindingLoadError('')
|
setBindingLoadError('')
|
||||||
setBindingInfo(null)
|
setBindingInfo(null)
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
setBindingSecondsLeft(0)
|
setBindingSecondsLeft(0)
|
||||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -636,7 +617,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
)
|
)
|
||||||
setBindingInfo(response.data.binding)
|
setBindingInfo(response.data.binding)
|
||||||
setBindingLoadError('')
|
setBindingLoadError('')
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
const nextDecision =
|
const nextDecision =
|
||||||
response.data.binding?.bindingDecision || response.data.task.bindingDecision
|
response.data.binding?.bindingDecision || response.data.task.bindingDecision
|
||||||
if (
|
if (
|
||||||
@@ -646,13 +626,10 @@ export default function CustomerFulfillmentPage({
|
|||||||
nextDecision?.flowState === 'manual_review'
|
nextDecision?.flowState === 'manual_review'
|
||||||
) {
|
) {
|
||||||
message.warning(nextDecision.message)
|
message.warning(nextDecision.message)
|
||||||
} else if (nextDecision?.canConfirmBinding) {
|
|
||||||
setBindingConfirmOpen(true)
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (isConnectorSessionExpired(error)) {
|
if (isConnectorSessionExpired(error)) {
|
||||||
setBindingSessionExpired(true)
|
setBindingSessionExpired(true)
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
message.warning(
|
message.warning(
|
||||||
selectedTask.platform === 'weibo'
|
selectedTask.platform === 'weibo'
|
||||||
? '微博登录已失效,请重新登录'
|
? '微博登录已失效,请重新登录'
|
||||||
@@ -678,11 +655,9 @@ export default function CustomerFulfillmentPage({
|
|||||||
)
|
)
|
||||||
setBindingInfo(response.data.binding)
|
setBindingInfo(response.data.binding)
|
||||||
setBindingLoadError('')
|
setBindingLoadError('')
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (isConnectorSessionExpired(error)) {
|
if (isConnectorSessionExpired(error)) {
|
||||||
setBindingSessionExpired(true)
|
setBindingSessionExpired(true)
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
message.warning('微博登录已失效,请重新登录')
|
message.warning('微博登录已失效,请重新登录')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -706,7 +681,7 @@ export default function CustomerFulfillmentPage({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handlePollBindingNow(openConfirm = false) {
|
async function handlePollBindingNow() {
|
||||||
if (!selectedTask) return
|
if (!selectedTask) return
|
||||||
setBindingLoading(true)
|
setBindingLoading(true)
|
||||||
try {
|
try {
|
||||||
@@ -719,10 +694,8 @@ export default function CustomerFulfillmentPage({
|
|||||||
setBindingLoadError('')
|
setBindingLoadError('')
|
||||||
if (selectedTask.platform === 'huya' && nextDecision) {
|
if (selectedTask.platform === 'huya' && nextDecision) {
|
||||||
if (nextDecision.canConfirmBinding) {
|
if (nextDecision.canConfirmBinding) {
|
||||||
setBindingConfirmOpen(true)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
if (nextDecision.flowState === 'confirmed') {
|
if (nextDecision.flowState === 'confirmed') {
|
||||||
message.success('平台绑定已确认,等待客服处理')
|
message.success('平台绑定已确认,等待客服处理')
|
||||||
return
|
return
|
||||||
@@ -760,7 +733,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 微博仍以平台事实状态展示。
|
// 微博仍以平台事实状态展示。
|
||||||
if (openConfirm) setBindingConfirmOpen(false)
|
|
||||||
const detail = nextBinding?.message || ''
|
const detail = nextBinding?.message || ''
|
||||||
if (nextTask.bindingStatus === 'confirmed') {
|
if (nextTask.bindingStatus === 'confirmed') {
|
||||||
message.success('微博角色已绑定,等待客服处理')
|
message.success('微博角色已绑定,等待客服处理')
|
||||||
@@ -774,7 +746,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (isConnectorSessionExpired(error)) {
|
if (isConnectorSessionExpired(error)) {
|
||||||
setBindingSessionExpired(true)
|
setBindingSessionExpired(true)
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
message.warning(
|
message.warning(
|
||||||
selectedTask.platform === 'weibo'
|
selectedTask.platform === 'weibo'
|
||||||
? '微博登录已失效,请重新登录'
|
? '微博登录已失效,请重新登录'
|
||||||
@@ -801,7 +772,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
setTasks((current) => current.map((task) => (task.id === nextTask.id ? nextTask : task)))
|
setTasks((current) => current.map((task) => (task.id === nextTask.id ? nextTask : task)))
|
||||||
if (nextBinding) setBindingInfo(nextBinding)
|
if (nextBinding) setBindingInfo(nextBinding)
|
||||||
setBindingLoadError('')
|
setBindingLoadError('')
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
if (
|
if (
|
||||||
nextDecision?.flowState === 'rebind_blocked_account' ||
|
nextDecision?.flowState === 'rebind_blocked_account' ||
|
||||||
nextDecision?.flowState === 'rebind_blocked_target_role' ||
|
nextDecision?.flowState === 'rebind_blocked_target_role' ||
|
||||||
@@ -811,14 +781,12 @@ export default function CustomerFulfillmentPage({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (nextDecision?.canConfirmBinding) {
|
if (nextDecision?.canConfirmBinding) {
|
||||||
message.success('已识别本次待确认角色,请核对后再确认绑定')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
message.info('尚未识别到新的待确认角色,请重新选择并刷新')
|
message.info('尚未识别到新的待确认角色,请重新选择并刷新')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (isConnectorSessionExpired(error)) {
|
if (isConnectorSessionExpired(error)) {
|
||||||
setBindingSessionExpired(true)
|
setBindingSessionExpired(true)
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
message.warning('虎牙登录会话已过期,请重新登录')
|
message.warning('虎牙登录会话已过期,请重新登录')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -858,7 +826,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
current.map((task) => (task.id === response.data.task.id ? response.data.task : task)),
|
current.map((task) => (task.id === response.data.task.id ? response.data.task : task)),
|
||||||
)
|
)
|
||||||
setBindingInfo(response.data.binding)
|
setBindingInfo(response.data.binding)
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
const nextDecision =
|
const nextDecision =
|
||||||
response.data.binding?.bindingDecision || response.data.task.bindingDecision
|
response.data.binding?.bindingDecision || response.data.task.bindingDecision
|
||||||
if (nextDecision?.flowState === 'confirmed') {
|
if (nextDecision?.flowState === 'confirmed') {
|
||||||
@@ -874,11 +841,10 @@ export default function CustomerFulfillmentPage({
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (isConnectorSessionExpired(error)) {
|
if (isConnectorSessionExpired(error)) {
|
||||||
setBindingSessionExpired(true)
|
setBindingSessionExpired(true)
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
message.warning('虎牙登录会话已过期,请重新登录')
|
message.warning('虎牙登录会话已过期,请重新登录')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
message.error(error instanceof Error ? error.message : '提交平台绑定失败')
|
message.error(error instanceof Error ? error.message : '确认绑定失败')
|
||||||
} finally {
|
} finally {
|
||||||
setBindingLoading(false)
|
setBindingLoading(false)
|
||||||
}
|
}
|
||||||
@@ -892,9 +858,8 @@ export default function CustomerFulfillmentPage({
|
|||||||
async function openProfileEditor() {
|
async function openProfileEditor() {
|
||||||
if (!selectedTask) return
|
if (!selectedTask) return
|
||||||
if (resettingBindingRef.current) return
|
if (resettingBindingRef.current) return
|
||||||
setBindingConfirmOpen(false)
|
|
||||||
setProfileEditing(true)
|
setProfileEditing(true)
|
||||||
// 资料步骤会隐藏绑定二维码与比对区,等 React 完成切换后再回到第一步顶部。
|
// 资料步骤会隐藏绑定二维码与操作区,等 React 完成切换后再回到第一步顶部。
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
document
|
document
|
||||||
.getElementById('customer-binding-stage')
|
.getElementById('customer-binding-stage')
|
||||||
@@ -1046,10 +1011,15 @@ export default function CustomerFulfillmentPage({
|
|||||||
].includes(bindingDecision.flowState),
|
].includes(bindingDecision.flowState),
|
||||||
)
|
)
|
||||||
const bindingComparison = bindingDecision?.comparison || bindingInfo?.comparison || null
|
const bindingComparison = bindingDecision?.comparison || bindingInfo?.comparison || null
|
||||||
|
const bindingAccountName = String(
|
||||||
|
bindingInfo?.bindGameAccount || selectedTask?.bindGameAccount || '',
|
||||||
|
).trim()
|
||||||
const currentRoleName = bindingInfo?.bindGameRole || selectedTask?.bindGameRole || ''
|
const currentRoleName = bindingInfo?.bindGameRole || selectedTask?.bindGameRole || ''
|
||||||
const pendingRoleName =
|
const pendingRoleName =
|
||||||
bindingInfo?.pendingBindGameRole || selectedTask?.pendingBindGameRole || ''
|
bindingInfo?.pendingBindGameRole || selectedTask?.pendingBindGameRole || ''
|
||||||
const bindingRoleName = pendingRoleName || currentRoleName
|
const bindingRoleName = pendingRoleName || currentRoleName
|
||||||
|
const bindingQrSource = bindingInfo?.qrImage || bindingQrImage || ''
|
||||||
|
const bindingQrReady = Boolean(bindingQrSource)
|
||||||
const rebindUnchanged = bindingInfo?.rebindUnchanged === true
|
const rebindUnchanged = bindingInfo?.rebindUnchanged === true
|
||||||
// 换绑被虎牙拒绝或未生效时展示失败原因;若客户已把资料改成与平台当前角色一致,
|
// 换绑被虎牙拒绝或未生效时展示失败原因;若客户已把资料改成与平台当前角色一致,
|
||||||
// 比对为 match,则回到正常提交流程,不再显示换绑失败。
|
// 比对为 match,则回到正常提交流程,不再显示换绑失败。
|
||||||
@@ -1110,7 +1080,7 @@ export default function CustomerFulfillmentPage({
|
|||||||
}
|
}
|
||||||
if (!bindingDecision && selectedTask?.bindingStatus === 'role_ready') {
|
if (!bindingDecision && selectedTask?.bindingStatus === 'role_ready') {
|
||||||
if (!bindingComparison) return { tone: 'is-info', text: '正在核对平台角色,请稍候' }
|
if (!bindingComparison) return { tone: 'is-info', text: '正在核对平台角色,请稍候' }
|
||||||
return { tone: 'is-info', text: '平台角色与已填资料一致,请提交平台绑定' }
|
return { tone: 'is-info', text: '角色名与区服验证通过,可确认绑定' }
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
!bindingDecision &&
|
!bindingDecision &&
|
||||||
@@ -1203,7 +1173,7 @@ export default function CustomerFulfillmentPage({
|
|||||||
<div className="customer-auth-profile" id="customer-profile-form">
|
<div className="customer-auth-profile" id="customer-profile-form">
|
||||||
<p>
|
<p>
|
||||||
{profileComplete
|
{profileComplete
|
||||||
? '修改目标角色资料后会重新核对虎牙账号当前绑定角色;角色名与区服一致后才能确认绑定。'
|
? '修改资料后会重新核对平台角色;角色名、区服和平台信息一致后才能确认绑定。'
|
||||||
: '第一步:请填写区服、游戏角色 UID 和角色名。UID 只做资料留档,不参与绑定核验。'}
|
: '第一步:请填写区服、游戏角色 UID 和角色名。UID 只做资料留档,不参与绑定核验。'}
|
||||||
</p>
|
</p>
|
||||||
<div className="customer-profile-form">
|
<div className="customer-profile-form">
|
||||||
@@ -1553,16 +1523,16 @@ export default function CustomerFulfillmentPage({
|
|||||||
|
|
||||||
{showBindingStage ? (
|
{showBindingStage ? (
|
||||||
<section id="customer-binding-stage" className="customer-binding-stage">
|
<section id="customer-binding-stage" className="customer-binding-stage">
|
||||||
{profileComplete && !profileEditing ? (
|
{profileComplete &&
|
||||||
|
!profileEditing &&
|
||||||
|
(bindingAccountName || currentRoleName || pendingRoleName) ? (
|
||||||
<div className="customer-binding-info">
|
<div className="customer-binding-info">
|
||||||
<h3>
|
<h3>
|
||||||
绑定信息 <small>(已登录虎牙账号)</small>
|
绑定信息 <small>(已登录虎牙账号)</small>
|
||||||
</h3>
|
</h3>
|
||||||
<div>
|
<div>
|
||||||
<span>登录账号</span>
|
<span>登录账号</span>
|
||||||
<strong>
|
<strong>{bindingAccountName || '未获取'}</strong>
|
||||||
{bindingInfo?.bindGameAccount || selectedTask.bindGameAccount || '未获取'}
|
|
||||||
</strong>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span>当前绑定角色</span>
|
<span>当前绑定角色</span>
|
||||||
@@ -1597,101 +1567,113 @@ export default function CustomerFulfillmentPage({
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{bindingBanner && !profileEditing ? (
|
{bindingBanner && !profileEditing && !bindingQrVisible ? (
|
||||||
<div className={`customer-binding-alert ${bindingBanner.tone}`}>
|
<div className={`customer-binding-alert ${bindingBanner.tone}`}>
|
||||||
{bindingBanner.text}
|
{bindingBanner.text}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{bindingQrVisible && !bindingSessionExpired && !profileEditing ? (
|
{bindingQrVisible && !bindingSessionExpired && !profileEditing ? (
|
||||||
<div className="customer-binding-qr-card">
|
<div className="customer-binding-qr-card customer-huya-qr-card">
|
||||||
<h3>游戏角色绑定二维码</h3>
|
<div className="customer-huya-qr-heading">
|
||||||
{bindingInfo?.qrImage || bindingQrImage ? (
|
<QrcodeOutlined />
|
||||||
<Image
|
<h3>微信扫码绑定</h3>
|
||||||
src={bindingInfo?.qrImage || bindingQrImage || ''}
|
</div>
|
||||||
alt="游戏角色绑定二维码"
|
{bindingQrReady ? (
|
||||||
width={260}
|
<div className="customer-huya-qr-code">
|
||||||
preview={false}
|
<Image
|
||||||
/>
|
src={bindingQrSource}
|
||||||
|
alt="微信扫码绑定游戏角色"
|
||||||
|
width={228}
|
||||||
|
preview={false}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
) : bindingLoadError ? (
|
) : bindingLoadError ? (
|
||||||
<div className="customer-binding-qr-error">
|
<div className="customer-huya-qr-code">
|
||||||
<p>绑定二维码加载失败</p>
|
<div className="customer-binding-qr-error">
|
||||||
<span>{bindingLoadError}</span>
|
<p>二维码加载失败</p>
|
||||||
<div className="customer-binding-qr-actions">
|
<span>{bindingLoadError}</span>
|
||||||
<Button type="primary" onClick={() => void handlePollBindingNow()}>
|
|
||||||
重试
|
|
||||||
</Button>
|
|
||||||
<Button loading={loading} onClick={() => void handleStartLogin()}>
|
|
||||||
返回登录
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="customer-auth-qr-placeholder">
|
<div className="customer-huya-qr-code">
|
||||||
<Spin />
|
<div className="customer-auth-qr-placeholder">
|
||||||
<span>正在生成绑定二维码...</span>
|
<Spin />
|
||||||
|
<span>正在生成二维码</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<p className="customer-binding-qr-hint">
|
<p className="customer-binding-qr-hint">
|
||||||
{bindingInfo?.hasExistingBinding === false
|
{bindingInfo?.hasExistingBinding === false
|
||||||
? '该虎牙账号还没有绑定游戏角色,请用微信扫码完成绑定'
|
? '使用微信扫码选择目标游戏角色'
|
||||||
: '请使用微信APP扫码进行游戏角色绑定'}
|
: '使用微信扫码选择要换绑的角色'}
|
||||||
</p>
|
</p>
|
||||||
<p className="customer-binding-qr-hint">
|
{selectedTask?.bindingStatus === 'scanned' ? (
|
||||||
扫码后系统只核对角色名称与区服,UID 不参与绑定判定。
|
|
||||||
</p>
|
|
||||||
<p className="customer-binding-qr-tip">
|
|
||||||
{selectedTask?.bindingStatus === 'scanned'
|
|
||||||
? rebindAccepted
|
|
||||||
? '已向虎牙提交换绑,正在等待角色生效,请稍候刷新。'
|
|
||||||
: bindConfirmPending
|
|
||||||
? '已向虎牙提交绑定,正在等待角色生效,请稍候刷新。'
|
|
||||||
: bindingInfo?.rebindRequested
|
|
||||||
? '扫码后请在虎牙弹窗中选中目标角色;选好后点下方「核对平台角色」。'
|
|
||||||
: '请在微信中完成角色绑定确认,再点击下方按钮核对平台角色。'
|
|
||||||
: '扫码后请在微信确认框中核对目标角色。'}
|
|
||||||
</p>
|
|
||||||
{nextRebindText ? (
|
|
||||||
<p className="customer-binding-qr-tip">
|
<p className="customer-binding-qr-tip">
|
||||||
本次换绑成功后,下次可换绑:{nextRebindText}。
|
{rebindAccepted || bindConfirmPending
|
||||||
|
? '平台处理中,请刷新绑定状态'
|
||||||
|
: '已扫码,请核对平台角色'}
|
||||||
</p>
|
</p>
|
||||||
) : null}
|
) : null}
|
||||||
<p className="customer-binding-qr-countdown">
|
<div className="customer-huya-qr-meta">
|
||||||
{selectedTask?.bindingStatus === 'scanned'
|
<span>
|
||||||
? bindingInfo?.message || '已扫码,等待角色生效'
|
{bindingSecondsLeft > 0
|
||||||
: `建议 ${formatCountdown(bindingSecondsLeft)} 内完成扫码`}
|
? `剩余 ${formatCountdown(bindingSecondsLeft)}`
|
||||||
</p>
|
: '有效期待更新'}
|
||||||
|
</span>
|
||||||
|
<span>{selectedTask?.bindingStatus === 'scanned' ? '等待核对' : '微信扫码'}</span>
|
||||||
|
</div>
|
||||||
<div className="customer-binding-qr-actions">
|
<div className="customer-binding-qr-actions">
|
||||||
<Button type="primary" onClick={() => void handleCopyBindingLink()}>
|
<Button
|
||||||
复制二维码链接
|
icon={<CopyOutlined />}
|
||||||
|
disabled={!bindingQrReady}
|
||||||
|
onClick={() => void handleCopyBindingLink()}
|
||||||
|
>
|
||||||
|
复制链接
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleRefreshBindingQr} loading={bindingLoading}>
|
<Button
|
||||||
刷新二维码
|
icon={<ReloadOutlined />}
|
||||||
|
onClick={
|
||||||
|
bindingLoadError ? () => void handlePollBindingNow() : handleRefreshBindingQr
|
||||||
|
}
|
||||||
|
loading={bindingLoading}
|
||||||
|
>
|
||||||
|
{bindingLoadError ? '重试' : '刷新'}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{selectedTask?.bindingStatus === 'scanned' &&
|
{bindingQrReady ? (
|
||||||
bindingInfo?.rebindRequested &&
|
selectedTask?.bindingStatus === 'scanned' &&
|
||||||
!rebindAccepted ? (
|
bindingInfo?.rebindRequested &&
|
||||||
<Button
|
!rebindAccepted ? (
|
||||||
block
|
<Button
|
||||||
size="large"
|
block
|
||||||
className="customer-binding-next"
|
size="large"
|
||||||
loading={bindingLoading}
|
className="customer-binding-next"
|
||||||
onClick={() => void handleSubmitRebind()}
|
loading={bindingLoading}
|
||||||
>
|
onClick={() => void handleSubmitRebind()}
|
||||||
核对平台角色
|
>
|
||||||
</Button>
|
核对平台角色
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<Button
|
||||||
|
block
|
||||||
|
size="large"
|
||||||
|
className="customer-binding-next"
|
||||||
|
loading={bindingLoading}
|
||||||
|
onClick={() => void handlePollBindingNow()}
|
||||||
|
>
|
||||||
|
{rebindAccepted || bindConfirmPending ? '刷新绑定状态' : '已扫码,核对角色'}
|
||||||
|
</Button>
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<Button
|
<Button
|
||||||
block
|
block
|
||||||
size="large"
|
size="large"
|
||||||
className="customer-binding-next"
|
className="customer-binding-next"
|
||||||
loading={bindingLoading}
|
loading={loading}
|
||||||
onClick={() => void handlePollBindingNow()}
|
onClick={() => void handleStartLogin()}
|
||||||
>
|
>
|
||||||
{rebindAccepted || bindConfirmPending
|
返回登录
|
||||||
? '刷新绑定状态'
|
|
||||||
: '已扫码绑定,点击核对平台角色'}
|
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -1745,7 +1727,7 @@ export default function CustomerFulfillmentPage({
|
|||||||
message="请联系客服人工核实绑定角色"
|
message="请联系客服人工核实绑定角色"
|
||||||
description={`两侧角色信息不完整,无法自动核对。请复制订单号 ${
|
description={`两侧角色信息不完整,无法自动核对。请复制订单号 ${
|
||||||
orderNo || selectedTask?.orderNo || ''
|
orderNo || selectedTask?.orderNo || ''
|
||||||
} 联系客服,核实完成前请不要提交平台绑定。`}
|
} 联系客服,核实完成前无法确认绑定。`}
|
||||||
/>
|
/>
|
||||||
) : showRebindFailure ? (
|
) : showRebindFailure ? (
|
||||||
<Alert
|
<Alert
|
||||||
@@ -1789,7 +1771,7 @@ export default function CustomerFulfillmentPage({
|
|||||||
{bindingComparison.customerRoleName || '角色未填'}
|
{bindingComparison.customerRoleName || '角色未填'}
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
角色名称与区服一致后才能确认绑定;请重新扫码换绑,或上一步修改资料。
|
角色名称、区服和平台信息一致后才能确认绑定;请重新扫码换绑,或上一步修改资料。
|
||||||
</span>
|
</span>
|
||||||
{nextRebindText ? (
|
{nextRebindText ? (
|
||||||
<span>平台预计下次允许换绑:{nextRebindText}</span>
|
<span>平台预计下次允许换绑:{nextRebindText}</span>
|
||||||
@@ -1820,58 +1802,61 @@ export default function CustomerFulfillmentPage({
|
|||||||
size="large"
|
size="large"
|
||||||
className="customer-binding-confirm"
|
className="customer-binding-confirm"
|
||||||
loading={bindingLoading}
|
loading={bindingLoading}
|
||||||
onClick={() => setBindingConfirmOpen(true)}
|
onClick={() => void handleConfirmBinding()}
|
||||||
>
|
>
|
||||||
提交平台绑定
|
确认绑定这个角色到虎牙
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : (
|
||||||
{decisionRequiresRebind || decisionCanRefreshQr ? (
|
<>
|
||||||
<Button
|
{decisionRequiresRebind || decisionCanRefreshQr ? (
|
||||||
block
|
<Button
|
||||||
size="large"
|
block
|
||||||
className="customer-binding-rebind"
|
size="large"
|
||||||
icon={<ReloadOutlined />}
|
className="customer-binding-rebind"
|
||||||
loading={bindingLoading}
|
icon={<ReloadOutlined />}
|
||||||
onClick={() => void handleRefreshBinding(true)}
|
loading={bindingLoading}
|
||||||
>
|
onClick={() => void handleRefreshBinding(true)}
|
||||||
{bindingDecision?.flowState === 'rebind_required'
|
>
|
||||||
? '重新扫码换绑'
|
{bindingDecision?.flowState === 'rebind_required'
|
||||||
: '刷新绑定二维码'}
|
? '重新扫码换绑'
|
||||||
</Button>
|
: '刷新绑定二维码'}
|
||||||
) : null}
|
</Button>
|
||||||
{decisionCanEditProfile ? (
|
) : null}
|
||||||
<Button
|
{decisionCanEditProfile ? (
|
||||||
block
|
<Button
|
||||||
size="large"
|
block
|
||||||
className="customer-binding-rebind"
|
size="large"
|
||||||
icon={<ExclamationCircleOutlined />}
|
className="customer-binding-rebind"
|
||||||
onClick={() => void openProfileEditor()}
|
icon={<ExclamationCircleOutlined />}
|
||||||
>
|
onClick={() => void openProfileEditor()}
|
||||||
上一步修改资料
|
>
|
||||||
</Button>
|
上一步修改资料
|
||||||
) : null}
|
</Button>
|
||||||
{bindingNeedsSupport ? (
|
) : null}
|
||||||
<Button
|
{bindingNeedsSupport ? (
|
||||||
block
|
<Button
|
||||||
size="large"
|
block
|
||||||
className="customer-binding-confirm"
|
size="large"
|
||||||
onClick={() => void copyOrderNoForSupport()}
|
className="customer-binding-confirm"
|
||||||
>
|
onClick={() => void copyOrderNoForSupport()}
|
||||||
复制订单号联系客服
|
>
|
||||||
</Button>
|
复制订单号联系客服
|
||||||
) : null}
|
</Button>
|
||||||
{decisionCanRefreshBinding ? (
|
) : null}
|
||||||
<Button
|
{decisionCanRefreshBinding ? (
|
||||||
block
|
<Button
|
||||||
size="large"
|
block
|
||||||
className="customer-binding-rebind"
|
size="large"
|
||||||
icon={<ReloadOutlined />}
|
className="customer-binding-rebind"
|
||||||
loading={bindingLoading}
|
icon={<ReloadOutlined />}
|
||||||
onClick={() => void handlePollBindingNow()}
|
loading={bindingLoading}
|
||||||
>
|
onClick={() => void handlePollBindingNow()}
|
||||||
刷新绑定状态
|
>
|
||||||
</Button>
|
刷新绑定状态
|
||||||
) : null}
|
</Button>
|
||||||
|
) : null}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Space>
|
</Space>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -1916,90 +1901,6 @@ export default function CustomerFulfillmentPage({
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<Modal
|
|
||||||
open={
|
|
||||||
bindingConfirmOpen &&
|
|
||||||
canConfirmDecision &&
|
|
||||||
!bindingDecision?.requiresSupport &&
|
|
||||||
!profileEditing
|
|
||||||
}
|
|
||||||
className="customer-binding-modal"
|
|
||||||
title="核对绑定角色"
|
|
||||||
onCancel={() => {
|
|
||||||
if (!bindingLoading) setBindingConfirmOpen(false)
|
|
||||||
}}
|
|
||||||
footer={
|
|
||||||
<div className="customer-binding-modal-footer">
|
|
||||||
{canConfirmDecision ? (
|
|
||||||
<div className="customer-binding-modal-actions">
|
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
if (!bindingLoading) setBindingConfirmOpen(false)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
取消
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
type="primary"
|
|
||||||
loading={bindingLoading}
|
|
||||||
onClick={() => void handleConfirmBinding()}
|
|
||||||
>
|
|
||||||
确认绑定此角色
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div className="customer-binding-modal-actions is-mismatch">
|
|
||||||
<Button onClick={() => void openProfileEditor()}>上一步修改资料</Button>
|
|
||||||
<Button loading={bindingLoading} onClick={() => void handleRefreshBinding(true)}>
|
|
||||||
重新扫码换绑
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{bindingComparison?.verdict === 'mismatch' ? (
|
|
||||||
<p className="customer-binding-modal-error">
|
|
||||||
{bindingComparison?.message || '两侧角色信息不一致,无法提交平台绑定'}
|
|
||||||
</p>
|
|
||||||
) : bindingComparison?.verdict === 'unknown' ? (
|
|
||||||
<p className="customer-binding-modal-warning">两侧角色信息不完整,请联系客服核实</p>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
destroyOnClose
|
|
||||||
>
|
|
||||||
<Space direction="vertical" size={14} style={{ width: '100%' }}>
|
|
||||||
<p style={{ margin: 0 }}>
|
|
||||||
请核对角色名称与区服。游戏角色 UID 为必填留档,不参与绑定判定。
|
|
||||||
</p>
|
|
||||||
<div className="customer-binding-compare">
|
|
||||||
<div className="customer-binding-compare-side">
|
|
||||||
<div className="customer-binding-compare-head">
|
|
||||||
<span>您填写的角色</span>
|
|
||||||
<Button type="link" size="small" onClick={() => void openProfileEditor()}>
|
|
||||||
编辑
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
<strong>{bindingComparison?.customerRoleName || '未填写'}</strong>
|
|
||||||
<em>{bindingComparison?.customerZone || '区服未填写'}</em>
|
|
||||||
</div>
|
|
||||||
<div className="customer-binding-compare-side">
|
|
||||||
<div className="customer-binding-compare-head">
|
|
||||||
<span>{pendingRoleName ? '本次待确认角色' : '平台当前角色'}</span>
|
|
||||||
<Button
|
|
||||||
type="link"
|
|
||||||
size="small"
|
|
||||||
loading={bindingLoading}
|
|
||||||
onClick={() => void handlePollBindingNow(true)}
|
|
||||||
>
|
|
||||||
刷新
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
<strong>{bindingComparison?.boundRoleName || '未识别到角色'}</strong>
|
|
||||||
<em>{bindingComparison?.boundZone || '区服未识别'}</em>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Space>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<HuyaChallengeModal
|
<HuyaChallengeModal
|
||||||
open={Boolean(huyaChallenge)}
|
open={Boolean(huyaChallenge)}
|
||||||
challenge={huyaChallenge}
|
challenge={huyaChallenge}
|
||||||
|
|||||||
@@ -373,81 +373,3 @@
|
|||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customer-binding-modal-footer {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customer-binding-modal-actions {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customer-binding-modal-actions .ant-btn {
|
|
||||||
height: 42px;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customer-binding-modal-actions.is-mismatch {
|
|
||||||
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|
||||||
}
|
|
||||||
|
|
||||||
.customer-binding-modal-error {
|
|
||||||
margin: 0;
|
|
||||||
color: #dc2626;
|
|
||||||
font-size: 13px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customer-binding-modal-warning {
|
|
||||||
margin: 0;
|
|
||||||
color: #d97706;
|
|
||||||
font-size: 13px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customer-binding-compare {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customer-binding-compare-side {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 6px;
|
|
||||||
padding: 14px;
|
|
||||||
border: 1px solid rgba(15, 23, 42, 0.12);
|
|
||||||
border-radius: 6px;
|
|
||||||
background: rgba(15, 23, 42, 0.04);
|
|
||||||
}
|
|
||||||
|
|
||||||
.customer-binding-compare-head {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 8px;
|
|
||||||
color: #64748b;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customer-binding-compare-side strong {
|
|
||||||
color: #0f172a;
|
|
||||||
font-size: 16px;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customer-binding-compare-side em {
|
|
||||||
color: #64748b;
|
|
||||||
font-style: normal;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 480px) {
|
|
||||||
.customer-binding-compare {
|
|
||||||
grid-template-columns: minmax(0, 1fr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -142,16 +142,14 @@ body.customer-mobile-body .customer-binding-qr-card img {
|
|||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 固定宽度弹窗(绑定确认 520 / 虎牙验证 430)在窄屏必须收到视口内 */
|
/* 虎牙验证弹窗在窄屏必须收进视口。 */
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
.customer-binding-modal,
|
|
||||||
.customer-huya-challenge-modal {
|
.customer-huya-challenge-modal {
|
||||||
width: calc(100vw - 24px) !important;
|
width: calc(100vw - 24px) !important;
|
||||||
max-width: 480px;
|
max-width: 480px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customer-binding-modal .ant-modal-content,
|
|
||||||
.customer-huya-challenge-modal .ant-modal-content {
|
.customer-huya-challenge-modal .ant-modal-content {
|
||||||
max-height: calc(100vh - 32px);
|
max-height: calc(100vh - 32px);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
@@ -159,8 +157,7 @@ body.customer-mobile-body .customer-binding-qr-card img {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 380px) {
|
@media (max-width: 380px) {
|
||||||
body.customer-mobile-body .customer-binding-qr-actions,
|
body.customer-mobile-body .customer-binding-qr-actions {
|
||||||
body.customer-mobile-body .customer-binding-modal-actions {
|
|
||||||
grid-template-columns: minmax(0, 1fr);
|
grid-template-columns: minmax(0, 1fr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,145 @@
|
|||||||
/** 虎牙客户安全验证样式。 */
|
/** 虎牙客户安全验证样式。 */
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-stage {
|
||||||
|
gap: 10px;
|
||||||
|
padding: 12px 16px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-info {
|
||||||
|
gap: 8px;
|
||||||
|
padding: 12px 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-alert {
|
||||||
|
padding: 10px 12px;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.55;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-qr-card {
|
||||||
|
gap: 8px;
|
||||||
|
padding: 14px;
|
||||||
|
color: #cbd5e1;
|
||||||
|
border: 1px solid #3a4150;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: #202631;
|
||||||
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-huya-qr-heading {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 7px;
|
||||||
|
color: #93c5fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-huya-qr-heading h3 {
|
||||||
|
margin: 0;
|
||||||
|
color: #e2e8f0;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-huya-qr-code {
|
||||||
|
width: min(100%, 228px);
|
||||||
|
aspect-ratio: 1;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
padding: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
border: 1px solid #4a5262;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: #e5e9ee;
|
||||||
|
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-huya-qr-code .ant-image,
|
||||||
|
.customer-huya-qr-code img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: block;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-huya-qr-code .customer-auth-qr-placeholder {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 0;
|
||||||
|
height: 100%;
|
||||||
|
color: #94a3b8;
|
||||||
|
border: 1px dashed #485162;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #171c24;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-huya-qr-code .customer-binding-qr-error {
|
||||||
|
gap: 6px;
|
||||||
|
padding: 16px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-qr-hint {
|
||||||
|
max-width: 300px;
|
||||||
|
color: #b8c1cf;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.55;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-qr-tip {
|
||||||
|
color: #f6c66f;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-huya-qr-meta {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 300px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
color: #8f9aaa;
|
||||||
|
font-size: 12px;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-qr-actions {
|
||||||
|
max-width: 300px;
|
||||||
|
margin-top: 2px;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-qr-actions .ant-btn {
|
||||||
|
height: 38px;
|
||||||
|
color: #e2e8f0;
|
||||||
|
border-color: #465063;
|
||||||
|
border-radius: 9px;
|
||||||
|
background: #2a313d;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-qr-actions .ant-btn:hover,
|
||||||
|
.customer-auth-page.is-huya .customer-binding-qr-actions .ant-btn:focus-visible {
|
||||||
|
color: #fff;
|
||||||
|
border-color: #657186;
|
||||||
|
background: #343c4a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-qr-actions .ant-btn:disabled {
|
||||||
|
color: #6f7a8b;
|
||||||
|
border-color: #394353;
|
||||||
|
background: #252c37;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-next.ant-btn {
|
||||||
|
max-width: 300px;
|
||||||
|
height: 46px;
|
||||||
|
margin-top: 0;
|
||||||
|
border-radius: 10px;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
.customer-huya-steps {
|
.customer-huya-steps {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
@@ -67,6 +207,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
|
.customer-auth-page.is-huya .customer-binding-stage {
|
||||||
|
gap: 8px;
|
||||||
|
padding: 10px 14px 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-auth-page.is-huya .customer-binding-qr-card {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customer-huya-qr-code {
|
||||||
|
width: min(100%, 214px);
|
||||||
|
}
|
||||||
|
|
||||||
.customer-huya-steps {
|
.customer-huya-steps {
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
margin: 10px 16px 0;
|
margin: 10px 16px 0;
|
||||||
|
|||||||
@@ -10,10 +10,13 @@ const source = readFileSync(
|
|||||||
'utf8',
|
'utf8',
|
||||||
)
|
)
|
||||||
const styles = readFileSync(join(root, '../src/styles/customer/binding.css'), 'utf8')
|
const styles = readFileSync(join(root, '../src/styles/customer/binding.css'), 'utf8')
|
||||||
|
const huyaStyles = readFileSync(join(root, '../src/styles/customer/platform/huya.css'), 'utf8')
|
||||||
|
|
||||||
test('只有唯一绑定决策允许时才自动弹核对框', () => {
|
test('绑定确认只保留页内按钮,不再自动弹窗', () => {
|
||||||
assert.ok(source.includes('if (!bindingDecision?.canConfirmBinding) return'))
|
assert.ok(!source.includes('customer-binding-modal'))
|
||||||
assert.ok(source.includes('if (nextDecision?.canConfirmBinding) {'))
|
assert.ok(!source.includes('bindingConfirmOpen'))
|
||||||
|
assert.ok(!source.includes('setBindingConfirmOpen'))
|
||||||
|
assert.ok(!source.includes('handlePollBindingNow(true)'))
|
||||||
assert.ok(!source.includes("bindingInfo.comparison.verdict === 'match'"))
|
assert.ok(!source.includes("bindingInfo.comparison.verdict === 'match'"))
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -81,19 +84,39 @@ test('虎牙绑定只在二维码或平台生效等待态轮询,过期二维
|
|||||||
assert.ok(!pollingSource.includes('bindingActions.has('))
|
assert.ok(!pollingSource.includes('bindingActions.has('))
|
||||||
})
|
})
|
||||||
|
|
||||||
test('角色名和区服一致才出现确认绑定,不一致时展示原因', () => {
|
test('角色名和区服一致才显示页内确认按钮,不一致时展示原因', () => {
|
||||||
assert.ok(source.includes('确认绑定此角色'))
|
assert.ok(source.includes('确认绑定这个角色到虎牙'))
|
||||||
assert.ok(source.includes('canConfirmDecision'))
|
assert.ok(source.includes('canConfirmDecision'))
|
||||||
assert.ok(source.includes('两侧角色信息不一致,无法提交平台绑定'))
|
assert.ok(source.includes('onClick={() => void handleConfirmBinding()}'))
|
||||||
assert.ok(source.includes('customer-binding-modal-error'))
|
assert.ok(source.includes('{canConfirmDecision ? ('))
|
||||||
|
const confirmBranchStart = source.indexOf('{canConfirmDecision ? (')
|
||||||
|
const confirmBranchEnd = source.indexOf(') : (', confirmBranchStart)
|
||||||
|
const confirmBranch = source.slice(confirmBranchStart, confirmBranchEnd)
|
||||||
|
assert.ok(confirmBranch.includes('确认绑定这个角色到虎牙'))
|
||||||
|
assert.ok(!confirmBranch.includes('刷新绑定二维码'))
|
||||||
|
assert.ok(!confirmBranch.includes('上一步修改资料'))
|
||||||
|
assert.ok(source.includes('平台角色与已填资料不一致'))
|
||||||
|
assert.ok(source.includes('角色名称、区服和平台信息一致后才能确认绑定'))
|
||||||
|
assert.ok(!styles.includes('.customer-binding-modal'))
|
||||||
|
assert.ok(!styles.includes('.customer-binding-compare'))
|
||||||
})
|
})
|
||||||
|
|
||||||
test('二维码区明确只核验角色名与区服,UID 不参与绑定', () => {
|
test('虎牙二维码使用深色紧凑卡片并删除重复说明', () => {
|
||||||
assert.ok(source.includes('扫码后系统只核对角色名称与区服,UID 不参与绑定判定'))
|
assert.ok(source.includes('微信扫码绑定'))
|
||||||
assert.ok(source.includes('游戏角色 UID 为必填留档,不参与绑定判定'))
|
assert.ok(source.includes('使用微信扫码选择目标游戏角色'))
|
||||||
|
assert.ok(source.includes('已扫码,核对角色'))
|
||||||
|
assert.ok(source.includes('customer-huya-qr-code'))
|
||||||
|
assert.ok(!source.includes('扫码后系统只核对角色名称与区服,UID 不参与绑定判定'))
|
||||||
|
assert.ok(!source.includes('游戏角色 UID 为必填留档,不参与绑定判定'))
|
||||||
|
assert.ok(!source.includes('本次换绑成功后,下次可换绑'))
|
||||||
|
assert.ok(huyaStyles.includes('.customer-auth-page.is-huya .customer-binding-qr-card'))
|
||||||
|
assert.ok(huyaStyles.includes('.customer-huya-qr-code'))
|
||||||
|
assert.ok(huyaStyles.includes('background: #202631'))
|
||||||
assert.ok(source.includes('本次待确认角色'))
|
assert.ok(source.includes('本次待确认角色'))
|
||||||
assert.ok(source.includes('登录账号'))
|
assert.ok(source.includes('登录账号'))
|
||||||
assert.ok(source.includes('当前绑定角色'))
|
assert.ok(source.includes('当前绑定角色'))
|
||||||
|
assert.ok(source.includes('(bindingAccountName || currentRoleName || pendingRoleName)'))
|
||||||
|
assert.ok(source.includes('!bindingQrVisible'))
|
||||||
assert.ok(!source.includes('虎牙账号 UID'))
|
assert.ok(!source.includes('虎牙账号 UID'))
|
||||||
assert.ok(!source.includes('目标角色 UID'))
|
assert.ok(!source.includes('目标角色 UID'))
|
||||||
assert.ok(!source.includes('待确认角色 UID'))
|
assert.ok(!source.includes('待确认角色 UID'))
|
||||||
|
|||||||
@@ -34,17 +34,17 @@ test('客户履约页必须覆盖 body 320px 最小宽度并使用 480px 移动
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('客户履约页固定宽度弹窗必须收进手机视口', async () => {
|
test('虎牙验证弹窗必须收进手机视口', async () => {
|
||||||
const [page, huya, css] = await Promise.all([
|
const [page, huya, css] = await Promise.all([
|
||||||
readFile(source('pages/customer-fulfillment/CustomerFulfillmentPage.tsx'), 'utf8'),
|
readFile(source('pages/customer-fulfillment/CustomerFulfillmentPage.tsx'), 'utf8'),
|
||||||
readFile(source('pages/customer-fulfillment/HuyaChallengeModal.tsx'), 'utf8'),
|
readFile(source('pages/customer-fulfillment/HuyaChallengeModal.tsx'), 'utf8'),
|
||||||
readFile(source('styles/customer/mobile.css'), 'utf8'),
|
readFile(source('styles/customer/mobile.css'), 'utf8'),
|
||||||
])
|
])
|
||||||
|
|
||||||
assert.match(page, /className="customer-binding-modal"/)
|
assert.ok(!page.includes('customer-binding-modal'))
|
||||||
assert.match(huya, /className="customer-huya-challenge-modal"/)
|
assert.match(huya, /className="customer-huya-challenge-modal"/)
|
||||||
assert.match(
|
assert.match(
|
||||||
css,
|
css,
|
||||||
/\.customer-binding-modal,\s*\.customer-huya-challenge-modal\s*\{[^}]*width:\s*calc\(100vw - 24px\)\s*!important/s,
|
/\.customer-huya-challenge-modal\s*\{[^}]*width:\s*calc\(100vw - 24px\)\s*!important/s,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -335,6 +335,8 @@ gameOpenId
|
|||||||
6. 没有真实平台 UID 时不得伪造,也不得声称已经拿到平台角色 UID。
|
6. 没有真实平台 UID 时不得伪造,也不得声称已经拿到平台角色 UID。
|
||||||
7. 平台数值 UID 可以在后台展示和留档,但不得改变角色名、区服决定的绑定结果。
|
7. 平台数值 UID 可以在后台展示和留档,但不得改变角色名、区服决定的绑定结果。
|
||||||
8. 客户绑定页只展示登录账号名称、当前角色名和必要的待确认角色名,不展示任何账号或角色 UID 值。
|
8. 客户绑定页只展示登录账号名称、当前角色名和必要的待确认角色名,不展示任何账号或角色 UID 值。
|
||||||
|
9. 第一步提交的角色名、区服和平台是唯一目标;验证一致时只显示页内
|
||||||
|
「确认绑定这个角色到虎牙」,不再弹核对弹窗,任一不一致时不显示确认按钮。
|
||||||
|
|
||||||
只读审计命令:
|
只读审计命令:
|
||||||
|
|
||||||
@@ -431,7 +433,7 @@ gameRoleStr
|
|||||||
|
|
||||||
| 版本 | 日期 | 变更 |
|
| 版本 | 日期 | 变更 |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| 1.3 | 2026-11-20 | 客户绑定页移除虎牙账号 UID、目标角色 UID、平台角色 UID 和待确认角色 UID 展示,仅保留账号名称、角色名与区服 |
|
| 1.3 | 2026-11-20 | 客户绑定页改用深色紧凑二维码卡片并移除全部 UID 展示;取消确认弹窗,仅在第一资料与平台角色名、区服、平台一致时显示页内确认按钮 |
|
||||||
| 1.2 | 2026-11-20 | 客户游戏角色 UID 恢复为必填资料,但只校验非空;UID 格式、真实值和平台数值 UID 均不参与绑定核验 |
|
| 1.2 | 2026-11-20 | 客户游戏角色 UID 恢复为必填资料,但只校验非空;UID 格式、真实值和平台数值 UID 均不参与绑定核验 |
|
||||||
| 1.1 | 2026-11-20 | 业务核验规则收口为角色名和平台区服;客户游戏角色 UID 改为可选留档,平台数值角色 UID 只作可选观测,均不参与绑定门禁 |
|
| 1.1 | 2026-11-20 | 业务核验规则收口为角色名和平台区服;客户游戏角色 UID 改为可选留档,平台数值角色 UID 只作可选观测,均不参与绑定门禁 |
|
||||||
| 1.0 | 2026-11-20 | 建立文档;完整解析虎牙绑定 WUP/TAF;确认 `roleId` 为不透明 token、`gameSerial` 和 `extendInfo` 为空;修正 `changeBindTime` 为下一次可换绑时间;确认腾讯侧存在 `gameRoleStr` 角色接口但本 HAR 未调用 |
|
| 1.0 | 2026-11-20 | 建立文档;完整解析虎牙绑定 WUP/TAF;确认 `roleId` 为不透明 token、`gameSerial` 和 `extendInfo` 为空;修正 `changeBindTime` 为下一次可换绑时间;确认腾讯侧存在 `gameRoleStr` 角色接口但本 HAR 未调用 |
|
||||||
|
|||||||
+10
-7
@@ -3,7 +3,7 @@ type: 权威架构与实施计划
|
|||||||
description: 订单、内部 SKU、履约路由、履约执行、商品、成本与财务的唯一权威口径及重构计划。
|
description: 订单、内部 SKU、履约路由、履约执行、商品、成本与财务的唯一权威口径及重构计划。
|
||||||
tags: [订单, 内部SKU, 履约, 商品, 成本, 财务, 迁移]
|
tags: [订单, 内部SKU, 履约, 商品, 成本, 财务, 迁移]
|
||||||
status: authoritative
|
status: authoritative
|
||||||
version: 2.35
|
version: 2.36
|
||||||
updated_at: 2026-11-20
|
updated_at: 2026-11-20
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -328,11 +328,13 @@ manual fulfillment
|
|||||||
`gameRole.extendInfo` 中明确的数值角色 UID 时,可分别保存到 `platform_game_role_uid` /
|
`gameRole.extendInfo` 中明确的数值角色 UID 时,可分别保存到 `platform_game_role_uid` /
|
||||||
`pending_platform_game_role_uid` 供展示和排障,同样不参与绑定门禁。当前实际响应可能不返回独立
|
`pending_platform_game_role_uid` 供展示和排障,同样不参与绑定门禁。当前实际响应可能不返回独立
|
||||||
数值 UID,页面不得由加密 token、账号 UID 或客户 UID 互相回填;
|
数值 UID,页面不得由加密 token、账号 UID 或客户 UID 互相回填;
|
||||||
⑤ 客户确认前必须通过 outer/inner 双路查询得到本次 pending 角色;确认绑定必须先呈现 pending 角色,
|
⑤ 客户确认前必须通过 outer/inner 双路查询得到本次 pending 角色;第一步提交的角色名、区服和平台
|
||||||
自动判定固定只比较角色名与平台区服,客户明确提交后才调用 `confirmBindActAccount`,写后回查
|
是唯一目标资料,自动判定只比较这三项对应的角色名与平台区服。三项一致时,页面直接展示唯一主操作
|
||||||
current 角色与 pending 的角色名、区服和 role token 一致才能进入 `binding_status = confirmed`。
|
「确认绑定这个角色到虎牙」,不得再弹出二次核对弹窗;任一项不一致时不得展示确认绑定按钮,只能
|
||||||
确认请求必须携带页面已核对的角色名、role token 与渠道快照,Connector 发现 pending 已变化时
|
重新扫码换绑或修改资料。客户明确点击后才调用 `confirmBindActAccount`,写后回查 current 角色与
|
||||||
拒绝写入;轮询和二维码刷新不得自动提交平台写操作。
|
pending 的角色名、区服和 role token 一致才能进入 `binding_status = confirmed`。确认请求必须携带
|
||||||
|
页面已核对的角色名、role token 与渠道快照,Connector 发现 pending 已变化时拒绝写入;轮询和二维码
|
||||||
|
刷新不得自动提交平台写操作。
|
||||||
- 角色不一致时客户页固定提供两个动作:「重新扫码换绑」和「上一步修改资料」。
|
- 角色不一致时客户页固定提供两个动作:「重新扫码换绑」和「上一步修改资料」。
|
||||||
平台已有旧角色导致首次不一致、扫码绑定后不一致、换绑被虎牙拒绝或未生效时,以重新扫码换绑为主;
|
平台已有旧角色导致首次不一致、扫码绑定后不一致、换绑被虎牙拒绝或未生效时,以重新扫码换绑为主;
|
||||||
换绑后仍不一致时以「上一步修改资料」为主。取消「直接使用原角色」的快捷确认:
|
换绑后仍不一致时以「上一步修改资料」为主。取消「直接使用原角色」的快捷确认:
|
||||||
@@ -758,7 +760,8 @@ has_active_cost
|
|||||||
不校验格式或真实值。
|
不校验格式或真实值。
|
||||||
- 绑定信息区只展示登录虎牙账号名称、当前平台角色名,以及存在时的待确认角色名;客户页面不得展示
|
- 绑定信息区只展示登录虎牙账号名称、当前平台角色名,以及存在时的待确认角色名;客户页面不得展示
|
||||||
虎牙账号 UID、客户填写 UID、平台角色 UID 或待确认角色 UID。自动判定固定只比较角色名与平台区服,
|
虎牙账号 UID、客户填写 UID、平台角色 UID 或待确认角色 UID。自动判定固定只比较角色名与平台区服,
|
||||||
角色名和区服一致才允许确认绑定。客户游戏角色 UID、平台可能返回的数值角色 UID 都不参与绑定 verdict,
|
角色名、区服和平台信息一致时,页面只显示「确认绑定这个角色到虎牙」一个主操作,不再使用确认弹窗;
|
||||||
|
任一项不一致时不显示确认按钮。客户游戏角色 UID、平台可能返回的数值角色 UID 都不参与绑定 verdict,
|
||||||
也不与虎牙账号 UID 或加密 role token 比较;这些 UID 可在后台留档和排障,不得把加密 role token
|
也不与虎牙账号 UID 或加密 role token 比较;这些 UID 可在后台留档和排障,不得把加密 role token
|
||||||
显示成 UID;
|
显示成 UID;
|
||||||
不一致时固定显示「重新扫码换绑」「上一步修改资料」,换绑后仍不一致时以修改资料为主。
|
不一致时固定显示「重新扫码换绑」「上一步修改资料」,换绑后仍不一致时以修改资料为主。
|
||||||
|
|||||||
Reference in New Issue
Block a user