feat(consignment): 打手端寄卖页标题跟随分类 tab 名称
This commit is contained in:
@@ -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 '寄卖'
|
||||
}
|
||||
Reference in New Issue
Block a user