feat(semi-auto): 缺角色ID时引导客户联系客服并拦截确认
This commit is contained in:
@@ -770,6 +770,21 @@ export default function CustomerFulfillmentPage() {
|
||||
}
|
||||
}
|
||||
|
||||
/** 缺角色 ID 时引导客户把订单号发给客服人工核实。 */
|
||||
async function copyOrderNoForSupport() {
|
||||
const text = String(orderNo || selectedTask?.orderNo || '').trim()
|
||||
if (!text) {
|
||||
message.warning('订单号为空,请直接联系客服')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await navigator.clipboard.writeText(text)
|
||||
message.success('订单号已复制,请联系客服核实角色ID')
|
||||
} catch {
|
||||
message.error('复制失败,请手动记录订单号后联系客服')
|
||||
}
|
||||
}
|
||||
|
||||
const config = selectedTask?.semiAutoConfig || {}
|
||||
const displayTitle = isWeibo ? '微博账号登录授权' : '绑定游戏角色'
|
||||
const loginQrVisible =
|
||||
@@ -801,12 +816,21 @@ export default function CustomerFulfillmentPage() {
|
||||
const bindConfirmState = bindingInfo?.bindConfirmState || 'idle'
|
||||
const bindConfirmRejected = bindConfirmState === 'rejected'
|
||||
const bindConfirmPending = bindConfirmState === 'submitting' || bindConfirmState === 'accepted'
|
||||
// 还没有绑定角色时,二维码区域已经说明了原因,不再重复提示「缺角色ID」。
|
||||
const showMissingRoleIdWarning =
|
||||
!bindingPendingUid && !rebindUnchanged && bindingInfo?.hasExistingBinding !== false
|
||||
const bindingRoleIdNumeric = /^\d+$/.test(String(bindingPendingUid || bindingRoleId || '').trim())
|
||||
// 平台返回了绑定角色但没有可核对的角色ID:提示联系客服,不能直接确认或重新扫码。
|
||||
const bindingRequiresSupport =
|
||||
Boolean(bindingInfo) &&
|
||||
(bindingInfo?.requiresSupport ??
|
||||
(Boolean(bindingInfo?.bindGameRole || bindingRoleName) && !bindingRoleIdNumeric))
|
||||
// 绑定阶段顶部状态条:按 bindingStatus 显式映射,已确认/已过期/失败不再显示(各自有卡片)。
|
||||
const bindingBanner = (() => {
|
||||
if (bindingSessionExpired) return null
|
||||
if (bindingRequiresSupport && selectedTask?.bindingStatus !== 'confirmed') {
|
||||
return {
|
||||
tone: 'is-warning',
|
||||
text: '已登录,但平台未返回可核对的角色ID,请联系客服人工核实',
|
||||
}
|
||||
}
|
||||
if (rebindUnchanged) {
|
||||
return {
|
||||
tone: 'is-warning',
|
||||
@@ -829,9 +853,6 @@ export default function CustomerFulfillmentPage() {
|
||||
text: '登录成功,该虎牙账号还没有绑定游戏角色,请扫码完成绑定',
|
||||
}
|
||||
}
|
||||
if (!bindingRoleId) {
|
||||
return { tone: 'is-warning', text: '未获取到已绑定的角色ID,请重新扫码绑定' }
|
||||
}
|
||||
return null
|
||||
})()
|
||||
const nextRebindText = bindingInfo?.nextRebindAt
|
||||
@@ -1355,7 +1376,16 @@ export default function CustomerFulfillmentPage() {
|
||||
|
||||
{selectedTask?.bindingStatus === 'role_ready' && !bindingSessionExpired ? (
|
||||
<Space direction="vertical" size={12} style={{ width: '100%' }}>
|
||||
{rebindUnchanged ? (
|
||||
{bindingRequiresSupport ? (
|
||||
<Alert
|
||||
type="warning"
|
||||
showIcon
|
||||
message="请联系客服人工核实绑定角色"
|
||||
description={`平台未返回可核对的角色ID,无法自动核对。请复制订单号 ${
|
||||
orderNo || selectedTask?.orderNo || ''
|
||||
} 联系客服,核实完成前请不要确认绑定。`}
|
||||
/>
|
||||
) : rebindUnchanged ? (
|
||||
<Alert
|
||||
type={rebindRejected ? 'error' : 'warning'}
|
||||
showIcon
|
||||
@@ -1391,7 +1421,7 @@ export default function CustomerFulfillmentPage() {
|
||||
.join(' · ')}
|
||||
/>
|
||||
)}
|
||||
{comparisonMismatch && bindingComparison ? (
|
||||
{!bindingRequiresSupport && comparisonMismatch && bindingComparison ? (
|
||||
<Alert
|
||||
type="warning"
|
||||
showIcon
|
||||
@@ -1413,15 +1443,31 @@ export default function CustomerFulfillmentPage() {
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
{showMissingRoleIdWarning ? (
|
||||
<Alert
|
||||
type="warning"
|
||||
showIcon
|
||||
message="未获取到已绑定的角色ID,请重新扫码绑定"
|
||||
description="没有角色 ID 时无法自动核对,请联系客服人工核实后再确认。"
|
||||
/>
|
||||
) : null}
|
||||
{rebindUnchanged ? (
|
||||
{bindingRequiresSupport ? (
|
||||
<div className="customer-binding-role-actions">
|
||||
<Button
|
||||
block
|
||||
size="large"
|
||||
className="customer-binding-confirm"
|
||||
onClick={() => void copyOrderNoForSupport()}
|
||||
>
|
||||
复制订单号联系客服
|
||||
</Button>
|
||||
<Button
|
||||
block
|
||||
size="large"
|
||||
className="customer-binding-rebind"
|
||||
icon={<ReloadOutlined />}
|
||||
loading={bindingLoading}
|
||||
onClick={() => {
|
||||
setBindingLoading(true)
|
||||
void load(true).finally(() => setBindingLoading(false))
|
||||
}}
|
||||
>
|
||||
刷新状态
|
||||
</Button>
|
||||
</div>
|
||||
) : rebindUnchanged ? (
|
||||
<div className="customer-binding-role-actions">
|
||||
<Button
|
||||
block
|
||||
@@ -1541,7 +1587,10 @@ export default function CustomerFulfillmentPage() {
|
||||
|
||||
<Modal
|
||||
open={
|
||||
bindingConfirmOpen && selectedTask?.bindingStatus === 'role_ready' && !rebindUnchanged
|
||||
bindingConfirmOpen &&
|
||||
selectedTask?.bindingStatus === 'role_ready' &&
|
||||
!rebindUnchanged &&
|
||||
!bindingRequiresSupport
|
||||
}
|
||||
title="确认绑定角色"
|
||||
onCancel={() => {
|
||||
|
||||
@@ -57,6 +57,10 @@ export type CustomerBindingInfo = {
|
||||
bindGameRole: string
|
||||
bindGameRoleId: string
|
||||
bindGameChannel: string
|
||||
/** 平台角色 ID 是否可核对(纯数字);false 时客户页只提示联系客服。 */
|
||||
roleIdVerified?: boolean
|
||||
/** 已绑定角色但缺少可核对角色 ID,需要客服人工核实。 */
|
||||
requiresSupport?: boolean
|
||||
hasExistingBinding: boolean
|
||||
rebindRequested: boolean
|
||||
rebindUnchanged: boolean
|
||||
|
||||
Reference in New Issue
Block a user