feat: wire guide data source and POI focus UI

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
lyf
2026-06-12 09:25:22 +08:00
parent a6bfda30e1
commit 2055b13b90
58 changed files with 5768 additions and 1898 deletions

View File

@@ -10,7 +10,7 @@
<view class="hall-hero">
<image class="hero-image" :src="hall.image" mode="aspectFill" />
<view class="hall-badge">
<text class="badge-text">{{ hall.floor }}</text>
<text class="badge-text">{{ hall.floorLabel }}</text>
</view>
</view>
@@ -48,7 +48,7 @@
<!-- 底部操作栏 -->
<view class="action-bar">
<view class="action-btn primary" @tap="handleNavigate">
<text class="btn-text">导航到展厅</text>
<text class="btn-text">查看展厅位置</text>
</view>
</view>
</view>
@@ -60,6 +60,15 @@ import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import GuidePageFrame from '@/components/navigation/GuidePageFrame.vue'
import ExhibitCard from '@/components/content/ExhibitCard.vue'
import {
explainUseCase
} from '@/usecases/explainUseCase'
import {
toExplainExhibitViewModel,
toHallDetailViewModel,
type ExplainExhibitViewModel,
type HallDetailViewModel
} from '@/view-models/explainViewModels'
import {
isGuideTopTab,
navigateToGuideTopTab,
@@ -68,24 +77,26 @@ import {
const activeTopTab = ref<GuideTopTab>('guide')
const hall = ref({
id: '1',
name: '1号展厅',
floor: '1F',
description: '文艺复兴时期艺术作品展厅,展示了欧洲文艺复兴时期最具代表性的绘画和雕塑作品。',
const hall = ref<HallDetailViewModel>({
id: '',
name: '展厅内容',
floorLabel: '楼层待补充',
description: '该展厅介绍待正式内容库补充。',
image: '/static/hall-placeholder.jpg',
exhibitCount: 25,
area: '500㎡'
exhibitCount: 0,
area: '待补充'
})
const exhibits = ref([
{ id: '1', name: '蒙娜丽莎', artist: '达芬奇', hasAudio: true },
{ id: '2', name: '最后的晚餐', artist: '达芬奇', hasAudio: true }
])
const exhibits = ref<ExplainExhibitViewModel[]>([])
onLoad((options: any) => {
onLoad(async (options: any) => {
if (options.id) {
console.log('加载展厅:', options.id)
const hallData = await explainUseCase.getHallById(options.id)
if (hallData) {
hall.value = toHallDetailViewModel(hallData)
const hallExhibits = await explainUseCase.listExhibitsByHallId(hallData.id)
exhibits.value = hallExhibits.map(toExplainExhibitViewModel)
}
}
const tab = Array.isArray(options.tab) ? options.tab[0] : options.tab
@@ -101,8 +112,17 @@ const handleExhibitClick = (exhibit: any) => {
}
const handleNavigate = () => {
console.log('导航到展厅')
uni.navigateBack()
if (!hall.value.poiId) {
uni.showToast({
title: '该展厅暂无三维位置数据',
icon: 'none'
})
return
}
uni.navigateTo({
url: `/pages/route/detail?facilityId=${encodeURIComponent(hall.value.poiId)}&target=${encodeURIComponent(hall.value.name)}&state=preview`
})
}
const handleTopTabChange = (tab: GuideTopTab) => {