feat(consignment): 打手端寄卖页标题跟随分类 tab 名称
This commit is contained in:
@@ -64,6 +64,7 @@ import type { UploadedFile } from '@/types/worker-platform'
|
||||
import { DEFAULT_CONSIGNMENT_INTAKE_FIELDS, buildSpecItemName } from '@/utils/consignment-spec'
|
||||
import { formatConsignmentContactSupporter } from '@/utils/consignment-contact'
|
||||
import { formatGiftCooldownRemaining } from '@/utils/consignment-cooldown'
|
||||
import { resolveConsignmentPageTitle } from '@/utils/consignment-page-title'
|
||||
import { canWorkerPublishConsignment } from '@/utils/consignment-whitelist'
|
||||
import { formatDateTime } from '@/utils/date-time'
|
||||
import { useIsMobile } from '@/utils/use-is-mobile'
|
||||
@@ -205,6 +206,7 @@ export default function WorkerConsignmentPage() {
|
||||
consignmentProfiles[0] ||
|
||||
null
|
||||
const selectedSpecs: ConsignmentSpecField[] = selectedProfile?.config.specs ?? []
|
||||
const pageTitle = resolveConsignmentPageTitle(selectedProfile)
|
||||
const intakeFields: ConsignmentIntakeField[] =
|
||||
selectedProfile?.config.intake?.fields ?? DEFAULT_CONSIGNMENT_INTAKE_FIELDS
|
||||
useEffect(() => {
|
||||
@@ -684,7 +686,7 @@ export default function WorkerConsignmentPage() {
|
||||
寄卖功能暂未开通
|
||||
</Typography.Title>
|
||||
<Typography.Paragraph type="secondary" style={{ fontSize: 13, marginBottom: 20 }}>
|
||||
平台当前开启寄卖白名单。请联系客服申请开通,由后台运营开通后即可发布苏尔南寄卖。
|
||||
平台当前开启寄卖白名单。请联系客服申请开通,由后台运营开通后即可发布寄卖。
|
||||
</Typography.Paragraph>
|
||||
<Button
|
||||
type="primary"
|
||||
@@ -1069,7 +1071,7 @@ export default function WorkerConsignmentPage() {
|
||||
<div className="worker-orders-desktop-header">
|
||||
<div className="worker-orders-header-left">
|
||||
<Typography.Title level={3} className="worker-orders-heading">
|
||||
苏尔南寄卖
|
||||
{pageTitle}
|
||||
</Typography.Title>
|
||||
<span className="worker-orders-live-badge">
|
||||
<span className="worker-orders-pulse-dot" />
|
||||
|
||||
@@ -4460,6 +4460,19 @@ body {
|
||||
.worker-consignment-page .worker-orders-desktop-header {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* 标题跟随分类配置,最长 30 字;移动端允许换行,避免挤压右侧刷新按钮 */
|
||||
.worker-consignment-page .worker-orders-header-left {
|
||||
min-width: 0;
|
||||
flex-shrink: 1;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.worker-consignment-page .worker-orders-heading.ant-typography {
|
||||
white-space: normal;
|
||||
overflow-wrap: anywhere;
|
||||
line-height: 1.25;
|
||||
}
|
||||
}
|
||||
|
||||
.worker-consignment-page .worker-orders-card {
|
||||
|
||||
@@ -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