feat(consignment): 打手端寄卖页标题跟随分类 tab 名称

This commit is contained in:
2026-11-08 10:46:32 +08:00
parent 313e619744
commit 229eef31a8
4 changed files with 79 additions and 2 deletions
@@ -0,0 +1,18 @@
import type { WorkerConsignmentProfile } from '../types/consignment'
type ConsignmentPageTitleProfile =
| Pick<WorkerConsignmentProfile, 'tabTitle' | 'categoryName'>
| null
| undefined
/**
* 打手端寄卖页大标题:跟随当前选中的寄卖分类。
* 后台「打手端 tab 名称」留空时按分类名称兜底,与配置页提示保持一致。
*/
export function resolveConsignmentPageTitle(profile: ConsignmentPageTitleProfile): string {
const tabTitle = profile?.tabTitle?.trim()
if (tabTitle) return tabTitle
const categoryName = profile?.categoryName?.trim()
if (categoryName) return categoryName
return '寄卖'
}