修复讲解详情接口并展示展厅统计

This commit is contained in:
lyf
2026-07-02 17:22:11 +08:00
parent 9b1f855515
commit ccd37bcd81
8 changed files with 127 additions and 38 deletions

View File

@@ -250,6 +250,9 @@ import {
import {
explainUseCase
} from '@/usecases/explainUseCase'
import {
normalizeExplainDetailTargetFromGuideStop
} from '@/domain/explainDetailTarget'
import type {
GuideRenderPoi
} from '@/domain/guideModel'
@@ -604,7 +607,8 @@ const loadExplainHalls = async () => {
explainLoadPromise = (async () => {
try {
const halls = await explainUseCase.loadExplainHalls()
explainHallItems.value = buildExplainHallItems(halls)
const summaries = await explainUseCase.loadExplainHallSummaries(halls.map((hall) => hall.id))
explainHallItems.value = buildExplainHallItems(halls, summaries)
} catch (error) {
console.error('加载讲解内容失败:', error)
explainError.value = '讲解内容加载失败,请稍后重试'
@@ -621,7 +625,8 @@ const loadExplainHalls = async () => {
const normalizeExplainKeyword = (value?: string) => (value || '').trim().toLowerCase()
const buildExplainHallItems = (
halls: Awaited<ReturnType<typeof explainUseCase.loadExplainHalls>>
halls: Awaited<ReturnType<typeof explainUseCase.loadExplainHalls>>,
summaries: Awaited<ReturnType<typeof explainUseCase.loadExplainHallSummaries>> = {}
): ExplainHallSelectItem[] => {
return halls.map((hall) => {
const keywordParts = [
@@ -637,6 +642,8 @@ const buildExplainHallItems = (
floorLabel: hall.floorLabel,
image: hall.image,
explainCount: hall.exhibitCount || 0,
businessUnitCount: summaries[hall.id]?.businessUnitCount,
guideStopCount: summaries[hall.id]?.guideStopCount,
searchText: normalizeExplainKeyword(keywordParts.join(' '))
}
})
@@ -1251,11 +1258,12 @@ const handleExplainBusinessUnitClick = (unitId: string) => {
}
const handleExplainGuideStopClick = (stopId: string) => {
const target = normalizeExplainDetailTargetFromGuideStop({ id: stopId })
const params = new URLSearchParams({
id: stopId,
id: target.targetId,
tab: 'explain',
targetType: 'STOP',
targetId: stopId
targetType: target.targetType,
targetId: target.targetId
})
uni.navigateTo({
url: `/pages/exhibit/detail?${params.toString()}`