调整导览讲解为底部主导航

This commit is contained in:
lyf
2026-06-29 20:55:13 +08:00
parent 81b9eac2f7
commit 4c9d480cce
12 changed files with 271 additions and 64 deletions

View File

@@ -2,9 +2,8 @@
<GuidePageFrame
:active-tab="currentTab"
variant="overlay"
:top-tabs-variant="currentTab === 'guide' ? 'segmented' : 'underline'"
:top-tabs-top="currentTab === 'guide' ? '80px' : '0'"
:show-top-tabs="currentTab === 'guide'"
:show-top-tabs="false"
show-bottom-nav
@tab-change="handleTabChange"
>
<GuideMapShell
@@ -38,11 +37,12 @@
:show-floor="is3DMode"
:tools="indoorCameraTools"
tools-top=""
tools-bottom="54px"
tools-bottom="138px"
show-zoom-controls
zoom-controls-top="calc(100vh - 284px)"
:route-preview="activeRoutePreview"
:show-route="Boolean(activeRoutePreview)"
:disable-auto-exit="disableIndoorAutoExit"
:auto-switch-threshold-low="0.58"
:auto-switch-threshold-high="1.18"
:outdoor-nav-polylines="outdoorNavPolylines"
@@ -171,14 +171,14 @@
<view v-if="guideOutdoorState === 'entrance' && !is3DMode" class="entrance-bottom-card">
<text class="entrance-card-title">主入口</text>
<text class="entrance-card-desc">
可参考主入口位置也可手动进入内3D并选择楼层/区域
可参考主入口位置也可手动进入内3D并选择楼层/区域
</text>
<view class="entrance-actions">
<view class="entrance-btn secondary" @tap="handleSwitchEntrance">
<text class="entrance-btn-text">切换入口</text>
</view>
<view class="entrance-btn primary" @tap="handleEnter3DMode">
<text class="entrance-btn-text">进入内3D</text>
<text class="entrance-btn-text">进入内3D</text>
</view>
</view>
</view>
@@ -320,7 +320,7 @@ const guideMapShellRef = ref<{
clearRoute?: () => void
} | null>(null)
// 外导航相关状态
// 外导航相关状态
const showOutdoorNavPanel = ref(false)
const outdoorNavLoading = ref(false)
const outdoorNavError = ref('')
@@ -373,6 +373,13 @@ const routePlanSummary = computed(() => {
const routePanelError = computed(() => routePlanError.value)
const disableIndoorAutoExit = computed(() => (
Boolean(selectedGuidePoi.value)
|| Boolean(activeRoutePreview.value)
|| showRoutePlanner.value
|| isSimulatingRoute.value
))
const showGuideQuickActions = computed(() => (
currentTab.value === 'guide'
&& !showRoutePlanner.value
@@ -398,12 +405,12 @@ const selectedGuidePoiSubtitle = computed(() => {
})
const routeSimulationStepText = computed(() => {
if (!activeRoutePreview.value) return routeReady.value ? '内导览 · 查看路线' : '内导览 · 查看位置'
if (!activeRoutePreview.value) return routeReady.value ? '内导览 · 查看路线' : '内导览 · 查看位置'
const hasConnector = activeRoutePreview.value.connectorPoints.length > 0
if (routeReady.value) {
return hasConnector ? '内导览 · 跨楼层路线' : '内导览 · 同层路线'
return hasConnector ? '内导览 · 跨楼层路线' : '内导览 · 同层路线'
}
return hasConnector ? '内导览 · 跨楼层位置关系' : '内导览 · 同层位置关系'
return hasConnector ? '内导览 · 跨楼层位置关系' : '内导览 · 同层位置关系'
})
const explainHallItems = ref<ExplainHallSelectItem[]>([])
@@ -868,7 +875,7 @@ const handleRouteView = async ({ startPoint, endPoint }: { startPoint: RoutePoin
if (!result.route) {
activeRoutePreview.value = null
routePlanError.value = result.error || '内导览位置关系生成失败'
routePlanError.value = result.error || '内导览位置关系生成失败'
return
}
@@ -876,9 +883,9 @@ const handleRouteView = async ({ startPoint, endPoint }: { startPoint: RoutePoin
focusRouteFloor(result.route)
showRoutePlanner.value = true
} catch (error) {
console.error('内导览位置关系生成失败:', error)
console.error('内导览位置关系生成失败:', error)
activeRoutePreview.value = null
routePlanError.value = error instanceof Error ? error.message : '内导览位置关系生成失败'
routePlanError.value = error instanceof Error ? error.message : '内导览位置关系生成失败'
} finally {
routePlanning.value = false
}
@@ -892,9 +899,9 @@ const handleRouteSimulate = () => {
isSimulatingRoute.value = true
}
// 进入 3D 内模式
// 进入 3D 内模式
const handleEnter3DMode = () => {
console.log('进入 3D 内模式')
console.log('进入 3D 内模式')
indoorView.value = 'overview'
is3DMode.value = true
guideOutdoorState.value = 'home'
@@ -927,15 +934,15 @@ const handleModeChange = (mode: '2d' | '3d') => {
const guideStatusLabel = computed(() => {
if (is3DMode.value) {
if (indoorView.value === 'overview') return '建筑外观'
if (indoorView.value === 'multi') return '内多层'
return '内单层'
if (indoorView.value === 'multi') return '内多层'
return '内单层'
}
if (guideOutdoorState.value === 'entrance') {
return '推荐入口'
}
return '外参考'
return '外参考'
})
const handleSwitchEntrance = () => {
@@ -946,13 +953,13 @@ const handleMoreRouteGuide = () => {
openRoutePlanner()
}
// 外导航处理函数
// 外导航处理函数
const openOutdoorNavPanel = () => {
showOutdoorNavPanel.value = true
showRoutePlanner.value = false
selectedGuidePoi.value = null
isPoiCardCollapsed.value = false
// 切换到外 2D 地图
// 切换到外 2D 地图
is3DMode.value = false
clearOutdoorNavState()
}
@@ -1163,7 +1170,7 @@ const handleExplainBack = () => {
position: absolute;
left: 12px;
right: 12px;
bottom: calc(env(safe-area-inset-bottom) + 30px);
bottom: calc(env(safe-area-inset-bottom) + 112px);
box-sizing: border-box;
background: rgba(255, 255, 255, 0.96);
border: 1px solid #e5e6de;
@@ -1325,7 +1332,7 @@ const handleExplainBack = () => {
.guide-quick-actions {
position: absolute;
right: 18px;
bottom: calc(env(safe-area-inset-bottom) + 54px);
bottom: calc(env(safe-area-inset-bottom) + 136px);
display: flex;
flex-direction: column;
align-items: stretch;
@@ -1454,7 +1461,7 @@ const handleExplainBack = () => {
position: absolute;
left: 12px;
right: 12px;
bottom: calc(env(safe-area-inset-bottom) + 30px);
bottom: calc(env(safe-area-inset-bottom) + 112px);
min-height: 54px;
padding: 10px 10px 10px 14px;
display: flex;
@@ -1556,7 +1563,7 @@ const handleExplainBack = () => {
position: absolute;
left: 12px;
right: 12px;
bottom: calc(env(safe-area-inset-bottom) + 134px);
bottom: calc(env(safe-area-inset-bottom) + 216px);
height: 84px;
padding: 16px 10px 8px;
display: flex;
@@ -1694,7 +1701,7 @@ const handleExplainBack = () => {
position: absolute;
left: 12px;
right: 12px;
bottom: calc(env(safe-area-inset-bottom) + 134px);
bottom: calc(env(safe-area-inset-bottom) + 216px);
z-index: 1003;
}
@@ -1702,7 +1709,7 @@ const handleExplainBack = () => {
position: absolute;
left: 12px;
right: 12px;
bottom: calc(env(safe-area-inset-bottom) + 30px);
bottom: calc(env(safe-area-inset-bottom) + 112px);
height: 94px;
padding: 16px 16px 10px;
display: flex;
@@ -1758,7 +1765,7 @@ const handleExplainBack = () => {
position: absolute;
left: 12px;
right: 12px;
bottom: calc(env(safe-area-inset-bottom) + 34px);
bottom: calc(env(safe-area-inset-bottom) + 116px);
height: 158px;
padding: 18px 16px 14px;
box-sizing: border-box;