chore: solidify guide P1 snapshot

This commit is contained in:
lyf
2026-06-11 16:18:57 +08:00
parent a90f63cef0
commit 9790501c3b
32 changed files with 4613 additions and 865 deletions

View File

@@ -7,7 +7,12 @@
ref="threeMapRef"
class="indoor-three-map"
:asset-base-url="indoorAssetBaseUrl"
:initial-floor-id="activeFloorId"
:initial-view="indoorInitialView"
:show-controls="false"
:show-poi="shouldShowIndoorPois"
:target-focus="targetFocusRequest"
@target-focus="handleTargetFocus"
/>
<!-- #endif -->
<!-- #ifndef H5 -->
@@ -77,6 +82,27 @@
<slot name="overlay"></slot>
<view
v-if="mapType === 'indoor' && showIndoorViewToggle"
class="indoor-view-toggle"
:style="indoorViewToggleStyle"
>
<view
class="indoor-view-item"
:class="{ active: indoorView === 'overview' }"
@tap="handleIndoorViewChange('overview')"
>
<text class="indoor-view-label">全馆</text>
</view>
<view
class="indoor-view-item"
:class="{ active: indoorView === 'floor' }"
@tap="handleIndoorViewChange('floor')"
>
<text class="indoor-view-label">楼层</text>
</view>
</view>
<view v-if="showFloor" class="floor-switcher" :style="floorSwitcherStyle">
<view
v-for="floor in floors"
@@ -116,16 +142,40 @@ import {
navFloorIdFromLabel
} from '@/services/navAssets'
interface TargetPoiFocusRequest {
requestId: number | string
poiId: string
name?: string
floorId: string
floorLabel?: string
primaryCategoryZh?: string
positionGltf?: [number, number, number]
}
interface TargetPoiFocusResult {
requestId: number | string
poiId: string
floorId: string
status: 'focused' | 'missing' | 'error'
message?: string
}
type IndoorViewMode = 'overview' | 'floor'
const props = withDefaults(defineProps<{
searchText?: string
activeMode?: '2d' | '3d'
activeFloor?: string
indoorView?: IndoorViewMode
indoorInitialView?: IndoorViewMode
searchTop?: string
floorTop?: string
indoorViewToggleTop?: string
toolsTop?: string
tools?: string[]
showSearch?: boolean
showFloor?: boolean
showIndoorViewToggle?: boolean
modeTop?: string
modeLayout?: 'full' | 'status'
modeStatus?: string
@@ -134,16 +184,21 @@ const props = withDefaults(defineProps<{
outdoorVariant?: 'home' | 'entrance'
indoorAssetBaseUrl?: string
dimmed?: boolean
targetFocusRequest?: TargetPoiFocusRequest | null
}>(), {
searchText: '搜索设施、展厅、入口',
activeMode: '3d',
activeFloor: '1F',
indoorView: 'floor',
indoorInitialView: 'floor',
searchTop: '16px',
floorTop: '164px',
indoorViewToggleTop: '154px',
toolsTop: '406px',
tools: () => [] as string[],
showSearch: true,
showFloor: true,
showIndoorViewToggle: false,
modeTop: '60px',
modeLayout: 'full',
modeStatus: '',
@@ -151,7 +206,8 @@ const props = withDefaults(defineProps<{
mapType: 'indoor',
outdoorVariant: 'home',
indoorAssetBaseUrl: NAV_ASSET_BASE_URL,
dimmed: false
dimmed: false,
targetFocusRequest: null
})
const emit = defineEmits<{
@@ -159,11 +215,18 @@ const emit = defineEmits<{
modeChange: [mode: '2d' | '3d']
floorChange: [floor: string]
toolClick: [tool: string]
indoorViewChange: [view: IndoorViewMode]
targetFocus: [result: TargetPoiFocusResult]
}>()
const threeMapRef = ref<{ switchFloor?: (floorId: string) => Promise<void> | void } | null>(null)
const threeMapRef = ref<{
switchFloor?: (floorId: string) => Promise<void> | void
showOverview?: () => Promise<void> | void
} | null>(null)
const floors = NAV_FLOOR_OPTIONS.map((floor) => floor.label)
const activeFloorId = computed(() => navFloorIdFromLabel(props.activeFloor))
const searchFieldStyle = computed(() => ({
top: props.searchTop
}))
@@ -172,6 +235,10 @@ const floorSwitcherStyle = computed(() => ({
top: props.floorTop
}))
const indoorViewToggleStyle = computed(() => ({
top: props.indoorViewToggleTop
}))
const modeRowStyle = computed(() => ({
top: props.modeTop
}))
@@ -180,6 +247,8 @@ const toolStackStyle = computed(() => ({
top: props.toolsTop
}))
const shouldShowIndoorPois = computed(() => Boolean(props.targetFocusRequest))
const handleSearchTap = () => {
emit('searchTap')
}
@@ -191,12 +260,27 @@ const handleModeChange = (mode: '2d' | '3d') => {
const handleFloorChange = (floor: string) => {
const floorId = navFloorIdFromLabel(floor)
void threeMapRef.value?.switchFloor?.(floorId)
emit('indoorViewChange', 'floor')
emit('floorChange', floor)
}
const handleIndoorViewChange = (view: IndoorViewMode) => {
if (view === 'overview') {
void threeMapRef.value?.showOverview?.()
} else {
void threeMapRef.value?.switchFloor?.(activeFloorId.value)
}
emit('indoorViewChange', view)
}
const handleToolClick = (tool: string) => {
emit('toolClick', tool)
}
const handleTargetFocus = (result: TargetPoiFocusResult) => {
emit('targetFocus', result)
}
</script>
<style scoped lang="scss">
@@ -434,6 +518,42 @@ const handleToolClick = (tool: string) => {
z-index: 35;
}
.indoor-view-toggle {
position: absolute;
right: 16px;
width: 58px;
padding: 5px;
display: flex;
flex-direction: column;
gap: 5px;
background: rgba(255, 255, 255, 0.94);
border: 1px solid #dde5df;
border-radius: 10px;
box-shadow: 0 8px 18px rgba(110, 127, 115, 0.12);
z-index: 36;
}
.indoor-view-item {
min-height: 34px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 7px;
color: #59645d;
}
.indoor-view-item.active {
background: var(--museum-accent);
color: #ffffff;
box-shadow: 0 6px 12px rgba(82, 107, 91, 0.18);
}
.indoor-view-label {
font-size: 12px;
font-weight: 700;
line-height: 1;
}
.floor-item {
position: relative;
height: 36px;