feat(consignment): 寄售匹配成功后向卖家端与客服后台透出买家加好友资料
This commit is contained in:
@@ -2,12 +2,15 @@ import {
|
||||
CheckCircleOutlined,
|
||||
ClockCircleOutlined,
|
||||
CloudUploadOutlined,
|
||||
CopyOutlined,
|
||||
DollarCircleOutlined,
|
||||
HistoryOutlined,
|
||||
InboxOutlined,
|
||||
PictureOutlined,
|
||||
PlusOutlined,
|
||||
ReloadOutlined,
|
||||
SafetyCertificateOutlined,
|
||||
UserOutlined,
|
||||
} from '@ant-design/icons'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import {
|
||||
@@ -912,6 +915,115 @@ function SpecTags({
|
||||
)
|
||||
}
|
||||
|
||||
function ConsignmentBuyerInfoBlock({
|
||||
buyerInfo,
|
||||
}: {
|
||||
buyerInfo: NonNullable<WorkerConsignmentRecord['buyerInfo']>
|
||||
}) {
|
||||
const { message } = App.useApp()
|
||||
|
||||
const copyText = (text: string, label: string) => {
|
||||
if (!text) return
|
||||
navigator.clipboard
|
||||
.writeText(text)
|
||||
.then(() => message.success(`已复制${label}:${text}`))
|
||||
.catch(() => message.error('复制失败,请手动长按复制'))
|
||||
}
|
||||
|
||||
const copyAll = () => {
|
||||
const parts: string[] = []
|
||||
if (buyerInfo.gameNickname) parts.push(`角色名: ${buyerInfo.gameNickname}`)
|
||||
if (buyerInfo.gameId) parts.push(`游戏ID: ${buyerInfo.gameId}`)
|
||||
if (buyerInfo.serverZone) parts.push(`区服: ${buyerInfo.serverZone}`)
|
||||
if (buyerInfo.system) parts.push(`系统: ${buyerInfo.system}`)
|
||||
copyText(parts.join(' | '), '买家加好友资料')
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="worker-consignment-buyer-box">
|
||||
<div className="worker-consignment-buyer-header">
|
||||
<Space size={6}>
|
||||
<UserOutlined style={{ color: '#1677ff' }} />
|
||||
<Typography.Text strong style={{ color: '#1677ff', fontSize: 13 }}>
|
||||
买家加好友资料
|
||||
</Typography.Text>
|
||||
</Space>
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
icon={<CopyOutlined />}
|
||||
style={{ padding: 0, height: 'auto', fontSize: 12 }}
|
||||
onClick={copyAll}
|
||||
>
|
||||
一键复制资料
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="worker-consignment-buyer-grid">
|
||||
{buyerInfo.gameNickname ? (
|
||||
<div className="buyer-field-cell">
|
||||
<span className="buyer-field-label">买家角色名</span>
|
||||
<Typography.Text
|
||||
strong
|
||||
copyable={{ text: buyerInfo.gameNickname }}
|
||||
className="buyer-field-highlight"
|
||||
>
|
||||
{buyerInfo.gameNickname}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{buyerInfo.gameId ? (
|
||||
<div className="buyer-field-cell">
|
||||
<span className="buyer-field-label">角色数字ID</span>
|
||||
<Typography.Text
|
||||
strong
|
||||
copyable={{ text: buyerInfo.gameId }}
|
||||
className="buyer-field-highlight"
|
||||
>
|
||||
{buyerInfo.gameId}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{buyerInfo.serverZone || buyerInfo.system ? (
|
||||
<div className="buyer-field-cell">
|
||||
<span className="buyer-field-label">区服与系统</span>
|
||||
<Space size={4} style={{ marginTop: 2 }}>
|
||||
{buyerInfo.system ? <Tag color="blue">{buyerInfo.system}</Tag> : null}
|
||||
{buyerInfo.serverZone ? <Tag color="cyan">{buyerInfo.serverZone}</Tag> : null}
|
||||
</Space>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{buyerInfo.screenshots && buyerInfo.screenshots.length > 0 ? (
|
||||
<div className="worker-consignment-buyer-shots-wrap">
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
<PictureOutlined style={{ marginRight: 4 }} />
|
||||
买家主页截图(在游戏内添加好友时核对头像/段位/等级,防加错人):
|
||||
</Typography.Text>
|
||||
<div style={{ marginTop: 6 }}>
|
||||
<Image.PreviewGroup>
|
||||
<Space size={8} wrap>
|
||||
{buyerInfo.screenshots.map((src: string, i: number) => (
|
||||
<Image
|
||||
key={`buyer-shot-${i}`}
|
||||
src={src}
|
||||
width={48}
|
||||
height={48}
|
||||
style={{ objectFit: 'cover', borderRadius: 6, border: '1px solid #bfdbfe' }}
|
||||
/>
|
||||
))}
|
||||
</Space>
|
||||
</Image.PreviewGroup>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 「我的寄卖」记录卡片:一件货一张卡。
|
||||
*
|
||||
@@ -968,6 +1080,7 @@ function ConsignmentRecordCard({
|
||||
{record.reviewNote ? (
|
||||
<Typography.Text type="danger">审核说明:{record.reviewNote}</Typography.Text>
|
||||
) : null}
|
||||
{record.buyerInfo ? <ConsignmentBuyerInfoBlock buyerInfo={record.buyerInfo} /> : null}
|
||||
{record.hint ? (
|
||||
<Typography.Text type="secondary" className="worker-consignment-record-hint">
|
||||
{record.hint}
|
||||
|
||||
Reference in New Issue
Block a user