修复讲解全局音频播放器交互

This commit is contained in:
lyf
2026-07-08 21:22:27 +08:00
parent 89923ab861
commit 9cdb2c08b2
12 changed files with 1715 additions and 324 deletions

View File

@@ -473,6 +473,7 @@ export const createGuideExplainDataAdapter = (dataset: GuideStaticExplainDataset
const visibleHalls = visibleHallsFrom(dataset.halls)
const visibleOutlines = visibleOutlinesFrom(dataset.outlines)
const visibleStops = visibleStopsFrom(dataset.guideStops)
const visibleExhibits = dataset.exhibits.filter(isVisibleRecord)
const visibleGuides = visibleGuidesFrom(dataset.guideContents)
const hallById = new Map(visibleHalls.map((hall) => [stringifyId(hall.id), hall]))
@@ -626,6 +627,10 @@ export const createGuideExplainDataAdapter = (dataset: GuideStaticExplainDataset
const stop = guide.targetType?.toUpperCase() === 'STOP'
? stopById.get(stringifyId(guide.targetId))
: undefined
const linkedExhibit = visibleExhibits.find((exhibit) => (
stringifyId(exhibit.id) === stringifyId(guide.exhibitId)
|| Boolean(stop?.id && stringifyId(exhibit.stopId) === stringifyId(stop.id))
))
const outline = outlineById.get(stringifyId(stop?.outlineId))
const hall = findHallForStop(stop)
const sourcePoiId = stringifyId(guide.poiId || stop?.poiId || hall?.poiId)
@@ -644,7 +649,12 @@ export const createGuideExplainDataAdapter = (dataset: GuideStaticExplainDataset
hallName: hall?.name || undefined,
floorId,
floorLabel: formatFloorLabel(floorId),
image: resolveImage(stop?.coverImageUrl, guide.mediaGallery),
image: resolveImage(
stop?.coverImageUrl,
linkedExhibit?.coverImageUrl,
linkedExhibit?.galleryUrls,
guide.mediaGallery
) || getExplainUnitPreviewImage(stringifyId(outline?.id)),
description: firstText(guideTextForLanguage(guide, 'zh-CN'), stop?.name),
poiId: location?.poiId,
sourcePoiId,

View File

@@ -237,6 +237,7 @@ export interface GuideStaticExplainDataset {
halls: GuideStaticHallPayload[]
outlines: GuideStaticOutlinePayload[]
guideStops: GuideStaticStopPayload[]
exhibits: GuideStaticExhibitPayload[]
guideContents: GuideStaticContentPayload[]
poiBridge: GuideStaticPoiBridgePayload
}
@@ -407,6 +408,7 @@ export const createStaticGuideDataProvider = (
halls: datasetCache.halls,
outlines: datasetCache.outlines,
guideStops: datasetCache.guideStops,
exhibits: datasetCache.exhibits,
guideContents: datasetCache.guideContents,
poiBridge: datasetCache.poiBridge
}
@@ -417,9 +419,11 @@ export const createStaticGuideDataProvider = (
explainDatasetRequest = provider.loadExplainNavigationDataset()
.then(async (navigationDataset) => {
const [
exhibits,
guideContents,
poiBridge
] = await Promise.all([
requestJson<GuideStaticPackagePayload<GuideStaticExhibitPayload>>(provider.assetUrl(navigationDataset.manifest.files.exhibits)),
requestJson<GuideStaticPackagePayload<GuideStaticContentPayload>>(provider.assetUrl(navigationDataset.manifest.files.guideContents)),
navigationDataset.manifest.files.poiBridge
? requestJson<GuideStaticPoiBridgePayload>(provider.assetUrl(navigationDataset.manifest.files.poiBridge))
@@ -428,6 +432,7 @@ export const createStaticGuideDataProvider = (
explainDatasetCache = {
...navigationDataset,
exhibits: exhibits.rows,
guideContents: guideContents.rows,
poiBridge
}