提交H5业务闭环修复代码

This commit is contained in:
lyf
2026-07-01 16:02:21 +08:00
parent c43aa00038
commit e0aeafe062
26 changed files with 396 additions and 95 deletions

View File

@@ -95,6 +95,9 @@ import {
isGuideTopTab,
type GuideTopTab
} from '@/utils/guideTopTabs'
import {
HALL_PLACEHOLDER_IMAGE
} from '@/utils/placeholders'
const activeTopTab = ref<GuideTopTab>('explain')
const loading = ref(false)
@@ -106,7 +109,7 @@ const hall = ref<HallDetailViewModel>({
name: '展厅讲解',
floorLabel: '楼层待补充',
description: '该展厅暂无介绍文案。',
image: '/static/hall-placeholder.jpg',
image: HALL_PLACEHOLDER_IMAGE,
exhibitCount: 0,
area: '待补充'
})
@@ -119,12 +122,6 @@ const explainCountText = computed(() => (
const hallLocationPoiId = computed(() => hall.value.poiId || resolvedHallPoiId.value)
const normalizePoiName = (value: string) => value
.trim()
.replace(/[\s()【】[\]_-]/g, '')
.toLowerCase()
// 展厅数据里可能没有直接写入 poiId优先走内容层映射再按展厅名称兜底匹配导览点位。
const applyMatchedHallPoi = (matchedPoi: Awaited<ReturnType<typeof guideUseCase.getPoiById>>) => {
if (!matchedPoi) return
@@ -146,26 +143,13 @@ const applyMatchedHallPoi = (matchedPoi: Awaited<ReturnType<typeof guideUseCase.
}
const resolveHallGuidePoi = async () => {
const directPoiId = hall.value.location?.poiId || hall.value.poiId
if (directPoiId) {
const directPoi = await guideUseCase.getPoiById(directPoiId)
if (directPoi) return directPoi
}
const normalizedTarget = normalizePoiName(hall.value.name)
if (!normalizedTarget) return null
const candidates = await guideUseCase.searchPois(hall.value.name)
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: hall.value.poiId,
location: hall.value.location,
hallId: hall.value.id,
hallName: hall.value.name,
targetName: hall.value.name
})
}
const resolveHallGuidePoiInBackground = () => {