提交H5业务闭环修复代码
This commit is contained in:
@@ -143,35 +143,15 @@ const detailMeta = computed(() => [
|
||||
].filter(Boolean).join(' · '))
|
||||
const hallLocationId = computed(() => exhibit.value.hallId || resolvedHallId.value)
|
||||
|
||||
const normalizePoiName = (value: string) => value
|
||||
.trim()
|
||||
.replace(/[\s()()【】[\]_-]/g, '')
|
||||
.toLowerCase()
|
||||
|
||||
// 讲解详情页只定位到所属展厅,不再追踪具体展品点位。
|
||||
const resolveHallGuidePoi = async () => {
|
||||
const hallId = exhibit.value.hallId
|
||||
if (hallId) {
|
||||
const hallPoi = await guideUseCase.getPoiById(hallId)
|
||||
if (hallPoi?.kind === 'hall' || hallPoi?.primaryCategory.id === 'exhibition_hall') {
|
||||
return hallPoi
|
||||
}
|
||||
}
|
||||
|
||||
const normalizedTarget = normalizePoiName(exhibit.value.hallName || '')
|
||||
if (!normalizedTarget) return null
|
||||
|
||||
const candidates = await guideUseCase.searchPois(exhibit.value.hallName || exhibit.value.title || '')
|
||||
return candidates.find((candidate) => {
|
||||
const candidateName = normalizePoiName(candidate.name)
|
||||
const candidateHallName = normalizePoiName(candidate.hallName || '')
|
||||
return candidate.kind === 'hall'
|
||||
|| candidate.primaryCategory.id === 'exhibition_hall'
|
||||
|| candidateName === normalizedTarget
|
||||
|| candidateHallName === normalizedTarget
|
||||
|| candidateName.includes(normalizedTarget)
|
||||
|| normalizedTarget.includes(candidateName)
|
||||
}) || candidates[0] || null
|
||||
return guideUseCase.resolveContentLocationPreviewTarget({
|
||||
directPoiId: exhibit.value.location?.poiId,
|
||||
location: exhibit.value.location,
|
||||
hallId: exhibit.value.hallId,
|
||||
hallName: exhibit.value.hallName,
|
||||
targetName: exhibit.value.title
|
||||
})
|
||||
}
|
||||
|
||||
onLoad(async (options: any = {}) => {
|
||||
@@ -288,6 +268,15 @@ const handleAudioError = (_audio: AudioItem | null, message: string) => {
|
||||
isPlaying.value = false
|
||||
showAudioPlayer.value = false
|
||||
currentAudio.value = null
|
||||
exhibit.value = {
|
||||
...exhibit.value,
|
||||
audio: {
|
||||
...exhibit.value.audio,
|
||||
status: 'unavailable',
|
||||
url: undefined,
|
||||
unavailableReason: message || '音频加载失败,当前提供图文讲解。'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const handleNavigate = async () => {
|
||||
|
||||
Reference in New Issue
Block a user