完善原生内容卡与H5详情分工
This commit is contained in:
@@ -35,6 +35,7 @@ function applyExperienceOverride(
|
||||
url: null,
|
||||
bridge: 'content-v1',
|
||||
fallback: 'native',
|
||||
presentation: 'sheet',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +45,7 @@ function applyExperienceOverride(
|
||||
url: override.url,
|
||||
bridge: override.bridge || (baseExperience ? baseExperience.bridge : 'content-v1'),
|
||||
fallback: override.fallback || 'native',
|
||||
presentation: override.presentation || (baseExperience ? baseExperience.presentation : 'sheet'),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +61,7 @@ function applyDisplayContentOverride(
|
||||
}
|
||||
|
||||
return {
|
||||
template: override.template || baseContent.template,
|
||||
title: override.title || baseContent.title,
|
||||
body: override.body || baseContent.body,
|
||||
autoPopup: override.autoPopup !== undefined ? override.autoPopup : baseContent.autoPopup,
|
||||
@@ -100,6 +103,7 @@ export function buildGameDefinitionFromCourse(
|
||||
sequence: null,
|
||||
score: null,
|
||||
displayContent: applyDisplayContentOverride({
|
||||
template: 'focus',
|
||||
title: '比赛开始',
|
||||
body: `${start.label || '开始点'}已激活,按提示前往下一个目标点。`,
|
||||
autoPopup: true,
|
||||
@@ -128,6 +132,7 @@ export function buildGameDefinitionFromCourse(
|
||||
sequence: control.sequence,
|
||||
score,
|
||||
displayContent: applyDisplayContentOverride({
|
||||
template: 'story',
|
||||
title: score !== null ? `收集 ${label} (+${score}分)` : `收集 ${label}`,
|
||||
body: score !== null ? `${buildDisplayBody(label, control.sequence)} · ${score}分` : buildDisplayBody(label, control.sequence),
|
||||
autoPopup: true,
|
||||
@@ -154,6 +159,7 @@ export function buildGameDefinitionFromCourse(
|
||||
sequence: null,
|
||||
score: null,
|
||||
displayContent: applyDisplayContentOverride({
|
||||
template: 'focus',
|
||||
title: '完成路线',
|
||||
body: `${finish.label || '结束点'}已完成,准备查看本局结果。`,
|
||||
autoPopup: true,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { type LonLatPoint } from '../../utils/projection'
|
||||
import { type GameAudioConfig } from '../audio/audioConfig'
|
||||
import { type H5ExperiencePresentation } from '../experience/h5Experience'
|
||||
|
||||
export type GameMode = 'classic-sequential' | 'score-o'
|
||||
export type GameControlKind = 'start' | 'control' | 'finish'
|
||||
@@ -10,6 +11,7 @@ export interface GameContentExperienceConfig {
|
||||
url: string | null
|
||||
bridge: string
|
||||
fallback: 'native'
|
||||
presentation: H5ExperiencePresentation
|
||||
}
|
||||
|
||||
export interface GameContentExperienceConfigOverride {
|
||||
@@ -17,9 +19,11 @@ export interface GameContentExperienceConfigOverride {
|
||||
url?: string
|
||||
bridge?: string
|
||||
fallback?: 'native'
|
||||
presentation?: H5ExperiencePresentation
|
||||
}
|
||||
|
||||
export interface GameControlDisplayContent {
|
||||
template: 'minimal' | 'story' | 'focus'
|
||||
title: string
|
||||
body: string
|
||||
autoPopup: boolean
|
||||
@@ -32,6 +36,7 @@ export interface GameControlDisplayContent {
|
||||
}
|
||||
|
||||
export interface GameControlDisplayContentOverride {
|
||||
template?: 'minimal' | 'story' | 'focus'
|
||||
title?: string
|
||||
body?: string
|
||||
autoPopup?: boolean
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export type H5ExperienceKind = 'content' | 'result'
|
||||
export type H5ExperiencePresentation = 'sheet' | 'dialog' | 'fullscreen'
|
||||
|
||||
export interface H5ExperienceFallbackPayload {
|
||||
title: string
|
||||
@@ -13,8 +14,10 @@ export interface H5ExperienceFallbackPayload {
|
||||
export interface H5ExperienceRequest {
|
||||
kind: H5ExperienceKind
|
||||
title: string
|
||||
subtitle?: string
|
||||
url: string
|
||||
bridgeVersion: string
|
||||
presentation: H5ExperiencePresentation
|
||||
context: Record<string, unknown>
|
||||
fallback: H5ExperienceFallbackPayload
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user