完善二期清单

This commit is contained in:
Azmat@qq.com
2026-08-18 14:11:05 +08:00
parent d1ecb52125
commit dfe94a923e
55 changed files with 1754 additions and 137 deletions
+29
View File
@@ -0,0 +1,29 @@
/** 商品「类目」= 电商 / 本地生活。跟商品库已有的「品类」(美妆/食品)是两个维度,不能混用。 */
export const BUSINESS_TYPES = {
ecommerce: "电商",
local_life: "本地生活",
} as const;
export type BusinessType = keyof typeof BUSINESS_TYPES;
export const BUSINESS_TYPE_KEYS = Object.keys(BUSINESS_TYPES) as BusinessType[];
/** 电商品类 · 新建抽屉 / 详情编辑共用 */
export const PC_CAT_OPTIONS = ["美妆个护", "服饰内衣", "食品饮料", "家居家电", "数码 3C", "个护清洁", "运动户外", "母婴亲子"];
/** 本地生活品类 · 团购/到店核销走这条,不跟电商 SKU 混在一个下拉里 */
export const PC_LOCAL_CAT_OPTIONS = ["餐饮美食", "休闲娱乐", "丽人美发", "酒店民宿", "生活服务", "运动健身", "亲子玩乐", "团购套餐"];
export function isLocalLife(product?: { business_type?: string } | null): boolean {
return product?.business_type === "local_life";
}
export function catOptionsFor(businessType: string): string[] {
return businessType === "local_life" ? PC_LOCAL_CAT_OPTIONS : PC_CAT_OPTIONS;
}
export function businessTypeLabel(value?: string | null): string {
if (value === "local_life") return BUSINESS_TYPES.local_life;
return BUSINESS_TYPES.ecommerce;
}