修复(接单平台): 售后微信未启用时不显示提示

This commit is contained in:
2026-11-25 11:04:11 +08:00
parent e2d9fca33c
commit 15e23312f6
@@ -81,10 +81,7 @@ export default function WorkerLoginPage() {
const [deviceManagerOpen, setDeviceManagerOpen] = useState(false)
const [deviceManagerLoading, setDeviceManagerLoading] = useState(false)
const [managedDevices, setManagedDevices] = useState<WorkerSessionDevice[]>([])
const [frozenAccountBlocked, setFrozenAccountBlocked] = useState(false)
const [supportContact, setSupportContact] = useState<WorkerSupportContactConfig | null>(null)
const [supportContactLoading, setSupportContactLoading] = useState(false)
const [supportContactError, setSupportContactError] = useState('')
useEffect(() => {
if (countdown <= 0) return
@@ -187,17 +184,15 @@ export default function WorkerLoginPage() {
}
async function loadFrozenSupportContact() {
setFrozenAccountBlocked(true)
setSupportContact(null)
setSupportContactError('')
setSupportContactLoading(true)
try {
const response = await fetchWorkerSupportContact()
setSupportContact(response.data)
} catch (error) {
setSupportContactError(error instanceof Error ? error.message : '售后微信加载失败')
} finally {
setSupportContactLoading(false)
const contact = response.data
if (contact.enabled && (contact.wechatId || contact.wechatQrCodeImage)) {
setSupportContact(contact)
}
} catch {
// 售后微信未启用或读取失败时,不额外展示联系卡片。
}
}
@@ -489,56 +484,40 @@ export default function WorkerLoginPage() {
</Button>
</Form>
)}
{frozenAccountBlocked ? (
{supportContact?.enabled &&
(supportContact.wechatId || supportContact.wechatQrCodeImage) ? (
<Alert
showIcon
type="warning"
closable
onClose={() => setFrozenAccountBlocked(false)}
onClose={() => setSupportContact(null)}
message="接单账号已被冻结,无法登录"
style={{ marginTop: 20 }}
description={
<Space direction="vertical" size={10} style={{ width: '100%' }}>
{supportContactLoading ? (
<Typography.Text type="secondary">
正在加载售后微信…
</Typography.Text>
) : supportContact?.enabled ? (
<>
<Typography.Text>
{supportContact.notice ||
'账号已被冻结,如有疑问请添加售后微信处理。'}
<Typography.Text>
{supportContact.notice ||
'账号已被冻结,如有疑问请添加售后微信处理。'}
</Typography.Text>
{supportContact.wechatId ? (
<div>
<Typography.Text strong>售后微信:</Typography.Text>
<Typography.Text copyable={{ text: supportContact.wechatId }}>
{supportContact.wechatId}
</Typography.Text>
{supportContact.wechatId ? (
<div>
<Typography.Text strong>售后微信:</Typography.Text>
<Typography.Text copyable={{ text: supportContact.wechatId }}>
{supportContact.wechatId}
</Typography.Text>
</div>
) : null}
{supportContact.wechatQrCodeImage ? (
<div style={{ width: '100%', textAlign: 'center' }}>
<Image
width={180}
src={
supportContact.wechatQrCodeImage.mediumUrl ||
supportContact.wechatQrCodeImage.url
}
alt="售后微信二维码"
/>
</div>
) : null}
</>
) : (
<Typography.Text type="secondary">
售后微信暂未启用,请稍后重试或通过平台其他渠道联系。
</Typography.Text>
)}
{supportContactError ? (
<Typography.Text type="danger">
{supportContactError}
</Typography.Text>
</div>
) : null}
{supportContact.wechatQrCodeImage ? (
<div style={{ width: '100%', textAlign: 'center' }}>
<Image
width={180}
src={
supportContact.wechatQrCodeImage.mediumUrl ||
supportContact.wechatQrCodeImage.url
}
alt="售后微信二维码"
/>
</div>
) : null}
</Space>
}