同步 sgs-frontend-mobile 源码
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-27 11:26:01 +08:00
parent 575dca430f
commit 9ea1bfab71
181 changed files with 24395 additions and 5212 deletions

View File

@@ -65,21 +65,6 @@ const syncPageTitle = (title: string) => {
if (typeof document !== 'undefined') document.title = title
}
const decodeRouteParam = (value: string) => {
let decoded = value
// H5 hash routes embedded in web-view can add multiple URL-encoding layers.
for (let index = 0; index < 8; index += 1) {
try {
const next = decodeURIComponent(decoded)
if (next === decoded) break
decoded = next
} catch {
break
}
}
return decoded
}
const loadPage = async (pageNo: number, replace: boolean) => {
const hallId = selectedExplainHallId.value
if (!hallId || disposed || (!replace && (loadingMore.value || !hasMore.value))) return false
@@ -130,8 +115,8 @@ const loadNextPage = () => void loadPage(nextPageNo.value, false)
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 = decodeRouteParam(first(options.hallName) || '讲解对象')
syncPageTitle(selectedExplainHallName.value)
selectedExplainHallName.value = first(options.hallName) || '讲解对象'
syncPageTitle('讲解对象')
if (!selectedExplainHallId.value) {
explainError.value = '缺少展厅参数,请返回展厅列表后重试'
return