fix(consignment): 内部现货履约文案对齐待加好友,并移除已废弃的指派打手路径
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,6 +6,27 @@ function asRecord(value: unknown): Record<string, unknown> {
|
||||
: {}
|
||||
}
|
||||
|
||||
/** 寄售截图可能是字符串 URL,也可能是 UploadedFile 对象。 */
|
||||
export function resolveConsignmentScreenshotUrls(screenshots: unknown): string[] {
|
||||
if (!Array.isArray(screenshots)) return []
|
||||
return screenshots
|
||||
.map((item) => {
|
||||
if (typeof item === 'string') return item.trim()
|
||||
if (item && typeof item === 'object' && !Array.isArray(item)) {
|
||||
const rec = item as Record<string, unknown>
|
||||
return String(rec.url || rec.mediumUrl || rec.thumbnailUrl || '').trim()
|
||||
}
|
||||
return ''
|
||||
})
|
||||
.filter(Boolean)
|
||||
}
|
||||
|
||||
export function resolveOrderConsignmentScreenshotUrls(order: { material?: unknown }): string[] {
|
||||
return resolveConsignmentScreenshotUrls(
|
||||
asRecord(asRecord(order.material).consignment).screenshots,
|
||||
)
|
||||
}
|
||||
|
||||
export type ConsignmentWorkerDisplayInfo = {
|
||||
tagText: '供货打手' | '内部现货'
|
||||
primaryName: string
|
||||
|
||||
Reference in New Issue
Block a user