同步小程序讲解页面标题
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-28 19:42:33 +08:00
parent b643273470
commit 93bfb7e778
4 changed files with 49 additions and 6 deletions

View File

@@ -1032,6 +1032,11 @@ const syncTopTabToUrl = (tabId: GuideTopTab) => {
}
}
const syncEmbeddedHostNavigationTitle = (tabId: GuideTopTab) => {
if (!isEmbeddedInWechatMiniProgram()) return
syncHostNavigationTitle(tabId === 'explain' ? '免费讲解' : '地图导览')
}
const isPoiSearchOverlayHistoryState = (state: unknown): state is PoiSearchOverlayHistoryState => (
Boolean(
state
@@ -1133,6 +1138,7 @@ const handleTabChange = (tabId: GuideTopTab) => {
}
currentTab.value = tabId
syncEmbeddedHostNavigationTitle(tabId)
syncTopTabToUrl(tabId)
loadTopTabData(tabId)
@@ -1160,11 +1166,13 @@ const syncTopTabFromHash = () => {
closeArrivalPanel()
}
syncTopTabToUrl(tab)
syncEmbeddedHostNavigationTitle(tab)
return
}
syncTopTabToUrl(currentTab.value)
loadTopTabData(currentTab.value)
syncEmbeddedHostNavigationTitle(currentTab.value)
}
onMounted(() => {
@@ -1173,10 +1181,6 @@ onMounted(() => {
if (typeof window === 'undefined') return
if (isEmbeddedInWechatMiniProgram()) {
syncHostNavigationTitle('地图导览')
}
stopOutdoorMapAvailabilitySubscription = subscribeOutdoorMapAvailability(handleOutdoorMapUnavailable)
void refreshOutdoorMapAvailability()
syncTopTabFromHash()