修复讲解详情返回对象列表
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-28 12:22:58 +08:00
parent 8b3e3f8d55
commit 2fb70fa1e3
6 changed files with 92 additions and 4 deletions

View File

@@ -234,6 +234,8 @@ const detailEntryRequest = ref<{
floorId?: string
floorLabel?: string
poiId?: string
returnToGuideStopList?: boolean
returnToHallList?: boolean
} | null>(null)
const detailTextByLanguage = ref<Record<AudioLanguage, string>>({
'zh-CN': defaultDetail.body,
@@ -569,7 +571,13 @@ onLoad(async (options: any = {}) => {
hallId: Array.isArray(options.hallId) ? options.hallId[0] : options.hallId,
hallName: Array.isArray(options.hallName) ? options.hallName[0] : options.hallName,
floorId: Array.isArray(options.floorId) ? options.floorId[0] : options.floorId,
poiId: Array.isArray(options.poiId) ? options.poiId[0] : options.poiId
poiId: Array.isArray(options.poiId) ? options.poiId[0] : options.poiId,
returnToGuideStopList: (Array.isArray(options.returnToGuideStopList)
? options.returnToGuideStopList[0]
: options.returnToGuideStopList) === '1',
returnToHallList: (Array.isArray(options.returnToHallList)
? options.returnToHallList[0]
: options.returnToHallList) === '1'
}
await loadExplainDetail(detailEntryRequest.value, lang)
} catch (error) {
@@ -772,6 +780,12 @@ function buildDetailRoute(lang: AudioLanguage = selectedAudioLanguage.value) {
if (lang) {
params.set('lang', lang)
}
if (request?.hallId) params.set('hallId', request.hallId)
if (request?.hallName) params.set('hallName', request.hallName)
if (request?.floorId) params.set('floorId', request.floorId)
if (request?.poiId) params.set('poiId', request.poiId)
if (request?.returnToGuideStopList) params.set('returnToGuideStopList', '1')
if (request?.returnToHallList) params.set('returnToHallList', '1')
return `/pages/exhibit/detail?${params.toString()}`
}
@@ -936,7 +950,9 @@ const fallbackToExplainObjectList = () => {
const hallId = detailEntryRequest.value?.hallId || exhibit.value.hallId
const hallName = decodeRouteParam(detailEntryRequest.value?.hallName || exhibit.value.hallName || '讲解')
const url = hallId
? explainGuideStopListUrl(hallId, hallName)
? explainGuideStopListUrl(hallId, hallName, {
returnToHallList: detailEntryRequest.value?.returnToHallList
})
: '/pages/explain/list'
uni.redirectTo({
@@ -963,6 +979,11 @@ const returnToExplainObjectList = async () => {
return
}
if (detailEntryRequest.value?.returnToGuideStopList) {
fallbackToExplainObjectList()
return
}
if (isEmbeddedInWechatMiniProgram()) {
if (returningToMiniProgram) return
returningToMiniProgram = true