feat:寄卖增加对接客服,db脚本迁移修复

This commit is contained in:
2026-10-27 13:56:08 +08:00
parent 622bd779dd
commit a53321ef30
16 changed files with 43 additions and 225 deletions
+2 -17
View File
@@ -2,17 +2,13 @@
export type ConsignmentContactDisplay = {
/** 姓名;没有对接客服时为空串 */
name: string
/** 联系方式(电话 / 微信),没有时为空串 */
contact: string
/** 姓名 + 联系方式,列表里直接展示 */
/** 姓名,没有时回退为指定文案(默认「未指定」) */
text: string
}
type ConsignmentContactLike =
| {
contactSupporterName?: string | null
contactSupporterPhone?: string | null
contactSupporterWechat?: string | null
}
| null
| undefined
@@ -22,16 +18,5 @@ export function formatConsignmentContactSupporter(
emptyText = '未指定',
): ConsignmentContactDisplay {
const name = String(source?.contactSupporterName || '').trim()
const phone = String(source?.contactSupporterPhone || '').trim()
const wechat = String(source?.contactSupporterWechat || '').trim()
const parts: string[] = []
if (phone) parts.push(`电话 ${phone}`)
if (wechat) parts.push(`微信 ${wechat}`)
const contact = parts.join(' · ')
if (!name) {
return { name: '', contact, text: contact || emptyText }
}
return { name, contact, text: contact ? `${name} · ${contact}` : name }
return { name, text: name || emptyText }
}