修复讲解详情返回对象列表
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

@@ -40,6 +40,7 @@ const explainError = ref('')
const loadMoreError = ref('')
const hasMore = ref(false)
const nextPageNo = ref(1)
const shouldReturnToHallList = ref(false)
let requestVersion = 0
let disposed = false
let returningToMiniProgram = false
@@ -119,6 +120,7 @@ onLoad((options: Record<string, string | string[] | undefined> = {}) => {
const first = (value: string | string[] | undefined) => Array.isArray(value) ? value[0] : value
selectedExplainHallId.value = first(options.hallId) || ''
selectedExplainHallName.value = first(options.hallName) || '讲解对象'
shouldReturnToHallList.value = first(options.returnToHallList) === '1'
syncPageTitle('讲解对象')
if (!selectedExplainHallId.value) {
explainError.value = '缺少展厅参数,请返回展厅列表后重试'
@@ -144,6 +146,8 @@ const handleExplainGuideStopClick = (stop: ExplainGuideStopCatalogItem) => {
if (hallName) params.set('hallName', hallName)
if (stop.floorId) params.set('floorId', stop.floorId)
if (stop.poiId) params.set('poiId', stop.poiId)
params.set('returnToGuideStopList', '1')
if (shouldReturnToHallList.value) params.set('returnToHallList', '1')
uni.navigateTo({ url: `/pages/exhibit/detail?${params.toString()}` })
}
@@ -173,6 +177,12 @@ const returnToHallList = async () => {
return
}
// H5 web-view 有时不会暴露完整页面栈,保留入口上下文即可回到展厅列表。
if (shouldReturnToHallList.value) {
fallbackToHallList()
return
}
if (isEmbeddedInWechatMiniProgram()) {
if (returningToMiniProgram) return
returningToMiniProgram = true