优化来馆面板收起入口
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-09 00:29:01 +08:00
parent 64dfb480dc
commit d165e17b4d
2 changed files with 132 additions and 17 deletions

View File

@@ -1,23 +1,35 @@
<template> <template>
<view <view
v-if="visible" v-if="visible && !isCollapsed"
class="arrival-scrim" class="arrival-scrim"
@tap="emit('close')" @tap="collapsePanel"
></view> ></view>
<view <view
v-if="visible" v-if="visible"
class="arrival-panel" class="arrival-panel"
:class="{ collapsed: isCollapsed }"
@tap.stop @tap.stop
> >
<view class="arrival-handle"></view> <view v-if="isCollapsed" class="arrival-collapsed" @tap="expandPanel">
<view class="arrival-collapsed-copy">
<text class="arrival-collapsed-title">来馆</text>
<text class="arrival-collapsed-summary">公交 / 地铁 / 停车</text>
</view>
<view class="arrival-collapsed-action">
<text class="arrival-collapsed-action-text">展开</text>
</view>
</view>
<template v-else>
<view class="arrival-handle" @tap="collapsePanel"></view>
<view class="arrival-header"> <view class="arrival-header">
<view class="arrival-title-group"> <view class="arrival-title-group">
<text class="arrival-kicker">来馆</text> <text class="arrival-kicker">来馆</text>
<text class="arrival-title">选择第三方地图检索目标</text> <text class="arrival-title">选择第三方地图检索目标</text>
</view> </view>
<view class="arrival-close" @tap="emit('close')"> <view class="arrival-collapse" @tap="collapsePanel">
<text class="arrival-close-text">×</text> <text class="arrival-collapse-text">收起</text>
</view> </view>
</view> </view>
@@ -76,6 +88,7 @@
<text class="arrival-target-action">选择地图</text> <text class="arrival-target-action">选择地图</text>
</view> </view>
</view> </view>
</template>
</view> </view>
<view <view
@@ -128,12 +141,14 @@ import {
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
visible?: boolean visible?: boolean
defaultCollapsed?: boolean
}>(), { }>(), {
visible: false visible: false,
defaultCollapsed: false
}) })
const emit = defineEmits<{ const emit = defineEmits<{
close: [] collapsedChange: [collapsed: boolean]
}>() }>()
const venueTargets = computed(() => ARRIVAL_VENUE_TARGETS) const venueTargets = computed(() => ARRIVAL_VENUE_TARGETS)
@@ -141,11 +156,22 @@ const transitTargets = computed(() => ARRIVAL_TRANSIT_TARGETS)
const realtimeTargets = computed(() => ARRIVAL_REALTIME_TARGETS) const realtimeTargets = computed(() => ARRIVAL_REALTIME_TARGETS)
const mapProviders = computed(() => THIRD_PARTY_MAP_PROVIDERS) const mapProviders = computed(() => THIRD_PARTY_MAP_PROVIDERS)
const selectedTarget = ref<ArrivalSearchTarget | null>(null) const selectedTarget = ref<ArrivalSearchTarget | null>(null)
const isCollapsed = ref(false)
const handleTargetSelect = (target: ArrivalSearchTarget) => { const handleTargetSelect = (target: ArrivalSearchTarget) => {
selectedTarget.value = target selectedTarget.value = target
} }
const collapsePanel = () => {
isCollapsed.value = true
emit('collapsedChange', true)
}
const expandPanel = () => {
isCollapsed.value = false
emit('collapsedChange', false)
}
const closeProviderSheet = () => { const closeProviderSheet = () => {
selectedTarget.value = null selectedTarget.value = null
} }
@@ -163,11 +189,20 @@ const handleProviderSelect = (provider: ThirdPartyMapProviderOption) => {
watch( watch(
() => props.visible, () => props.visible,
(visible) => { (visible) => {
if (!visible) { if (visible) {
isCollapsed.value = props.defaultCollapsed
emit('collapsedChange', props.defaultCollapsed)
} else {
selectedTarget.value = null selectedTarget.value = null
isCollapsed.value = false
emit('collapsedChange', false)
} }
} }
) )
defineExpose({
expandPanel
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@@ -195,6 +230,67 @@ watch(
transform: translateX(-50%); transform: translateX(-50%);
} }
.arrival-panel.collapsed {
bottom: calc(env(safe-area-inset-bottom) + 92px);
max-height: none;
padding: 0;
overflow: visible;
}
.arrival-collapsed {
min-height: 58px;
display: flex;
align-items: center;
gap: 10px;
padding: 10px 10px 10px 14px;
box-sizing: border-box;
}
.arrival-collapsed-copy {
min-width: 0;
flex: 1;
display: flex;
flex-direction: column;
gap: 2px;
}
.arrival-collapsed-title {
font-size: 16px;
line-height: 22px;
font-weight: 700;
color: #262421;
}
.arrival-collapsed-summary {
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 12px;
line-height: 17px;
color: #696962;
}
.arrival-collapsed-action {
height: 34px;
min-width: 56px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 0 12px;
box-sizing: border-box;
background: #262421;
border-radius: 8px;
}
.arrival-collapsed-action-text {
font-size: 13px;
line-height: 18px;
font-weight: 600;
color: #e0e100;
}
.arrival-handle { .arrival-handle {
width: 38px; width: 38px;
height: 4px; height: 4px;
@@ -230,20 +326,23 @@ watch(
color: #262421; color: #262421;
} }
.arrival-close { .arrival-collapse {
width: 32px;
height: 32px;
flex-shrink: 0; flex-shrink: 0;
height: 32px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 0 10px;
box-sizing: border-box;
border: 1px solid #d7d9cf;
border-radius: 8px; border-radius: 8px;
background: #f3f3f3; background: #ffffff;
} }
.arrival-close-text { .arrival-collapse-text {
font-size: 22px; font-size: 12px;
line-height: 26px; line-height: 17px;
font-weight: 600;
color: #424754; color: #424754;
} }

View File

@@ -227,9 +227,11 @@
</GuideMapShell> </GuideMapShell>
<ArrivalPanel <ArrivalPanel
ref="arrivalPanelRef"
v-if="currentTab === 'guide'" v-if="currentTab === 'guide'"
:visible="showArrivalPanel" :visible="showArrivalPanel"
@close="closeArrivalPanel" :default-collapsed="true"
@collapsed-change="handleArrivalPanelCollapsedChange"
/> />
<view v-else-if="currentTab === 'explain'" class="explain-page"> <view v-else-if="currentTab === 'explain'" class="explain-page">
@@ -539,6 +541,8 @@ const handleLaunchContinue = () => {
} }
const showArrivalPanel = ref(false) const showArrivalPanel = ref(false)
const showArrivalPanelCollapsed = ref(false)
const arrivalPanelRef = ref<InstanceType<typeof ArrivalPanel> | null>(null)
const indoorNavAssetBaseUrl = guideUseCase.getAssetBaseUrl() const indoorNavAssetBaseUrl = guideUseCase.getAssetBaseUrl()
const indoorModelSource = guideUseCase.getModelSource() const indoorModelSource = guideUseCase.getModelSource()
@@ -607,7 +611,7 @@ const showGuideHomeDock = computed(() => (
const showGuideFloatingActions = computed(() => ( const showGuideFloatingActions = computed(() => (
currentTab.value === 'guide' currentTab.value === 'guide'
&& !showRoutePlanner.value && !showRoutePlanner.value
&& !showArrivalPanel.value && (!showArrivalPanel.value || showArrivalPanelCollapsed.value)
&& !selectedGuidePoi.value && !selectedGuidePoi.value
&& !isSimulatingRoute.value && !isSimulatingRoute.value
&& (!showGuideHomeDock.value || !homeSearchExpanded.value) && (!showGuideHomeDock.value || !homeSearchExpanded.value)
@@ -1273,6 +1277,11 @@ const handleMoreRouteGuide = () => {
const closeArrivalPanel = () => { const closeArrivalPanel = () => {
showArrivalPanel.value = false showArrivalPanel.value = false
showArrivalPanelCollapsed.value = false
}
const handleArrivalPanelCollapsedChange = (collapsed: boolean) => {
showArrivalPanelCollapsed.value = collapsed
} }
const closeHomeSearchDock = () => { const closeHomeSearchDock = () => {
@@ -1281,7 +1290,14 @@ const closeHomeSearchDock = () => {
} }
const handleMoreOutdoorNav = () => { const handleMoreOutdoorNav = () => {
if (showArrivalPanel.value && showArrivalPanelCollapsed.value) {
arrivalPanelRef.value?.expandPanel()
showArrivalPanelCollapsed.value = false
return
}
showArrivalPanel.value = true showArrivalPanel.value = true
showArrivalPanelCollapsed.value = true
showRoutePlanner.value = false showRoutePlanner.value = false
is3DMode.value = false is3DMode.value = false
guideOutdoorState.value = 'home' guideOutdoorState.value = 'home'