功能(订单服务): 将未成年提示和底部引导图并入分类配置
This commit is contained in:
@@ -68,11 +68,7 @@ export const WORKER_PLATFORM_TAB_QUERY_KEYS: Record<string, string[][]> = {
|
||||
finance: [['admin-finance-settlements'], ['admin-finance-withdrawals']],
|
||||
levels: [['admin-worker-levels']],
|
||||
notifications: [['admin-notifications']],
|
||||
announcement: [
|
||||
['admin-announcements'],
|
||||
['admin-worker-support-contact'],
|
||||
['admin-order-service-age-gate'],
|
||||
],
|
||||
announcement: [['admin-announcements'], ['admin-worker-support-contact']],
|
||||
'hall-config': [['admin-hall-config']],
|
||||
'risk-control': [['admin-worker-risk-overview'], ['admin-worker-risk-events']],
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import type { OrderServiceAgeGateConfig } from '@/types/worker-platform'
|
||||
import type {
|
||||
OrderServiceAgeGateConfig,
|
||||
OrderServiceBottomGuideImageConfig,
|
||||
UploadedFile,
|
||||
} from '@/types/worker-platform'
|
||||
|
||||
export type OrderServiceAgeGateDecision = 'pending' | 'adult' | 'minor'
|
||||
|
||||
@@ -127,3 +131,25 @@ export function mergeOrderServiceAgeGateConfig(
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
export function selectFirstOrderServiceAgeGate(
|
||||
items: Array<{ ageGate?: OrderServiceAgeGateConfig }>,
|
||||
): OrderServiceAgeGateConfig | null {
|
||||
return items.find((item) => item.ageGate)?.ageGate || null
|
||||
}
|
||||
|
||||
export function dedupeOrderServiceBottomGuideImages(
|
||||
items: Array<{ bottomGuideImage?: OrderServiceBottomGuideImageConfig }>,
|
||||
): Array<OrderServiceBottomGuideImageConfig & { image: UploadedFile }> {
|
||||
const result: Array<OrderServiceBottomGuideImageConfig & { image: UploadedFile }> = []
|
||||
const seen = new Set<string>()
|
||||
for (const item of items) {
|
||||
const config = item.bottomGuideImage
|
||||
if (!config?.enabled || !config.image) continue
|
||||
const identity = String(config.image.objectKey || config.image.url || '').trim()
|
||||
if (!identity || seen.has(identity)) continue
|
||||
seen.add(identity)
|
||||
result.push({ ...config, image: config.image })
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user