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