feat(consignment): 苏尔南寄卖接入打手端押金履约

打手可直接提报寄卖,关联 worker 与履约押金后指派交枪;后台去掉旧收集链接管理,提报审核与库存/工单流程对齐接单平台。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-09-15 16:00:33 +08:00
co-authored by Cursor
parent 7672360875
commit 4a6215e816
23 changed files with 2218 additions and 677 deletions
@@ -1,7 +1,8 @@
import {
CheckCircleOutlined,
CloudUploadOutlined,
LockOutlined,
DollarOutlined,
SafetyCertificateOutlined,
TrophyOutlined,
} from '@ant-design/icons'
import {
@@ -15,7 +16,6 @@ import {
Image,
Input,
InputNumber,
Radio,
Result,
Row,
Select,
@@ -48,9 +48,38 @@ export default function ConsignmentCollectPage() {
const [submittedResult, setSubmittedResult] = useState<ConsignmentSubmission | null>(null)
const [fileList, setFileList] = useState<UploadFile[]>([])
const [submitting, setSubmitting] = useState(false)
const [depositTouched, setDepositTouched] = useState(false)
const [form] = Form.useForm()
function updateAutoItemName(changedValues?: Record<string, unknown>) {
const sys = form.getFieldValue('system') || '苹果'
const zone = form.getFieldValue('serverZone') || '微信区'
const ser = form.getFieldValue('series') || '暗潮'
const dia = form.getFieldValue('diamondLevel') || 1
const bri = form.getFieldValue('brillianceCount') || 0
const briStr = bri > 0 ? `${bri}璀璨` : ''
const next: Record<string, unknown> = {
itemName: `${sys}${zone}${ser}${dia}钻${briStr} 苏尔南`,
}
if (changedValues && Object.prototype.hasOwnProperty.call(changedValues, 'depositAmount')) {
setDepositTouched(true)
}
if (
changedValues &&
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
}
form.setFieldsValue(next)
}
useEffect(() => {
if (!token) {
setErrorMsg('缺少收集凭证')
@@ -66,15 +95,16 @@ export default function ConsignmentCollectPage() {
form.setFieldsValue({
itemName:
data.title ||
`${data.system}${data.serverZone}${data.series}${data.diamondLevel}钻${briStr}`,
`${data.system || '苹果'}${data.serverZone || '微信区'}${data.series || '暗潮'}${data.diamondLevel || 1}钻${briStr} 苏尔南`,
system: data.system || '苹果',
serverZone: data.serverZone || '微信区',
series: data.series || '暗潮',
diamondLevel: data.diamondLevel || 1,
brillianceCount: data.brillianceCount || 0,
askingPrice: data.presetPriceFen > 0 ? data.presetPriceFen / 100 : undefined,
loginMethod: 'wechat_qrcode',
depositAmount: data.presetPriceFen > 0 ? data.presetPriceFen / 100 : 100,
})
setDepositTouched(false)
})
.catch((err: any) => {
setErrorMsg(err.message || '获取收集信息失败或链接已失效')
@@ -86,15 +116,36 @@ export default function ConsignmentCollectPage() {
async function handleSubmit(values: any) {
if (!token) return
const screenshots = fileList
.filter((f) => f.status === 'done' && (f.response?.url || f.url))
.map((f) => f.response?.url || f.url)
if (screenshots.length === 0) {
message.error('请上传游戏主页截图以供核验!')
return
}
setSubmitting(true)
try {
const askingPriceFen = Math.round(Number(values.askingPrice || 0) * 100)
const screenshots = fileList
.filter((f) => f.status === 'done' && (f.response?.url || f.url))
.map((f) => f.response?.url || f.url)
const depositAmountFen = Math.round(
Number(values.depositAmount || values.askingPrice || 100) * 100,
)
if (askingPriceFen < 100) {
message.error('寄售价格不能少于1元')
return
}
if (depositAmountFen < 100) {
message.error('履约押金不能少于1元')
return
}
const payload = {
itemName: values.itemName,
itemName:
values.itemName ||
`${values.system}${values.serverZone}${values.series}${values.diamondLevel}钻苏尔南`,
system: values.system,
serverZone: values.serverZone,
series: values.series,
@@ -103,22 +154,21 @@ export default function ConsignmentCollectPage() {
sellerContact: values.sellerContact,
contactInfo: values.sellerContact,
sellerPhone: values.sellerPhone,
sellerGameId: values.sellerGameId,
sellerPaymentInfo: values.sellerPaymentInfo,
sellerGameId: `${values.characterName} (${values.characterId})`,
sellerPaymentInfo: '走接单平台钱包结算',
askingPriceFen,
depositAmountFen,
screenshotsJson: screenshots,
contentJson: {
loginMethod: values.loginMethod,
account: values.account,
password: values.password,
authNote: values.authNote,
characterName: values.characterName,
characterId: values.characterId,
sellerNote: values.sellerNote,
},
}
const res = await submitPublicConsignment(token, payload)
setSubmittedResult(res.data)
message.success('寄卖申请提交成功!')
message.success('苏尔南手枪寄卖登记提交成功!')
} catch (err: any) {
message.error(err.message || '提交失败,请重试')
} finally {
@@ -128,16 +178,16 @@ export default function ConsignmentCollectPage() {
if (loading) {
return (
<div style={{ padding: '60px 20px', textAlign: 'center' }}>
<div style={{ padding: '80px 20px', textAlign: 'center' }}>
<Spin size="large" />
<div style={{ marginTop: 16, color: '#8c8c8c' }}>正在加载寄卖登记信息...</div>
<div style={{ marginTop: 16, color: '#8c8c8c' }}>正在加载苏尔南手枪寄卖登记信息...</div>
</div>
)
}
if (errorMsg) {
return (
<div style={{ maxWidth: 600, margin: '40px auto', padding: '0 16px' }}>
<div style={{ maxWidth: 600, margin: '60px auto', padding: '0 16px' }}>
<Result
status="warning"
title="链接无法访问"
@@ -150,24 +200,27 @@ export default function ConsignmentCollectPage() {
if (submittedResult) {
return (
<div style={{ maxWidth: 600, margin: '40px auto', padding: '0 16px' }}>
<div style={{ maxWidth: 640, margin: '40px auto', padding: '0 16px' }}>
<Card
bordered={false}
style={{ boxShadow: '0 4px 12px rgba(0,0,0,0.05)', borderRadius: 12 }}
style={{ boxShadow: '0 4px 16px rgba(0,0,0,0.06)', borderRadius: 16 }}
>
<Result
status="success"
title="寄卖登记提交成功!"
title="苏尔南手枪寄售登记成功!"
subTitle={
<div>
<div>
您的登记单号:
<Text strong copyable>
<div style={{ fontSize: 15, margin: '8px 0' }}>
登记单号:
<Text strong copyable style={{ color: '#1890ff' }}>
{submittedResult.submissionNo}
</Text>
</div>
<div style={{ marginTop: 8 }}>
客服将在核实账号及物品品质后,通过您填写的联系方式与您确认交接并打款。
<div style={{ marginTop: 12, color: '#595959', lineHeight: 1.7 }}>
您的寄售手枪已进入<strong>打手接单平台寄售池</strong>。
<br />
匹配到买家工单后,系统将通过接单平台指派您进行局内交付,并自动执行
<strong>押金保障机制</strong>。交付验收后货款将直达您的账户。
</div>
</div>
}
@@ -186,7 +239,7 @@ export default function ConsignmentCollectPage() {
<div
style={{
minHeight: '100vh',
background: '#f5f7fa',
background: '#f0f2f5',
padding: '24px 16px 60px',
}}
>
@@ -195,26 +248,26 @@ export default function ConsignmentCollectPage() {
<Card
bordered={false}
style={{
borderRadius: 12,
borderRadius: 16,
marginBottom: 16,
boxShadow: '0 2px 8px rgba(0,0,0,0.04)',
background: 'linear-gradient(135deg, #1890ff 0%, #096dd9 100%)',
boxShadow: '0 4px 14px rgba(24, 144, 255, 0.15)',
background: 'linear-gradient(135deg, #096dd9 0%, #1890ff 50%, #40a9ff 100%)',
color: '#fff',
}}
>
<Space orientation="vertical" size={6} style={{ width: '100%' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<TrophyOutlined style={{ fontSize: 24, color: '#ffd666' }} />
<Space direction="vertical" size={8} style={{ width: '100%' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
<TrophyOutlined style={{ fontSize: 26, color: '#ffd666' }} />
<Title level={4} style={{ color: '#fff', margin: 0 }}>
{linkInfo?.title || '和平精英 装备/账号 寄卖登记'}
{linkInfo?.title || '苏尔南手枪 · 走打手接单平台寄卖'}
</Title>
</div>
<Paragraph style={{ color: 'rgba(255,255,255,0.85)', margin: 0, fontSize: 13 }}>
平台保障 · 极速审核 · 验货即打款 · 请如实填写以下信息
<Paragraph style={{ color: 'rgba(255,255,255,0.92)', margin: 0, fontSize: 13.5 }}>
平台保障 · 走接单平台押金履约 · 验货即打款 · 杜绝私下跑单
</Paragraph>
{linkInfo ? (
<div style={{ marginTop: 8, display: 'flex', flexWrap: 'wrap', gap: 6 }}>
<div style={{ marginTop: 6, display: 'flex', flexWrap: 'wrap', gap: 6 }}>
{linkInfo.system ? <Tag color="blue">{linkInfo.system}</Tag> : null}
{linkInfo.serverZone ? <Tag color="cyan">{linkInfo.serverZone}</Tag> : null}
{linkInfo.series ? <Tag color="orange">{linkInfo.series}</Tag> : null}
@@ -232,22 +285,55 @@ export default function ConsignmentCollectPage() {
</Space>
</Card>
{/* 押金保障卡片 */}
<Alert
showIcon
icon={<SafetyCertificateOutlined style={{ fontSize: 20, color: '#52c41a' }} />}
type="success"
message="走打手接单平台 · 押金保障机制"
description="寄售手枪统一通过接单平台派单交付。登记时可填写履约押金(默认跟寄售价一致);指派交枪时冻结押金,买家验货确认后解冻并结算货款。"
style={{ marginBottom: 16, borderRadius: 12, border: '1px solid #b7eb8f' }}
/>
{/* 表单填写区 */}
<Card
bordered={false}
style={{
borderRadius: 12,
boxShadow: '0 2px 8px rgba(0,0,0,0.04)',
borderRadius: 16,
boxShadow: '0 2px 10px rgba(0,0,0,0.04)',
}}
>
<Form form={form} layout="vertical" onFinish={handleSubmit}>
<Title level={5} style={{ marginBottom: 16 }}>
1. 物品与规格确认
</Title>
<Form
form={form}
layout="vertical"
initialValues={{ depositAmount: 100 }}
onFinish={handleSubmit}
onValuesChange={(changed) => updateAutoItemName(changed)}
>
{/* 1. 枪系与规格 */}
<div
style={{
display: 'flex',
alignItems: 'center',
gap: 8,
marginBottom: 16,
borderBottom: '1px solid #f0f0f0',
paddingBottom: 8,
}}
>
<TrophyOutlined style={{ color: '#1890ff', fontSize: 18 }} />
<Title level={5} style={{ margin: 0 }}>
1. 苏尔南手枪规格与价格
</Title>
</div>
<Row gutter={12}>
<Col span={12}>
<Form.Item name="system" label="操作系统" rules={[{ required: true }]}>
<Form.Item
name="system"
label="操作系统"
rules={[{ required: true, message: '请选择操作系统' }]}
>
<Select
options={[
{ label: '苹果 (iOS)', value: '苹果' },
@@ -258,7 +344,11 @@ export default function ConsignmentCollectPage() {
</Form.Item>
</Col>
<Col span={12}>
<Form.Item name="serverZone" label="游戏区服" rules={[{ required: true }]}>
<Form.Item
name="serverZone"
label="游戏区服"
rules={[{ required: true, message: '请选择游戏区服' }]}
>
<Select
options={[
{ label: '微信区', value: '微信区' },
@@ -271,20 +361,26 @@ export default function ConsignmentCollectPage() {
<Row gutter={12}>
<Col span={8}>
<Form.Item name="series" label="系列/枪系" rules={[{ required: true }]}>
<Form.Item
name="series"
label="系列/枪系"
rules={[{ required: true, message: '请选择枪系' }]}
>
<Select
options={[
{ label: '暗潮', value: '暗潮' },
{ label: '怒嚎', value: '怒嚎' },
{ label: '血宴', value: '血宴' },
{ label: '矩阵', value: '矩阵' },
{ label: '其他', value: '其他' },
]}
/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item name="diamondLevel" label="钻石等级" rules={[{ required: true }]}>
<Form.Item
name="diamondLevel"
label="钻石等级 (1-7)"
rules={[{ required: true, message: '请选择钻石等级' }]}
>
<Select
options={[
{ label: '1 钻', value: 1 },
@@ -293,89 +389,138 @@ export default function ConsignmentCollectPage() {
{ label: '4 钻', value: 4 },
{ label: '5 钻', value: 5 },
{ label: '6 钻', value: 6 },
{ label: '7 钻', value: 7 },
]}
/>
</Form.Item>
</Col>
<Col span={8}>
<Form.Item name="brillianceCount" label="璀璨数">
<InputNumber min={0} max={6} style={{ width: '100%' }} />
<Form.Item name="brillianceCount" label="璀璨数 (0-7)">
<Select
options={[
{ label: '无璀璨 (0)', value: 0 },
{ label: '1 璀璨', value: 1 },
{ label: '2 璀璨', value: 2 },
{ label: '3 璀璨', value: 3 },
{ label: '4 璀璨', value: 4 },
{ label: '5 璀璨', value: 5 },
{ label: '6 璀璨', value: 6 },
{ label: '7 璀璨', value: 7 },
]}
/>
</Form.Item>
</Col>
</Row>
<Form.Item
name="itemName"
label="物品/账号名称"
rules={[{ required: true, message: '请输入物品名称' }]}
>
<Input placeholder="如:苹果微信暗潮1钻" />
</Form.Item>
<Row gutter={12}>
<Col span={10}>
<Form.Item
name="itemName"
label="物品名称"
rules={[{ required: true, message: '请输入物品名称' }]}
>
<Input placeholder="如:苹果微信暗潮1钻 苏尔南" />
</Form.Item>
</Col>
<Col span={7}>
<Form.Item
name="askingPrice"
label="寄售价格 (元)"
rules={[{ required: true, message: '请填写寄售价格' }]}
>
<InputNumber
min={1}
step={1}
style={{ width: '100%' }}
placeholder="如 80"
addonBefore="¥"
/>
</Form.Item>
</Col>
<Col span={7}>
<Form.Item
name="depositAmount"
label="履约押金 (元)"
rules={[{ required: true, message: '请填写履约押金' }]}
tooltip="指派打手交枪时冻结;验货通过后解冻。建议不低于寄售价。"
extra="默认跟寄售价一致,也可手动调整"
>
<InputNumber
min={1}
step={10}
style={{ width: '100%' }}
placeholder="如 100"
addonBefore="¥"
/>
</Form.Item>
</Col>
</Row>
<Form.Item
name="askingPrice"
label="期望转让/收购价格 (元)"
rules={[{ required: true, message: '请填写出价' }]}
{/* 2. 卖家联系方式与游戏凭据 */}
<div
style={{
display: 'flex',
alignItems: 'center',
gap: 8,
margin: '24px 0 16px',
borderBottom: '1px solid #f0f0f0',
paddingBottom: 8,
}}
>
<InputNumber
min={1}
step={1}
style={{ width: '100%' }}
placeholder="请输入您的心理价位 (元)"
/>
</Form.Item>
<Title level={5} style={{ margin: '24px 0 16px' }}>
2. 卖家联系与收款方式
</Title>
<SafetyCertificateOutlined style={{ color: '#52c41a', fontSize: 18 }} />
<Title level={5} style={{ margin: 0 }}>
2. 卖家联系方式与游戏凭据
</Title>
</div>
<Row gutter={12}>
<Col span={12}>
<Form.Item
name="sellerContact"
label="您的微信号/QQ号"
rules={[{ required: true, message: '请填写联系微信号或QQ' }]}
rules={[{ required: true, message: '请填写微信号或QQ' }]}
>
<Input placeholder="方便客服核实联系" />
<Input placeholder="方便客服核实与通知" />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item name="sellerPhone" label="联系电话">
<Input placeholder="手机号 (选填)" />
<Form.Item
name="sellerPhone"
label="联系电话 (用于打手平台关联)"
rules={[{ required: true, message: '请填写联系电话' }]}
tooltip="如您已是接单平台打手,请填写注册手机号,系统将自动识别并关联您的打手账户与押金额度"
>
<Input placeholder="手机号 (用于匹配打手)" />
</Form.Item>
</Col>
</Row>
<Row gutter={12}>
<Col span={12}>
<Form.Item
name="characterName"
label="游戏内角色名"
rules={[{ required: true, message: '请填写游戏内角色名' }]}
>
<Input placeholder="如:战神张三 (用于局内加好友丢枪)" />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
name="characterId"
label="角色数字ID"
rules={[{ required: true, message: '请填写角色数字ID' }]}
>
<Input placeholder="如:1089238472 (核准号主身份)" />
</Form.Item>
</Col>
</Row>
<Form.Item
name="sellerGameId"
label="游戏内角色名 / 角色数字ID"
rules={[{ required: true, message: '请填写游戏内角色名称或ID' }]}
label="游戏主页截图 (必须包含角色名、ID及仓库/手枪详情)"
required
tooltip="请上传游戏个人主页或背包手枪品质截图,供客服审核真实性"
>
<Input placeholder="如:和平精英-玩家张三 (用于核实号主)" />
</Form.Item>
<Form.Item
name="sellerPaymentInfo"
label="收款账户 (支付宝账号及姓名 或 微信收款卡号)"
rules={[{ required: true, message: '请填写收款信息' }]}
>
<Input placeholder="如:支付宝 13800000000 (张三) / 工商银行 6222... (张三)" />
</Form.Item>
<Title level={5} style={{ margin: '24px 0 16px' }}>
3. 凭据截图与账号交接 (仅内部审核验号可见)
</Title>
<Alert
showIcon
icon={<LockOutlined />}
type="info"
message="信息安全保障"
description="您填写的账号凭据与截图受平台严格加密保护,仅由官方指定客服在验货核实时可见,绝不泄露给任何无关第三方。"
style={{ marginBottom: 16 }}
/>
<Form.Item label="游戏内物品/品质/仓库截图证明 (最多4张)">
<Upload
listType="picture-card"
fileList={fileList}
@@ -393,41 +538,18 @@ export default function ConsignmentCollectPage() {
>
{fileList.length < 4 ? (
<div>
<CloudUploadOutlined style={{ fontSize: 20, color: '#1890ff' }} />
<div style={{ marginTop: 6, fontSize: 12 }}>上传截图</div>
<CloudUploadOutlined style={{ fontSize: 22, color: '#1890ff' }} />
<div style={{ marginTop: 6, fontSize: 12 }}>上传主页截图</div>
</div>
) : null}
</Upload>
</Form.Item>
<Form.Item name="loginMethod" label="交付/上号方式">
<Radio.Group>
<Radio value="wechat_qrcode">微信扫码登录</Radio>
<Radio value="qq_qrcode">QQ扫码登录</Radio>
<Radio value="account_pwd">账号密码交付</Radio>
<Radio value="in_game_transfer">游戏内转赠/投喂</Radio>
</Radio.Group>
</Form.Item>
<Row gutter={12}>
<Col span={12}>
<Form.Item name="account" label="游戏账号/上号手机号">
<Input placeholder="如账号密码交付请填写" />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item name="password" label="上号密码">
<Input.Password placeholder="如需密码登录请填写" />
</Form.Item>
</Col>
</Row>
<Form.Item name="authNote" label="上号与二次验证说明">
<Input placeholder="如:需发微信确认登录、备用安全码、在线时间段等" />
</Form.Item>
<Form.Item name="sellerNote" label="其他留言与补充">
<Input.TextArea rows={2} placeholder="如有其他装备搭配或说明可在此补充" />
<Input.TextArea
rows={2}
placeholder="如有手枪配件、子弹、涂装或在线时间段说明,可在此备注"
/>
</Form.Item>
<Button
@@ -436,14 +558,16 @@ export default function ConsignmentCollectPage() {
size="large"
block
loading={submitting}
icon={<DollarOutlined />}
style={{
marginTop: 16,
height: 48,
fontSize: 16,
borderRadius: 8,
borderRadius: 10,
background: 'linear-gradient(135deg, #1890ff 0%, #096dd9 100%)',
}}
>
提交寄卖申请并登记
提交苏尔南手枪寄售登记
</Button>
</Form>
</Card>