merge(douyu): 合入客户领取与直播账号履约

- 合入斗鱼客户资料收集、角色绑定和半自动履约工作台
- 合入事务 Outbox、签名 Webhook 与低频对账链路
- 合入双角色识别、绑定重置、取消释放账号和已分配状态修复
- 将斗鱼履约数据库变更合并为单个 171 迁移文件
- 更新拆分后的客户样式测试入口并适配最新 main 客户页样式
This commit is contained in:
yml
2026-11-18 11:10:04 +08:00
67 changed files with 8854 additions and 3980 deletions
+25 -1
View File
@@ -12,7 +12,10 @@ import {
import { getAdminRole, hasAdminSession } from '@/utils/admin-auth'
import { isClaimPath, isH5ClaimPath } from '@/utils/claim-path'
import { isCustomerFulfillmentPath } from '@/utils/customer-fulfillment-link'
import {
isCustomerFulfillmentPath,
isDouyuFulfillmentPath,
} from '@/utils/customer-fulfillment-link'
import {
isLegacySupplementPath,
isOrderServicePath,
@@ -44,6 +47,7 @@ const AdminPlatformShopsPage = lazy(() => import('@/pages/admin/platform/AdminPl
const AdminTaskDetailPage = lazy(() => import('@/pages/admin/AdminTaskDetailPage'))
const AdminTasksPage = lazy(() => import('@/pages/admin/AdminTasksPage'))
const AdminSemiAutoTasksPage = lazy(() => import('@/pages/admin/AdminSemiAutoTasksPage'))
const AdminDouyuFulfillmentPage = lazy(() => import('@/pages/admin/AdminDouyuFulfillmentPage'))
const AdminUsersPage = lazy(() => import('@/pages/admin/AdminUsersPage'))
const AdminDevMockPage = lazy(() => import('@/pages/admin/AdminDevMockPage'))
const AdminWorkerPlatformPage = lazy(() => import('@/pages/admin/AdminWorkerPlatformPage'))
@@ -53,6 +57,7 @@ const OrderServicePage = lazy(() => import('@/pages/public/OrderServicePage'))
const CustomerFulfillmentPage = lazy(
() => import('@/pages/customer-fulfillment/CustomerFulfillmentPage'),
)
const DouyuFulfillmentPage = lazy(() => import('@/pages/douyu-fulfillment/DouyuFulfillmentPage'))
const NotFoundPage = lazy(() => import('@/pages/NotFoundPage'))
const RedeemPage = lazy(() => import('@/pages/redeem/RedeemPage'))
const WorkerHallPage = lazy(() => import('@/pages/worker/WorkerHallPage'))
@@ -136,6 +141,10 @@ export default function App() {
return <OrderServiceApplication />
}
if (isDouyuFulfillmentPath(window.location.pathname)) {
return <DouyuFulfillmentApplication />
}
if (isCustomerFulfillmentPath(window.location.pathname)) {
return <CustomerFulfillmentApplication />
}
@@ -152,6 +161,20 @@ export default function App() {
return <AdminApplication />
}
function DouyuFulfillmentApplication() {
useClearStrayHash()
return (
<BrowserRouter>
<Suspense fallback={<RouteLoading />}>
<Routes>
<Route path="/coll/d/:orderNo" element={<DouyuFulfillmentPage />} />
<Route path="*" element={<DouyuFulfillmentPage />} />
</Routes>
</Suspense>
</BrowserRouter>
)
}
function OrderServiceApplication() {
useClearStrayHash()
return (
@@ -229,6 +252,7 @@ function AdminApplication() {
<Route path="tasks" element={<AdminTasksPage />} />
<Route path="tasks/:taskId" element={<AdminTaskDetailPage />} />
<Route path="semi-auto-tasks" element={<AdminSemiAutoTasksPage />} />
<Route path="douyu-fulfillment" element={<AdminDouyuFulfillmentPage />} />
</Route>
<Route element={<RequireRole roles={['admin', 'operator', 'support', 'finance']} />}>
<Route path="orders" element={<AdminOrdersPage />} />
+16
View File
@@ -17,6 +17,7 @@ import {
SettingOutlined,
SoundOutlined,
TeamOutlined,
ThunderboltOutlined,
TrophyOutlined,
UnorderedListOutlined,
UserOutlined,
@@ -187,6 +188,7 @@ export default function AdminLayout() {
void queryClient.invalidateQueries({ queryKey: ['admin-notifications'] })
void queryClient.invalidateQueries({ queryKey: ['admin-tasks'] })
void queryClient.invalidateQueries({ queryKey: ['admin-orders'] })
void queryClient.invalidateQueries({ queryKey: ['admin-douyu-fulfillment'] })
void queryClient.invalidateQueries({ queryKey: ['admin-dashboard-summary'] })
},
// 会话过期时清登录态回登录页,避免 SSE 带着失效 token 无限重连刷 401。
@@ -252,6 +254,11 @@ export default function AdminLayout() {
icon: <RobotOutlined />,
label: '半自动履约',
},
{
key: '/admin/douyu-fulfillment',
icon: <ThunderboltOutlined />,
label: '斗鱼领取',
},
{ key: '/admin/worker-platform', icon: <TrophyOutlined />, label: '接单平台' },
{
key: '/admin/kuaishou-industry',
@@ -274,6 +281,11 @@ export default function AdminLayout() {
icon: <RobotOutlined />,
label: '半自动履约',
},
{
key: '/admin/douyu-fulfillment',
icon: <ThunderboltOutlined />,
label: '斗鱼领取',
},
{ key: '/admin/worker-platform', icon: <TrophyOutlined />, label: '接单平台' },
{
key: '/admin/kuaishou-industry',
@@ -511,6 +523,10 @@ function applyAdminRealtimeEvent(
event: RealtimeEvent,
queryClient: ReturnType<typeof useQueryClient>,
) {
if (event.type === 'order.changed' && event.scopes.includes('admin_douyu_fulfillment')) {
void queryClient.invalidateQueries({ queryKey: ['admin-douyu-fulfillment'] })
}
if (event.type === 'admin_notification.changed' && isRecord(event.data)) {
queryClient.setQueryData(['admin-notifications'], (current: unknown) => {
if (!isRecord(current) || !isRecord(current.data)) return current
+620 -289
View File
@@ -1,4 +1,13 @@
import { BugOutlined, CopyOutlined, LinkOutlined } from '@ant-design/icons'
import {
ApiOutlined,
BugOutlined,
CopyOutlined,
GiftOutlined,
LinkOutlined,
SearchOutlined,
ThunderboltOutlined,
WalletOutlined,
} from '@ant-design/icons'
import {
Alert,
App,
@@ -6,13 +15,17 @@ import {
Card,
Col,
Divider,
Empty,
Form,
Input,
InputNumber,
Result,
Row,
Segmented,
Select,
Space,
Tabs,
Tag,
Typography,
} from 'antd'
import { useMutation, useQuery } from '@tanstack/react-query'
@@ -23,6 +36,7 @@ import PageHeader from '@/components/admin/PageHeader'
import {
buildOpen91QueryDevMock,
createAffiliateDashDevMock,
createDouyuFulfillmentDevMock,
createKuaishouIndustryVoucherDevMock,
createSemiAutoDevMock,
createSemiAutoIntegrationDevMock,
@@ -31,16 +45,24 @@ import {
type DevMockKuaishouIndustryVoucherResult,
type DevMockOpen91QueryResult,
type DevMockSemiAutoResult,
type DevDouyuFulfillmentMockResult,
type DevSemiAutoIntegrationResult,
} from '@/services/admin'
import { buildCustomerFulfillmentPath } from '@/utils/customer-fulfillment-link'
type MockTabKey = 'douyu' | 'semi-auto' | 'affiliate-dash' | 'kuaishou-voucher' | 'open91'
type SemiAutoMode = 'integration' | 'direct'
export default function AdminDevMockPage() {
const { message } = App.useApp()
const [activeTab, setActiveTab] = useState<MockTabKey>('douyu')
const [semiAutoMode, setSemiAutoMode] = useState<SemiAutoMode>('integration')
const [lastCreate, setLastCreate] = useState<DevMockCreateResult | null>(null)
const [lastVoucherCreate, setLastVoucherCreate] =
useState<DevMockKuaishouIndustryVoucherResult | null>(null)
const [lastQuery, setLastQuery] = useState<DevMockOpen91QueryResult | null>(null)
const [lastDouyuFulfillment, setLastDouyuFulfillment] =
useState<DevDouyuFulfillmentMockResult | null>(null)
const [lastSemiAuto, setLastSemiAuto] = useState<
DevMockSemiAutoResult | DevSemiAutoIntegrationResult | null
>(null)
@@ -109,8 +131,18 @@ export default function AdminDevMockPage() {
},
})
const douyuFulfillmentMutation = useMutation({
mutationFn: createDouyuFulfillmentDevMock,
onSuccess: (response) => {
setLastDouyuFulfillment(response.data)
message.success('斗鱼直播账号履约测试单已生成')
},
onError: (error) => {
message.error(error instanceof Error ? error.message : '生成失败')
},
})
const defaultOrderNo = useMemo(() => lastCreate?.orderNo || '', [lastCreate?.orderNo])
// 页面展示按平台重新生成规范路径,避免历史 Mock 响应里的 customerPath 仍是 /c。
const semiAutoCustomerPath = lastSemiAuto
? buildCustomerFulfillmentPath(lastSemiAuto.orderNo, lastSemiAuto.semiAutoPlatform) ||
lastSemiAuto.customerPath
@@ -148,314 +180,587 @@ export default function AdminDevMockPage() {
<section className="page-stack">
<PageHeader
title="开发 Mock"
description="一键造单与测试数据;半自动履约可选择只 Mock 订单,登录、绑定走真实 Connector。"
description="按场景切换测试工具,只展示当前模块,减少长页面和误操作。"
extra={
<Typography.Text type="secondary">NODE_ENV={status?.nodeEnv || '-'}</Typography.Text>
<Space size={8}>
<Tag color="green">Mock 已开启</Tag>
<Typography.Text type="secondary">NODE_ENV={status?.nodeEnv || '-'}</Typography.Text>
</Space>
}
/>
<Alert
type="info"
type="warning"
showIcon
icon={<BugOutlined />}
message="Mock 会写入开发库真实订单/任务;除订单外,登录、绑定、票据注入和完成确认都可以走真实流程。"
description="默认使用 order_site 内置真实 Connector,不依赖 live-hub-py;只有显式选择内置 Mock 时才会 Mock 登录和绑定。"
message="仅用于开发环境"
description="Mock 会向当前开发库写入真实订单和任务。请先确认当前环境,再切换对应业务模块生成测试数据。"
/>
<Row gutter={[16, 16]}>
<Col xs={24} xl={12}>
<Card title="1. affiliate-dash 领取(mock 二维码/提交发货)" bordered={false}>
<AffiliateDashMockForm
loading={affiliateDashMutation.isPending}
onSubmit={(values) => affiliateDashMutation.mutate(values)}
/>
</Card>
</Col>
<Col xs={24} xl={12}>
<Card title="2. 半自动真实履约链路测试单" bordered={false}>
<Alert
type="success"
showIcon
style={{ marginBottom: 12 }}
message="正式订单入口"
description="订单走 upsertOrderFromSource,随后执行 SKU 映射、渠道判定、Carrier 补偿和半自动任务生成。"
/>
<SemiAutoMockForm
loading={semiAutoIntegrationMutation.isPending}
submitText="生成真实链路测试单"
defaultConnectorMode={status?.semiAuto?.defaultConnectorMode}
externalConnectorConfigured={status?.semiAuto?.externalConnectorConfigured}
mockConnectorAvailable={status?.semiAuto?.mockConnectorAvailable}
onSubmit={(values) => semiAutoIntegrationMutation.mutate(values)}
/>
</Card>
</Col>
<Col xs={24} xl={12}>
<Card title="3. 半自动直连 Mock(页面联调)" bordered={false}>
<SemiAutoMockForm
loading={semiAutoMutation.isPending}
defaultConnectorMode={status?.semiAuto?.defaultConnectorMode}
externalConnectorConfigured={status?.semiAuto?.externalConnectorConfigured}
mockConnectorAvailable={status?.semiAuto?.mockConnectorAvailable}
onSubmit={(values) => semiAutoMutation.mutate(values)}
/>
</Card>
</Col>
<Col xs={24} xl={12}>
<Card title="4. 快手电子凭证测试数据" bordered={false}>
<KuaishouIndustryVoucherMockForm
loading={voucherMutation.isPending}
onSubmit={(values) => voucherMutation.mutate(values)}
/>
</Card>
</Col>
<Col xs={24}>
<Card title="5. 模拟 91 查单(open-91/query)" bordered={false}>
<Form
layout="inline"
initialValues={{ orderNo: defaultOrderNo, execute: '1' }}
key={defaultOrderNo}
onFinish={(values) =>
open91Mutation.mutate({
orderNo: values.orderNo,
execute: values.execute === '1',
})
}
>
<Form.Item
label="orderNo"
name="orderNo"
rules={[{ required: true, message: '填写上方生成的订单号' }]}
>
<Input style={{ width: 280 }} placeholder="MOCK91…" />
</Form.Item>
<Form.Item label="执行" name="execute">
<Select
style={{ width: 180 }}
<Tabs
className="dev-mock-tabs"
type="card"
activeKey={activeTab}
onChange={(key) => setActiveTab(key as MockTabKey)}
items={[
{
key: 'douyu',
label: (
<Space size={6}>
<ThunderboltOutlined />
斗鱼履约
</Space>
),
children: (
<Row gutter={[16, 16]}>
<Col xs={24} xl={14}>
<Card title="创建斗鱼履约测试单" extra={<Tag color="blue">正式订单链路</Tag>}>
<Alert
type="success"
showIcon
style={{ marginBottom: 16 }}
message="供 live-hub 直播账号履约工作台读取"
description="生成 manual + assigned 履约和内部 SKU 映射,不创建 huya/weibo 半自动任务。"
/>
<DouyuFulfillmentMockForm
loading={douyuFulfillmentMutation.isPending}
onSubmit={(values) => douyuFulfillmentMutation.mutate(values)}
/>
</Card>
</Col>
<Col xs={24} xl={10}>
<Space direction="vertical" size={16} style={{ width: '100%' }}>
{lastDouyuFulfillment ? (
<DouyuFulfillmentResultCard result={lastDouyuFulfillment} />
) : (
<MockResultEmpty description="生成后显示订单号、内部 SKU 和履约 ID" />
)}
<Card size="small" title="联调口径">
<ul style={{ margin: 0, paddingLeft: 18 }}>
<li>订单走正式 upsertOrderFromSource 入库。</li>
<li>工作台同步后使用返回的内部 SKU 配置斗鱼商品映射。</li>
<li>不生成半自动任务,客户绑定和人工兑换都在 live-hub 完成。</li>
</ul>
</Card>
</Space>
</Col>
</Row>
),
},
{
key: 'semi-auto',
label: (
<Space size={6}>
<ApiOutlined />
半自动履约
</Space>
),
children: (
<Space direction="vertical" size={16} style={{ width: '100%' }}>
<Segmented
block
value={semiAutoMode}
onChange={(value) => setSemiAutoMode(value as SemiAutoMode)}
options={[
{ value: '1', label: '生成并请求本机' },
{ value: '0', label: '仅生成请求体' },
{ label: '正式订单链路', value: 'integration' },
{ label: '直连 Mock', value: 'direct' },
]}
/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit" loading={open91Mutation.isPending}>
模拟 91 查单
</Button>
</Form.Item>
</Form>
<Typography.Paragraph type="secondary" style={{ marginTop: 12, marginBottom: 0 }}>
对应日志:POST /api/v1/open/91/orders/query。需配置 KAQUAN91_SECRET(32 位)。
</Typography.Paragraph>
</Card>
<Row gutter={[16, 16]}>
<Col xs={24} xl={14}>
<Card
title={semiAutoMode === 'integration' ? '正式链路测试单' : '页面直连 Mock'}
extra={
<Tag color={semiAutoMode === 'integration' ? 'blue' : 'orange'}>
{semiAutoMode === 'integration' ? 'upsertOrderFromSource' : '直连造单'}
</Tag>
}
>
<Alert
type={semiAutoMode === 'integration' ? 'success' : 'warning'}
showIcon
style={{ marginBottom: 16 }}
message={
semiAutoMode === 'integration'
? '订单走正式订单、渠道和半自动任务链路'
: '仅适合半自动页面联调,不经过正式订单入口'
}
/>
<SemiAutoMockForm
loading={
semiAutoMode === 'integration'
? semiAutoIntegrationMutation.isPending
: semiAutoMutation.isPending
}
submitText={
semiAutoMode === 'integration' ? '生成真实链路测试单' : '生成直连 Mock'
}
integration={semiAutoMode === 'integration'}
defaultConnectorMode={status?.semiAuto?.defaultConnectorMode}
externalConnectorConfigured={status?.semiAuto?.externalConnectorConfigured}
mockConnectorAvailable={status?.semiAuto?.mockConnectorAvailable}
onSubmit={(values) => {
if (semiAutoMode === 'integration') {
semiAutoIntegrationMutation.mutate(values)
return
}
semiAutoMutation.mutate(values)
}}
/>
</Card>
</Col>
<Col xs={24} xl={10}>
<Space direction="vertical" size={16} style={{ width: '100%' }}>
{lastSemiAuto &&
(semiAutoMode === 'integration'
? 'pipeline' in lastSemiAuto
: !('pipeline' in lastSemiAuto)) ? (
<SemiAutoResultCard
result={lastSemiAuto}
customerUrl={semiAutoCustomerUrl}
/>
) : (
<MockResultEmpty description="当前模式生成后显示任务和客户履约入口" />
)}
<Card size="small" title="两种模式的区别">
<ul style={{ margin: 0, paddingLeft: 18 }}>
<li>正式订单链路会经过 SKU 映射、渠道判定和 Carrier 补偿。</li>
<li>直连 Mock 只用于半自动页面联调,验证页面和 Connector 状态。</li>
<li>微博固定使用内置 Connector,虎牙可按环境选择。</li>
</ul>
</Card>
</Space>
</Col>
</Row>
</Space>
),
},
{
key: 'affiliate-dash',
label: (
<Space size={6}>
<GiftOutlined />
affiliate-dash
</Space>
),
children: (
<Row gutter={[16, 16]}>
<Col xs={24} xl={14}>
<Card title="affiliate-dash 领取 Mock">
<Typography.Paragraph type="secondary">
生成领取订单、任务和二维码上下文,用于领取页的填写 UID、绑定、提交和完成流程。
</Typography.Paragraph>
<AffiliateDashMockForm
loading={affiliateDashMutation.isPending}
onSubmit={(values) => affiliateDashMutation.mutate(values)}
/>
</Card>
</Col>
<Col xs={24} xl={10}>
{lastCreate ? (
<AffiliateDashResultCard result={lastCreate} />
) : (
<MockResultEmpty description="生成后显示领取链接和操作提示" />
)}
</Col>
</Row>
),
},
{
key: 'kuaishou-voucher',
label: (
<Space size={6}>
<WalletOutlined />
快手凭证
</Space>
),
children: (
<Row gutter={[16, 16]}>
<Col xs={24} xl={14}>
<Card title="快手电子凭证测试数据">
<Typography.Paragraph type="secondary">
一次生成 6 条不同状态的测试券码,覆盖待使用、已核销、已销毁和回调异常。
</Typography.Paragraph>
<KuaishouIndustryVoucherMockForm
loading={voucherMutation.isPending}
onSubmit={(values) => voucherMutation.mutate(values)}
/>
</Card>
</Col>
<Col xs={24} xl={10}>
{lastVoucherCreate ? (
<KuaishouVoucherResultCard result={lastVoucherCreate} />
) : (
<MockResultEmpty description="生成后显示店铺和测试券码" />
)}
</Col>
</Row>
),
},
{
key: 'open91',
label: (
<Space size={6}>
<SearchOutlined />
91 查单
</Space>
),
children: (
<Row gutter={[16, 16]}>
<Col xs={24} xl={14}>
<Card title="模拟 91 查单">
<Form
layout="vertical"
initialValues={{ orderNo: defaultOrderNo, execute: '1' }}
key={defaultOrderNo}
onFinish={(values) =>
open91Mutation.mutate({
orderNo: values.orderNo,
execute: values.execute === '1',
})
}
>
<Row gutter={12}>
<Col xs={24} md={14}>
<Form.Item
label="orderNo"
name="orderNo"
rules={[{ required: true, message: '填写要查询的订单号' }]}
>
<Input placeholder="MOCK91…" />
</Form.Item>
</Col>
<Col xs={24} md={10}>
<Form.Item label="执行方式" name="execute">
<Select
options={[
{ value: '1', label: '生成并请求本机' },
{ value: '0', label: '仅生成请求体' },
]}
/>
</Form.Item>
</Col>
</Row>
<Typography.Paragraph type="secondary">
对应日志:POST /api/v1/open/91/orders/query。需配置 KAQUAN91_SECRET(32
位)。
</Typography.Paragraph>
<Button type="primary" htmlType="submit" loading={open91Mutation.isPending}>
模拟 91 查单
</Button>
</Form>
</Card>
</Col>
<Col xs={24} xl={10}>
{lastQuery ? (
<Open91ResultCard result={lastQuery} />
) : (
<MockResultEmpty description="生成后显示请求体、curl 和响应" />
)}
</Col>
</Row>
),
},
]}
/>
</section>
)
}
function MockResultEmpty({ description }: { description: string }) {
return (
<Card size="small" title="最近结果">
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={description} />
</Card>
)
}
function AffiliateDashResultCard({ result }: { result: DevMockCreateResult }) {
const { message } = App.useApp()
return (
<Card
size="small"
title="最近结果"
extra={
<Space>
<Link to={`/admin/orders/${result.orderId}`}>订单 #{result.orderId}</Link>
<Link to={`/admin/tasks/${result.taskId}`}>任务 #{result.taskId}</Link>
</Space>
}
>
<Space direction="vertical" size={12} style={{ width: '100%' }}>
<div>
<Typography.Text type="secondary">平台 / 步骤</Typography.Text>
<div>
<Typography.Text strong>
{result.platform} · {result.step}
</Typography.Text>
</div>
</div>
<div>
<Typography.Text type="secondary">订单号</Typography.Text>
<div>
<Typography.Text copyable>{result.orderNo}</Typography.Text>
</div>
</div>
<div>
<Typography.Text type="secondary">商品 / UID</Typography.Text>
<div>
{result.productName} · {result.expectedUid}
</div>
</div>
<div>
<Typography.Text type="secondary">领取链接</Typography.Text>
<Typography.Paragraph style={{ margin: '4px 0 0' }}>
<Typography.Link href={result.claimUrl} target="_blank" rel="noreferrer">
<LinkOutlined /> {result.claimUrl}
</Typography.Link>
</Typography.Paragraph>
</div>
<Space wrap>
<Button
icon={<CopyOutlined />}
onClick={async () => {
await navigator.clipboard.writeText(result.claimUrl)
message.success('已复制领取链接')
}}
>
复制链接
</Button>
<Button type="primary" href={result.claimUrl} target="_blank">
打开领取页
</Button>
</Space>
<Alert
type="success"
showIcon
message="操作提示"
description={
<ul style={{ margin: 0, paddingLeft: 18 }}>
{result.tips.map((tip) => (
<li key={tip}>{tip}</li>
))}
<li>{result.open91QueryHint}</li>
</ul>
}
/>
</Space>
</Card>
)
}
function DouyuFulfillmentResultCard({ result }: { result: DevDouyuFulfillmentMockResult }) {
const { message } = App.useApp()
const customerUrl = `${window.location.origin}${result.customerPath}`
return (
<Card size="small" title="最近结果" extra={<Link to={result.adminPath}>打开订单</Link>}>
<Row gutter={[12, 12]}>
<Col span={24}>
<Typography.Text type="secondary">订单号</Typography.Text>
<div>
<Typography.Text copyable strong>
{result.orderNo}
</Typography.Text>
</div>
</Col>
<Col span={24}>
<Typography.Text type="secondary">内部 SKU</Typography.Text>
<div>
<Typography.Text copyable>{result.skuKey}</Typography.Text>
</div>
</Col>
<Col span={12}>
<Typography.Text type="secondary">订单项</Typography.Text>
<div>#{result.orderItemId}</div>
</Col>
<Col span={12}>
<Typography.Text type="secondary">履约单</Typography.Text>
<div>#{result.fulfillmentId}</div>
</Col>
<Col span={24}>
<Typography.Text type="secondary">客户领取链接</Typography.Text>
<Typography.Paragraph style={{ margin: '4px 0 0' }}>
<Typography.Link href={customerUrl} target="_blank" rel="noreferrer">
<LinkOutlined /> {customerUrl}
</Typography.Link>
</Typography.Paragraph>
</Col>
<Col span={24}>
<Alert
type="success"
showIcon
message="下一步"
description={
<ul style={{ margin: 0, paddingLeft: 18 }}>
{result.tips.map((tip) => (
<li key={tip}>{tip}</li>
))}
</ul>
}
/>
</Col>
<Col span={24}>
<Space wrap>
<Button
icon={<CopyOutlined />}
onClick={async () => {
await navigator.clipboard.writeText(customerUrl)
message.success('斗鱼客户领取链接已复制')
}}
>
复制客户链接
</Button>
<Button type="primary" href={customerUrl} target="_blank">
打开客户领取页
</Button>
</Space>
</Col>
</Row>
</Card>
)
}
{lastCreate ? (
<Card
title="最近生成结果"
extra={
<Space>
<Link to={`/admin/orders/${lastCreate.orderId}`}>订单 #{lastCreate.orderId}</Link>
<Link to={`/admin/tasks/${lastCreate.taskId}`}>任务 #{lastCreate.taskId}</Link>
</Space>
function SemiAutoResultCard({
result,
customerUrl,
}: {
result: DevMockSemiAutoResult | DevSemiAutoIntegrationResult
customerUrl: string
}) {
const { message } = App.useApp()
return (
<Card size="small" title="最近结果" extra={<Link to={result.adminPath}>打开后台任务</Link>}>
<Space direction="vertical" size={12} style={{ width: '100%' }}>
<div>
<Typography.Text type="secondary">订单号</Typography.Text>
<div>
<Typography.Text copyable strong>
{result.orderNo}
</Typography.Text>
</div>
</div>
<div>
<Typography.Text type="secondary">内部 SKU / 任务</Typography.Text>
<div>
{result.semiAutoPlatform === 'weibo' ? '微博' : '虎牙'} · {result.skuKey} · 任务 #
{result.taskId}
</div>
</div>
<div>
<Typography.Text type="secondary">客户履约入口</Typography.Text>
<Typography.Paragraph style={{ margin: '4px 0 0' }}>
<Typography.Link href={customerUrl} target="_blank" rel="noreferrer">
<LinkOutlined /> {customerUrl}
</Typography.Link>
</Typography.Paragraph>
</div>
<Space wrap>
<Button
icon={<CopyOutlined />}
onClick={async () => {
await navigator.clipboard.writeText(customerUrl)
message.success('已复制客户履约链接')
}}
>
复制客户链接
</Button>
<Button type="primary" href={customerUrl} target="_blank">
打开客户页
</Button>
</Space>
<Alert
type={
result.connectorMode === 'mock'
? 'warning'
: result.connectorConfigured
? 'success'
: 'error'
}
>
<Row gutter={[16, 12]}>
<Col xs={24} md={12}>
<Typography.Text type="secondary">平台</Typography.Text>
<div>
<Typography.Text strong>{lastCreate.platform}</Typography.Text>
</div>
</Col>
<Col xs={24} md={12}>
<Typography.Text type="secondary">步骤 / UID</Typography.Text>
<div>
<Typography.Text strong>
{lastCreate.step} / {lastCreate.expectedUid}
</Typography.Text>
</div>
</Col>
<Col xs={24} md={12}>
<Typography.Text type="secondary">91 订单号</Typography.Text>
<div>
<Typography.Text copyable>{lastCreate.orderNo}</Typography.Text>
</div>
</Col>
<Col xs={24} md={12}>
<Typography.Text type="secondary">商品</Typography.Text>
<div>{lastCreate.productName}</div>
</Col>
<Col span={24}>
<Typography.Text type="secondary">领取链接</Typography.Text>
<div>
<Typography.Link href={lastCreate.claimUrl} target="_blank" rel="noreferrer">
<LinkOutlined /> {lastCreate.claimUrl}
</Typography.Link>
</div>
<Space style={{ marginTop: 8 }} wrap>
<Button
icon={<CopyOutlined />}
onClick={async () => {
await navigator.clipboard.writeText(lastCreate.claimUrl)
message.success('已复制领取链接')
}}
>
复制链接
</Button>
<Button type="primary" href={lastCreate.claimUrl} target="_blank">
打开领取页
</Button>
</Space>
</Col>
<Col span={24}>
<Alert
type="success"
showIcon
message="操作提示"
description={
<ul style={{ margin: 0, paddingLeft: 18 }}>
{lastCreate.tips.map((tip) => (
<li key={tip}>{tip}</li>
))}
<li>{lastCreate.open91QueryHint}</li>
</ul>
}
/>
</Col>
</Row>
</Card>
) : null}
showIcon
message={
result.connectorMode === 'mock'
? '当前使用内置 Mock Connector'
: result.connectorConfigured
? result.connectorMode === 'external'
? '当前使用远程真实 Connector'
: '当前使用 order_site 内置真实 Connector'
: '当前选择远程真实 Connector,但尚未配置'
}
description={
<ul style={{ margin: 0, paddingLeft: 18 }}>
{result.tips.map((tip) => (
<li key={tip}>{tip}</li>
))}
</ul>
}
/>
</Space>
</Card>
)
}
{lastSemiAuto ? (
<Card
title="最近生成的半自动测试单"
extra={<Link to={lastSemiAuto.adminPath}>打开后台任务</Link>}
>
<Row gutter={[16, 12]}>
<Col xs={24} md={12}>
<Typography.Text type="secondary">订单号</Typography.Text>
<div>
<Typography.Text copyable strong>
{lastSemiAuto.orderNo}
</Typography.Text>
</div>
</Col>
<Col xs={24} md={12}>
<Typography.Text type="secondary">内部 SKU / 任务</Typography.Text>
<div>
{lastSemiAuto.semiAutoPlatform === 'weibo' ? '微博' : '虎牙'} ·{' '}
{lastSemiAuto.skuKey} · 任务 #{lastSemiAuto.taskId}
{'pipeline' in lastSemiAuto ? ' · 正式订单链路' : ' · 直连 Mock'}
</div>
</Col>
<Col span={24}>
<Typography.Text type="secondary">客户履约入口</Typography.Text>
<div>
<Typography.Link href={semiAutoCustomerUrl} target="_blank" rel="noreferrer">
<LinkOutlined /> {window.location.origin}
{semiAutoCustomerPath}
</Typography.Link>
</div>
<Space style={{ marginTop: 8 }} wrap>
<Button
icon={<CopyOutlined />}
onClick={async () => {
await navigator.clipboard.writeText(semiAutoCustomerUrl)
message.success('已复制客户履约链接')
}}
>
复制客户链接
</Button>
<Button type="primary" href={semiAutoCustomerUrl} target="_blank">
打开客户页
</Button>
</Space>
</Col>
<Col span={24}>
<Alert
type={
lastSemiAuto.connectorMode === 'mock'
? 'warning'
: lastSemiAuto.connectorConfigured
? 'success'
: 'error'
}
showIcon
message={
lastSemiAuto.connectorMode === 'mock'
? '当前使用内置 Mock Connector'
: lastSemiAuto.connectorConfigured
? lastSemiAuto.connectorMode === 'external'
? '当前使用远程真实 Connector'
: '当前使用 order_site 内置真实 Connector'
: '当前选择远程真实 Connector,但尚未配置'
}
description={
<ul style={{ margin: 0, paddingLeft: 18 }}>
{lastSemiAuto.tips.map((tip) => (
<li key={tip}>{tip}</li>
))}
</ul>
}
/>
</Col>
</Row>
</Card>
) : null}
function KuaishouVoucherResultCard({ result }: { result: DevMockKuaishouIndustryVoucherResult }) {
return (
<Card
size="small"
title="最近结果"
extra={<Link to="/admin/kuaishou-industry">查看电子凭证</Link>}
>
<Typography.Paragraph type="secondary">
已为店铺 {result.sellerId} 写入 {result.createdCount} 条测试券码。
</Typography.Paragraph>
<Space direction="vertical" size={6}>
{result.vouchers.map((voucher) => (
<Typography.Text key={voucher.voucherCode} copyable>
{voucher.status} · {voucher.voucherCode} · {voucher.oid}
</Typography.Text>
))}
</Space>
</Card>
)
}
{lastVoucherCreate ? (
<Card
title="最近生成的电子凭证 Mock"
extra={<Link to="/admin/kuaishou-industry">查看电子凭证</Link>}
>
<Typography.Paragraph type="secondary">
已为店铺 {lastVoucherCreate.sellerId} 写入 {lastVoucherCreate.createdCount} 条测试券码。
</Typography.Paragraph>
<Space direction="vertical" size={4}>
{lastVoucherCreate.vouchers.map((voucher) => (
<Typography.Text key={voucher.voucherCode} copyable>
{voucher.status} · {voucher.voucherCode} · {voucher.oid}
</Typography.Text>
))}
</Space>
</Card>
) : null}
{lastQuery ? (
<Card title="91 查单结果">
<Typography.Paragraph>
<Typography.Text type="secondary">Endpoint:</Typography.Text>
function Open91ResultCard({ result }: { result: DevMockOpen91QueryResult }) {
return (
<Card size="small" title="查单结果">
<Space direction="vertical" size={12} style={{ width: '100%' }}>
<div>
<Typography.Text type="secondary">Endpoint</Typography.Text>
<div>
<Typography.Text code copyable>
{lastQuery.endpoint}
{result.endpoint}
</Typography.Text>
</div>
</div>
<div>
<Typography.Text type="secondary">Request</Typography.Text>
<pre className="dev-mock-pre" style={{ marginTop: 6 }}>
{JSON.stringify(result.requestBody, null, 2)}
</pre>
</div>
<div>
<Typography.Text type="secondary">curl</Typography.Text>
<Typography.Paragraph style={{ margin: '4px 0 0' }}>
<Typography.Text code copyable>
{result.curl}
</Typography.Text>
</Typography.Paragraph>
<Typography.Paragraph>
<Typography.Text type="secondary">Request:</Typography.Text>
</Typography.Paragraph>
<pre className="dev-mock-pre">{JSON.stringify(lastQuery.requestBody, null, 2)}</pre>
<Typography.Paragraph>
<Typography.Text type="secondary">curl:</Typography.Text>
<Typography.Text code copyable>
{lastQuery.curl}
</Typography.Text>
</Typography.Paragraph>
{lastQuery.response ? (
<>
<Divider />
<Typography.Paragraph>
<Typography.Text type="secondary">Response:</Typography.Text>
</Typography.Paragraph>
<pre className="dev-mock-pre">{JSON.stringify(lastQuery.response, null, 2)}</pre>
</>
) : null}
</Card>
) : null}
</section>
</div>
{result.response ? (
<>
<Divider style={{ margin: 0 }} />
<div>
<Typography.Text type="secondary">Response</Typography.Text>
<pre className="dev-mock-pre" style={{ marginTop: 6 }}>
{JSON.stringify(result.response, null, 2)}
</pre>
</div>
</>
) : null}
</Space>
</Card>
)
}
@@ -549,6 +854,32 @@ function KuaishouIndustryVoucherMockForm({
)
}
function DouyuFulfillmentMockForm({
loading,
onSubmit,
}: {
loading: boolean
onSubmit: (values: { orderNo?: string; skuName?: string }) => void
}) {
return (
<Form layout="vertical" onFinish={onSubmit}>
<Form.Item
label="内部 SKU 名称(可空)"
name="skuName"
extra="留空自动生成“斗鱼精英宝典联调-时间戳”;必须包含中文,live-hub 将用它配置斗鱼商品映射。"
>
<Input allowClear placeholder="斗鱼精英宝典联调" />
</Form.Item>
<Form.Item label="订单号 orderNo(可空)" name="orderNo" extra="留空自动生成 LIVEHUBDOUYU…">
<Input allowClear placeholder="LIVEHUBDOUYU…" />
</Form.Item>
<Button type="primary" htmlType="submit" loading={loading} block>
生成斗鱼履约测试单
</Button>
</Form>
)
}
function SemiAutoMockForm({
loading,
submitText,
@@ -0,0 +1,403 @@
import {
CopyOutlined,
LinkOutlined,
ReloadOutlined,
SyncOutlined,
ThunderboltOutlined,
} from '@ant-design/icons'
import {
Alert,
App,
Button,
Card,
Descriptions,
Drawer,
Input,
Select,
Space,
Tag,
Timeline,
Typography,
} from 'antd'
import type { TableColumnsType } from 'antd'
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { useState } from 'react'
import PageHeader from '@/components/admin/PageHeader'
import PercentTable from '@/components/common/PercentTable'
import {
fetchAdminDouyuFulfillmentDetail,
fetchAdminDouyuFulfillmentTasks,
refreshAdminDouyuBinding,
restartAdminDouyuBinding,
syncAdminDouyuFulfillmentTasks,
} from '@/services/admin'
import type { DouyuFulfillmentTask } from '@/types/douyu-fulfillment'
import { formatAdminDateTime } from '@/utils/admin-time'
const { Text } = Typography
const STATUS_LABELS: Record<string, string> = {
waiting_profile: '待客户填资料',
preparing: '准备账号',
allocated: '已分配',
qr_pending: '待扫码',
role_ready: '待确认角色',
bound: '角色已绑定',
waiting_operator: '待客服处理',
processing: '处理中',
completed: '已完成',
failed: '绑定失败',
manual_required: '人工处理',
cancelled: '已取消',
}
const STATUS_COLORS: Record<string, string> = {
waiting_profile: 'blue',
preparing: 'gold',
allocated: 'geekblue',
qr_pending: 'cyan',
role_ready: 'orange',
bound: 'green',
waiting_operator: 'volcano',
processing: 'processing',
completed: 'success',
failed: 'error',
manual_required: 'warning',
cancelled: 'default',
}
const PLATFORM_LABELS: Record<string, string> = {
wechat: '微信',
qq: 'QQ',
}
const SYSTEM_LABELS: Record<string, string> = {
ios: '苹果',
android: '安卓',
}
const EVENT_LABELS: Record<string, string> = {
task_created: '订单进入斗鱼领取队列',
customer_link_opened: '客户打开领取链接',
customer_profile_saved: '客户保存游戏资料',
customer_profile_reset: '客服重置客户角色资料',
status_changed: '领取状态更新',
}
export default function AdminDouyuFulfillmentPage() {
const { message } = App.useApp()
const queryClient = useQueryClient()
const [keyword, setKeyword] = useState('')
const [status, setStatus] = useState('')
const [page, setPage] = useState(1)
const [pageSize, setPageSize] = useState(20)
const [detailOrderNo, setDetailOrderNo] = useState('')
const listQuery = useQuery({
queryKey: ['admin-douyu-fulfillment', keyword, status, page, pageSize],
queryFn: () =>
fetchAdminDouyuFulfillmentTasks({
keyword: keyword.trim() || undefined,
status: status || undefined,
page,
pageSize,
}),
})
const detailQuery = useQuery({
queryKey: ['admin-douyu-fulfillment-detail', detailOrderNo],
queryFn: () => fetchAdminDouyuFulfillmentDetail(detailOrderNo),
enabled: Boolean(detailOrderNo),
})
const list = listQuery.data?.data.items || []
const pagination = listQuery.data?.data.pagination
const detail = detailQuery.data?.data
async function refreshAll() {
await Promise.all([
queryClient.invalidateQueries({ queryKey: ['admin-douyu-fulfillment'] }),
detailOrderNo
? queryClient.invalidateQueries({
queryKey: ['admin-douyu-fulfillment-detail', detailOrderNo],
})
: Promise.resolve(),
])
}
const syncMutation = useMutation({
mutationFn: syncAdminDouyuFulfillmentTasks,
onSuccess: async (response) => {
message.success(
`同步完成:新增 ${response.data.created},更新 ${response.data.updated},核验状态 ${response.data.checked}`,
)
await refreshAll()
},
onError: (error) => message.error(error instanceof Error ? error.message : '同步失败'),
})
const refreshMutation = useMutation({
mutationFn: refreshAdminDouyuBinding,
onSuccess: async () => {
message.success('绑定状态已刷新')
await refreshAll()
},
onError: (error) => message.error(error instanceof Error ? error.message : '刷新失败'),
})
const restartMutation = useMutation({
mutationFn: restartAdminDouyuBinding,
onSuccess: async () => {
message.success('已重新生成绑定二维码')
await refreshAll()
},
onError: (error) => message.error(error instanceof Error ? error.message : '重新生成失败'),
})
async function copyLink(task: DouyuFulfillmentTask) {
const url = `${window.location.origin}${task.linkPath}`
try {
await navigator.clipboard.writeText(url)
message.success('客户领取链接已复制')
} catch {
message.error('复制失败,请手动复制')
}
}
const columns: TableColumnsType<DouyuFulfillmentTask> = [
{
title: '订单 / 商品',
key: 'order',
width: 280,
render: (_, task) => (
<Space direction="vertical" size={2}>
<Text strong>{task.platform_order_id}</Text>
<Text>{task.product_name || task.sku_name || task.sku_code}</Text>
<Text type="secondary">订单项 #{task.order_item_id}</Text>
</Space>
),
},
{
title: '客户资料',
key: 'profile',
width: 220,
render: (_, task) =>
task.customer_role_name ? (
<Space direction="vertical" size={2}>
<Text strong>{task.customer_role_name}</Text>
<Text type="secondary">
{PLATFORM_LABELS[task.customer_platform] || '-'} ·{' '}
{SYSTEM_LABELS[task.customer_system] || '-'}
</Text>
</Space>
) : (
<Text type="secondary">待客户填写</Text>
),
},
{
title: '绑定角色',
key: 'boundRole',
width: 220,
render: (_, task) =>
task.bound_role_name ? (
<Space direction="vertical" size={2}>
<Text strong>{task.bound_role_name}</Text>
<Text type="secondary">
{[task.bound_area_name, task.bound_plat_name].filter(Boolean).join(' · ') || '-'}
</Text>
</Space>
) : (
<Text type="secondary">未识别</Text>
),
},
{
title: '状态',
dataIndex: 'status',
width: 140,
render: (value: string) => (
<Tag color={STATUS_COLORS[value] || 'default'}>{STATUS_LABELS[value] || value}</Tag>
),
},
{
title: '更新时间',
dataIndex: 'updated_at',
width: 165,
render: (value: string) => formatAdminDateTime(value),
},
{
title: '操作',
key: 'actions',
width: 360,
render: (_, task) => (
<Space wrap>
<Button size="small" onClick={() => setDetailOrderNo(task.platform_order_id)}>
详情
</Button>
<Button size="small" icon={<CopyOutlined />} onClick={() => void copyLink(task)}>
客户链接
</Button>
<Button
size="small"
icon={<ReloadOutlined />}
loading={refreshMutation.isPending}
onClick={() => refreshMutation.mutate(task.platform_order_id)}
>
刷新绑定
</Button>
</Space>
),
},
]
return (
<section className="page-stack">
<PageHeader
title="斗鱼领取工作台"
description="客户提交游戏资料并完成角色绑定;内部账号与兑换仍在直播账号履约工作台处理。"
/>
<Alert
type="info"
showIcon
message="客户领取链接格式"
description="域名/coll/d/订单号。客户资料和绑定状态会同步到 live-hub,但不会向客户展示 CK、积分或账号信息。"
/>
<Card size="small">
<Space wrap style={{ marginBottom: 16 }}>
<Input.Search
allowClear
placeholder="订单号 / 商品 / 角色名"
value={keyword}
onChange={(event) => {
setKeyword(event.target.value)
setPage(1)
}}
style={{ width: 300 }}
/>
<Select
allowClear
placeholder="全部状态"
value={status || undefined}
onChange={(value) => {
setStatus(value || '')
setPage(1)
}}
options={Object.entries(STATUS_LABELS).map(([value, label]) => ({
value,
label,
}))}
style={{ width: 160 }}
/>
<Button
type="primary"
icon={<SyncOutlined />}
loading={syncMutation.isPending}
onClick={() => syncMutation.mutate()}
>
立即同步
</Button>
<Button icon={<ReloadOutlined />} onClick={() => void listQuery.refetch()}>
刷新
</Button>
</Space>
<PercentTable<DouyuFulfillmentTask>
rowKey="id"
loading={listQuery.isLoading}
columns={columns}
dataSource={list}
scroll={{ x: 1250 }}
pagination={{
current: pagination?.page || page,
pageSize: pagination?.pageSize || pageSize,
total: pagination?.total || 0,
showSizeChanger: true,
onChange: (nextPage, nextPageSize) => {
setPage(nextPage)
setPageSize(nextPageSize)
},
}}
/>
</Card>
<Drawer
open={Boolean(detailOrderNo)}
width="min(980px, 94vw)"
title={detail ? `斗鱼领取详情 · ${detail.task.platform_order_id}` : '斗鱼领取详情'}
onClose={() => setDetailOrderNo('')}
>
{detailQuery.isLoading || !detail ? (
<Text type="secondary">加载中...</Text>
) : (
<Space direction="vertical" size={16} style={{ width: '100%' }}>
<Alert
type={detail.comparison.matched ? 'success' : 'warning'}
showIcon
message={STATUS_LABELS[detail.task.status] || detail.task.status}
description={detail.comparison.message || detail.live.message}
/>
<Descriptions bordered size="small" column={2}>
<Descriptions.Item label="订单号" span={2}>
{detail.task.platform_order_id}
</Descriptions.Item>
<Descriptions.Item label="商品" span={2}>
{detail.task.product_name || detail.task.sku_name}
</Descriptions.Item>
<Descriptions.Item label="客户角色">
{detail.task.customer_role_name || '-'}
</Descriptions.Item>
<Descriptions.Item label="客户平台">
{PLATFORM_LABELS[detail.task.customer_platform] || '-'} ·{' '}
{SYSTEM_LABELS[detail.task.customer_system] || '-'}
</Descriptions.Item>
<Descriptions.Item label="平台角色">{detail.live.roleName || '-'}</Descriptions.Item>
<Descriptions.Item label="平台渠道">
{[detail.live.areaName, detail.live.platName].filter(Boolean).join(' · ') || '-'}
</Descriptions.Item>
<Descriptions.Item label="绑定阶段" span={2}>
{detail.task.binding_phase || '-'}
</Descriptions.Item>
</Descriptions>
<Space wrap>
<Button icon={<CopyOutlined />} onClick={() => void copyLink(detail.task)}>
复制客户链接
</Button>
<Button
icon={<ReloadOutlined />}
loading={refreshMutation.isPending}
onClick={() => refreshMutation.mutate(detail.task.platform_order_id)}
>
刷新绑定
</Button>
<Button
type="primary"
icon={<ThunderboltOutlined />}
loading={restartMutation.isPending}
onClick={() => restartMutation.mutate(detail.task.platform_order_id)}
>
重新生成二维码
</Button>
<Button icon={<LinkOutlined />} href={detail.linkPath} target="_blank">
打开客户页
</Button>
</Space>
<Card size="small" title="事件时间线">
<Timeline
items={detail.events.map((event) => ({
color: event.event_type.includes('failed') ? 'red' : 'blue',
children: (
<Space direction="vertical" size={2}>
<Text strong>{EVENT_LABELS[event.event_type] || event.event_type}</Text>
{event.event_type === 'customer_profile_reset' && event.detail_json.reason ? (
<Text>{String(event.detail_json.reason)}</Text>
) : null}
<Text type="secondary">
{formatAdminDateTime(event.created_at)} · {event.actor_type}
</Text>
</Space>
),
}))}
/>
</Card>
</Space>
)}
</Drawer>
</section>
)
}
@@ -68,6 +68,7 @@ type ConfigFormValues = {
note?: string
semiAutoEnabled?: boolean
semiAutoPlatform?: '' | 'huya' | 'weibo'
douyuFulfillmentEnabled?: boolean
semiAutoConfig?: {
pageTitle?: string
pageDescription?: string
@@ -153,6 +154,7 @@ export function ManualSkuConfigPanel() {
semiAutoEnabled: values.semiAutoEnabled === true,
semiAutoPlatform: values.semiAutoEnabled ? values.semiAutoPlatform || '' : '',
semiAutoConfig: values.semiAutoConfig || {},
douyuFulfillmentEnabled: values.douyuFulfillmentEnabled === true,
}),
onSuccess: (response) => {
const summary = response.data.syncSummary
@@ -215,6 +217,7 @@ export function ManualSkuConfigPanel() {
semiAutoEnabled: item.config?.semiAutoEnabled === true,
semiAutoPlatform: item.config?.semiAutoPlatform || '',
semiAutoConfig: item.config?.semiAutoConfig || {},
douyuFulfillmentEnabled: item.config?.douyuFulfillmentEnabled === true,
})
setModalOpen(true)
}
@@ -229,6 +232,7 @@ export function ManualSkuConfigPanel() {
semiAutoEnabled: false,
semiAutoPlatform: '',
semiAutoConfig: {},
douyuFulfillmentEnabled: false,
})
setModalOpen(true)
}
@@ -697,6 +701,14 @@ export function ManualSkuConfigPanel() {
) : null
}
</Form.Item>
<Form.Item
name="douyuFulfillmentEnabled"
label="启用斗鱼精英宝典领取"
valuePropName="checked"
extra="客户通过 域名/coll/d/订单号 提交资料并扫码绑定角色;内部账号和兑换仍在直播账号履约工作台处理。"
>
<Switch />
</Form.Item>
</Card>
<Form.Item name="note" label="备注">
<Input.TextArea rows={2} maxLength={300} showCount />
@@ -0,0 +1,672 @@
import {
CheckCircleFilled,
ExclamationCircleOutlined,
LoadingOutlined,
QrcodeOutlined,
ReloadOutlined,
} from '@ant-design/icons'
import { Alert, App, Button, Image, Input, Progress, Space, Spin } from 'antd'
import QRCode from 'qrcode'
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
import { useParams } from 'react-router'
import {
confirmDouyuBinding,
fetchDouyuFulfillment,
pollDouyuBinding,
saveDouyuProfile,
startDouyuBinding,
} from '@/services/douyu-fulfillment'
import type {
DouyuCustomerFulfillment,
DouyuCustomerPlatform,
DouyuCustomerSystem,
} from '@/types/douyu-fulfillment'
import { formatAdminDateTime } from '@/utils/admin-time'
const POLL_INTERVAL_MS = 3000
const BINDING_FAILURE_ISSUES = new Set([
'binding_failed',
'account_role_cooldown',
'customer_role_cooldown',
])
const STATUS_LABELS: Record<string, string> = {
waiting_profile: '等待填写资料',
preparing: '正在准备账号',
allocated: '账号已分配',
qr_pending: '等待扫码绑定',
role_ready: '请确认游戏角色',
bound: '角色已绑定',
waiting_operator: '待客服处理',
processing: '正在兑换',
completed: '领取完成',
failed: '角色绑定失败',
manual_required: '等待人工处理',
cancelled: '订单已取消',
}
function platformLabel(value: string) {
if (value === 'wechat') return '微信'
if (value === 'qq') return 'QQ'
return '未填写'
}
function systemLabel(value: string) {
if (value === 'ios') return '苹果'
if (value === 'android') return '安卓'
return '未填写'
}
function formatRemainingTime(totalSeconds: number) {
const seconds = Math.max(0, Math.ceil(totalSeconds))
const minutes = Math.floor(seconds / 60)
const rest = seconds % 60
return `${String(minutes).padStart(2, '0')}:${String(rest).padStart(2, '0')}`
}
export default function DouyuFulfillmentPage() {
const { message } = App.useApp()
const { orderNo = '' } = useParams<{ orderNo: string }>()
const [data, setData] = useState<DouyuCustomerFulfillment | null>(null)
const [loading, setLoading] = useState(true)
const [loadError, setLoadError] = useState('')
const [saving, setSaving] = useState(false)
const [bindingLoading, setBindingLoading] = useState(false)
const [roleName, setRoleName] = useState('')
const [platform, setPlatform] = useState<DouyuCustomerPlatform>('wechat')
const [system, setSystem] = useState<DouyuCustomerSystem>('android')
const [qrImage, setQrImage] = useState('')
const [bindingQrExpanded, setBindingQrExpanded] = useState(false)
const [nowMs, setNowMs] = useState(() => Date.now())
const autoStartRef = useRef('')
const customerRoleRef = useRef('')
const applyData = useCallback((next: DouyuCustomerFulfillment) => {
const previousRole = customerRoleRef.current
const nextRole = next.task.customer_role_name || ''
customerRoleRef.current = nextRole
setData(next)
if (previousRole && !nextRole) {
setRoleName('')
setPlatform('wechat')
setSystem('android')
} else {
setRoleName((current) => current || nextRole)
}
if (next.task.customer_platform === 'qq' || next.task.customer_platform === 'wechat') {
setPlatform(next.task.customer_platform)
}
if (next.task.customer_system === 'ios' || next.task.customer_system === 'android') {
setSystem(next.task.customer_system)
}
}, [])
const load = useCallback(
async (silent = false) => {
if (!orderNo) {
setLoadError('订单号无效')
setLoading(false)
return
}
if (!silent) setLoading(true)
try {
const response = await fetchDouyuFulfillment(orderNo)
applyData(response.data)
setLoadError('')
} catch (error) {
if (!silent) {
setLoadError(error instanceof Error ? error.message : '读取订单失败')
}
} finally {
if (!silent) setLoading(false)
}
},
[applyData, orderNo],
)
useEffect(() => {
void load()
}, [load])
const task = data?.task
const live = data?.live
const needsProfile = Boolean(task && !task.customer_role_name)
const bindingFailed = Boolean(live && BINDING_FAILURE_ISSUES.has(live.issueCode))
const activeBinding = Boolean(
task &&
!needsProfile &&
!bindingFailed &&
!['completed', 'cancelled'].includes(task.status) &&
!live?.bindConfirmed,
)
useEffect(() => {
if (!activeBinding || !orderNo) return
const timer = window.setInterval(() => {
void pollDouyuBinding(orderNo)
.then((response) => applyData(response.data))
.catch(() => undefined)
}, POLL_INTERVAL_MS)
return () => window.clearInterval(timer)
}, [activeBinding, applyData, orderNo])
useEffect(() => {
const url = live?.qrUrl || ''
if (!url) {
setQrImage('')
return
}
void QRCode.toDataURL(url, {
width: 320,
margin: 2,
color: { dark: '#111827', light: '#e8ebef' },
}).then(setQrImage)
}, [live?.qrUrl])
useEffect(() => {
setBindingQrExpanded(false)
}, [live?.bindConfirmed, live?.bindReadyForConfirm, live?.qrUrl])
useEffect(() => {
const tick = () => setNowMs(Date.now())
tick()
const timer = window.setInterval(tick, 1000)
return () => window.clearInterval(timer)
}, [live?.qrExpiresAt])
useEffect(() => {
if (!task || !live || needsProfile || live.qrUrl || live.bindConfirmed) return
if (!live.accountReady) return
if (
task.status !== 'preparing' &&
task.status !== 'allocated' &&
task.status !== 'waiting_profile'
) {
return
}
if (autoStartRef.current === orderNo) return
autoStartRef.current = orderNo
let cancelled = false
setBindingLoading(true)
void startDouyuBinding(orderNo)
.then((response) => {
if (!cancelled) applyData(response.data)
})
.catch(() => undefined)
.finally(() => {
if (!cancelled) setBindingLoading(false)
})
return () => {
cancelled = true
}
}, [applyData, live, needsProfile, orderNo, task])
const expiresInSeconds = useMemo(() => {
const raw = live?.qrExpiresAt || ''
const expiresAt = raw ? Date.parse(raw) : 0
if (!expiresAt || Number.isNaN(expiresAt)) return 0
return Math.max(0, Math.floor((expiresAt - nowMs) / 1000))
}, [live?.qrExpiresAt, nowMs])
const qrExpired = Boolean(live?.qrUrl && live.qrExpiresAt && expiresInSeconds <= 0)
const qrTotalSeconds = (() => {
const generatedAt = live?.qrGeneratedAt ? Date.parse(live.qrGeneratedAt) : 0
const expiresAt = live?.qrExpiresAt ? Date.parse(live.qrExpiresAt) : 0
if (!generatedAt || !expiresAt || Number.isNaN(generatedAt) || Number.isNaN(expiresAt)) {
return 600
}
return Math.max(1, Math.floor((expiresAt - generatedAt) / 1000))
})()
const qrProgressPercent = Math.max(0, Math.min(100, (expiresInSeconds / qrTotalSeconds) * 100))
const canRevealBindingQr = Boolean(
live?.qrUrl && (live.bindReadyForConfirm || live.bindConfirmed),
)
const showBindingQr = Boolean(live?.qrUrl && (!canRevealBindingQr || bindingQrExpanded))
const waitingForSupport = Boolean(
task && (live?.bindConfirmed || task.status === 'waiting_operator' || task.status === 'bound'),
)
const bindingFailureMessage =
live?.issueCode === 'account_role_cooldown'
? '当前斗鱼账号暂不可换绑,本次绑定未生效。'
: live?.issueCode === 'customer_role_cooldown'
? '该游戏角色仍处于换绑冷却期,本次绑定未生效。'
: '本次游戏角色绑定失败。'
const bindingDescription = live?.bindConfirmed
? '角色绑定已完成,待客服处理。'
: live?.bindReadyForConfirm
? '已识别游戏角色,请核对并确认绑定。'
: bindingFailed
? bindingFailureMessage
: qrExpired
? '当前二维码已过期,请刷新二维码后重新扫码。'
: live?.issueCode === 'binding_failed'
? '暂未识别到绑定角色,请继续使用当前二维码完成扫码。'
: !live?.accountReady
? '系统正在自动准备账号和二维码,请稍候,无需重复操作。'
: live?.qrUrl
? '必须使用微信扫码。请选择与资料一致的和平精英角色,QQ 扫码或其他方式无效。'
: live?.message || '正在准备绑定二维码,请稍候。'
const bindingStageTitle =
task?.status === 'qr_pending' && live?.qrUrl
? '必须使用微信扫码绑定'
: STATUS_LABELS[task?.status || ''] || '等待处理'
async function submitProfile() {
if (!roleName.trim()) {
message.warning('请输入游戏角色名')
return
}
setSaving(true)
try {
const response = await saveDouyuProfile(orderNo, {
roleName: roleName.trim(),
platform,
system,
})
applyData(response.data)
message.success('资料已提交,正在准备绑定二维码')
} catch (error) {
message.error(error instanceof Error ? error.message : '提交资料失败')
} finally {
setSaving(false)
}
}
async function startBinding(forceRefresh = false) {
if (forceRefresh && !qrExpired) {
message.info('二维码有效期内无需刷新')
return
}
setBindingLoading(true)
try {
const response = await startDouyuBinding(orderNo, forceRefresh)
applyData(response.data)
message.success(forceRefresh ? '二维码已刷新' : '绑定流程已继续')
} catch (error) {
message.error(error instanceof Error ? error.message : '生成绑定二维码失败')
} finally {
setBindingLoading(false)
}
}
async function confirmBinding() {
setBindingLoading(true)
try {
const response = await confirmDouyuBinding(orderNo)
applyData(response.data)
message.success('角色绑定已确认,待客服处理')
} catch (error) {
message.error(error instanceof Error ? error.message : '确认角色绑定失败')
} finally {
setBindingLoading(false)
}
}
if (loading) {
return (
<CustomerFrame title="斗鱼精英宝典领取">
<div className="customer-auth-loading">
<Spin indicator={<LoadingOutlined spin />} />
<span>正在读取订单...</span>
</div>
</CustomerFrame>
)
}
if (loadError || !data || !task) {
return (
<CustomerFrame title="斗鱼精英宝典领取">
<div className="customer-auth-state is-error">
<h2>暂时无法打开订单</h2>
<p>{loadError || '订单信息不存在'}</p>
</div>
</CustomerFrame>
)
}
if (task.status === 'completed') {
return (
<CustomerFrame title="斗鱼精英宝典领取">
<OrderCard data={data} />
<div className="customer-auth-state is-success">
<div className="customer-auth-state-icon">
<CheckCircleFilled />
</div>
<h2>领取已完成</h2>
<p>运营已完成本订单兑换,请到和平精英账号中确认。</p>
{task.completed_at ? (
<span className="customer-auth-state-time">
完成时间:{formatAdminDateTime(task.completed_at)}
</span>
) : null}
</div>
</CustomerFrame>
)
}
if (task.status === 'cancelled') {
return (
<CustomerFrame title="斗鱼精英宝典领取">
<OrderCard data={data} />
<Alert
className="customer-order-closed-alert"
type="warning"
showIcon
message="订单领取已关闭"
description="如订单发生退款或取消,请联系客服确认。"
/>
</CustomerFrame>
)
}
return (
<CustomerFrame
title="斗鱼精英宝典领取"
compact={Boolean(
live?.qrUrl && !live.bindReadyForConfirm && !live.bindConfirmed && !bindingFailed,
)}
>
<OrderCard data={data} />
{needsProfile ? (
<section className="customer-auth-section">
<div className="customer-auth-section-heading">
<div>
<h2>填写游戏角色</h2>
<p>资料用于核对扫码绑定的和平精英角色。</p>
</div>
</div>
<div className="customer-collect-body">
<label className="customer-collect-label">登录方式</label>
<ChoiceSwitch
ariaLabel="登录方式"
value={platform}
onChange={setPlatform}
options={[
{ label: '微信', value: 'wechat' },
{ label: 'QQ', value: 'qq' },
]}
/>
<label className="customer-collect-label">设备系统</label>
<ChoiceSwitch
ariaLabel="设备系统"
value={system}
onChange={setSystem}
options={[
{ label: '安卓', value: 'android' },
{ label: '苹果', value: 'ios' },
]}
/>
<label className="customer-collect-label">游戏角色名</label>
<Input
className="customer-collect-input"
value={roleName}
onChange={(event) => setRoleName(event.target.value)}
placeholder="请输入和平精英角色名"
maxLength={100}
/>
<Button
block
size="large"
className="customer-collect-submit"
loading={saving}
onClick={() => void submitProfile()}
>
提交资料并继续
</Button>
</div>
</section>
) : waitingForSupport ? (
<section className="customer-binding-stage">
<Alert type="success" showIcon message="待客服处理" />
</section>
) : (
<section className="customer-binding-stage">
{bindingFailed ? (
<div className="customer-douyu-binding-failure">
<Alert
type="error"
showIcon
message="角色绑定失败"
description={bindingFailureMessage}
/>
<p>请截图本页面并联系客服处理,客服会根据截图重新安排绑定。</p>
</div>
) : (
<Alert
className={live?.qrUrl ? 'customer-douyu-binding-alert is-wechat' : undefined}
type={qrExpired ? 'warning' : live?.bindConfirmed ? 'success' : 'info'}
showIcon
message={bindingStageTitle}
description={bindingDescription}
/>
)}
{!bindingFailed && canRevealBindingQr ? (
<Button
className="customer-binding-qr-toggle"
icon={<QrcodeOutlined />}
onClick={() => setBindingQrExpanded((current) => !current)}
>
{bindingQrExpanded ? '收起绑定二维码' : '查看绑定二维码'}
</Button>
) : null}
{!bindingFailed &&
!live?.qrUrl &&
!live?.bindReadyForConfirm &&
task.status !== 'completed' ? (
<div className="customer-binding-qr-card customer-douyu-preparing-card">
<h3>游戏角色绑定二维码</h3>
<div className="customer-douyu-qr-main">
<span className="customer-douyu-qr-rail" aria-hidden="true">
必须使用微信扫码
</span>
<div className="customer-binding-qr-code">
<div className="customer-douyu-qr-preparing">
<div className="customer-douyu-qr-skeleton" aria-hidden="true" />
<div className="customer-douyu-qr-preparing-copy">
<Spin />
<strong>正在生成二维码</strong>
<span>系统会自动刷新,请稍候</span>
</div>
</div>
</div>
<span className="customer-douyu-qr-rail" aria-hidden="true">
必须使用微信扫码
</span>
</div>
<p className="customer-binding-qr-hint">
二维码准备完成后,必须使用微信扫码并选择游戏角色。
</p>
<Button
block
size="large"
className="customer-douyu-preparing-button"
loading={bindingLoading}
onClick={() => void startBinding(false)}
>
继续准备
</Button>
</div>
) : null}
{!bindingFailed && live?.qrUrl && showBindingQr ? (
<div className="customer-binding-qr-card">
<h3>游戏角色绑定二维码</h3>
<div className="customer-douyu-qr-main">
<span className="customer-douyu-qr-rail" aria-hidden="true">
必须使用微信扫码
</span>
<div className="customer-binding-qr-code">
{qrImage ? (
<Image
src={qrImage}
alt="和平精英角色绑定二维码"
width="100%"
preview={false}
/>
) : (
<div className="customer-auth-qr-placeholder">
<Spin />
<span>正在生成二维码图片...</span>
</div>
)}
</div>
<span className="customer-douyu-qr-rail" aria-hidden="true">
必须使用微信扫码
</span>
</div>
<p className="customer-binding-qr-hint">
必须使用微信扫码,并选择与资料一致的和平精英角色。
</p>
{qrExpired ? (
<div className="customer-binding-qr-countdown is-expired">二维码已过期</div>
) : (
<div className="customer-binding-qr-countdown">
二维码有效期剩余 {formatRemainingTime(expiresInSeconds)}
</div>
)}
<Progress percent={qrProgressPercent} showInfo={false} />
<div className="customer-binding-qr-actions is-single">
<Button
icon={<ReloadOutlined />}
loading={bindingLoading}
disabled={!qrExpired}
onClick={() => void startBinding(true)}
>
刷新二维码
</Button>
</div>
<p className="customer-douyu-qr-refresh-note">
{qrExpired
? '二维码已过期,请刷新后重新扫码'
: '二维码有效期内无需刷新,过期后可重新生成'}
</p>
</div>
) : null}
{!bindingFailed && live?.bindReadyForConfirm ? (
<div className="customer-binding-qr-card">
<h3>核对绑定角色</h3>
<p className="customer-binding-qr-hint">
平台识别角色:{live.roleName || '-'} · {live.areaName || '-'} ·{' '}
{live.platName || '-'}
</p>
<p className="customer-binding-qr-hint">
已填资料:{task.customer_role_name} · {platformLabel(task.customer_platform)} ·{' '}
{systemLabel(task.customer_system)}
</p>
<Alert
type={data.comparison.matched ? 'success' : 'warning'}
showIcon
message={data.comparison.matched ? '角色信息一致' : '角色信息不一致'}
description={data.comparison.message}
/>
<Space direction="vertical" size={10} style={{ width: '100%' }}>
<Button
block
size="large"
type="primary"
disabled={!data.comparison.matched}
loading={bindingLoading}
onClick={() => void confirmBinding()}
>
确认绑定角色
</Button>
<Button
block
danger
icon={<ExclamationCircleOutlined />}
onClick={() => {
setData({ ...data, task: { ...task, customer_role_name: '' } })
}}
>
修改资料
</Button>
</Space>
</div>
) : null}
</section>
)}
</CustomerFrame>
)
}
function ChoiceSwitch<T extends string>(input: {
value: T
options: ReadonlyArray<{ label: string; value: T }>
ariaLabel: string
onChange: (value: T) => void
}) {
return (
<div className="customer-choice-switch" role="radiogroup" aria-label={input.ariaLabel}>
{input.options.map((option) => {
const selected = input.value === option.value
return (
<button
key={option.value}
type="button"
role="radio"
aria-checked={selected}
className={`customer-choice-option${selected ? ' is-selected' : ''}`}
onClick={() => input.onChange(option.value)}
>
{option.label}
</button>
)
})}
</div>
)
}
function CustomerFrame({
title,
compact = false,
children,
}: {
title: string
compact?: boolean
children: ReactNode
}) {
return (
<div className={`customer-auth-page is-huya is-douyu${compact ? ' is-compact' : ''}`}>
<div className="customer-auth-shell">
<header className="customer-auth-hero">
<div className="customer-auth-brand">
<div>
<h1>{title}</h1>
</div>
</div>
</header>
<div className="customer-auth-warning">温馨提示:未成年人禁止下单</div>
<main className="customer-auth-main">{children}</main>
</div>
</div>
)
}
function OrderCard({ data }: { data: DouyuCustomerFulfillment }) {
return (
<section className="customer-order-card customer-douyu-order-card">
<div className="customer-douyu-order-head">
<h3>订单信息</h3>
<strong
className={`customer-order-status customer-douyu-order-status is-${data.task.status}`}
>
{STATUS_LABELS[data.task.status] || data.task.status}
</strong>
</div>
<div className="customer-douyu-order-field">
<span>订单号</span>
<strong>{data.task.platform_order_id}</strong>
</div>
<div className="customer-douyu-order-field">
<span>商品</span>
<strong>
{data.task.product_name || data.task.sku_name} × {data.task.quantity}
</strong>
</div>
</section>
)
}
@@ -365,6 +365,7 @@ export function saveAdminManualConfig(payload: {
semiAutoEnabled?: boolean
semiAutoPlatform?: '' | 'huya' | 'weibo'
semiAutoConfig?: Record<string, unknown>
douyuFulfillmentEnabled?: boolean
}) {
return apiPost<ManualFulfillmentConfig>('/api/v1/admin/cost-center/manual-configs', payload)
}
@@ -73,6 +73,21 @@ export type DevSemiAutoIntegrationResult = DevMockSemiAutoResult & {
mappingId: number
}
export type DevDouyuFulfillmentMockResult = {
platform: 'douyu'
pipeline: 'order_service'
orderId: number
orderNo: string
orderItemId: number
fulfillmentId: number
configId: number
mappingId: number
skuKey: string
customerPath: string
adminPath: string
tips: string[]
}
export function fetchDevMockStatus() {
return apiGet<DevMockStatus>('/api/v1/admin/dev-mock/status')
}
@@ -122,6 +137,10 @@ export function createSemiAutoIntegrationDevMock(payload: {
)
}
export function createDouyuFulfillmentDevMock(payload: { orderNo?: string; skuName?: string }) {
return apiPost<DevDouyuFulfillmentMockResult>('/api/v1/admin/dev-mock/douyu-fulfillment', payload)
}
export function buildOpen91QueryDevMock(payload: {
orderNo: string
execute?: boolean
@@ -0,0 +1,41 @@
import { apiGet, apiPost } from '@/lib/http'
import type { DouyuFulfillmentDetail, DouyuFulfillmentTask } from '@/types/douyu-fulfillment'
export function fetchAdminDouyuFulfillmentTasks(params: {
keyword?: string
status?: string
page?: number
pageSize?: number
}) {
return apiGet<{
items: DouyuFulfillmentTask[]
pagination: { page: number; pageSize: number; total: number }
}>('/api/v1/admin/douyu-fulfillment/tasks', { params })
}
export function syncAdminDouyuFulfillmentTasks() {
return apiPost<{ created: number; updated: number; checked: number }>(
'/api/v1/admin/douyu-fulfillment/sync',
{},
)
}
export function fetchAdminDouyuFulfillmentDetail(orderNo: string) {
return apiGet<DouyuFulfillmentDetail>(
`/api/v1/admin/douyu-fulfillment/tasks/${encodeURIComponent(orderNo)}`,
)
}
export function refreshAdminDouyuBinding(orderNo: string) {
return apiPost<DouyuFulfillmentDetail>(
`/api/v1/admin/douyu-fulfillment/tasks/${encodeURIComponent(orderNo)}/binding/refresh`,
{},
)
}
export function restartAdminDouyuBinding(orderNo: string) {
return apiPost<DouyuFulfillmentDetail>(
`/api/v1/admin/douyu-fulfillment/tasks/${encodeURIComponent(orderNo)}/binding/start`,
{ forceRefresh: true },
)
}
@@ -15,3 +15,4 @@ export * from './tasks'
export * from './dev-mock'
export * from './notifications'
export * from './worker-platform'
export * from './douyu-fulfillment'
@@ -0,0 +1,46 @@
import { apiGet, apiPost } from '@/lib/http'
import type {
DouyuCustomerFulfillment,
DouyuCustomerPlatform,
DouyuCustomerSystem,
} from '@/types/douyu-fulfillment'
export function fetchDouyuFulfillment(orderNo: string) {
return apiGet<DouyuCustomerFulfillment>(
`/api/v1/douyu-fulfillment/${encodeURIComponent(orderNo)}`,
)
}
export function saveDouyuProfile(
orderNo: string,
input: {
roleName: string
platform: DouyuCustomerPlatform
system: DouyuCustomerSystem
},
) {
return apiPost<DouyuCustomerFulfillment>(
`/api/v1/douyu-fulfillment/${encodeURIComponent(orderNo)}/profile`,
input,
)
}
export function startDouyuBinding(orderNo: string, forceRefresh = false) {
return apiPost<DouyuCustomerFulfillment>(
`/api/v1/douyu-fulfillment/${encodeURIComponent(orderNo)}/binding/start`,
{ forceRefresh },
)
}
export function pollDouyuBinding(orderNo: string) {
return apiGet<DouyuCustomerFulfillment>(
`/api/v1/douyu-fulfillment/${encodeURIComponent(orderNo)}/binding/status`,
)
}
export function confirmDouyuBinding(orderNo: string) {
return apiPost<DouyuCustomerFulfillment>(
`/api/v1/douyu-fulfillment/${encodeURIComponent(orderNo)}/binding/confirm`,
{},
)
}
+12
View File
@@ -123,6 +123,18 @@ select {
line-height: 1.5;
}
.dev-mock-tabs > .ant-tabs-nav {
margin-bottom: 0;
}
.dev-mock-tabs > .ant-tabs-content-holder {
margin-top: 16px;
}
.dev-mock-tabs > .ant-tabs-nav .ant-tabs-tab {
padding-inline: 18px;
}
.total-badge {
display: inline-flex;
align-items: center;
File diff suppressed because it is too large Load Diff
+462
View File
@@ -0,0 +1,462 @@
/* ==========================================================================
买家前台:提卡与信息收集页 (Buyer Claim & Collect Pages)
========================================================================== */
.claim-page {
min-height: 100vh;
padding: 24px;
background: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
display: flex;
flex-direction: column;
align-items: center;
gap: 18px;
}
.claim-header-card,
.claim-content-card {
width: min(680px, 100%);
border-color: rgba(148, 163, 184, 0.18);
box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}
.claim-header-card {
position: relative;
}
.claim-header-card .ant-card-body,
.claim-content-card .ant-card-body {
display: flex;
flex-direction: column;
gap: 18px;
}
.claim-header-copy {
min-width: 0;
padding-right: 220px;
}
.claim-header-copy h1 {
margin: 0;
color: #0f172a;
font-size: 30px;
line-height: 1.25;
overflow-wrap: anywhere;
}
.claim-header-copy p,
.claim-muted {
margin: 0;
color: #64748b;
line-height: 1.6;
}
.claim-step-indicator {
position: absolute;
top: 24px;
right: 24px;
max-width: 210px;
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 7px;
}
.claim-step-dots {
display: flex;
gap: 8px;
}
.claim-step-dot {
width: 32px;
height: 32px;
border-radius: 50%;
background: #e5e7eb;
color: #94a3b8;
display: inline-flex;
align-items: center;
justify-content: center;
font-weight: 700;
}
.claim-step-dot.active {
background: var(--theme-primary);
color: #ffffff;
}
.claim-step-progress-text {
color: #64748b;
font-size: 13px;
font-weight: 700;
line-height: 1.4;
text-align: right;
overflow-wrap: anywhere;
}
.claim-content-card .ant-typography {
margin: 0;
}
.claim-state-card .ant-card-body {
min-height: 240px;
align-items: center;
justify-content: center;
text-align: center;
}
.claim-large-icon {
font-size: 44px;
}
.claim-icon-success {
color: #16a34a;
}
.claim-icon-warning {
color: #d97706;
}
.claim-icon-info {
color: var(--theme-primary);
}
.claim-icon-error {
color: #dc2626;
}
.claim-qr-block {
display: flex;
flex-direction: column;
align-items: center;
gap: 14px;
padding: 14px;
border-radius: 8px;
background: #f8fbff;
border: 1px solid #dbeafe;
}
.claim-qr-guide-panel {
display: grid;
grid-template-columns: 42px minmax(0, 280px) 42px;
grid-template-areas:
'left code right'
'. hint .';
gap: 10px;
align-items: center;
justify-content: center;
width: 100%;
max-width: 410px;
min-width: 0;
}
.claim-scan-label {
align-self: stretch;
min-height: 150px;
padding: 10px 6px;
color: #e11d48;
font-weight: 900;
font-size: 17px;
line-height: 1.2;
writing-mode: vertical-rl;
text-orientation: upright;
display: flex;
align-items: center;
justify-content: center;
}
.claim-scan-label-left {
grid-area: left;
}
.claim-scan-label-right {
grid-area: right;
}
.claim-qr-code {
grid-area: code;
width: 100%;
max-width: 280px;
aspect-ratio: 1 / 1;
padding: 10px;
background: #ffffff;
border-radius: 8px;
border: 1px solid #dbeafe;
}
.claim-save-hint {
grid-area: hint;
margin: 0;
justify-self: center;
color: #64748b;
font-size: 14px;
font-weight: 700;
line-height: 1.4;
text-align: center;
}
.claim-role-panel {
display: grid;
grid-template-columns: 1fr;
gap: 8px;
}
.claim-role-panel.pending {
opacity: 0.82;
}
.claim-role-panel-item {
min-width: 0;
display: grid;
grid-template-columns: 88px minmax(0, 1fr);
align-items: center;
gap: 12px;
}
.claim-role-panel-item span {
color: #64748b;
font-size: 13px;
line-height: 1.4;
white-space: nowrap;
}
.claim-role-panel-item strong {
min-width: 0;
color: #0f172a;
font-size: 17px;
line-height: 1.45;
overflow-wrap: anywhere;
}
.claim-action-row {
width: 100%;
}
.claim-action-tooltip-wrap {
display: inline-flex;
}
.claim-meta-footer {
display: flex;
flex-wrap: wrap;
gap: 4px 10px;
justify-content: center;
color: #94a3b8;
font-size: 11px;
line-height: 1.5;
}
.claim-info-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 14px;
}
.claim-info-grid-compact {
gap: 8px;
margin-bottom: 10px;
}
.claim-info-grid-compact .claim-info-item {
padding: 8px 10px;
gap: 2px;
border-radius: 6px;
}
.claim-info-grid-compact .claim-info-item span {
font-size: 11px;
line-height: 1.3;
}
.claim-info-grid-compact .claim-info-item strong {
font-size: 13px;
line-height: 1.35;
font-weight: 600;
}
.claim-uid-step .ant-card-body {
gap: 10px;
}
.claim-uid-step-title.ant-typography {
margin: 0 !important;
font-size: 20px !important;
line-height: 1.3 !important;
}
.claim-uid-step-desc {
font-size: 13px;
line-height: 1.45;
}
.claim-uid-guide {
margin: 4px 0 0;
padding: 6px;
border-radius: 8px;
background: #f8fafc;
border: 1px solid #e5e7eb;
}
.claim-uid-guide-image {
display: block;
width: 100%;
max-width: 360px;
max-height: 160px;
margin: 0 auto;
border-radius: 6px;
border: 1px solid #e2e8f0;
object-fit: contain;
background: #fff;
}
.claim-uid-guide-caption {
margin: 6px 0 0;
text-align: center;
color: #64748b;
font-size: 12px;
line-height: 1.35;
}
.claim-uid-warning {
margin: 2px 0 0;
color: #ff4d4f;
font-size: 13px;
font-weight: 600;
line-height: 1.45;
}
.claim-info-item {
min-width: 0;
padding: 16px;
border-radius: 6px;
background: #f8fafc;
border: 1px solid #e5e7eb;
display: flex;
flex-direction: column;
gap: 6px;
}
.claim-info-item span {
color: #64748b;
font-size: 13px;
}
.claim-info-item strong {
color: #0f172a;
font-size: 17px;
overflow-wrap: anywhere;
}
.claim-result-header {
display: flex;
align-items: flex-start;
gap: 14px;
}
.claim-feifei-main {
display: grid;
gap: 8px;
}
.claim-feifei-main p {
margin: 0;
color: var(--theme-primary);
font-weight: 700;
}
.claim-feifei-label {
color: #64748b;
font-size: 13px;
}
.claim-product-items {
display: flex;
flex-direction: column;
gap: 10px;
}
.claim-product-items-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
color: #64748b;
font-size: 13px;
}
.claim-product-items-header strong {
color: var(--theme-primary);
font-weight: 700;
}
.claim-product-items-list {
display: flex;
flex-direction: column;
gap: 8px;
}
.claim-product-item-row {
min-height: 44px;
padding: 10px 12px;
border: 1px solid #e5e7eb;
border-radius: 6px;
background: #f8fafc;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.claim-product-item-row span {
min-width: 0;
color: #0f172a;
font-weight: 700;
line-height: 1.35;
overflow-wrap: anywhere;
}
.claim-product-item-row strong {
flex: 0 0 auto;
color: #0f172a;
font-size: 15px;
}
.claim-product-items.compact {
margin-top: 10px;
gap: 8px;
}
.claim-product-items.compact .claim-product-items-list {
gap: 6px;
}
.claim-product-items.compact .claim-product-item-row {
min-height: 36px;
padding: 8px 10px;
background: rgba(248, 250, 252, 0.72);
}
/* 待领取物品图:居中大图;imageUrl 为空或加载失败时是同一尺寸的虚线占位块(不会出现破图) */
.claim-product-image-wrap {
display: flex;
justify-content: center;
}
.claim-product-image {
width: min(160px, 48%);
aspect-ratio: 1 / 1;
border-radius: 16px;
object-fit: contain;
background: #f8fafc;
padding: 8px;
border: 1px solid rgba(148, 163, 184, 0.24);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.claim-product-image-fallback {
display: flex;
align-items: center;
justify-content: center;
font-size: 46px;
color: rgba(100, 116, 139, 0.55);
border-style: dashed;
}
+770
View File
@@ -0,0 +1,770 @@
/* ===== 收集页 (Collect Page) ===== */
.collect-page {
min-height: 100vh;
display: grid;
place-items: center;
padding: 32px 16px;
background: #f5f7fb;
}
.collect-card {
width: min(520px, 100%);
}
.collect-order-input {
flex: 1;
margin-bottom: 0;
}
/* ===== 一次性补资料链接页 (Collect Material Link) ===== */
.collect-link-page {
min-height: 100vh;
padding: 32px 16px;
background: #f5f7fb;
display: flex;
justify-content: center;
align-items: flex-start;
}
.collect-link-card {
width: min(720px, 100%);
}
.collect-link-card .ant-card-body {
padding: 28px;
}
/* 一单多工单时,内层商品卡片比外层容器更紧凑 */
.collect-link-order-card .ant-card-body {
padding: 16px;
}
.collect-link-status-card {
background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.collect-link-status-card .ant-card-body {
padding: 16px;
}
.collect-link-status-head {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px;
color: #0f172a;
font-size: 15px;
}
.collect-link-status-head .ant-tag {
margin-inline-end: 0;
}
.collect-link-order-meta {
display: flex;
flex-wrap: wrap;
gap: 4px 18px;
color: #64748b;
font-size: 13px;
}
.collect-link-order-meta strong {
color: #0f172a;
font-weight: 600;
}
.collect-link-description {
margin-top: 6px;
font-size: 12px;
}
.collect-link-submitted {
display: grid;
gap: 10px;
padding: 12px;
background: #f8fafc;
border: 1px solid #e7edf5;
border-radius: 10px;
}
.collect-link-submitted-head {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: space-between;
gap: 5px 14px;
}
.collect-link-submitted-head > span {
display: grid;
gap: 1px;
}
.collect-link-submitted-head .ant-typography:last-child {
font-size: 11px;
}
.collect-link-submitted-head > .ant-typography {
font-size: 11px;
}
.collect-link-submitted-fields {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 7px;
}
.collect-link-submitted-fields > div {
display: grid;
gap: 2px;
min-width: 0;
padding: 8px 10px;
background: #ffffff;
border: 1px solid #edf1f6;
border-radius: 8px;
}
.collect-link-submitted-fields span,
.collect-link-submitted-screenshots > span {
color: #94a3b8;
font-size: 11px;
}
.collect-link-submitted-fields strong {
color: #1e293b;
font-size: 13px;
font-weight: 500;
line-height: 1.5;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.collect-link-submitted-screenshots {
display: grid;
gap: 7px;
}
.collect-link-submitted-screenshots > div {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.collect-link-submitted-screenshots .ant-image {
overflow: hidden;
border: 1px solid #dbe3ee;
border-radius: 8px;
}
.collect-link-submitted-screenshots .ant-image-img {
object-fit: cover;
}
.collect-link-current-status {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
gap: 12px;
align-items: flex-start;
padding: 13px;
color: #475569;
background: #f8fafc;
border: 1px solid #e8edf4;
border-left: 4px solid #94a3b8;
border-radius: 9px;
}
.collect-link-current-status-index {
display: inline-flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
color: #ffffff;
font-size: 13px;
font-weight: 700;
background: #64748b;
border-radius: 999px;
}
.collect-link-current-status-copy {
display: grid;
gap: 5px;
min-width: 0;
}
.collect-link-current-status-copy > div {
display: flex;
flex-wrap: wrap;
gap: 3px 12px;
align-items: baseline;
justify-content: space-between;
}
.collect-link-current-status-copy > div .ant-typography:last-child {
font-size: 11px;
}
.collect-link-current-status-copy p {
margin: 0;
color: inherit;
font-size: 13px;
line-height: 1.7;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.collect-link-current-status.is-open,
.collect-link-current-status.is-pending_material {
color: #8a4b00;
background: #fffaf0;
border-color: #ffe7ba;
border-left-color: #faad14;
}
.collect-link-current-status.is-open .collect-link-current-status-index,
.collect-link-current-status.is-pending_material .collect-link-current-status-index {
background: #faad14;
}
.collect-link-current-status.is-in_progress,
.collect-link-current-status.is-unassigned {
color: #0958d9;
background: #f0f7ff;
border-color: #d6e8ff;
border-left-color: #1677ff;
}
.collect-link-current-status.is-in_progress .collect-link-current-status-index,
.collect-link-current-status.is-unassigned .collect-link-current-status-index {
background: #1677ff;
}
.collect-link-current-status.is-pending_acceptance {
color: #531dab;
background: #f9f0ff;
border-color: #efdbff;
border-left-color: #722ed1;
}
.collect-link-current-status.is-pending_acceptance .collect-link-current-status-index {
background: #722ed1;
}
.collect-link-current-status.is-accepted {
color: #237804;
background: #f6ffed;
border-color: #d9f7be;
border-left-color: #52c41a;
}
.collect-link-current-status.is-accepted .collect-link-current-status-index {
background: #52c41a;
}
.collect-link-current-status.is-problem {
color: #a8071a;
background: #fff1f0;
border-color: #ffccc7;
border-left-color: #ff4d4f;
}
.collect-link-current-status.is-problem .collect-link-current-status-index {
background: #ff4d4f;
}
.collect-link-status-message {
padding: 10px 12px;
color: #475569;
font-size: 13px;
line-height: 1.65;
background: #f8fafc;
border-left: 3px solid #94a3b8;
border-radius: 0 8px 8px 0;
}
.collect-link-status-message.is-open,
.collect-link-status-message.is-pending_material {
color: #8a4b00;
background: #fffaf0;
border-left-color: #faad14;
}
.collect-link-status-message.is-in_progress,
.collect-link-status-message.is-unassigned {
color: #0958d9;
background: #f0f7ff;
border-left-color: #1677ff;
}
.collect-link-status-message.is-pending_acceptance {
color: #531dab;
background: #f9f0ff;
border-left-color: #722ed1;
}
.collect-link-status-message.is-accepted {
color: #237804;
background: #f6ffed;
border-left-color: #52c41a;
}
.collect-link-status-message.is-problem {
color: #a8071a;
background: #fff1f0;
border-left-color: #ff4d4f;
}
.collect-link-status-times {
display: flex;
flex-wrap: wrap;
gap: 4px 18px;
color: #94a3b8;
font-size: 12px;
}
.collect-link-acceptance {
display: grid;
gap: 10px;
padding-top: 12px;
border-top: 1px solid #eef2f7;
}
.collect-link-acceptance > div:first-child {
display: flex;
align-items: baseline;
justify-content: space-between;
flex-wrap: wrap;
gap: 4px 12px;
}
.collect-link-acceptance > div:first-child .ant-typography:last-child {
font-size: 12px;
}
.collect-link-acceptance-images {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.collect-link-acceptance-images .ant-image {
overflow: hidden;
border: 1px solid #dbe3ee;
border-radius: 9px;
}
.collect-link-acceptance-images .ant-image-img {
object-fit: cover;
}
.collect-link-acceptance-video {
display: grid;
gap: 8px;
}
.collect-link-acceptance-video video {
width: min(100%, 520px);
max-height: 360px;
background: #0f172a;
border: 1px solid #dbe3ee;
border-radius: 10px;
}
.collect-link-acceptance-video > div {
display: flex;
flex-wrap: wrap;
gap: 4px 14px;
align-items: center;
justify-content: space-between;
font-size: 12px;
}
.collect-link-acceptance-video a {
color: #1677ff;
}
.collect-link-title {
margin: 0 0 4px !important;
}
.collect-link-heading {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
}
.collect-link-confirm {
display: grid;
gap: 12px;
max-height: 58vh;
padding-top: 4px;
padding-right: 4px;
overflow-y: auto;
}
.collect-link-confirm-meta {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 4px 16px;
color: #64748b;
font-size: 12px;
}
.collect-link-confirm-meta span:first-child {
color: #0f172a;
font-size: 14px;
font-weight: 600;
}
.collect-link-confirm-fields {
overflow: hidden;
border: 1px solid #e8edf4;
border-radius: 9px;
}
.collect-link-confirm-field {
display: grid;
grid-template-columns: 110px minmax(0, 1fr);
gap: 12px;
padding: 9px 12px;
font-size: 13px;
border-bottom: 1px solid #eef2f7;
}
.collect-link-confirm-field:last-child {
border-bottom: 0;
}
.collect-link-confirm-field span,
.collect-link-confirm-screenshots span {
color: #64748b;
}
.collect-link-confirm-field strong,
.collect-link-confirm-screenshots strong {
color: #0f172a;
font-weight: 500;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.collect-link-confirm-field strong.is-empty {
color: #94a3b8;
}
.collect-link-confirm-screenshots {
display: grid;
gap: 8px;
padding: 10px 12px;
font-size: 13px;
background: #f8fafc;
border-radius: 9px;
}
.collect-link-confirm-screenshots > div:first-child {
display: flex;
justify-content: space-between;
gap: 12px;
}
.collect-link-confirm-images {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.collect-link-confirm-images img {
width: 58px;
height: 58px;
object-fit: cover;
background: #ffffff;
border: 1px solid #dbe3ee;
border-radius: 8px;
}
.collect-link-confirm-content {
padding: 10px 12px;
color: #8a4b00;
font-size: 13px;
line-height: 1.7;
background: #fff7e6;
border: 1px solid #ffe7ba;
border-radius: 9px;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
/* 商品名与订单号放在同一个信息头里,避免标题和灰色信息块分离 */
.collect-link-order-head {
display: flex;
align-items: baseline;
justify-content: space-between;
flex-wrap: wrap;
gap: 6px 20px;
padding-bottom: 12px;
border-bottom: 1px solid #eef2f7;
}
.collect-link-order-name {
min-width: 0;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
color: #0f172a;
font-size: 16px;
font-weight: 700;
overflow-wrap: anywhere;
}
.collect-link-order-no {
min-width: 0;
display: flex;
align-items: baseline;
gap: 6px;
color: #64748b;
font-size: 12px;
}
.collect-link-order-no strong {
color: #0f172a;
font-size: 14px;
font-weight: 600;
overflow-wrap: anywhere;
}
.collect-link-state {
min-height: 220px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16px;
}
/* 提交成功:居中的成功状态,不再展示订单号 */
.collect-link-success {
min-height: 380px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
padding: 24px 12px 8px;
text-align: center;
}
.collect-link-success-icon {
font-size: 64px;
color: #22c55e;
filter: drop-shadow(0 10px 20px rgba(34, 197, 94, 0.18));
}
.collect-link-success-title {
margin: 2px 0 0 !important;
color: #0f172a;
}
.collect-link-success-products {
max-width: 100%;
margin-top: 10px;
padding: 12px 22px;
border: 1px solid #dcfce7;
border-radius: 12px;
background: #f0fdf4;
display: flex;
flex-direction: column;
gap: 4px;
}
.collect-link-success-products span {
color: #16a34a;
font-size: 12px;
}
.collect-link-success-products strong {
color: #166534;
font-size: 15px;
overflow-wrap: anywhere;
}
.collect-link-success .collect-link-footnote {
margin-top: 18px;
}
.collect-link-screenshot-control {
display: grid;
gap: 14px;
align-items: start;
}
.collect-link-screenshot-control.has-guide {
grid-template-columns: 120px minmax(180px, 260px);
gap: 16px;
}
.collect-link-guide-example {
display: grid;
grid-template-columns: 1fr;
gap: 6px;
min-width: 0;
max-width: 100%;
align-content: start;
justify-items: start;
}
.collect-link-guide-example .ant-image {
display: block;
width: 128px !important;
height: 88px !important;
overflow: hidden;
border: 1px solid #dbe3ee;
border-radius: 7px;
cursor: zoom-in;
}
.collect-link-guide-example .ant-image-img {
display: block;
width: 128px !important;
height: 88px !important;
object-fit: cover;
object-position: center;
}
.collect-link-guide-copy {
display: grid;
align-content: center;
gap: 3px;
min-width: 0;
}
.collect-link-guide-copy .ant-typography:first-child {
color: #334155;
font-size: 12px;
}
.collect-link-guide-copy .ant-typography:last-child {
max-width: 220px;
font-size: 11px;
line-height: 1.55;
white-space: pre-wrap;
}
.collect-link-actions {
display: flex;
justify-content: flex-end;
margin-top: 4px;
}
.collect-link-actions .ant-btn {
min-width: 180px;
}
.collect-link-footnote {
display: block;
text-align: center;
font-size: 12px;
white-space: pre-wrap;
}
@media (max-width: 720px) {
.collect-link-page {
padding: 14px;
}
.collect-link-card .ant-card-body {
padding: 18px;
}
.collect-link-screenshot-control.has-guide {
grid-template-columns: 112px minmax(160px, 220px);
gap: 12px;
}
.collect-link-guide-example .ant-image {
width: 116px !important;
height: 80px !important;
}
.collect-link-guide-example .ant-image-img {
width: 116px !important;
height: 80px !important;
}
.collect-link-actions {
justify-content: stretch;
}
.collect-link-actions .ant-btn {
width: 100%;
}
}
@media (max-width: 480px) {
.collect-link-page {
padding: 10px;
}
.collect-link-card .ant-card-body {
padding: 14px;
}
.collect-link-screenshot-control.has-guide {
grid-template-columns: 104px minmax(0, 1fr);
gap: 8px;
}
.collect-link-guide-example {
gap: 5px;
}
.collect-link-guide-example .ant-image {
width: 96px !important;
height: 68px !important;
}
.collect-link-guide-example .ant-image-img {
width: 96px !important;
height: 68px !important;
}
.collect-link-guide-copy .ant-typography:first-child {
font-size: 11px;
}
.collect-link-guide-copy .ant-typography:last-child {
font-size: 10px;
}
.collect-link-success {
min-height: 320px;
padding: 16px 4px 4px;
}
.collect-link-success-icon {
font-size: 52px;
}
.collect-link-success-products {
padding: 10px 16px;
}
.collect-link-confirm-field {
grid-template-columns: 88px minmax(0, 1fr);
padding: 8px 10px;
}
.collect-link-order-meta,
.collect-link-submitted-fields {
grid-template-columns: 1fr;
}
.collect-link-order-meta {
display: grid;
}
}
@@ -0,0 +1,25 @@
/* ===== 兑换中心 (Redeem Page) ===== */
.redeem-page {
min-height: 100vh;
display: grid;
place-items: center;
padding: 32px 16px;
background: #f5f7fb;
}
.redeem-card {
width: min(520px, 100%);
}
.redeem-order-input {
flex: 1;
margin-bottom: 0;
}
/* ===== H5 领取入口页(`/h5`,只有前缀没有订单号) ===== */
/* 复用领取页的卡片与背景,只把单卡在视口内垂直居中 */
.h5-claim-entry {
justify-content: center;
}
@@ -0,0 +1,177 @@
/* ===== 买家页面响应式断点 ===== */
@media (max-width: 720px) {
.claim-page {
padding: 14px;
}
.claim-header-card .ant-card-body,
.claim-content-card .ant-card-body {
gap: 14px;
}
.claim-header-copy {
padding-right: 150px;
}
.claim-header-copy h1 {
font-size: 24px;
line-height: 1.22;
}
.claim-header-copy p {
font-size: 14px;
line-height: 1.4;
}
.claim-step-indicator {
top: 16px;
right: 16px;
max-width: 140px;
}
.claim-step-dots {
gap: 5px;
}
.claim-step-dot {
width: 26px;
height: 26px;
font-size: 13px;
}
.claim-step-progress-text {
font-size: 12px;
}
.claim-info-grid {
grid-template-columns: 1fr;
}
.claim-qr-block {
padding: 12px;
}
.claim-qr-guide-panel {
grid-template-columns: 34px minmax(0, 1fr) 34px;
gap: 8px;
max-width: 100%;
}
.claim-scan-label {
min-height: 128px;
padding: 8px 4px;
font-size: 14px;
}
.claim-qr-code {
max-width: 232px;
padding: 8px;
}
.claim-save-hint {
font-size: 13px;
}
.claim-role-panel-item {
grid-template-columns: 76px minmax(0, 1fr);
gap: 10px;
}
.claim-role-panel-item span {
font-size: 12px;
}
.claim-role-panel-item strong {
font-size: 16px;
}
.claim-action-row {
display: flex;
flex-direction: column;
align-items: stretch;
}
.claim-action-row .ant-space-item,
.claim-action-row .ant-btn,
.claim-action-tooltip-wrap {
width: 100%;
}
.claim-meta-footer {
justify-content: flex-start;
}
.claim-result-header {
display: grid;
}
}
@media (max-width: 480px) {
.claim-page {
padding: 12px;
gap: 10px;
}
.claim-header-card .ant-card-body,
.claim-content-card .ant-card-body {
gap: 12px;
}
.claim-header-copy {
padding-right: 112px;
}
.claim-header-copy h1 {
font-size: 22px;
}
.claim-step-indicator {
position: absolute;
top: 16px;
right: 16px;
max-width: 100px;
align-items: flex-end;
}
.claim-step-dot {
width: 26px;
height: 26px;
font-size: 12px;
}
.claim-step-dots {
gap: 5px;
}
.claim-step-progress-text {
text-align: right;
font-size: 12px;
}
.claim-uid-step-title.ant-typography {
font-size: 18px !important;
}
.claim-uid-guide-image {
max-height: 140px;
}
}
@media (max-width: 420px) {
.claim-header-copy {
padding-right: 124px;
}
.claim-header-copy h1 {
font-size: 22px;
}
.claim-header-copy p {
padding-right: 0;
}
.claim-step-indicator {
max-width: 116px;
}
}
@@ -0,0 +1,349 @@
.customer-auth-tabs {
margin-top: 22px;
}
.customer-auth-tabs .ant-tabs-nav {
margin-bottom: 18px;
}
.customer-auth-tabs .ant-tabs-nav::before {
display: none;
}
.customer-auth-tabs .ant-tabs-nav-list {
width: 100%;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 5px;
padding: 5px;
border: 1px solid rgba(148, 163, 184, 0.18);
border-radius: 11px;
background: rgba(4, 15, 37, 0.72);
}
.customer-auth-tabs .ant-tabs-tab {
justify-content: center;
margin: 0 !important;
padding: 11px 18px;
color: var(--auth-muted);
background: transparent;
border: 0 !important;
border-radius: 7px;
}
.customer-auth-tabs .ant-tabs-tab.ant-tabs-tab-active {
background: var(--auth-accent);
}
.customer-auth-tabs .ant-tabs-tab-btn {
color: inherit !important;
font-size: 16px;
}
.customer-auth-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
color: #111827 !important;
font-weight: 700;
}
.customer-auth-tabs .ant-tabs-ink-bar {
display: none;
}
.customer-auth-form {
display: flex;
flex-direction: column;
gap: 14px;
padding-top: 18px;
}
.customer-auth-field {
display: grid;
align-items: center;
min-height: 50px;
overflow: hidden;
border: 1px solid rgba(148, 163, 184, 0.24);
border-radius: 10px;
background: rgba(13, 29, 61, 0.72);
transition:
border-color 0.2s ease,
box-shadow 0.2s ease;
}
.customer-auth-field:focus-within {
border-color: var(--auth-accent);
box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.12);
}
.customer-auth-field > * {
min-width: 0;
}
.customer-auth-phone-field {
grid-template-columns: 58px minmax(0, 1fr) 112px;
padding: 4px;
}
.customer-auth-code-field {
grid-template-columns: minmax(0, 1fr) 122px;
gap: 5px;
padding: 5px;
}
.customer-auth-field .ant-select-selector,
.customer-auth-field .ant-input,
.customer-auth-field .ant-input-affix-wrapper {
color: #f8fafc !important;
border: 0 !important;
border-radius: 0 !important;
background: transparent !important;
box-shadow: none !important;
}
.customer-auth-field .ant-select-selector {
height: 48px !important;
padding-inline: 14px !important;
align-items: center;
}
.customer-auth-field .ant-select {
height: 48px;
background: transparent !important;
}
.customer-auth-field .ant-select-selection-item {
color: #f8fafc !important;
line-height: 46px !important;
}
.customer-auth-field .ant-select-arrow {
color: #c4cede !important;
}
.customer-auth-country-prefix {
display: grid;
place-items: center;
align-self: stretch;
color: #f8fafc;
font-size: 14px;
font-weight: 600;
border-right: 1px solid var(--auth-line);
}
.customer-auth-field .ant-input-affix-wrapper {
height: 48px;
padding-inline: 15px;
}
.customer-auth-field .ant-input {
height: 48px;
padding-inline: 10px;
font-size: 15px;
}
.customer-auth-field .ant-input-affix-wrapper .ant-input {
padding-inline: 0;
}
.customer-auth-field .ant-input::placeholder {
color: #7f8ca5;
}
.customer-auth-field .ant-input-prefix {
margin-inline-end: 9px;
color: var(--auth-accent);
}
.customer-auth-send-code {
height: 40px !important;
padding-inline: 10px !important;
color: #111827;
border: 0 !important;
border-radius: 7px !important;
background: var(--auth-accent) !important;
font-size: 14px !important;
font-weight: 700;
}
.customer-auth-send-code:hover {
background: var(--auth-accent-hover) !important;
}
.customer-auth-code-submit {
height: 40px !important;
color: #111827;
border: 0 !important;
border-radius: 7px !important;
background: var(--auth-accent) !important;
font-weight: 700;
}
.customer-auth-code-submit:hover {
background: var(--auth-accent-hover) !important;
}
.customer-auth-note {
padding: 11px 14px;
color: #fbbf24;
font-size: 13px;
line-height: 1.6;
border: 1px solid rgba(251, 191, 36, 0.48);
border-radius: 4px;
background: rgba(251, 191, 36, 0.06);
}
.customer-auth-form-hint {
color: #7f8ca5;
font-size: 12px;
}
.customer-auth-page .ant-btn-primary {
color: #fff;
border-color: var(--auth-accent);
background: var(--auth-accent);
font-weight: 700;
box-shadow: none;
}
.customer-auth-page .ant-btn-primary:hover {
color: #fff !important;
border-color: var(--auth-accent-hover) !important;
background: var(--auth-accent-hover) !important;
}
.customer-auth-page .customer-auth-secondary-button {
color: #fff;
border-color: rgba(148, 163, 184, 0.42);
background: rgba(19, 39, 77, 0.52);
}
.customer-auth-page .customer-auth-secondary-button:hover {
color: #fff !important;
border-color: rgba(196, 210, 236, 0.72) !important;
background: rgba(31, 55, 102, 0.72) !important;
}
.customer-auth-qr {
display: flex;
flex-direction: column;
align-items: center;
gap: 13px;
padding-top: 22px;
text-align: center;
}
.customer-auth-qr > p {
margin: 0;
color: var(--auth-muted);
line-height: 1.7;
}
.customer-auth-qr-image,
.customer-auth-qr-placeholder {
display: grid;
place-items: center;
width: 252px;
min-height: 252px;
padding: 10px;
border-radius: 6px;
background: #fff;
}
.customer-auth-qr-placeholder {
color: #64748b;
font-size: 13px;
background: rgba(255, 255, 255, 0.94);
}
.customer-auth-role-card {
width: min(100%, 580px);
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: 4px 18px;
padding: 15px 18px;
text-align: left;
border: 1px solid rgba(255, 138, 0, 0.42);
border-radius: 5px;
background: rgba(255, 138, 0, 0.06);
}
.customer-auth-role-card span {
color: var(--auth-muted);
font-size: 13px;
}
.customer-auth-role-card strong {
justify-self: end;
color: #fff;
font-size: 17px;
}
.customer-auth-role-card small {
grid-column: 1 / -1;
color: var(--auth-muted);
font-size: 12px;
}
.customer-auth-binding {
display: flex;
flex-direction: column;
gap: 16px;
}
.customer-auth-binding-tip {
color: #ffb454;
font-size: 13px;
}
.customer-auth-profile {
padding: 16px;
border: 1px solid #3a4150;
border-radius: 12px;
background: #212733;
}
.customer-auth-profile-summary {
padding: 14px;
border: 1px solid rgba(255, 255, 255, 0.14);
border-radius: 6px;
background: rgba(255, 255, 255, 0.04);
}
.customer-auth-profile > p {
margin: 0 0 12px;
color: #9aa3b2;
font-size: 13px;
line-height: 1.6;
}
.customer-profile-form {
display: flex;
flex-direction: column;
gap: 12px;
}
.customer-profile-form .customer-collect-label {
margin-top: 2px;
}
.customer-auth-profile-summary {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 10px;
}
.customer-auth-profile-summary span {
color: var(--auth-muted);
font-size: 13px;
}
.customer-auth-profile-summary strong {
color: #fff;
font-size: 15px;
}
.customer-auth-profile-summary em {
color: var(--auth-muted);
font-style: normal;
font-size: 13px;
}
@@ -0,0 +1,10 @@
/** 客户领取页公共样式入口:平台差异见 platform/huya.css、platform/weibo.css、platform/douyu.css。 */
@import './layout.css';
@import './auth-form.css';
@import './profile.css';
@import './login.css';
@import './order.css';
@import './binding.css';
@import './status.css';
@import './responsive.css';
@@ -0,0 +1,453 @@
.customer-binding-stage {
display: flex;
flex-direction: column;
gap: 14px;
padding: 16px;
}
.customer-binding-session-card {
display: flex;
flex-direction: column;
gap: 10px;
padding: 18px;
border: 1px solid #78350f;
border-radius: 12px;
background: rgba(120, 53, 15, 0.22);
}
.customer-binding-session-title {
margin: 0;
color: #fbbf24;
font-size: 16px;
font-weight: 700;
}
.customer-binding-session-desc {
margin: 0 0 4px;
color: #fcd34d;
font-size: 13px;
line-height: 1.6;
}
.customer-binding-qr-error {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
padding: 24px 12px;
text-align: center;
}
.customer-binding-qr-error p {
margin: 0;
color: #fca5a5;
font-size: 15px;
font-weight: 600;
}
.customer-binding-qr-error span {
color: #cbd5e1;
font-size: 13px;
line-height: 1.6;
overflow-wrap: anywhere;
}
/* antd Alert 在绑定阶段统一走深色卡片,避免浅色块破坏整体深色风格 */
.customer-binding-stage .ant-alert {
align-items: flex-start;
padding: 12px 14px;
border: 1px solid #3a4150;
border-radius: 12px;
background: #212733;
}
.customer-binding-stage .ant-alert .ant-alert-message {
color: #e2e8f0;
font-size: 14px;
font-weight: 600;
}
/* antd v6 的标题节点是 .ant-alert-title(v5 为 .ant-alert-message) */
.customer-binding-stage .ant-alert .ant-alert-title {
color: #e2e8f0;
font-size: 14px;
font-weight: 600;
line-height: 1.5;
}
.customer-binding-stage .ant-alert .ant-alert-description {
color: #cbd5e1;
font-size: 13px;
line-height: 1.6;
}
.customer-binding-stage .ant-alert-warning {
border-color: #78350f;
background: rgba(120, 53, 15, 0.22);
}
.customer-binding-stage .ant-alert-warning .ant-alert-icon,
.customer-binding-stage .ant-alert-warning .ant-alert-message,
.customer-binding-stage .ant-alert-warning .ant-alert-title {
color: #fbbf24;
}
.customer-binding-stage .ant-alert-warning .ant-alert-description {
color: #fcd34d;
}
.customer-binding-stage .ant-alert-error {
border-color: #7f1d1d;
background: rgba(127, 29, 29, 0.24);
}
.customer-binding-stage .ant-alert-error .ant-alert-icon,
.customer-binding-stage .ant-alert-error .ant-alert-message,
.customer-binding-stage .ant-alert-error .ant-alert-title {
color: #fca5a5;
}
.customer-binding-stage .ant-alert-error .ant-alert-description {
color: #fecaca;
}
.customer-binding-stage .ant-alert-success {
border-color: #065f46;
background: rgba(6, 78, 59, 0.28);
}
.customer-binding-stage .ant-alert-success .ant-alert-icon,
.customer-binding-stage .ant-alert-success .ant-alert-message,
.customer-binding-stage .ant-alert-success .ant-alert-title {
color: #6ee7b7;
}
.customer-binding-stage .ant-alert-success .ant-alert-description {
color: #a7f3d0;
}
.customer-binding-role-actions {
display: flex;
flex-direction: column;
gap: 12px;
width: 100%;
}
.customer-binding-role-actions .customer-binding-confirm.ant-btn {
height: 52px;
border-radius: 14px;
background: #2563eb !important;
border-color: #2563eb !important;
color: #fff !important;
font-size: 17px;
font-weight: 600;
}
.customer-binding-role-actions .customer-binding-confirm.ant-btn:hover,
.customer-binding-role-actions .customer-binding-confirm.ant-btn:focus-visible {
background: #1d4ed8 !important;
border-color: #1d4ed8 !important;
color: #fff !important;
}
.customer-binding-role-actions .customer-binding-rebind.ant-btn {
height: 48px;
border-radius: 14px;
background: transparent !important;
border-color: #3a4150 !important;
color: #cbd5e1 !important;
font-size: 16px;
font-weight: 500;
}
.customer-binding-role-actions .customer-binding-rebind.ant-btn .anticon {
color: #f59e0b;
}
.customer-binding-role-actions .customer-binding-rebind.ant-btn:hover,
.customer-binding-role-actions .customer-binding-rebind.ant-btn:focus-visible {
background: rgba(245, 158, 11, 0.08) !important;
border-color: #b45309 !important;
color: #fbbf24 !important;
}
.customer-binding-role-actions .customer-binding-accept.ant-btn {
height: 46px;
border-radius: 12px;
background: transparent !important;
border-color: transparent !important;
color: #94a3b8 !important;
font-size: 15px;
font-weight: 500;
}
.customer-binding-role-actions .customer-binding-accept.ant-btn:hover,
.customer-binding-role-actions .customer-binding-accept.ant-btn:focus-visible {
background: rgba(148, 163, 184, 0.1) !important;
border-color: transparent !important;
color: #e2e8f0 !important;
}
.customer-binding-info {
padding: 16px;
border: 1px solid #3a4150;
border-radius: 12px;
background: #212733;
display: flex;
flex-direction: column;
gap: 10px;
}
.customer-binding-info h3 {
margin: 0 0 4px;
color: #9aa3b2;
font-size: 13px;
font-weight: 500;
}
.customer-binding-info h3 small {
color: #64748b;
font-weight: 400;
}
.customer-binding-info > div {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
color: #cbd5e1;
font-size: 14px;
line-height: 1.5;
}
.customer-binding-info > div > span {
flex: 0 0 auto;
white-space: nowrap;
}
.customer-binding-info > div strong {
flex: 1 1 auto;
min-width: 0;
color: #fff;
text-align: right;
overflow-wrap: anywhere;
}
.customer-binding-alert {
padding: 12px 14px;
border-radius: 8px;
border: 1px solid transparent;
font-size: 14px;
}
.customer-binding-alert.is-warning {
color: #fbbf24;
border-color: #78350f;
background: rgba(120, 53, 15, 0.25);
}
.customer-binding-alert.is-info {
color: #93c5fd;
border-color: #1e3a8a;
background: rgba(30, 58, 138, 0.3);
}
.customer-binding-verify {
padding: 18px;
border: 1px solid #3a4150;
border-radius: 12px;
background: transparent;
display: flex;
flex-direction: column;
gap: 16px;
text-align: center;
}
.customer-binding-verify p {
margin: 0;
color: #e5e7eb;
font-size: 16px;
line-height: 1.6;
}
.customer-binding-qr-card {
padding: 18px;
border-radius: 12px;
background: #fff;
color: #111827;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
.customer-binding-qr-card h3 {
margin: 0;
color: #6b7280;
font-size: 14px;
font-weight: 500;
}
.customer-binding-qr-hint {
margin: 0;
color: #6b7280;
font-size: 13px;
}
.customer-binding-qr-tip {
margin: 0;
color: #f59e0b;
font-size: 13px;
}
.customer-binding-qr-countdown {
margin: 0;
color: #6b7280;
font-size: 13px;
}
.customer-binding-qr-actions {
width: 100%;
margin-top: 4px;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.customer-binding-qr-actions .ant-btn {
height: 40px;
border-radius: 8px;
}
/* 斗鱼客户领取页沿用后台深色二维码面板,避免大块纯白卡片刺眼。 */
.customer-choice-switch {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 3px;
padding: 3px;
overflow: hidden;
border: 1px solid #354052;
border-radius: 10px;
background: #171d27;
}
.customer-choice-option {
height: 42px;
min-width: 0;
padding: 0 10px;
color: #aeb8c8;
border: 0;
border-radius: 8px;
outline: none;
background: transparent;
font: inherit;
font-size: 14px;
cursor: pointer;
transition: color 100ms ease;
}
.customer-choice-option:hover {
color: #e2e8f0;
background: #242c39;
}
.customer-choice-option.is-selected {
color: #fff;
background: #2f6fed;
font-weight: 700;
}
.customer-choice-option:focus-visible {
outline: 2px solid #60a5fa;
outline-offset: 2px;
}
.customer-binding-next.ant-btn {
width: 100%;
height: 52px;
margin-top: 6px;
border-radius: 14px;
background: #2563eb !important;
border-color: #2563eb !important;
color: #fff !important;
font-size: 17px;
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);
}
}
@@ -0,0 +1,240 @@
/** 客户领取页公共样式:布局、表单、登录、订单、角色绑定与状态。 */
/**
* 客户领取页样式
*
* 覆盖虎牙、微博、斗鱼客户领取、资料收集、角色绑定与二维码阶段。
* 从 client.css 拆分,保持原选择器和层叠顺序不变。
*/
.customer-auth-page {
--auth-accent: #2f6fed;
--auth-accent-hover: #4a83ff;
--auth-panel: #232936;
--auth-panel-soft: #2a3140;
--auth-line: rgba(255, 255, 255, 0.08);
--auth-text: #f5f7fa;
--auth-muted: #9aa3b2;
min-height: 100vh;
display: flex;
justify-content: center;
overflow-x: hidden;
padding: 0;
color: var(--auth-text);
background: #232936;
}
.customer-auth-shell {
width: min(560px, 100%);
min-width: 0;
align-self: stretch;
overflow: hidden;
border: none;
border-radius: 0;
background: transparent;
box-shadow: none;
}
.customer-auth-hero {
position: relative;
min-height: clamp(112px, 15vw, 136px);
display: flex;
align-items: flex-end;
justify-content: flex-start;
padding: 12px 20px 14px;
overflow: hidden;
text-align: left;
background-color: #0b1220;
background-image:
linear-gradient(180deg, rgba(11, 18, 32, 0.06) 0%, rgba(11, 18, 32, 0.62) 72%, #232936 100%),
url('/images/customer/inside-kv.jpg');
background-repeat: no-repeat;
background-position: center 38%;
background-size: cover;
}
/* 微博与虎牙客户页统一使用同一套顶部 KV,不再单独覆盖背景。 */
.customer-auth-brand {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-start;
gap: 0;
min-width: 0;
}
.customer-auth-logo {
width: 62px;
height: 62px;
flex: none;
display: grid;
place-items: center;
border: 1px solid rgba(255, 255, 255, 0.22);
border-radius: 8px;
color: var(--auth-accent);
font-size: 34px;
background: rgba(3, 12, 34, 0.58);
box-shadow: inset 0 0 24px rgba(255, 138, 0, 0.06);
}
.customer-auth-brand h1 {
margin: 0;
color: #fff;
font-size: 20px;
line-height: 1.4;
font-weight: 700;
letter-spacing: 0;
text-align: left;
text-shadow: 0 2px 12px rgba(0, 0, 0, 0.72);
white-space: normal;
overflow-wrap: anywhere;
}
.customer-auth-warning {
padding: 6px 16px 10px;
color: #ff6975;
text-align: center;
font-size: 14px;
font-weight: 600;
background: transparent;
border-bottom: none;
}
.customer-auth-main {
min-width: 0;
padding-bottom: 24px;
color: var(--auth-text);
background: transparent;
}
.customer-auth-content-stack {
min-width: 0;
display: flex;
flex-direction: column;
}
.customer-auth-task-switcher {
display: flex;
align-items: flex-start;
gap: 16px;
padding: 20px 24px;
border-bottom: 1px solid var(--auth-line);
}
.customer-auth-task-switcher > span {
flex: none;
padding-top: 5px;
color: var(--auth-muted);
font-size: 13px;
}
.customer-auth-task-switcher > div {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.customer-auth-task-switcher .ant-btn {
height: auto;
padding: 6px 10px;
color: #dce6f8;
white-space: normal;
text-align: left;
border-color: rgba(255, 255, 255, 0.16);
background: rgba(255, 255, 255, 0.04);
}
.customer-auth-task-switcher .ant-btn-primary {
color: #111827;
border-color: var(--auth-accent);
}
.customer-auth-facts {
min-width: 0;
padding: 0 26px;
}
.customer-auth-facts > div {
display: grid;
grid-template-columns: 132px minmax(0, 1fr);
align-items: center;
gap: 18px;
min-height: 74px;
padding: 16px 4px;
border-bottom: 1px solid var(--auth-line);
}
.customer-auth-facts > div > span {
color: #c0c8d8;
font-size: 16px;
}
.customer-auth-facts > div > strong {
min-width: 0;
justify-self: end;
color: #f8fafc;
font-size: 18px;
line-height: 1.5;
font-weight: 600;
text-align: right;
word-break: break-all;
overflow-wrap: anywhere;
}
.customer-auth-section {
min-width: 0;
padding: 16px;
border-bottom: none;
}
.customer-auth-section-heading {
display: flex;
align-items: flex-start;
gap: 14px;
}
.customer-auth-section-icon {
width: 36px;
height: 36px;
flex: none;
display: grid;
place-items: center;
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 8px;
color: var(--auth-accent);
font-size: 18px;
background: rgba(255, 255, 255, 0.035);
}
.customer-auth-section-heading h2,
.customer-auth-state h2 {
margin: 0 0 6px;
color: #fff;
font-size: 18px;
line-height: 1.4;
font-weight: 700;
}
.customer-auth-section-heading p,
.customer-auth-state p,
.customer-auth-form-copy {
margin: 0;
color: var(--auth-muted);
font-size: 15px;
line-height: 1.75;
}
.customer-auth-section-copy h2 {
margin: 0 0 8px;
color: #fff;
font-size: 23px;
line-height: 1.35;
font-weight: 700;
}
.customer-auth-section-copy p {
margin: 0;
color: var(--auth-muted);
font-size: 15px;
line-height: 1.75;
}
@@ -0,0 +1,87 @@
/* 登录与绑定页(图 2-10) */
.customer-login-form {
display: flex;
flex-direction: column;
gap: 12px;
}
.customer-login-hint {
margin: 0 0 2px;
color: #d5dae3;
font-size: 16px;
line-height: 1.5;
}
.customer-login-mobile-row {
display: flex;
align-items: stretch;
gap: 12px;
}
.customer-login-mobile.ant-input {
flex: 1;
min-width: 0;
height: 48px;
padding: 0 16px;
border-radius: 8px;
border-color: #3a4150;
background: #1b2130;
color: #fff;
font-size: 15px;
}
.customer-login-mobile.ant-input::placeholder {
color: #6b7482;
}
.customer-login-code-button.ant-btn {
flex: none;
width: 118px;
height: 48px;
border-radius: 8px;
background: #3b82f6 !important;
border-color: #3b82f6 !important;
color: #fff !important;
font-size: 16px;
}
.customer-login-code-input.ant-input {
height: 48px;
border-radius: 8px;
border-color: #3a4150;
background: #1b2130;
color: #fff;
text-align: center;
font-size: 15px;
letter-spacing: 6px;
}
.customer-login-code-input.ant-input::placeholder {
color: #6b7482;
}
.customer-login-submit.ant-btn {
height: 52px;
border-radius: 14px;
background: #2563eb !important;
border-color: #2563eb !important;
color: #fff !important;
font-size: 17px;
font-weight: 600;
}
.customer-login-submit.ant-btn:hover,
.customer-login-submit.ant-btn:focus-visible {
background: #1d4ed8 !important;
border-color: #1d4ed8 !important;
color: #fff !important;
}
.customer-login-alt.ant-btn {
height: 48px;
border-radius: 8px;
background: transparent !important;
border-color: #3a4150 !important;
color: #cbd5e1 !important;
font-size: 16px;
}
@@ -0,0 +1,240 @@
/* ==========================================================================
客户履约页(半自动)固定移动端 + 窄屏自适应
--------------------------------------------------------------------------
全局 base.css 给 body 设了 min-width:320px,worker.css 又用 overflow-x:hidden
裁掉横向溢出。应用内浏览器 / 分屏 / 系统显示放大时实际视口可能小于 320px,
页面右侧(输入框、商品值、提示文案)会被直接裁掉。
下面只作用于客户履约页(body.customer-mobile-body),不影响后台与打手端。
========================================================================== */
html.customer-mobile-html,
body.customer-mobile-body {
min-width: 0;
width: 100%;
max-width: 100%;
overflow-x: hidden;
}
body.customer-mobile-body #root {
width: 100%;
min-width: 0;
max-width: 100%;
}
body.customer-mobile-body .customer-collect-page,
body.customer-mobile-body .customer-auth-page {
width: 100%;
min-width: 0;
max-width: 100%;
min-height: 100vh;
min-height: 100dvh;
overflow-x: hidden;
}
body.customer-mobile-body .customer-collect-hero {
width: min(480px, 100%);
margin: 0 auto;
}
body.customer-mobile-body .customer-collect-body {
width: 100%;
max-width: 480px;
margin: 0 auto;
padding: 20px clamp(12px, 4vw, 20px) calc(40px + env(safe-area-inset-bottom));
padding-left: max(clamp(12px, 4vw, 20px), env(safe-area-inset-left));
padding-right: max(clamp(12px, 4vw, 20px), env(safe-area-inset-right));
gap: 10px;
}
body.customer-mobile-body .customer-auth-shell {
width: min(480px, 100%);
min-width: 0;
}
body.customer-mobile-body .customer-auth-main {
padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
body.customer-mobile-body .customer-auth-content-stack,
body.customer-mobile-body .customer-auth-section,
body.customer-mobile-body .customer-auth-facts,
body.customer-mobile-body .customer-auth-facts > div,
body.customer-mobile-body .customer-auth-task-switcher,
body.customer-mobile-body .customer-login-form,
body.customer-mobile-body .customer-collect-card,
body.customer-mobile-body .customer-order-card {
min-width: 0;
}
body.customer-mobile-body .customer-collect-card,
body.customer-mobile-body .customer-collect-readonly,
body.customer-mobile-body .customer-collect-input.ant-input,
body.customer-mobile-body .customer-collect-select.ant-select,
body.customer-mobile-body .customer-login-mobile.ant-input,
body.customer-mobile-body .customer-login-code-input.ant-input,
body.customer-mobile-body .customer-login-submit.ant-btn,
body.customer-mobile-body .customer-login-alt.ant-btn {
width: 100%;
min-width: 0;
max-width: 100%;
}
/* 订单卡片自带左右 16px 外边距,不能用 width:100% 再加边距 */
body.customer-mobile-body .customer-order-card {
width: auto;
max-width: 100%;
}
body.customer-mobile-body .customer-collect-card > div,
body.customer-mobile-body .customer-order-card > div {
flex-wrap: wrap;
}
body.customer-mobile-body .customer-collect-card > div strong,
body.customer-mobile-body .customer-order-card > div strong {
flex: 1 1 10ch;
min-width: 0;
overflow-wrap: anywhere;
word-break: break-word;
}
/* 状态胶囊保持自身宽度,不参与长值换行规则 */
body.customer-mobile-body .customer-order-card > div strong.customer-order-status {
flex: 0 0 auto;
max-width: 100%;
text-align: center;
}
body.customer-mobile-body .customer-collect-readonly {
overflow-wrap: anywhere;
word-break: break-all;
}
body.customer-mobile-body .customer-collect-card > p {
overflow-wrap: anywhere;
word-break: break-word;
}
body.customer-mobile-body .customer-login-form,
body.customer-mobile-body .customer-login-mobile-row,
body.customer-mobile-body .customer-login-code-input.ant-input {
min-width: 0;
}
body.customer-mobile-body .customer-auth-role-card,
body.customer-mobile-body .customer-auth-button-stack {
width: 100%;
}
/* 登录/绑定二维码:容器与图片都不超过可用宽度,避免 232/252/260px 固定宽溢出 */
body.customer-mobile-body .customer-auth-qr-image,
body.customer-mobile-body .customer-auth-qr-placeholder {
width: min(252px, 100%);
min-height: 0;
aspect-ratio: 1;
}
body.customer-mobile-body .customer-auth-qr-image .ant-image,
body.customer-mobile-body .customer-auth-qr-image img,
body.customer-mobile-body .customer-binding-qr-card .ant-image,
body.customer-mobile-body .customer-binding-qr-card img {
max-width: 100%;
height: auto;
}
/* 固定宽度弹窗(绑定确认 520 / 虎牙验证 430)在窄屏必须收到视口内 */
@media (max-width: 640px) {
.customer-binding-modal,
.customer-huya-challenge-modal {
width: calc(100vw - 24px) !important;
max-width: 480px;
margin: 0 auto;
}
.customer-binding-modal .ant-modal-content,
.customer-huya-challenge-modal .ant-modal-content {
max-height: calc(100vh - 32px);
overflow-y: auto;
}
}
@media (max-width: 380px) {
body.customer-mobile-body .customer-binding-qr-actions,
body.customer-mobile-body .customer-binding-modal-actions {
grid-template-columns: minmax(0, 1fr);
}
}
@media (max-width: 340px) {
body.customer-mobile-body .customer-collect-body {
padding-inline: 12px;
}
/* 标签 + 长值改为上下排列,值不再被挤到屏幕外 */
body.customer-mobile-body .customer-collect-card > div,
body.customer-mobile-body .customer-order-card > div {
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
body.customer-mobile-body .customer-collect-card > div strong,
body.customer-mobile-body .customer-order-card > div strong {
flex: 0 1 auto;
max-width: 100%;
justify-self: start;
text-align: left;
}
body.customer-mobile-body .customer-order-card > div strong.customer-order-status {
flex: 0 0 auto;
text-align: center;
}
body.customer-mobile-body .customer-collect-card > p {
text-align: left;
}
body.customer-mobile-body .customer-login-mobile-row {
flex-direction: column;
gap: 10px;
}
body.customer-mobile-body .customer-login-code-button.ant-btn {
width: 100%;
}
body.customer-mobile-body .customer-auth-task-switcher {
flex-direction: column;
gap: 8px;
padding: 16px;
}
body.customer-mobile-body .customer-auth-task-switcher > span {
padding-top: 0;
}
body.customer-mobile-body .customer-auth-facts {
padding-inline: 12px;
}
body.customer-mobile-body .customer-auth-facts > div {
grid-template-columns: minmax(0, 1fr);
gap: 4px;
min-height: 0;
padding-block: 12px;
}
body.customer-mobile-body .customer-auth-facts > div > strong {
justify-self: start;
text-align: left;
}
body.customer-mobile-body .customer-auth-state {
padding: 32px 16px;
}
body.customer-mobile-body .customer-auth-privacy {
margin-inline: 16px;
}
}
@@ -0,0 +1,53 @@
.customer-order-card {
margin: 10px 16px 0;
padding: 16px;
border: 1px solid #3a4150;
border-radius: 12px;
background: #212733;
display: flex;
flex-direction: column;
gap: 10px;
}
.customer-order-card h3 {
margin: 0 0 4px;
color: #94a3b8;
font-size: 13px;
font-weight: 500;
}
.customer-order-card > div {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
color: #cbd5e1;
font-size: 14px;
line-height: 1.5;
}
.customer-order-card > div > span {
flex: 0 0 auto;
white-space: nowrap;
color: #9aa3b2;
}
.customer-order-card > div strong {
flex: 1 1 auto;
min-width: 0;
color: #fff;
text-align: right;
overflow-wrap: anywhere;
}
.customer-order-card > div strong.customer-order-status {
flex: 0 0 auto;
padding: 3px 12px;
border: 1px solid rgba(96, 165, 250, 0.38);
border-radius: 999px;
color: #dbeafe;
font-size: 13px;
font-weight: 600;
text-align: center;
background: rgba(47, 111, 237, 0.28);
}
@@ -0,0 +1,563 @@
/** 斗鱼客户领取页平台差异样式。 */
.customer-auth-page.is-douyu .customer-binding-qr-card {
padding: 18px;
color: var(--auth-text);
border: 1px solid #3a4150;
border-radius: 14px;
background: #202631;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.customer-auth-page.is-douyu .customer-binding-qr-card h3 {
color: #d7dee9;
font-size: 15px;
font-weight: 600;
}
.customer-auth-page.is-douyu .customer-binding-qr-code {
width: min(100%, 292px);
aspect-ratio: 1;
display: grid;
place-items: center;
padding: 14px;
overflow: hidden;
border: 1px solid #4a5262;
border-radius: 12px;
background: #e8ebef;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}
.customer-auth-page.is-douyu .customer-binding-qr-code .ant-image,
.customer-auth-page.is-douyu .customer-binding-qr-code img {
width: 100%;
height: 100%;
display: block;
border-radius: 7px;
}
.customer-auth-page.is-douyu .customer-auth-qr-placeholder {
width: 100%;
min-height: 100%;
color: #8f9aab;
border: 1px dashed #485162;
border-radius: 9px;
background: #171c24;
}
.customer-auth-page.is-douyu .customer-binding-qr-hint {
max-width: 340px;
color: #b8c1cf;
font-size: 13px;
line-height: 1.6;
text-align: center;
}
.customer-auth-page.is-douyu .customer-binding-qr-countdown {
color: #cbd5e1;
font-variant-numeric: tabular-nums;
}
.customer-auth-page.is-douyu .customer-binding-qr-card .ant-progress {
width: min(100%, 292px);
}
.customer-auth-page.is-douyu .customer-binding-qr-card .ant-progress-inner {
background: #353d4b;
}
.customer-auth-page.is-douyu .customer-binding-qr-card .ant-progress-bg {
background: #f59e0b;
}
.customer-auth-page.is-douyu .customer-binding-qr-actions .ant-btn {
color: #e2e8f0;
border-color: #465063;
background: #2a313d;
box-shadow: none;
}
.customer-auth-page.is-douyu .customer-binding-qr-actions .ant-btn:hover,
.customer-auth-page.is-douyu .customer-binding-qr-actions .ant-btn:focus-visible {
color: #fff;
border-color: #657186;
background: #343c4a;
}
.customer-auth-page.is-douyu .customer-binding-qr-toggle.ant-btn {
align-self: flex-end;
height: 34px;
padding-inline: 12px;
color: #b8c1cf;
border-color: #3f495a;
border-radius: 8px;
background: transparent;
font-size: 13px;
box-shadow: none;
}
.customer-auth-page.is-douyu .customer-binding-qr-toggle.ant-btn:hover,
.customer-auth-page.is-douyu .customer-binding-qr-toggle.ant-btn:focus-visible {
color: #fff;
border-color: #64748b;
background: #2a313d;
}
.customer-auth-page.is-douyu .customer-auth-hero {
min-height: 148px;
align-items: flex-end;
justify-content: center;
padding: 0 16px 18px;
background-color: #111827;
background-image:
linear-gradient(180deg, rgba(11, 18, 32, 0.08) 0%, rgba(11, 18, 32, 0.56) 68%, #232936 100%),
url('/images/customer/inside-kv.jpg');
background-repeat: no-repeat;
background-position: center 38%;
background-size: cover;
}
.customer-auth-page.is-douyu .customer-auth-brand {
width: auto;
align-items: flex-end;
justify-content: center;
}
.customer-auth-page.is-douyu .customer-auth-brand h1 {
font-size: 16px;
line-height: 1.4;
text-align: center;
text-shadow: 0 2px 12px rgba(0, 0, 0, 0.82);
}
.customer-auth-page.is-douyu .customer-auth-warning {
padding-top: 12px;
}
.customer-auth-page.is-douyu .customer-order-closed-alert.ant-alert {
align-items: flex-start;
margin: 10px 16px 0;
padding: 12px 14px;
color: #f6c66f;
border: 1px solid #6b4d1f;
border-radius: 10px;
background: #2a2418;
}
.customer-auth-page.is-douyu .customer-order-closed-alert .ant-alert-icon {
margin-top: 2px;
color: #f6ad3c;
font-size: 16px;
}
.customer-auth-page.is-douyu .customer-order-closed-alert .ant-alert-message,
.customer-auth-page.is-douyu .customer-order-closed-alert .ant-alert-title {
color: #f7d394;
font-size: 14px;
font-weight: 600;
line-height: 1.4;
}
.customer-auth-page.is-douyu .customer-order-closed-alert .ant-alert-description {
margin-top: 3px;
color: #d8c39b;
font-size: 13px;
line-height: 1.5;
}
.customer-auth-page.is-douyu .customer-douyu-order-card {
padding: 0;
overflow: hidden;
gap: 0;
border-radius: 12px;
background: #202631;
}
.customer-auth-page.is-douyu .customer-douyu-order-head {
align-items: center;
gap: 12px;
padding: 13px 16px;
border-bottom: 1px solid #343d4c;
}
.customer-auth-page.is-douyu .customer-douyu-order-head h3 {
margin: 0;
color: #9aa3b2;
font-size: 13px;
font-weight: 600;
}
.customer-auth-page.is-douyu .customer-douyu-order-field {
display: grid;
grid-template-columns: 72px minmax(0, 1fr);
align-items: start;
gap: 12px;
padding: 11px 16px;
border-bottom: 1px solid #343d4c;
}
.customer-auth-page.is-douyu .customer-douyu-order-field:last-child {
border-bottom: 0;
}
.customer-auth-page.is-douyu .customer-douyu-order-field > span {
color: #8f9aaa;
font-size: 13px;
line-height: 1.5;
}
.customer-auth-page.is-douyu .customer-douyu-order-field > strong {
min-width: 0;
color: #f1f5f9;
font-size: 14px;
font-weight: 600;
line-height: 1.5;
text-align: right;
overflow-wrap: anywhere;
}
.customer-auth-page.is-douyu .customer-douyu-order-status {
flex: 0 0 auto;
padding: 2px 10px;
border-color: rgba(96, 165, 250, 0.36);
color: #dbeafe;
font-size: 12px;
font-weight: 600;
background: rgba(47, 111, 237, 0.22);
}
.customer-auth-page.is-douyu .customer-douyu-order-status.is-cancelled {
border-color: rgba(245, 158, 11, 0.38);
color: #f8d28a;
background: rgba(245, 158, 11, 0.14);
}
.customer-auth-page.is-douyu .customer-douyu-order-status.is-completed {
border-color: rgba(52, 211, 153, 0.38);
color: #a7f3d0;
background: rgba(6, 95, 70, 0.24);
}
.customer-auth-page.is-douyu .customer-douyu-order-status.is-failed {
border-color: rgba(248, 113, 113, 0.38);
color: #fecaca;
background: rgba(127, 29, 29, 0.24);
}
.customer-douyu-qr-main {
width: 100%;
display: grid;
grid-template-columns: 30px minmax(0, 220px) 30px;
align-items: stretch;
justify-content: center;
gap: 7px;
}
.customer-douyu-qr-rail {
display: flex;
align-items: center;
justify-content: center;
min-height: 0;
padding: 0;
color: #ff5a67;
font-size: 12px;
font-weight: 800;
line-height: 1.05;
letter-spacing: 1px;
text-align: center;
writing-mode: vertical-rl;
text-orientation: upright;
background: none;
}
.customer-auth-page.is-douyu .customer-douyu-qr-main .customer-binding-qr-code {
width: 100%;
max-width: none;
padding: 10px;
}
.customer-auth-page.is-douyu .customer-douyu-qr-preparing {
position: relative;
width: 100%;
height: 100%;
min-height: 100%;
display: grid;
place-items: center;
overflow: hidden;
border-radius: 7px;
background: #171c24;
}
.customer-auth-page.is-douyu .customer-douyu-qr-skeleton {
position: absolute;
inset: 18px;
opacity: 0.16;
background-image:
linear-gradient(90deg, #9fb1ca 50%, transparent 50%),
linear-gradient(#9fb1ca 50%, transparent 50%);
background-position:
0 0,
0 0;
background-size:
18px 18px,
18px 18px;
-webkit-mask-image: linear-gradient(135deg, #000 12%, transparent 82%);
mask-image: linear-gradient(135deg, #000 12%, transparent 82%);
}
.customer-auth-page.is-douyu .customer-douyu-qr-preparing-copy {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
color: #b8c1cf;
text-align: center;
}
.customer-auth-page.is-douyu .customer-douyu-qr-preparing-copy strong {
color: #e2e8f0;
font-size: 14px;
font-weight: 600;
}
.customer-auth-page.is-douyu .customer-douyu-qr-preparing-copy span {
color: #8f9aaa;
font-size: 12px;
}
.customer-auth-page.is-douyu .customer-douyu-preparing-button.ant-btn {
color: #e2e8f0;
border-color: #465063;
background: #2a313d;
box-shadow: none;
}
.customer-auth-page.is-douyu .customer-douyu-preparing-button.ant-btn:hover,
.customer-auth-page.is-douyu .customer-douyu-preparing-button.ant-btn:focus-visible {
color: #fff;
border-color: #657186;
background: #343c4a;
}
.customer-auth-page.is-douyu .customer-binding-qr-actions.is-single {
grid-template-columns: minmax(0, 1fr);
}
.customer-auth-page.is-douyu .customer-binding-qr-actions .ant-btn:disabled {
color: #7d8797;
border-color: #394353;
background: #252c37;
opacity: 1;
}
.customer-auth-page.is-douyu .customer-binding-qr-countdown.is-expired {
color: #ff7a84;
font-weight: 700;
}
.customer-auth-page.is-douyu .customer-douyu-qr-refresh-note {
margin: -2px 0 0;
color: #8f9aaa;
font-size: 11px;
line-height: 1.4;
text-align: center;
}
.customer-auth-page.is-douyu .customer-douyu-binding-alert.is-wechat {
border-color: rgba(248, 113, 113, 0.34);
background: linear-gradient(135deg, rgba(127, 29, 29, 0.26), rgba(32, 38, 49, 0.9));
}
.customer-auth-page.is-douyu .customer-douyu-binding-alert.is-wechat .ant-alert-icon,
.customer-auth-page.is-douyu .customer-douyu-binding-alert.is-wechat .ant-alert-message,
.customer-auth-page.is-douyu .customer-douyu-binding-alert.is-wechat .ant-alert-title {
color: #ff8a92;
}
.customer-douyu-binding-failure {
display: flex;
flex-direction: column;
gap: 10px;
}
.customer-douyu-binding-failure > p {
margin: 0;
padding: 12px 14px;
color: #fecaca;
font-size: 13px;
line-height: 1.6;
text-align: center;
border: 1px solid rgba(248, 113, 113, 0.3);
border-radius: 10px;
background: rgba(127, 29, 29, 0.18);
}
.customer-auth-page.is-douyu.is-compact {
height: 100vh;
height: 100dvh;
min-height: 0;
overflow: hidden;
}
.customer-auth-page.is-douyu.is-compact .customer-auth-shell {
height: 100%;
display: flex;
flex-direction: column;
}
.customer-auth-page.is-douyu.is-compact .customer-auth-hero {
min-height: 148px;
padding: 0 16px 18px;
background-position: center 34%;
}
.customer-auth-page.is-douyu.is-compact .customer-auth-warning {
padding: 8px 16px 12px;
font-size: 14px;
}
.customer-auth-page.is-douyu.is-compact .customer-auth-main {
display: flex;
flex-direction: column;
flex: 1 1 auto;
min-height: 0;
padding-bottom: 0;
overflow: hidden;
}
.customer-auth-page.is-douyu.is-compact .customer-douyu-order-card {
flex: none;
margin: 10px 16px 0;
}
.customer-auth-page.is-douyu.is-compact .customer-douyu-order-head {
padding: 13px 16px;
}
.customer-auth-page.is-douyu.is-compact .customer-douyu-order-field {
grid-template-columns: 72px minmax(0, 1fr);
gap: 12px;
padding: 11px 16px;
}
.customer-auth-page.is-douyu.is-compact .customer-douyu-order-field > span,
.customer-auth-page.is-douyu.is-compact .customer-douyu-order-field > strong {
font-size: 14px;
line-height: 1.5;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-stage {
flex: 1 1 auto;
min-height: 0;
justify-content: center;
gap: 14px;
padding: 16px;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-stage .ant-alert {
flex: none;
padding: 12px 14px;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-stage .ant-alert-description {
margin-top: 4px;
font-size: 13px;
line-height: 1.6;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-qr-card {
flex: 0 1 auto;
justify-content: center;
gap: 10px;
padding: 18px;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-qr-card h3 {
font-size: 15px;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-qr-hint {
font-size: 13px;
line-height: 1.6;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-qr-countdown {
font-size: 13px;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-qr-card .ant-progress {
line-height: 1.5;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-qr-actions {
margin-top: 4px;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-qr-actions .ant-btn {
height: 40px;
font-size: 14px;
}
@media (max-height: 720px) {
.customer-auth-page.is-douyu.is-compact .customer-auth-hero {
min-height: 60px;
padding-bottom: 6px;
}
.customer-auth-page.is-douyu.is-compact .customer-auth-warning {
padding-block: 1px 4px;
font-size: 11px;
}
.customer-auth-page.is-douyu.is-compact .customer-douyu-order-head {
padding-block: 6px;
}
.customer-auth-page.is-douyu.is-compact .customer-douyu-order-field {
padding-block: 5px;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-stage {
justify-content: flex-start;
gap: 6px;
padding-block: 6px;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-stage .ant-alert-description {
display: none;
}
.customer-auth-page.is-douyu.is-compact .customer-binding-qr-card {
gap: 4px;
padding-block: 7px;
}
.customer-auth-page.is-douyu.is-compact .customer-douyu-qr-main {
grid-template-columns: 26px minmax(0, clamp(154px, 30dvh, 190px)) 26px;
gap: 5px;
}
.customer-auth-page.is-douyu.is-compact .customer-douyu-qr-rail {
font-size: 10px;
}
}
.customer-auth-page.is-douyu .customer-collect-submit.ant-btn {
height: 48px;
margin-top: 14px;
color: #fff !important;
border-color: #2f6fed !important;
border-radius: 10px;
background: #2f6fed !important;
font-size: 15px;
font-weight: 700;
}
.customer-auth-page.is-douyu .customer-collect-submit.ant-btn:hover,
.customer-auth-page.is-douyu .customer-collect-submit.ant-btn:focus-visible {
color: #fff !important;
border-color: #4a83ff !important;
background: #4a83ff !important;
}
@@ -0,0 +1,221 @@
/** 虎牙客户安全验证样式。 */
.customer-huya-steps {
display: flex;
gap: 8px;
margin: 12px 16px 0;
padding: 12px 14px;
list-style: none;
border: 1px solid #3a4150;
border-radius: 12px;
background: #1b212c;
}
.customer-huya-step {
display: flex;
flex: 1 1 0;
align-items: center;
gap: 7px;
min-width: 0;
color: #64748b;
font-size: 13px;
line-height: 1.3;
}
.customer-huya-step-index {
display: inline-flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
border: 1px solid #3a4150;
border-radius: 50%;
color: #94a3b8;
font-size: 12px;
font-weight: 600;
background: #212733;
}
.customer-huya-step-label {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.customer-huya-step.is-active {
color: #f8fafc;
font-weight: 600;
}
.customer-huya-step.is-active .customer-huya-step-index {
color: #fff;
border-color: #2563eb;
background: #2563eb;
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.customer-huya-step.is-done {
color: #6ee7b7;
}
.customer-huya-step.is-done .customer-huya-step-index {
color: #6ee7b7;
border-color: #065f46;
background: rgba(6, 78, 59, 0.4);
}
@media (max-width: 640px) {
.customer-huya-steps {
gap: 6px;
margin: 10px 16px 0;
padding: 10px 12px;
}
.customer-huya-step {
gap: 5px;
font-size: 11px;
}
.customer-huya-step-index {
width: 19px;
height: 19px;
font-size: 10px;
}
}
.huya-slider-challenge {
display: flex;
flex-direction: column;
gap: 14px;
}
.huya-slider-challenge > p {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 6px 12px;
margin: 0;
color: #475569;
font-size: 14px;
line-height: 1.65;
}
.huya-challenge-progress {
color: #c2410c;
font-size: 12px;
font-weight: 700;
}
.huya-click-tip {
display: block;
max-width: 100%;
max-height: 64px;
object-fit: contain;
}
.huya-slider-stage {
position: relative;
width: 100%;
overflow: hidden;
border: 1px solid rgba(148, 163, 184, 0.36);
border-radius: 8px;
background: #e2e8f0;
user-select: none;
}
.huya-slider-stage.is-click {
cursor: crosshair;
}
.huya-slider-background,
.huya-slider-puzzle {
pointer-events: none;
user-select: none;
}
.huya-slider-puzzle.is-rotate {
transform-origin: center;
}
.huya-click-point {
position: absolute;
display: grid;
width: 24px;
height: 24px;
place-items: center;
color: #fff;
font-size: 12px;
font-weight: 700;
border: 2px solid #fff;
border-radius: 50%;
background: #ea580c;
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.32);
transform: translate(-50%, -50%);
pointer-events: none;
}
.huya-slider-background {
display: block;
width: 100%;
height: 100%;
}
.huya-slider-puzzle {
position: absolute;
max-width: none;
height: auto;
}
.huya-slider-track {
position: relative;
height: 46px;
overflow: hidden;
border: 1px solid rgba(148, 163, 184, 0.36);
border-radius: 8px;
background: #f1f5f9;
touch-action: none;
}
.huya-slider-track-fill {
position: absolute;
inset: 0 auto 0 0;
max-width: 100%;
background: rgba(249, 115, 22, 0.16);
}
.huya-slider-handle {
position: absolute;
top: 3px;
left: 3px;
width: 58px;
height: 38px;
padding: 0;
color: #111827;
font-size: 13px;
font-weight: 700;
border: 0;
border-radius: 6px;
background: #f97316;
cursor: grab;
touch-action: none;
}
.huya-slider-handle:active {
cursor: grabbing;
}
.huya-rotate-control {
display: grid;
grid-template-columns: minmax(0, 1fr) 48px;
gap: 12px;
align-items: center;
}
.huya-rotate-control > span {
color: #475569;
font-size: 13px;
font-variant-numeric: tabular-nums;
text-align: right;
}
@@ -0,0 +1,11 @@
/** 微博客户领取页平台差异样式。 */
.customer-auth-page.is-weibo .customer-auth-brand {
width: 100%;
justify-content: flex-start;
}
.customer-auth-page.is-weibo .customer-auth-brand h1 {
text-align: left;
text-shadow: 0 2px 12px rgba(0, 0, 0, 0.72);
}
@@ -0,0 +1,234 @@
/* 客户资料页(图 1) */
.customer-collect-page {
min-height: 100vh;
background: #0b1220;
color: #e5e7eb;
}
/* 资料页顶部 KV:原图 https://game.gtimg.cn/images/gp/web201908/inside_kv.jpg(本地 1600×510 q82) */
.customer-collect-hero {
position: relative;
min-height: clamp(132px, 18vw, 160px);
display: flex;
align-items: flex-end;
justify-content: center;
padding: 0 18px 12px;
overflow: hidden;
text-align: center;
background-color: #0b1220;
background-image:
linear-gradient(180deg, rgba(11, 18, 32, 0) 38%, rgba(11, 18, 32, 0.55) 72%, #0b1220 100%),
url('/images/customer/inside-kv.jpg');
background-repeat: no-repeat;
background-position: center 40%;
background-size: cover;
}
.customer-collect-warning {
margin: 0;
text-align: center;
color: #f87171;
font-size: 17px;
font-weight: 600;
text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
@media (max-width: 640px) {
.customer-collect-hero {
min-height: 132px;
padding: 0 16px 12px;
background-position: center 42%;
}
.customer-collect-warning {
font-size: 15px;
}
}
.customer-collect-body {
max-width: 560px;
margin: 0 auto;
padding: 24px 20px 48px;
display: flex;
flex-direction: column;
gap: 12px;
}
.customer-collect-label {
margin-top: 8px;
color: #e5e7eb;
font-size: 15px;
line-height: 1.4;
}
.customer-collect-label span {
color: #f87171;
}
.customer-collect-readonly {
height: 48px;
display: flex;
align-items: center;
padding: 0 16px;
border-radius: 12px;
background: #1b2436;
border: 1px solid #26344d;
color: #94a3b8;
font-size: 15px;
}
.customer-collect-card {
margin: 10px 0;
padding: 16px;
border-radius: 12px;
border: 1px solid #1e2f4a;
background: #141d30;
display: flex;
flex-direction: column;
gap: 12px;
}
.customer-collect-card > div {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
color: #cbd5e1;
font-size: 15px;
line-height: 1.5;
}
.customer-collect-card > div > span {
flex: 0 0 auto;
white-space: nowrap;
}
.customer-collect-card > div strong {
flex: 1 1 auto;
min-width: 0;
color: #fff;
font-weight: 600;
text-align: right;
overflow-wrap: anywhere;
}
.customer-collect-card > p {
margin: 6px 0 0;
color: #fbbf24;
font-size: 13px;
text-align: center;
}
.customer-collect-input.ant-input {
height: 48px;
border-radius: 12px;
background: #1b2436;
border-color: #26344d;
color: #fff;
}
.customer-collect-input.ant-input::placeholder {
color: #64748b;
}
.customer-collect-select.ant-select {
width: 100%;
height: 48px;
padding-inline: 16px;
align-items: center;
font-size: 15px;
border-radius: 12px;
border: 1px solid #26344d;
background: #1b2436;
color: #fff;
--ant-select-height: 48px;
--ant-select-border-radius: 12px;
--ant-select-border-color: #26344d;
--ant-select-background-color: #1b2436;
--ant-select-color: #fff;
--ant-select-hover-border-color: #3b4d6b;
--ant-select-active-border-color: #2563eb;
--ant-select-active-outline-color: rgba(37, 99, 235, 0.2);
}
.customer-collect-select.ant-select:hover {
border-color: #3b4d6b;
}
.customer-collect-select.ant-select.ant-select-focused {
border-color: #2563eb;
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.customer-collect-select .ant-select-content {
align-items: center;
}
.customer-collect-select .ant-select-selection-item {
color: #fff;
line-height: 1.5;
}
.customer-collect-select .ant-select-placeholder {
color: #64748b;
}
.customer-collect-select .ant-select-suffix {
color: #94a3b8;
}
.ant-select-dropdown.customer-collect-dropdown {
padding: 6px;
border-radius: 12px;
background: #141d30;
box-shadow: 0 14px 34px rgba(2, 6, 23, 0.55);
--ant-select-option-active-bg: #1b2436;
--ant-select-option-selected-bg: #1e3a8a;
--ant-select-option-selected-color: #fff;
}
.customer-collect-dropdown .ant-select-item {
border-radius: 8px;
color: #cbd5e1;
}
.customer-collect-dropdown .ant-select-item-option-active {
background: #1b2436 !important;
color: #fff;
}
.customer-collect-dropdown .ant-select-item-option-selected {
background: #1e3a8a !important;
color: #fff;
font-weight: 600;
}
.customer-collect-page .customer-collect-submit.ant-btn,
.customer-auth-profile .customer-collect-submit.ant-btn {
height: 52px;
margin-top: 14px;
border-radius: 14px;
font-size: 17px;
font-weight: 600;
--ant-btn-bg-color: #2563eb;
--ant-btn-bg-color-hover: #1d4ed8;
--ant-btn-bg-color-active: #1e40af;
--ant-btn-text-color: #fff;
--ant-btn-text-color-hover: #fff;
--ant-btn-text-color-active: #fff;
--ant-btn-border-color: #2563eb;
--ant-btn-border-color-hover: #1d4ed8;
--ant-btn-border-color-active: #1e40af;
background: #2563eb !important;
border-color: #2563eb !important;
color: #fff !important;
}
.customer-collect-page .customer-collect-submit.ant-btn:hover,
.customer-collect-page .customer-collect-submit.ant-btn:focus-visible,
.customer-auth-profile .customer-collect-submit.ant-btn:hover,
.customer-auth-profile .customer-collect-submit.ant-btn:focus-visible {
background: #1d4ed8 !important;
border-color: #1d4ed8 !important;
color: #fff !important;
}
@@ -0,0 +1,162 @@
@media (max-width: 640px) {
.customer-auth-page {
height: auto;
min-height: 100vh;
overflow: visible;
padding: 0;
background: var(--auth-panel);
}
.customer-auth-shell {
width: 100%;
height: auto;
display: block;
border: 0;
border-radius: 0;
box-shadow: none;
}
.customer-auth-hero {
min-height: 112px;
padding: 12px 16px 14px;
background-position: center 42%;
}
.customer-auth-brand h1 {
font-size: 20px;
}
.customer-auth-warning {
padding: 6px 16px 10px;
font-size: 14px;
}
.customer-auth-main {
overflow: visible;
}
.customer-auth-content-stack {
height: auto;
min-height: 0;
}
.customer-auth-facts {
padding-inline: 20px;
}
.customer-auth-facts > div {
grid-template-columns: 92px minmax(0, 1fr);
gap: 12px;
min-height: 52px;
padding-block: 8px;
}
.customer-auth-facts > div > span {
font-size: 13px;
}
.customer-auth-facts > div > strong {
font-size: 15px;
line-height: 1.35;
}
.customer-auth-section {
padding: 16px;
}
.customer-auth-section-copy h2,
.customer-auth-state h2 {
font-size: 20px;
}
.customer-auth-section-copy p,
.customer-auth-state p,
.customer-auth-form-copy {
font-size: 13px;
line-height: 1.5;
}
.customer-auth-tabs {
margin-top: 0;
}
.customer-auth-tabs .ant-tabs-nav {
margin-bottom: 10px;
}
.customer-auth-tabs .ant-tabs-nav-list {
gap: 4px;
padding: 4px;
}
.customer-auth-tabs .ant-tabs-tab {
padding: 9px 14px;
}
.customer-auth-tabs .ant-tabs-tab-btn {
font-size: 15px;
}
.customer-auth-form {
gap: 10px;
padding-top: 0;
}
.customer-auth-field {
min-height: 44px;
border-radius: 9px;
}
.customer-auth-phone-field {
grid-template-columns: 50px minmax(0, 1fr) 104px;
}
.customer-auth-code-field {
grid-template-columns: minmax(0, 1fr) 104px;
}
.customer-auth-field .ant-select,
.customer-auth-field .ant-select-selector,
.customer-auth-field .ant-input,
.customer-auth-field .ant-input-affix-wrapper {
height: 44px;
}
.customer-auth-field .ant-select-selection-item {
line-height: 42px !important;
}
.customer-auth-field .ant-input-affix-wrapper {
padding-inline: 12px;
}
.customer-auth-code-field {
padding: 4px;
}
.customer-auth-code-submit {
height: 36px !important;
}
.customer-auth-send-code {
height: 36px !important;
}
.customer-auth-form-hint {
font-size: 10px;
line-height: 1.35;
}
.customer-auth-qr-image,
.customer-auth-qr-placeholder {
width: 232px;
min-height: 232px;
}
.customer-auth-privacy {
margin: 8px 16px 12px;
padding: 8px 12px;
font-size: 12px;
line-height: 1.45;
}
}
@@ -0,0 +1,106 @@
.customer-auth-button-stack {
width: min(100%, 580px);
display: flex;
flex-direction: column;
gap: 12px;
}
.customer-auth-button-stack .ant-btn,
.customer-auth-form > .ant-btn {
height: 52px;
font-size: 17px;
}
.customer-auth-status-pill {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 34px;
padding: 4px 15px;
color: #fff;
font-size: 15px !important;
font-weight: 600 !important;
text-align: center;
border-radius: 999px;
background: #3169aa;
}
.customer-auth-status-pill.is-pending,
.customer-auth-status-pill.is-scanned {
background: #3a6fa8;
}
.customer-auth-status-pill.is-success {
background: #237a57;
}
.customer-auth-status-pill.is-danger {
background: #a33a48;
}
.customer-auth-state {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
padding: 48px 26px;
text-align: center;
}
.customer-auth-state h2 {
margin: 0;
}
.customer-auth-state p {
max-width: 560px;
}
.customer-auth-state-icon {
width: 58px;
height: 58px;
display: grid;
place-items: center;
color: var(--auth-accent);
font-size: 29px;
border: 1px solid rgba(255, 255, 255, 0.16);
border-radius: 50%;
background: rgba(255, 255, 255, 0.045);
}
.customer-auth-state.is-success .customer-auth-state-icon {
color: #52d39a;
}
.customer-auth-state.is-error .customer-auth-state-icon {
color: #ff6975;
}
.customer-auth-state-time {
color: var(--auth-muted);
font-size: 12px;
}
.customer-auth-loading {
min-height: 240px;
display: grid;
place-items: center;
align-content: center;
gap: 14px;
color: var(--auth-muted);
}
.customer-auth-privacy {
margin: 24px 26px 28px;
padding: 14px 18px;
color: #d8b46a;
font-size: 14px;
line-height: 1.65;
text-align: center;
border: 1px solid rgba(216, 180, 106, 0.64);
border-radius: 5px;
background: rgba(0, 0, 0, 0.08);
}
.customer-auth-page .ant-spin-dot-item {
background: var(--auth-accent);
}
+8 -2
View File
@@ -3,12 +3,18 @@
* 按业务模块拆分,便于维护与多人协作开发:
* 1. base.css - 全局主题变量、基础排版、重置、通用工具类
* 2. admin.css - 后台管理端 (Admin Portal & Login)
* 3. client.css - 买家前台提卡与聚合页 (Buyer Claim & Collect)
* 4. worker.css - 打手接单端 PC 与移动端 (Worker Portal & Mobile)
* 3. client.css - 买家提卡、补资料与兑换页样式入口
* 4. customer/ - 客户领取页公共流程及平台差异
* 5. worker.css - 打手接单端 PC 与移动端 (Worker Portal & Mobile)
*/
@import './base.css';
@import './admin.css';
@import './client.css';
@import './customer/base.css';
@import './customer/platform/huya.css';
@import './customer/platform/weibo.css';
@import './customer/platform/douyu.css';
@import './customer/mobile.css';
@import './worker.css';
@import './table.css';
@@ -432,6 +432,7 @@ export interface ManualFulfillmentConfig {
enabled: boolean
semiAutoEnabled: boolean
semiAutoPlatform: '' | 'huya' | 'weibo'
douyuFulfillmentEnabled: boolean
semiAutoConfig: {
pageTitle?: string
pageDescription?: string
@@ -0,0 +1,91 @@
export type DouyuCustomerPlatform = 'wechat' | 'qq'
export type DouyuCustomerSystem = 'ios' | 'android'
export type DouyuFulfillmentTask = {
id: number
order_id: number
order_item_id: number
fulfillment_id: number | null
live_session_id: number | null
status: string
customer_role_name: string
customer_platform: string
customer_system: string
binding_phase: string
live_execution_status: string
live_binding_status: string
issue_code: string
last_error: string
bound_role_name: string
bound_area_name: string
bound_plat_name: string
customer_link_opened_at: string | null
binding_started_at: string | null
bound_at: string | null
completed_at: string | null
last_synced_at: string | null
created_at: string
updated_at: string
platform_order_id: string
sku_code: string
sku_name: string
quantity: number
product_name: string
fulfillment_status: string
linkPath: string
}
export type DouyuLiveBindingState = {
sessionId: number
platformOrderId: string
sourceOrderItemId: string
productName: string
quantity: number
executionStatus: string
bindingStatus: string
exchangeStatus: string
issueCode: string
message: string
accountReady: boolean
bindTaskId: number | null
bindTaskStatus: string
bindPhase: string
qrUrl: string
qrGeneratedAt: string
qrExpiresAt: string
roleName: string
areaName: string
platName: string
bindReadyForConfirm: boolean
bindConfirmed: boolean
customerProfileReset?: boolean
resetReason?: string
completedAt: string | null
updatedAt: string
}
export type DouyuRoleComparison = {
matched: boolean
roleMatched: boolean
channelMatched: boolean
message: string
}
export type DouyuCustomerFulfillment = {
task: DouyuFulfillmentTask
live: DouyuLiveBindingState
comparison: DouyuRoleComparison
linkPath: string
}
export type DouyuFulfillmentEvent = {
id: number
event_type: string
actor_type: string
detail_json: Record<string, unknown>
created_at: string
}
export type DouyuFulfillmentDetail = DouyuCustomerFulfillment & {
events: DouyuFulfillmentEvent[]
}
@@ -20,6 +20,21 @@ export function isCustomerFulfillmentPath(pathname: unknown): boolean {
return first === 'c' || first === 'd'
}
/** 斗鱼客户领取入口:/coll/d/:orderNo。 */
export function buildDouyuFulfillmentPath(orderNo: unknown): string {
const normalizedOrderNo = String(orderNo || '').trim()
return normalizedOrderNo ? `/coll/d/${encodeURIComponent(normalizedOrderNo)}` : ''
}
export function isDouyuFulfillmentPath(pathname: unknown): boolean {
const parts = String(pathname || '')
.trim()
.split(/[?#]/)[0]
.split('/')
.filter(Boolean)
return parts[0] === 'coll' && parts[1] === 'd'
}
/**
* 严格绑定下的自动归一化:当前路径对应平台没有任务、但订单只有另一个平台任务时,
* 返回应跳转的平台;双平台订单返回 null(各路径只展示自己的任务),