修改
This commit is contained in:
+2
-2
@@ -2,8 +2,8 @@
|
||||
"name" : "CHEFLINK delivery",
|
||||
"appid" : "__UNI__06509BE",
|
||||
"description" : "",
|
||||
"versionName" : "3.2.2",
|
||||
"versionCode" : 322,
|
||||
"versionName" : "3.2.3",
|
||||
"versionCode" : 323,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/** 精选菜品列表 POST body,见 docs/app-featured-dish-list.md */
|
||||
export type FeaturedDishQueryBody = {
|
||||
operationalEntry?: string
|
||||
hasMemberPrice?: any
|
||||
stockMin?: any
|
||||
stockMax?: any
|
||||
@@ -10,6 +11,12 @@ export type FeaturedDishQueryBody = {
|
||||
isNew?: any
|
||||
}
|
||||
|
||||
/** 运营入口固定参数(精选菜品列表 operationalEntry) */
|
||||
export const OPERATIONAL_ENTRY = {
|
||||
FRESH_SEAFOOD_TODAY: 'fresh-seafood-today',
|
||||
LIMITED_AIR_SEAFOOD: 'limited-air-seafood',
|
||||
} as const
|
||||
|
||||
export type RouteQueryMap = Record<string, string | undefined>
|
||||
/** 将 URL 上可选筛选参数合并进 body(分页仍走 query) */
|
||||
export function mergeRouteQueryIntoBody(
|
||||
@@ -24,7 +31,9 @@ export function mergeRouteQueryIntoBody(
|
||||
const createEndTime = routeQuery.createEndTime
|
||||
const hasMemberPrice = routeQuery.hasMemberPrice
|
||||
const salesSort = routeQuery.salesSort
|
||||
const operationalEntry = routeQuery.operationalEntry
|
||||
|
||||
if (operationalEntry != null) body.operationalEntry = operationalEntry
|
||||
if (recipeCategoryId != null) body.recipeCategoryId = recipeCategoryId
|
||||
if (stockMin != null) body.stockMin = stockMin
|
||||
if (stockMax != null) body.stockMax = stockMax
|
||||
@@ -41,17 +50,10 @@ export function buildMemberZoneQuery(routeQuery?: RouteQueryMap): FeaturedDishQu
|
||||
return mergeRouteQueryIntoBody({ hasMemberPrice: true }, routeQuery)
|
||||
}
|
||||
|
||||
/** 海鲜菜谱分类 ID(保持字符串,勿转 number) */
|
||||
const SEAFOOD_RECIPE_CATEGORY_ID = '2037471880338415618'
|
||||
|
||||
/** 限量空运活海鲜:海鲜分类 + 库存范围 */
|
||||
/** 限量空运活海鲜:固定运营入口 */
|
||||
export function buildLiveSeafoodAirQuery(routeQuery?: RouteQueryMap): FeaturedDishQueryBody {
|
||||
return mergeRouteQueryIntoBody(
|
||||
{
|
||||
recipeCategoryId: SEAFOOD_RECIPE_CATEGORY_ID,
|
||||
stockMin: 1,
|
||||
stockMax: 200,
|
||||
},
|
||||
{ operationalEntry: OPERATIONAL_ENTRY.LIMITED_AIR_SEAFOOD },
|
||||
routeQuery,
|
||||
)
|
||||
}
|
||||
@@ -100,13 +102,10 @@ export function buildNewCalendarQuery(routeQuery?: RouteQueryMap): FeaturedDishQ
|
||||
)
|
||||
}
|
||||
|
||||
/** 今日现打海鲜:海鲜分类 + 当天创建时间(秒级时间戳) */
|
||||
/** 今日现打海鲜:固定运营入口 */
|
||||
export function buildFreshSeafoodTodayQuery(routeQuery?: RouteQueryMap): FeaturedDishQueryBody {
|
||||
return mergeRouteQueryIntoBody(
|
||||
{
|
||||
recipeCategoryId: SEAFOOD_RECIPE_CATEGORY_ID,
|
||||
...getTodayCreateTimeRange(),
|
||||
},
|
||||
{ operationalEntry: OPERATIONAL_ENTRY.FRESH_SEAFOOD_TODAY },
|
||||
routeQuery,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -29,11 +29,25 @@ export function resolveQuickTopicFromMerchantCategory(
|
||||
return QUICK_TOPIC_SLUGS[safeIndex]
|
||||
}
|
||||
|
||||
/** 快捷入口 topic 与 operationalEntry 固定映射 */
|
||||
export const TOPIC_OPERATIONAL_ENTRY: Partial<Record<QuickTopicSlug, string>> = {
|
||||
'live-seafood-air': 'limited-air-seafood',
|
||||
'fresh-seafood-today': 'fresh-seafood-today',
|
||||
}
|
||||
|
||||
export function buildQuickTopicUrl(
|
||||
topic: QuickTopicSlug,
|
||||
extra: { merchantCategoryId?: string | number; categoryName?: string } = {},
|
||||
extra: {
|
||||
merchantCategoryId?: string | number
|
||||
categoryName?: string
|
||||
operationalEntry?: string
|
||||
} = {},
|
||||
) {
|
||||
const parts = [`topic=${encodeURIComponent(topic)}`]
|
||||
const operationalEntry = extra.operationalEntry ?? TOPIC_OPERATIONAL_ENTRY[topic]
|
||||
if (operationalEntry) {
|
||||
parts.push(`operationalEntry=${encodeURIComponent(operationalEntry)}`)
|
||||
}
|
||||
if (extra.merchantCategoryId != null && extra.merchantCategoryId !== '') {
|
||||
parts.push(`merchantCategoryId=${encodeURIComponent(String(extra.merchantCategoryId))}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user