补齐讲解字段映射并优先展示接口展厅图
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-07 01:31:06 +08:00
parent 0ce38b390e
commit 4b03cc281c
9 changed files with 199 additions and 17 deletions

View File

@@ -46,7 +46,11 @@ export interface ExplainDetailPageViewModel {
coverImages: string[]
hallId?: string
hallName?: string
floorId?: string
floorLabel?: string
poiId?: string
mapX?: number
mapY?: number
summary: string
body: string
audio: {
@@ -61,6 +65,7 @@ export interface ExplainDetailPageViewModel {
statusText?: string
}
imageStatus?: string
galleryStatusText?: string
linkedExhibitCount?: number
isSharedStop?: boolean
linkedExhibitStatusText?: string
@@ -68,8 +73,11 @@ export interface ExplainDetailPageViewModel {
id: string
name: string
nameEn?: string
code?: string
exhibitCode?: string
coverImageUrl?: string
galleryUrls?: string[]
sortOrder?: number
}>
chapters: Array<{
id: string
@@ -171,6 +179,10 @@ export const toExplainExhibitViewModel = (exhibit: MuseumExhibit): ExplainExhibi
export const toExplainDetailPageViewModel = (exhibit: MuseumExhibit): ExplainDetailPageViewModel => {
const hasPlayableAudio = isAudioReady(exhibit)
const coverImages = [
exhibit.image || EXPLAIN_DETAIL_PLACEHOLDER_IMAGE,
...(exhibit.galleryUrls || [])
].filter(Boolean)
const linkedExhibitCount = typeof exhibit.linkedExhibitCount === 'number'
? exhibit.linkedExhibitCount
: exhibit.linkedExhibits?.length
@@ -195,13 +207,14 @@ export const toExplainDetailPageViewModel = (exhibit: MuseumExhibit): ExplainDet
title: exhibit.name,
subtitle: buildSubtitle(exhibit),
contentType: contentTypeFor(exhibit),
coverImages: [
exhibit.image || EXPLAIN_DETAIL_PLACEHOLDER_IMAGE,
...(exhibit.galleryUrls || [])
].filter(Boolean),
coverImages,
hallId: exhibit.hallId,
hallName: exhibit.hallName,
floorId: exhibit.floorId,
floorLabel: exhibit.floorLabel,
poiId: exhibit.poiId,
mapX: exhibit.mapX,
mapY: exhibit.mapY,
summary: transcript || '该展项暂无讲解文稿。',
body,
audio: {
@@ -218,6 +231,7 @@ export const toExplainDetailPageViewModel = (exhibit: MuseumExhibit): ExplainDet
statusText: hasPlayableAudio ? '可播放' : '当前语言暂无语音讲解'
},
imageStatus: exhibit.imageStatus,
galleryStatusText: coverImages.length > 1 ? `${coverImages.length} 张讲解图片` : undefined,
linkedExhibitCount,
isSharedStop: exhibit.isSharedStop,
linkedExhibitStatusText,