完成JC-ArtList与JC-Salon端侧清理和统一命名

This commit is contained in:
2026-08-25 16:21:05 +08:00
parent aa93695704
commit abce4a2787
1839 changed files with 653 additions and 50415 deletions
+15
View File
@@ -0,0 +1,15 @@
export const BUY_NOW_MODE = 'buyNow'
type QueryValue = string | string[] | null | undefined
const firstQueryValue = (value: QueryValue) => Array.isArray(value) ? value[0] : value
export const getBuyNowProductIdFromQuery = (query: Record<string, unknown>) => {
const mode = firstQueryValue(query.mode as QueryValue)
const productId = firstQueryValue(query.productId as QueryValue)
return mode === BUY_NOW_MODE && productId ? String(productId) : ''
}
export const isBuyNowCartItem = (itemProductId: unknown, buyNowProductId: string) => {
return Boolean(buyNowProductId) && String(itemProductId || '') === String(buyNowProductId)
}