This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="explain-hall-select" :class="{ 'host-navigation': shouldUseHostNavigation }">
|
<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">
|
<view class="header-back" @tap="handleBack">
|
||||||
<text class="header-back-icon">‹</text>
|
<text class="header-back-icon">‹</text>
|
||||||
<text class="header-back-text">返回</text>
|
<text class="header-back-text">返回</text>
|
||||||
@@ -241,6 +241,7 @@ const hallPreviewMap: Record<string, string> = {
|
|||||||
|
|
||||||
const filteredHalls = computed(() => props.halls)
|
const filteredHalls = computed(() => props.halls)
|
||||||
const shouldUseHostNavigation = computed(() => isEmbeddedInWechatMiniProgram())
|
const shouldUseHostNavigation = computed(() => isEmbeddedInWechatMiniProgram())
|
||||||
|
const showInternalHeader = computed(() => !shouldUseHostNavigation.value)
|
||||||
const headerTitle = computed(() => {
|
const headerTitle = computed(() => {
|
||||||
if (props.stage === 'unit') return props.selectedHallName || '选择业务单元'
|
if (props.stage === 'unit') return props.selectedHallName || '选择业务单元'
|
||||||
if (props.stage === 'stop') return props.selectedBusinessUnitName || '选择讲解点'
|
if (props.stage === 'stop') return props.selectedBusinessUnitName || '选择讲解点'
|
||||||
|
|||||||
@@ -5142,9 +5142,30 @@ const handleFloorChange = async (floorId: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const showOverview = async () => {
|
const showOverview = async () => {
|
||||||
// 建筑外观不再作为手动切换入口;只在初始加载与缩放自动切换时展示。
|
|
||||||
if (activeView.value === 'overview') {
|
if (activeView.value === 'overview') {
|
||||||
resetCamera()
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -705,6 +705,18 @@ const handleZoomClick = (direction: 'in' | 'out') => {
|
|||||||
emit('toolClick', direction === 'in' ? '放大' : '缩小')
|
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 = () => {
|
const handleMoreTap = () => {
|
||||||
emit('moreClick')
|
emit('moreClick')
|
||||||
}
|
}
|
||||||
@@ -766,7 +778,8 @@ const handleOutdoorMarkerClick = (markerId: string) => {
|
|||||||
defineExpose({
|
defineExpose({
|
||||||
clearRoute: () => {
|
clearRoute: () => {
|
||||||
indoorRendererRef.value?.clearRoute?.()
|
indoorRendererRef.value?.clearRoute?.()
|
||||||
}
|
},
|
||||||
|
showOverview: handleShowOverview
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
<view class="guide-quick-icon-floor top"></view>
|
<view class="guide-quick-icon-floor top"></view>
|
||||||
<view class="guide-quick-icon-floor bottom"></view>
|
<view class="guide-quick-icon-floor bottom"></view>
|
||||||
</view>
|
</view>
|
||||||
<text class="guide-quick-action-text">馆内</text>
|
<text class="guide-quick-action-text">{{ indoorQuickActionLabel }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="guide-quick-action"
|
class="guide-quick-action"
|
||||||
@@ -416,10 +416,12 @@ const routeReady = ref(false)
|
|||||||
const activeRoutePreview = ref<GuideRouteResult | null>(null)
|
const activeRoutePreview = ref<GuideRouteResult | null>(null)
|
||||||
const isSimulatingRoute = ref(false)
|
const isSimulatingRoute = ref(false)
|
||||||
const isPoiCardCollapsed = ref(false)
|
const isPoiCardCollapsed = ref(false)
|
||||||
|
const returningToOverview = ref(false)
|
||||||
|
|
||||||
// GuideMapShell 组件引用,用于显式调用路线清除方法
|
// GuideMapShell 组件引用,用于显式调用路线清除方法
|
||||||
const guideMapShellRef = ref<{
|
const guideMapShellRef = ref<{
|
||||||
clearRoute?: () => void
|
clearRoute?: () => void
|
||||||
|
showOverview?: () => Promise<void> | void
|
||||||
} | null>(null)
|
} | null>(null)
|
||||||
const homeSearchPanelRef = ref<{
|
const homeSearchPanelRef = ref<{
|
||||||
expandHomePanel?: () => void
|
expandHomePanel?: () => void
|
||||||
@@ -696,6 +698,9 @@ const guideQuickActiveAction = computed<'indoor' | 'arrival' | 'explain'>(() =>
|
|||||||
if (showArrivalPanel.value) return 'arrival'
|
if (showArrivalPanel.value) return 'arrival'
|
||||||
return is3DMode.value ? 'indoor' : 'arrival'
|
return is3DMode.value ? 'indoor' : 'arrival'
|
||||||
})
|
})
|
||||||
|
const indoorQuickActionLabel = computed(() => (
|
||||||
|
is3DMode.value && indoorView.value !== 'overview' ? '外观' : '馆内'
|
||||||
|
))
|
||||||
|
|
||||||
const toRoutePointOption = (target: GuideRouteTarget): RoutePointOption => ({
|
const toRoutePointOption = (target: GuideRouteTarget): RoutePointOption => ({
|
||||||
poiId: target.poiId,
|
poiId: target.poiId,
|
||||||
@@ -1299,7 +1304,36 @@ const handleSwitchEntrance = () => {
|
|||||||
guideOutdoorState.value = 'home'
|
guideOutdoorState.value = 'home'
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleMoreRouteGuide = () => {
|
const handleMoreRouteGuide = async () => {
|
||||||
|
if (returningToOverview.value) return
|
||||||
|
|
||||||
|
if (is3DMode.value && indoorView.value !== 'overview') {
|
||||||
|
returningToOverview.value = true
|
||||||
|
showRoutePlanner.value = false
|
||||||
|
selectedGuidePoi.value = null
|
||||||
|
isPoiCardCollapsed.value = false
|
||||||
|
isSimulatingRoute.value = false
|
||||||
|
requestedFloorId.value = ''
|
||||||
|
requestedFloorLabel.value = ''
|
||||||
|
loadingFloorId.value = ''
|
||||||
|
failedFloorId.value = ''
|
||||||
|
clearRoutePreviewState()
|
||||||
|
|
||||||
|
try {
|
||||||
|
await guideMapShellRef.value?.showOverview?.()
|
||||||
|
indoorView.value = 'overview'
|
||||||
|
guideOutdoorState.value = 'home'
|
||||||
|
closeHomeSearchDock()
|
||||||
|
showIndoorHint('已返回建筑外观,可放大再次进入馆内', 3200)
|
||||||
|
} catch (error) {
|
||||||
|
console.error('返回建筑外观失败:', error)
|
||||||
|
showIndoorHint('建筑外观加载失败,请稍后重试', 3200)
|
||||||
|
} finally {
|
||||||
|
returningToOverview.value = false
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
closeArrivalPanel()
|
closeArrivalPanel()
|
||||||
showRoutePlanner.value = false
|
showRoutePlanner.value = false
|
||||||
is3DMode.value = true
|
is3DMode.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user