@@ -14,7 +14,7 @@
|
||||
@mouseup="handlePanelMouseEnd"
|
||||
@mouseleave="resetPanelMouse"
|
||||
>
|
||||
<view v-if="variant === 'home' && showSearchContent" class="home-fullscreen-nav">
|
||||
<view v-if="showHomeFullscreenNav" class="home-fullscreen-nav">
|
||||
<view class="home-back-button" data-testid="poi-search-cancel" @tap.stop="handleCancel">
|
||||
<text class="home-back-icon">‹</text>
|
||||
</view>
|
||||
@@ -245,6 +245,7 @@ import type {
|
||||
PoiCategoryResultState,
|
||||
PoiSearchContext
|
||||
} from '@/domain/poiSearch'
|
||||
import { isEmbeddedInWechatMiniProgram } from '@/utils/hostEnvironment'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
initialKeyword?: string
|
||||
@@ -308,6 +309,12 @@ let searchRequestSeq = 0
|
||||
const collapseDragThreshold = 48
|
||||
const homeExpandTapGuardMs = 360
|
||||
const showSearchContent = computed(() => props.variant === 'page' || homeExpanded.value)
|
||||
const shouldUseHostNavigation = computed(() => isEmbeddedInWechatMiniProgram())
|
||||
const showHomeFullscreenNav = computed(() => (
|
||||
props.variant === 'home'
|
||||
&& showSearchContent.value
|
||||
&& !shouldUseHostNavigation.value
|
||||
))
|
||||
const isHomeCategoryMode = computed(() => (
|
||||
props.variant === 'home' && homeCategoryMode.value && !homeExpanded.value
|
||||
))
|
||||
|
||||
@@ -715,7 +715,11 @@ const syncTopTabToUrl = (tabId: GuideTopTab) => {
|
||||
if (typeof window === 'undefined') return
|
||||
if (!isIndexHashRoute()) return
|
||||
|
||||
const url = `#/pages/index/index?tab=${tabId}`
|
||||
const currentHash = window.location.hash || ''
|
||||
const queryStart = currentHash.indexOf('?')
|
||||
const params = new URLSearchParams(queryStart >= 0 ? currentHash.slice(queryStart + 1) : '')
|
||||
params.set('tab', tabId)
|
||||
const url = `#/pages/index/index?${params.toString()}`
|
||||
if (window.location.hash !== url) {
|
||||
window.history.replaceState(window.history.state, '', url)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user