chore: freeze guide and explain update
This commit is contained in:
@@ -13,12 +13,18 @@
|
||||
search-top="60px"
|
||||
mode-top="104px"
|
||||
floor-top="208px"
|
||||
tools-top="176px"
|
||||
:active-mode="activeMode"
|
||||
:active-floor="activeFloor"
|
||||
:map-type="activeMode === '2d' ? 'outdoor' : 'indoor'"
|
||||
:tools="mapTools"
|
||||
:indoor-model-source="indoorModelSource"
|
||||
:floors="guideFloors"
|
||||
:normalize-floor-id="normalizeGuideFloorId"
|
||||
@search-tap="handleSearchTap"
|
||||
@mode-change="handleModeChange"
|
||||
@floor-change="handleFloorChange"
|
||||
@tool-click="handleToolClick"
|
||||
>
|
||||
<template #overlay>
|
||||
<view
|
||||
@@ -124,10 +130,12 @@ interface FilterItem {
|
||||
|
||||
interface FacilityResult extends FacilityResultViewModel {}
|
||||
|
||||
const searchKeyword = ref('卫生间')
|
||||
const searchKeyword = ref('')
|
||||
const indoorModelSource = guideUseCase.getModelSource()
|
||||
const guideFloors = ref<MuseumFloor[]>([])
|
||||
const normalizeGuideFloorId = (labelOrId: string) => guideUseCase.normalizeFloorId(labelOrId)
|
||||
const activeMode = ref<'2d' | '3d'>('3d')
|
||||
const activeFloor = ref('1F')
|
||||
const searchDraftKeyword = ref('')
|
||||
const currentFilter = ref<FilterItem['id']>('all')
|
||||
const isLoading = ref(false)
|
||||
@@ -140,6 +148,7 @@ const filters: FilterItem[] = [
|
||||
{ id: 'accessible', label: '无障碍' },
|
||||
{ id: 'floor', label: '1F 点位' }
|
||||
]
|
||||
const mapTools = computed(() => ['重置', activeMode.value === '2d' ? '3D' : '2D'])
|
||||
|
||||
const facilities = ref<FacilityResult[]>([])
|
||||
|
||||
@@ -154,7 +163,7 @@ const visibleFacilities = computed(() => {
|
||||
})
|
||||
|
||||
const resultTitle = computed(() => {
|
||||
if (isLoading.value) return '正在读取 clean 导览数据'
|
||||
if (isLoading.value) return '正在读取中心线路网导览数据'
|
||||
return `${searchKeyword.value || '设施'} ${visibleFacilities.value.length} 个结果`
|
||||
})
|
||||
|
||||
@@ -166,7 +175,7 @@ const loadFacilityResults = async () => {
|
||||
.filter((poi) => poi.primaryCategory.id !== 'touring_poi')
|
||||
.map(toFacilityResultViewModel)
|
||||
} catch (error) {
|
||||
console.error('加载 clean 导览搜索结果失败:', error)
|
||||
console.error('加载中心线路网导览搜索结果失败:', error)
|
||||
facilities.value = []
|
||||
uni.showToast({
|
||||
title: '导览数据读取失败',
|
||||
@@ -179,7 +188,12 @@ const loadFacilityResults = async () => {
|
||||
|
||||
const loadGuideFloors = async () => {
|
||||
try {
|
||||
guideFloors.value = await guideUseCase.getFloors()
|
||||
const floors = await guideUseCase.getFloors()
|
||||
guideFloors.value = floors
|
||||
activeFloor.value = floors.find((floor) => floor.label === activeFloor.value)?.label
|
||||
|| floors.find((floor) => floor.id === 'L1')?.label
|
||||
|| floors[0]?.label
|
||||
|| activeFloor.value
|
||||
} catch (error) {
|
||||
console.error('加载导览楼层失败:', error)
|
||||
guideFloors.value = []
|
||||
@@ -250,11 +264,36 @@ const handleResultAction = (facility: FacilityResult) => {
|
||||
}
|
||||
|
||||
const handleModeChange = (mode: '2d' | '3d') => {
|
||||
console.log('切换搜索页导览模式:', mode)
|
||||
activeMode.value = mode
|
||||
uni.showToast({
|
||||
title: mode === '2d' ? '已切换室外入口参考' : '已切换室内三维位置',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
const handleFloorChange = (floor: string) => {
|
||||
console.log('搜索页切换楼层:', floor)
|
||||
activeFloor.value = floor
|
||||
}
|
||||
|
||||
const handleToolClick = (tool: string) => {
|
||||
if (tool === '2D') {
|
||||
handleModeChange('2d')
|
||||
return
|
||||
}
|
||||
|
||||
if (tool === '3D') {
|
||||
handleModeChange('3d')
|
||||
return
|
||||
}
|
||||
|
||||
if (tool === '重置') {
|
||||
activeMode.value = '3d'
|
||||
}
|
||||
|
||||
uni.showToast({
|
||||
title: tool === '重置' ? '已回到三维位置预览' : '该工具暂未开放',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
const handleTopTabChange = (tab: GuideTopTab) => {
|
||||
|
||||
Reference in New Issue
Block a user