修复(半自动履约): 虎牙UID改为必填不校验

This commit is contained in:
yml
2026-11-20 17:08:07 +08:00
parent f4806fb758
commit 132a281a3e
9 changed files with 103 additions and 73 deletions
@@ -116,10 +116,11 @@ export default function CustomerFulfillmentPage({
),
)
const isWeibo = selectedTask?.platform === 'weibo'
// 虎牙流程:填写资料(区服/角色名,UID 可选)→ 登录 → 绑定角色。
// 虎牙流程:填写资料(区服/UID/角色名)→ 登录 → 绑定角色。
// 资料齐全前不生成绑定二维码,避免客户在资料缺失时先绑错角色。
const profileComplete = Boolean(
String(selectedTask?.customerServerZone || '').trim() &&
String(selectedTask?.customerGameRoleId || '').trim() &&
String(selectedTask?.customerGameRoleName || '').trim(),
)
@@ -930,18 +931,14 @@ export default function CustomerFulfillmentPage({
async function handleSaveProfile() {
if (!selectedTask) return
if (!profileServerZone.trim() || !profileRoleName.trim()) {
message.warning('请完整填写区服和角色名')
if (!profileServerZone.trim() || !profileRoleId.trim() || !profileRoleName.trim()) {
message.warning('请完整填写区服、游戏角色 UID 和角色名')
return
}
if (!SERVER_ZONE_OPTIONS.includes(profileServerZone.trim())) {
message.warning('请选择区服')
return
}
if (profileRoleId.trim() && !/^\d+$/.test(profileRoleId.trim())) {
message.warning('游戏角色 UID 只能是数字')
return
}
setProfileSaving(true)
try {
const response = await saveCustomerTaskProfile(orderNo, selectedTask.id, {
@@ -1220,7 +1217,7 @@ export default function CustomerFulfillmentPage({
<p>
{profileComplete
? '修改目标角色资料后会重新核对虎牙账号当前绑定角色;角色名与区服一致后才能确认绑定。'
: '第一步:请填写区服和角色名。游戏角色 UID 为选填资料,不参与绑定核验。'}
: '第一步:请填写区服、游戏角色 UID 和角色名。UID 只做资料留档,不参与绑定核验。'}
</p>
<div className="customer-profile-form">
<label className="customer-collect-label">
@@ -1234,12 +1231,14 @@ export default function CustomerFulfillmentPage({
placeholder="请选择区服"
options={SERVER_ZONE_OPTIONS.map((value) => ({ value, label: value }))}
/>
<label className="customer-collect-label">游戏角色 UID(选填)</label>
<label className="customer-collect-label">
游戏角色 UID <span>*</span>
</label>
<Input
className="customer-collect-input"
value={profileRoleId}
onChange={(event) => setProfileRoleId(event.target.value)}
placeholder="选填,仅用于订单资料留档"
placeholder="请输入游戏角色 UID,仅作资料留档"
maxLength={64}
inputMode="numeric"
/>
@@ -1587,7 +1586,7 @@ export default function CustomerFulfillmentPage({
<strong>{currentRoleName || '未识别到角色'}</strong>
</div>
<div>
<span>目标角色 UID(选填)</span>
<span>目标角色 UID</span>
<strong>{targetRoleUid || '未填写'}</strong>
</div>
{pendingRoleName ? (
@@ -2005,7 +2004,7 @@ export default function CustomerFulfillmentPage({
>
<Space direction="vertical" size={14} style={{ width: '100%' }}>
<p style={{ margin: 0 }}>
请核对角色名称与区服。游戏角色 UID 为选填留档,不参与绑定判定。
请核对角色名称与区服。游戏角色 UID 为必填留档,不参与绑定判定。
</p>
<div className="customer-binding-compare">
<div className="customer-binding-compare-side">
@@ -2016,7 +2015,7 @@ export default function CustomerFulfillmentPage({
</Button>
</div>
<strong>{bindingComparison?.customerRoleName || '未填写'}</strong>
<em>{bindingComparison?.customerRoleId || '未填写游戏角色 UID(不影响绑定)'}</em>
<em>{bindingComparison?.customerRoleId || '未填写游戏角色 UID'}</em>
</div>
<div className="customer-binding-compare-side">
<div className="customer-binding-compare-head">
@@ -50,17 +50,18 @@ test('虎牙客户页固定先填写资料,再登录并绑定角色', () => {
assert.ok(source.includes('(isWeibo || profileComplete) &&'))
})
test('资料完整只要求区服和角色名,游戏角色 UID 可选', () => {
test('资料完整要求区服、角色名和 UID,但 UID 不做格式校验', () => {
const profileStart = source.indexOf('const profileComplete = Boolean(')
const profileEnd = source.indexOf('\n\n const load =', profileStart)
const profileSource = source.slice(profileStart, profileEnd)
assert.ok(profileSource.includes('customerServerZone'))
assert.ok(profileSource.includes('customerGameRoleId'))
assert.ok(profileSource.includes('customerGameRoleName'))
assert.ok(!profileSource.includes('customerGameRoleId'))
assert.ok(source.includes('请完整填写区服和角色名'))
assert.ok(source.includes('游戏角色 UID 为选填资料,不参与绑定核验'))
assert.ok(source.includes('游戏角色 UID(选填)'))
assert.ok(source.includes('if (profileRoleId.trim() && !/^\\d+$/.test(profileRoleId.trim()))'))
assert.ok(source.includes('请完整填写区服、游戏角色 UID 和角色名'))
assert.ok(source.includes('UID 只做资料留档,不参与绑定核验'))
assert.ok(source.includes('游戏角色 UID <span>*</span>'))
assert.ok(!source.includes('游戏角色 UID 只能是数字'))
assert.ok(!source.includes('!/^\\d+$/.test(profileRoleId.trim())'))
})
test('登录和绑定专用同步阶段暂停整单轮询', () => {
@@ -89,7 +90,7 @@ test('角色名和区服一致才出现确认绑定,不一致时展示原因',
test('二维码区明确只核验角色名与区服,UID 不参与绑定', () => {
assert.ok(source.includes('扫码后系统只核对角色名称与区服,UID 不参与绑定判定'))
assert.ok(source.includes('游戏角色 UID 为选填留档,不参与绑定判定'))
assert.ok(source.includes('游戏角色 UID 为必填留档,不参与绑定判定'))
assert.ok(source.includes('本次待确认角色'))
assert.ok(source.includes('虎牙账号 UID'))
assert.ok(!source.includes('平台已返回加密角色标识'))
@@ -39,7 +39,7 @@ test('取消直接使用原角色的快捷确认路径', () => {
test('点击上一步修改资料会回到第一步并隐藏绑定区', () => {
// 步骤条把编辑资料视为第一步,即使资料原本已完整。
assert.ok(source.includes('profileEditing || !profileComplete'))
assert.ok(source.includes("'第一步:请填写区服和角色名"))
assert.ok(source.includes("'第一步:请填写区服、游戏角色 UID 和角色名"))
assert.ok(source.includes('返回绑定角色'))
// 资料步骤隐藏二维码、失败提示和比对操作,避免与第二步混在一起。
assert.ok(source.includes('!profileEditing'))