feat(consignment): 苏尔南寄卖接入打手端押金履约
打手可直接提报寄卖,关联 worker 与履约押金后指派交枪;后台去掉旧收集链接管理,提报审核与库存/工单流程对齐接单平台。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,739 @@
|
||||
import {
|
||||
CheckCircleOutlined,
|
||||
ClockCircleOutlined,
|
||||
CloudUploadOutlined,
|
||||
DollarCircleOutlined,
|
||||
HistoryOutlined,
|
||||
InboxOutlined,
|
||||
PlusOutlined,
|
||||
ReloadOutlined,
|
||||
SafetyCertificateOutlined,
|
||||
} from '@ant-design/icons'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import {
|
||||
Alert,
|
||||
App,
|
||||
Button,
|
||||
Card,
|
||||
Col,
|
||||
Divider,
|
||||
Empty,
|
||||
Form,
|
||||
Image,
|
||||
Input,
|
||||
InputNumber,
|
||||
Row,
|
||||
Select,
|
||||
Space,
|
||||
Tabs,
|
||||
Tag,
|
||||
Typography,
|
||||
} from 'antd'
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
|
||||
import ImageUpload from '@/components/files/ImageUpload'
|
||||
import {
|
||||
fetchWorkerConsignments,
|
||||
fetchWorkerProfile,
|
||||
publishWorkerConsignment,
|
||||
} from '@/services/worker'
|
||||
import type { WorkerConsignmentItem, WorkerInventoryItem } from '@/services/worker'
|
||||
import type { UploadedFile } from '@/types/worker-platform'
|
||||
import { useIsMobile } from '@/utils/use-is-mobile'
|
||||
|
||||
const SERIES_OPTIONS = [
|
||||
{ label: '暗潮', value: '暗潮' },
|
||||
{ label: '怒嚎', value: '怒嚎' },
|
||||
{ label: '血宴', value: '血宴' },
|
||||
]
|
||||
|
||||
const DIAMOND_OPTIONS = [1, 2, 3, 4, 5, 6, 7].map((v) => ({
|
||||
label: `${v} 钻`,
|
||||
value: v,
|
||||
}))
|
||||
|
||||
const BRILLIANCE_OPTIONS = [
|
||||
{ label: '无璀璨 (0)', value: 0 },
|
||||
...[1, 2, 3, 4, 5, 6, 7].map((v) => ({ label: `${v} 璀璨`, value: v })),
|
||||
]
|
||||
|
||||
type RecordFilter = 'all' | 'pending' | 'in_stock' | 'done'
|
||||
|
||||
export default function WorkerConsignmentPage() {
|
||||
const isMobile = useIsMobile()
|
||||
const { message } = App.useApp()
|
||||
const [activeTab, setActiveTab] = useState<'publish' | 'records'>('publish')
|
||||
const [recordFilter, setRecordFilter] = useState<RecordFilter>('all')
|
||||
const [screenshots, setScreenshots] = useState<UploadedFile[]>([])
|
||||
const [submitting, setSubmitting] = useState(false)
|
||||
const [depositTouched, setDepositTouched] = useState(false)
|
||||
const [form] = Form.useForm()
|
||||
|
||||
const profileQuery = useQuery({
|
||||
queryKey: ['worker-profile'],
|
||||
queryFn: () => fetchWorkerProfile(),
|
||||
staleTime: 60_000,
|
||||
})
|
||||
const worker = profileQuery.data?.data.worker
|
||||
|
||||
const myConsignmentsQuery = useQuery({
|
||||
queryKey: ['worker-my-consignments'],
|
||||
queryFn: () => fetchWorkerConsignments(),
|
||||
})
|
||||
|
||||
const submissions = myConsignmentsQuery.data?.data.submissions || []
|
||||
const inventories = myConsignmentsQuery.data?.data.inventories || []
|
||||
|
||||
const pendingCount = submissions.filter((s) => s.status === 'pending_review').length
|
||||
const inStockCount = inventories.filter((i) => i.status === 'in_stock').length
|
||||
const doneCount = inventories.filter((i) => i.status === 'consumed').length
|
||||
const rejectedCount = submissions.filter((s) => s.status === 'rejected').length
|
||||
|
||||
useEffect(() => {
|
||||
if (worker?.phone) {
|
||||
form.setFieldsValue({ sellerPhone: worker.phone })
|
||||
}
|
||||
}, [worker, form])
|
||||
|
||||
function handleFormValuesChange(changedValues: Record<string, unknown>) {
|
||||
const sys = form.getFieldValue('system')
|
||||
const zone = form.getFieldValue('serverZone')
|
||||
const ser = form.getFieldValue('series')
|
||||
const dia = form.getFieldValue('diamondLevel')
|
||||
const bri = form.getFieldValue('brillianceCount')
|
||||
const next: Record<string, unknown> = {}
|
||||
|
||||
if (sys && zone && ser && dia != null && bri != null) {
|
||||
const briNum = Number(bri)
|
||||
const briStr = briNum > 0 ? `${briNum}璀璨` : ''
|
||||
next.itemName = `${sys}${zone}${ser}${dia}钻${briStr} 苏尔南`
|
||||
}
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(changedValues, 'depositAmount')) {
|
||||
setDepositTouched(true)
|
||||
}
|
||||
|
||||
if (
|
||||
Object.prototype.hasOwnProperty.call(changedValues, 'askingPrice') &&
|
||||
!depositTouched &&
|
||||
!Object.prototype.hasOwnProperty.call(changedValues, 'depositAmount')
|
||||
) {
|
||||
const price = Number(changedValues.askingPrice || 0)
|
||||
if (price > 0) next.depositAmount = price
|
||||
}
|
||||
|
||||
if (Object.keys(next).length > 0) {
|
||||
form.setFieldsValue(next)
|
||||
}
|
||||
}
|
||||
|
||||
async function handlePublishSubmit(values: Record<string, any>) {
|
||||
const urls = screenshots.map((f) => f.url).filter(Boolean)
|
||||
if (urls.length === 0) {
|
||||
message.error('请上传游戏主页截图以供核验')
|
||||
return
|
||||
}
|
||||
|
||||
const askingPriceFen = Math.round(Number(values.askingPrice || 0) * 100)
|
||||
if (askingPriceFen < 100) {
|
||||
message.error('寄售价格不能少于1元')
|
||||
return
|
||||
}
|
||||
|
||||
const depositAmountFen = Math.round(
|
||||
Number(values.depositAmount || values.askingPrice || 100) * 100,
|
||||
)
|
||||
if (depositAmountFen < 100) {
|
||||
message.error('履约押金不能少于1元')
|
||||
return
|
||||
}
|
||||
|
||||
setSubmitting(true)
|
||||
try {
|
||||
await publishWorkerConsignment({
|
||||
itemName: values.itemName,
|
||||
system: values.system,
|
||||
serverZone: values.serverZone,
|
||||
series: values.series,
|
||||
diamondLevel: Number(values.diamondLevel || 1),
|
||||
brillianceCount: Number(values.brillianceCount || 0),
|
||||
askingPriceFen,
|
||||
sellerContact: values.sellerContact,
|
||||
sellerPhone: values.sellerPhone || worker?.phone || '',
|
||||
characterName: values.characterName,
|
||||
characterId: values.characterId,
|
||||
screenshotsJson: urls,
|
||||
sellerNote: values.sellerNote,
|
||||
depositAmountFen,
|
||||
})
|
||||
|
||||
message.success('寄卖提报成功,已进入审核')
|
||||
form.resetFields()
|
||||
setDepositTouched(false)
|
||||
setScreenshots([])
|
||||
await myConsignmentsQuery.refetch()
|
||||
setRecordFilter('pending')
|
||||
setActiveTab('records')
|
||||
} catch (err: any) {
|
||||
message.error(err.message || '发布寄卖失败,请重试')
|
||||
} finally {
|
||||
setSubmitting(false)
|
||||
}
|
||||
}
|
||||
|
||||
const filteredRecords = useMemo(() => {
|
||||
const pendingSubs = submissions.filter((s) => s.status === 'pending_review')
|
||||
const rejectedSubs = submissions.filter((s) => s.status === 'rejected')
|
||||
const approvedSubs = submissions.filter((s) => s.status === 'approved')
|
||||
const inStock = inventories.filter((i) => i.status === 'in_stock')
|
||||
const done = inventories.filter((i) => i.status === 'consumed' || i.status === 'archived')
|
||||
|
||||
if (recordFilter === 'pending') {
|
||||
return { submissions: [...pendingSubs, ...rejectedSubs], inventories: [] as WorkerInventoryItem[] }
|
||||
}
|
||||
if (recordFilter === 'in_stock') {
|
||||
return { submissions: [] as WorkerConsignmentItem[], inventories: inStock }
|
||||
}
|
||||
if (recordFilter === 'done') {
|
||||
return { submissions: [] as WorkerConsignmentItem[], inventories: done }
|
||||
}
|
||||
return {
|
||||
submissions: [...pendingSubs, ...rejectedSubs, ...approvedSubs],
|
||||
inventories,
|
||||
}
|
||||
}, [submissions, inventories, recordFilter])
|
||||
|
||||
const recordTotal =
|
||||
filteredRecords.submissions.length + filteredRecords.inventories.length
|
||||
|
||||
return (
|
||||
<section className="page-stack worker-consignment-page">
|
||||
<div className="worker-orders-desktop-header">
|
||||
<div className="worker-orders-header-left">
|
||||
<Typography.Title level={3} className="worker-orders-heading">
|
||||
苏尔南寄卖
|
||||
</Typography.Title>
|
||||
<span className="worker-orders-live-badge">
|
||||
<span className="worker-orders-pulse-dot" />
|
||||
接单平台押金履约
|
||||
</span>
|
||||
</div>
|
||||
<div className="worker-orders-header-right">
|
||||
<Button
|
||||
icon={<ReloadOutlined />}
|
||||
loading={myConsignmentsQuery.isFetching}
|
||||
onClick={() => myConsignmentsQuery.refetch()}
|
||||
>
|
||||
刷新
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="worker-orders-kpi-grid">
|
||||
<div
|
||||
className={`worker-orders-kpi-card ${recordFilter === 'pending' && activeTab === 'records' ? 'active' : ''}`}
|
||||
onClick={() => {
|
||||
setRecordFilter('pending')
|
||||
setActiveTab('records')
|
||||
}}
|
||||
>
|
||||
<div className="worker-orders-kpi-top">
|
||||
<div className="worker-orders-kpi-icon-wrap pending">
|
||||
<ClockCircleOutlined />
|
||||
</div>
|
||||
<div className="worker-orders-kpi-info">
|
||||
<span className="worker-orders-kpi-title">审核中 / 驳回</span>
|
||||
<strong className="worker-orders-kpi-val">
|
||||
{pendingCount + rejectedCount}
|
||||
<span className="worker-orders-kpi-unit"> 单</span>
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div className="worker-orders-kpi-bottom">
|
||||
<span className="worker-orders-kpi-sub-label">
|
||||
{pendingCount > 0 ? `${pendingCount} 单待客服审核` : '暂无待审提报'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={`worker-orders-kpi-card ${recordFilter === 'in_stock' && activeTab === 'records' ? 'active' : ''}`}
|
||||
onClick={() => {
|
||||
setRecordFilter('in_stock')
|
||||
setActiveTab('records')
|
||||
}}
|
||||
>
|
||||
<div className="worker-orders-kpi-top">
|
||||
<div className="worker-orders-kpi-icon-wrap in-progress">
|
||||
<InboxOutlined />
|
||||
</div>
|
||||
<div className="worker-orders-kpi-info">
|
||||
<span className="worker-orders-kpi-title">在库待派单</span>
|
||||
<strong className="worker-orders-kpi-val">
|
||||
{inStockCount}
|
||||
<span className="worker-orders-kpi-unit"> 把</span>
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div className="worker-orders-kpi-bottom">
|
||||
<span className="worker-orders-kpi-sub-label">已入库,等待匹配买家工单</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={`worker-orders-kpi-card ${recordFilter === 'done' && activeTab === 'records' ? 'active' : ''}`}
|
||||
onClick={() => {
|
||||
setRecordFilter('done')
|
||||
setActiveTab('records')
|
||||
}}
|
||||
>
|
||||
<div className="worker-orders-kpi-top">
|
||||
<div className="worker-orders-kpi-icon-wrap accepted">
|
||||
<CheckCircleOutlined />
|
||||
</div>
|
||||
<div className="worker-orders-kpi-info">
|
||||
<span className="worker-orders-kpi-title">已履约出库</span>
|
||||
<strong className="worker-orders-kpi-val">
|
||||
{doneCount}
|
||||
<span className="worker-orders-kpi-unit"> 把</span>
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div className="worker-orders-kpi-bottom">
|
||||
<span className="worker-orders-kpi-sub-label">押金履约交付完成</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={`worker-orders-kpi-card ${activeTab === 'publish' ? 'active' : ''}`}
|
||||
onClick={() => setActiveTab('publish')}
|
||||
>
|
||||
<div className="worker-orders-kpi-top">
|
||||
<div className="worker-orders-kpi-icon-wrap problem">
|
||||
<PlusOutlined />
|
||||
</div>
|
||||
<div className="worker-orders-kpi-info">
|
||||
<span className="worker-orders-kpi-title">发布寄卖</span>
|
||||
<strong className="worker-orders-kpi-val" style={{ fontSize: 18 }}>
|
||||
苏尔南
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div className="worker-orders-kpi-bottom">
|
||||
<span className="worker-orders-kpi-sub-label">暗潮 / 怒嚎 / 血宴 · 押金履约</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Card bordered={false} className="worker-orders-card">
|
||||
<Tabs
|
||||
className="worker-order-tabs"
|
||||
activeKey={activeTab}
|
||||
onChange={(key) => setActiveTab(key as 'publish' | 'records')}
|
||||
items={[
|
||||
{
|
||||
key: 'publish',
|
||||
label: (
|
||||
<span>
|
||||
<DollarCircleOutlined /> 发布寄卖
|
||||
</span>
|
||||
),
|
||||
children: (
|
||||
<Form
|
||||
form={form}
|
||||
layout="vertical"
|
||||
className="worker-consignment-form"
|
||||
onFinish={handlePublishSubmit}
|
||||
onValuesChange={handleFormValuesChange}
|
||||
>
|
||||
<Alert
|
||||
type="info"
|
||||
showIcon
|
||||
icon={<SafetyCertificateOutlined />}
|
||||
className="worker-consignment-tip"
|
||||
message="走接单平台押金履约:审核入库后匹配买家工单,系统按登记押金冻结钱包;局内交枪验货通过后解冻并结算货款。"
|
||||
/>
|
||||
|
||||
<Divider orientation="left" plain className="worker-consignment-divider">
|
||||
规格与价格
|
||||
</Divider>
|
||||
|
||||
<Row gutter={[12, 0]}>
|
||||
<Col xs={12} sm={8} md={6}>
|
||||
<Form.Item
|
||||
name="system"
|
||||
label="操作系统"
|
||||
rules={[{ required: true, message: '请选择系统' }]}
|
||||
>
|
||||
<Select
|
||||
placeholder="请选择"
|
||||
options={[
|
||||
{ label: '苹果 (iOS)', value: '苹果' },
|
||||
{ label: '安卓 (Android)', value: '安卓' },
|
||||
{ label: '通用/双端', value: '通用' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={12} sm={8} md={6}>
|
||||
<Form.Item
|
||||
name="serverZone"
|
||||
label="游戏区服"
|
||||
rules={[{ required: true, message: '请选择区服' }]}
|
||||
>
|
||||
<Select
|
||||
placeholder="请选择"
|
||||
options={[
|
||||
{ label: '微信区', value: '微信区' },
|
||||
{ label: 'QQ区', value: 'QQ区' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={12} sm={8} md={6}>
|
||||
<Form.Item
|
||||
name="series"
|
||||
label="系列/枪系"
|
||||
rules={[{ required: true, message: '请选择枪系' }]}
|
||||
>
|
||||
<Select placeholder="请选择" options={SERIES_OPTIONS} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={12} sm={8} md={6}>
|
||||
<Form.Item
|
||||
name="diamondLevel"
|
||||
label="钻石等级"
|
||||
rules={[{ required: true, message: '请选择钻级' }]}
|
||||
>
|
||||
<Select placeholder="请选择" options={DIAMOND_OPTIONS} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={12} sm={8} md={6}>
|
||||
<Form.Item
|
||||
name="brillianceCount"
|
||||
label="璀璨数"
|
||||
rules={[{ required: true, message: '请选择璀璨数' }]}
|
||||
>
|
||||
<Select placeholder="请选择" options={BRILLIANCE_OPTIONS} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={24} sm={16} md={12}>
|
||||
<Form.Item
|
||||
name="itemName"
|
||||
label="物品名称"
|
||||
rules={[{ required: true, message: '请输入名称' }]}
|
||||
>
|
||||
<Input placeholder="选择规格后自动生成,也可手动修改" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={12} sm={8} md={6}>
|
||||
<Form.Item
|
||||
name="askingPrice"
|
||||
label="寄售价格 (元)"
|
||||
rules={[{ required: true, message: '请填写寄售价格' }]}
|
||||
>
|
||||
<InputNumber
|
||||
min={1}
|
||||
step={1}
|
||||
style={{ width: '100%' }}
|
||||
placeholder="请输入"
|
||||
addonBefore="¥"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={12} sm={8} md={6}>
|
||||
<Form.Item
|
||||
name="depositAmount"
|
||||
label="履约押金 (元)"
|
||||
rules={[{ required: true, message: '请填写履约押金' }]}
|
||||
tooltip="派单交枪时冻结,验货后解冻。填写寄售价后可自动带出,也可手动改。"
|
||||
>
|
||||
<InputNumber
|
||||
min={1}
|
||||
step={10}
|
||||
style={{ width: '100%' }}
|
||||
placeholder="请输入"
|
||||
addonBefore="¥"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Divider orientation="left" plain className="worker-consignment-divider">
|
||||
联系方式与游戏凭据
|
||||
</Divider>
|
||||
|
||||
<Row gutter={[12, 0]}>
|
||||
<Col xs={24} sm={12}>
|
||||
<Form.Item
|
||||
name="sellerContact"
|
||||
label="微信号 / QQ号"
|
||||
rules={[{ required: true, message: '请填写微信号或QQ' }]}
|
||||
>
|
||||
<Input placeholder="方便派单与紧急联系" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={24} sm={12}>
|
||||
<Form.Item
|
||||
name="sellerPhone"
|
||||
label="联系电话"
|
||||
tooltip="默认使用当前接单账号绑定手机号"
|
||||
>
|
||||
<Input placeholder="手机号" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={24} sm={12}>
|
||||
<Form.Item
|
||||
name="characterName"
|
||||
label="游戏内角色名"
|
||||
rules={[{ required: true, message: '请填写角色名' }]}
|
||||
>
|
||||
<Input placeholder="局内加好友丢枪用" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col xs={24} sm={12}>
|
||||
<Form.Item
|
||||
name="characterId"
|
||||
label="角色数字ID"
|
||||
rules={[{ required: true, message: '请填写数字ID' }]}
|
||||
>
|
||||
<Input placeholder="如 1089238472" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Item
|
||||
label="游戏主页截图"
|
||||
required
|
||||
extra="须包含角色名、ID 及仓库/手枪详情,最多 4 张"
|
||||
>
|
||||
<ImageUpload
|
||||
value={screenshots}
|
||||
onChange={setScreenshots}
|
||||
scene="consignment_screenshot"
|
||||
scope="worker"
|
||||
maxCount={4}
|
||||
showPasteHint={!isMobile}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Item name="sellerNote" label="其他留言与补充">
|
||||
<Input.TextArea
|
||||
rows={2}
|
||||
placeholder="配件、子弹、涂装或在线时段等(选填)"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<div className="worker-consignment-actions">
|
||||
<Button
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
size="large"
|
||||
loading={submitting}
|
||||
icon={<CloudUploadOutlined />}
|
||||
>
|
||||
提交寄卖提报
|
||||
</Button>
|
||||
<Typography.Text type="secondary">
|
||||
提交后进入客服审核,通过后入库匹配
|
||||
</Typography.Text>
|
||||
</div>
|
||||
</Form>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'records',
|
||||
label: (
|
||||
<span>
|
||||
<HistoryOutlined /> 我的寄卖
|
||||
{submissions.length + inventories.length > 0 ? (
|
||||
<span className="worker-order-tab-count">
|
||||
{submissions.length + inventories.length}
|
||||
</span>
|
||||
) : null}
|
||||
</span>
|
||||
),
|
||||
children: (
|
||||
<Space direction="vertical" size={14} style={{ width: '100%' }}>
|
||||
<div className="worker-consignment-filter-row">
|
||||
{(
|
||||
[
|
||||
{ key: 'all', label: '全部' },
|
||||
{ key: 'pending', label: '审核中' },
|
||||
{ key: 'in_stock', label: '在库' },
|
||||
{ key: 'done', label: '已出库' },
|
||||
] as const
|
||||
).map((item) => (
|
||||
<Button
|
||||
key={item.key}
|
||||
size="small"
|
||||
type={recordFilter === item.key ? 'primary' : 'default'}
|
||||
onClick={() => setRecordFilter(item.key)}
|
||||
>
|
||||
{item.label}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{myConsignmentsQuery.isLoading ? (
|
||||
<Typography.Text type="secondary">正在加载寄卖记录…</Typography.Text>
|
||||
) : recordTotal === 0 ? (
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
description="暂无寄卖记录,去发布一单苏尔南吧"
|
||||
>
|
||||
<Button type="primary" onClick={() => setActiveTab('publish')}>
|
||||
发布寄卖
|
||||
</Button>
|
||||
</Empty>
|
||||
) : (
|
||||
<div className="worker-consignment-record-list">
|
||||
{filteredRecords.inventories.map((inv) => (
|
||||
<InventoryRecordCard key={`inv-${inv.id}`} inv={inv} />
|
||||
))}
|
||||
{filteredRecords.submissions.map((sub) => (
|
||||
<SubmissionRecordCard key={`sub-${sub.id}`} sub={sub} />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Card>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function SpecTags({
|
||||
system,
|
||||
serverZone,
|
||||
series,
|
||||
diamondLevel,
|
||||
brillianceCount,
|
||||
}: {
|
||||
system: string
|
||||
serverZone: string
|
||||
series: string
|
||||
diamondLevel: number
|
||||
brillianceCount: number
|
||||
}) {
|
||||
return (
|
||||
<Space size={4} wrap>
|
||||
<Tag>{system}</Tag>
|
||||
<Tag>{serverZone}</Tag>
|
||||
<Tag color="orange">{series}</Tag>
|
||||
<Tag color="gold">{diamondLevel} 钻</Tag>
|
||||
{brillianceCount > 0 ? <Tag color="magenta">{brillianceCount} 璀璨</Tag> : null}
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
|
||||
function InventoryRecordCard({ inv }: { inv: WorkerInventoryItem }) {
|
||||
return (
|
||||
<article className="worker-consignment-record-card">
|
||||
<div className="worker-consignment-record-main">
|
||||
<div className="worker-consignment-record-title-row">
|
||||
<Typography.Text strong>{inv.itemName}</Typography.Text>
|
||||
<Typography.Text type="secondary" className="worker-consignment-record-no">
|
||||
{inv.inventoryNo}
|
||||
</Typography.Text>
|
||||
{inv.status === 'in_stock' ? (
|
||||
<Tag color="green">在库待派</Tag>
|
||||
) : inv.status === 'consumed' ? (
|
||||
<Tag color="blue">已履约</Tag>
|
||||
) : (
|
||||
<Tag>已下架</Tag>
|
||||
)}
|
||||
</div>
|
||||
<SpecTags
|
||||
system={inv.system}
|
||||
serverZone={inv.serverZone}
|
||||
series={inv.series}
|
||||
diamondLevel={inv.diamondLevel}
|
||||
brillianceCount={inv.brillianceCount}
|
||||
/>
|
||||
<div className="worker-consignment-record-meta">
|
||||
<span>
|
||||
货款 <strong>¥{(inv.costPriceFen / 100).toFixed(2)}</strong>
|
||||
</span>
|
||||
<span>
|
||||
押金 <strong>¥{((inv.depositAmountFen || 0) / 100).toFixed(0)}</strong>
|
||||
</span>
|
||||
{inv.boundPlatformOrderId ? (
|
||||
<Typography.Text copyable={{ text: inv.boundPlatformOrderId }}>
|
||||
履约单 {inv.boundPlatformOrderId}
|
||||
</Typography.Text>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
<Typography.Text type="secondary" className="worker-consignment-record-time">
|
||||
{inv.createdAt}
|
||||
</Typography.Text>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
function SubmissionRecordCard({ sub }: { sub: WorkerConsignmentItem }) {
|
||||
const shots = Array.isArray(sub.screenshotsJson)
|
||||
? sub.screenshotsJson.filter((s): s is string => typeof s === 'string')
|
||||
: []
|
||||
|
||||
return (
|
||||
<article className="worker-consignment-record-card">
|
||||
<div className="worker-consignment-record-main">
|
||||
<div className="worker-consignment-record-title-row">
|
||||
<Typography.Text strong>{sub.itemName}</Typography.Text>
|
||||
<Typography.Text type="secondary" className="worker-consignment-record-no">
|
||||
{sub.submissionNo}
|
||||
</Typography.Text>
|
||||
{sub.status === 'pending_review' ? (
|
||||
<Tag color="gold">审核中</Tag>
|
||||
) : sub.status === 'approved' ? (
|
||||
<Tag color="green">已通过</Tag>
|
||||
) : (
|
||||
<Tag color="red">已驳回</Tag>
|
||||
)}
|
||||
</div>
|
||||
<SpecTags
|
||||
system={sub.system}
|
||||
serverZone={sub.serverZone}
|
||||
series={sub.series}
|
||||
diamondLevel={sub.diamondLevel}
|
||||
brillianceCount={sub.brillianceCount}
|
||||
/>
|
||||
<div className="worker-consignment-record-meta">
|
||||
<span>
|
||||
期望价 <strong>¥{(sub.askingPriceFen / 100).toFixed(2)}</strong>
|
||||
</span>
|
||||
{sub.reviewNote ? (
|
||||
<Typography.Text type="danger">审核说明:{sub.reviewNote}</Typography.Text>
|
||||
) : null}
|
||||
</div>
|
||||
{shots.length > 0 ? (
|
||||
<div className="worker-consignment-record-shots">
|
||||
<Image.PreviewGroup>
|
||||
<Space size={8}>
|
||||
{shots.map((src, i) => (
|
||||
<Image
|
||||
key={`${src}-${i}`}
|
||||
src={src}
|
||||
width={44}
|
||||
height={44}
|
||||
style={{ objectFit: 'cover', borderRadius: 6 }}
|
||||
/>
|
||||
))}
|
||||
</Space>
|
||||
</Image.PreviewGroup>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
<Typography.Text type="secondary" className="worker-consignment-record-time">
|
||||
{sub.createdAt}
|
||||
</Typography.Text>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user