完善建筑外观切换与宿主页面适配
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-11 17:51:45 +08:00
parent f9fefa11ef
commit ee0691174e
4 changed files with 74 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
<template>
<view class="explain-hall-select" :class="{ 'host-navigation': shouldUseHostNavigation }">
<view v-if="!shouldUseHostNavigation" class="explain-page-header">
<view v-if="showInternalHeader" class="explain-page-header">
<view class="header-back" @tap="handleBack">
<text class="header-back-icon"></text>
<text class="header-back-text">返回</text>
@@ -241,6 +241,7 @@ const hallPreviewMap: Record<string, string> = {
const filteredHalls = computed(() => props.halls)
const shouldUseHostNavigation = computed(() => isEmbeddedInWechatMiniProgram())
const showInternalHeader = computed(() => !shouldUseHostNavigation.value)
const headerTitle = computed(() => {
if (props.stage === 'unit') return props.selectedHallName || '选择业务单元'
if (props.stage === 'stop') return props.selectedBusinessUnitName || '选择讲解点'

View File

@@ -5142,9 +5142,30 @@ const handleFloorChange = async (floorId: string) => {
}
const showOverview = async () => {
// 建筑外观不再作为手动切换入口;只在初始加载与缩放自动切换时展示。
if (activeView.value === 'overview') {
resetCamera()
return
}
const previousLoadToken = modelLoadVersion
try {
isLoading.value = true
loadError.value = false
clearMapSelection(false)
clearRoutePreview()
await loadOverview()
} catch (error) {
if (!isStaleModelLoadError(error)) {
console.error('建筑外观模型加载失败:', error)
loadError.value = true
setFriendlyModelLoadError()
}
throw error
} finally {
const requestWasSuperseded = modelLoadVersion > previousLoadToken + 1
if (!requestWasSuperseded) {
isLoading.value = false
}
}
}

View File

@@ -705,6 +705,18 @@ const handleZoomClick = (direction: 'in' | 'out') => {
emit('toolClick', direction === 'in' ? '放大' : '缩小')
}
const handleShowOverview = async () => {
indoorRendererRef.value?.disableAutoSwitchTemporarily?.(10000)
loadingFloorId.value = ''
requestedFloorId.value = ''
requestedFloorLabel.value = ''
failedFloorId.value = ''
await indoorRendererRef.value?.showOverview?.()
emit('selectionClear')
emit('indoorViewChange', 'overview')
emit('layerModeChange', 'single')
}
const handleMoreTap = () => {
emit('moreClick')
}
@@ -766,7 +778,8 @@ const handleOutdoorMarkerClick = (markerId: string) => {
defineExpose({
clearRoute: () => {
indoorRendererRef.value?.clearRoute?.()
}
},
showOverview: handleShowOverview
})
</script>