fix(worker-consignment): 修复卖家提交赠送截图后在接单平台无法回显的问题
1. 后端 listWorkerConsignments 接口从关联工单验收资料中提取 giftEvidenceImages、giftEvidenceNote、giftEvidenceSubmittedAt 并在打手端寄卖列表中下发; 2. 接单平台「我的寄卖」卡片新增已提交赠送凭证展示模块,支持展示缩略图、张数统计、大图预览及赠送备注; 3. 优化提报单与库存、工单的 SQL 关联兼容双向绑定,确保后台与前台均能稳定查到赠送凭证。
This commit is contained in:
@@ -393,7 +393,11 @@ export default function WorkerConsignmentPage() {
|
||||
setEvidenceSubmitting(true)
|
||||
try {
|
||||
const note = evidenceNote.trim()
|
||||
const payload = note ? { imageUrls: urls, note } : { imageUrls: urls }
|
||||
const payload = {
|
||||
files: evidenceFiles,
|
||||
imageUrls: urls,
|
||||
...(note ? { note } : {}),
|
||||
}
|
||||
await submitWorkerConsignmentGiftEvidence(submissionId, payload)
|
||||
message.success('赠送截图已提交,等待客服验收')
|
||||
closeEvidenceModal()
|
||||
@@ -1044,6 +1048,9 @@ function ConsignmentRecordCard({
|
||||
const shots = Array.isArray(record.screenshotsJson)
|
||||
? record.screenshotsJson.filter((s): s is string => typeof s === 'string')
|
||||
: []
|
||||
const giftShots = Array.isArray(record.giftEvidenceImages)
|
||||
? record.giftEvidenceImages.filter((s): s is string => typeof s === 'string')
|
||||
: []
|
||||
// 只有后端把阶段标成 gift_cooldown 时才显示倒计时,前端不自己推阶段
|
||||
const cooldown =
|
||||
record.stage === 'gift_cooldown' && record.giftAvailableAt
|
||||
@@ -1096,7 +1103,35 @@ function ConsignmentRecordCard({
|
||||
) : null}
|
||||
</Space>
|
||||
) : null}
|
||||
{shots.length > 0 ? (
|
||||
{giftShots.length > 0 ? (
|
||||
<div className="worker-consignment-gift-shots-wrap" style={{ marginTop: 8, padding: '8px 12px', background: '#f0fdf4', borderRadius: 6, border: '1px solid #bbf7d0' }}>
|
||||
<Typography.Text strong style={{ fontSize: 13, color: '#15803d', display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
<CheckCircleOutlined />
|
||||
已提交赠送凭证(共 {giftShots.length} 张截图,等待客服验收):
|
||||
</Typography.Text>
|
||||
<div style={{ marginTop: 6 }}>
|
||||
<Image.PreviewGroup>
|
||||
<Space size={8} wrap>
|
||||
{giftShots.map((src, i) => (
|
||||
<Image
|
||||
key={`gift-shot-${i}`}
|
||||
src={src}
|
||||
width={52}
|
||||
height={52}
|
||||
style={{ objectFit: 'cover', borderRadius: 6, border: '1px solid #86efac' }}
|
||||
/>
|
||||
))}
|
||||
</Space>
|
||||
</Image.PreviewGroup>
|
||||
</div>
|
||||
{record.giftEvidenceNote ? (
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12, display: 'block', marginTop: 4 }}>
|
||||
赠送备注:{record.giftEvidenceNote}
|
||||
</Typography.Text>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
{shots.length > 0 && giftShots.length === 0 ? (
|
||||
<div className="worker-consignment-record-shots">
|
||||
<Image.PreviewGroup>
|
||||
<Space size={8}>
|
||||
|
||||
@@ -432,6 +432,9 @@ export type WorkerConsignmentRecord = {
|
||||
depositAmountFen: number
|
||||
reviewNote: string
|
||||
screenshotsJson: string[]
|
||||
giftEvidenceImages?: string[]
|
||||
giftEvidenceNote?: string
|
||||
giftEvidenceSubmittedAt?: string | null
|
||||
createdAt: string
|
||||
stage: WorkerConsignmentStage
|
||||
/** 中文阶段名,如「已匹配-待加好友」 */
|
||||
|
||||
Reference in New Issue
Block a user