- 识别微信小程序 web-view 宿主环境 - 宿主导航存在时隐藏 H5 自绘返回与页面标题 - 收回详情、搜索、讲解列表页面顶部预留空间 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="poi-search-page">
|
||||
<view class="search-header">
|
||||
<view class="poi-search-page" :class="{ 'host-navigation': shouldUseHostNavigation }">
|
||||
<view v-if="!shouldUseHostNavigation" class="search-header">
|
||||
<view class="search-header-copy">
|
||||
<text class="page-title">点位搜索</text>
|
||||
<text class="page-subtitle">Search Museum Locations</text>
|
||||
@@ -21,11 +21,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, ref } from 'vue'
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import PoiSearchPanel from '@/components/search/PoiSearchPanel.vue'
|
||||
import { isEmbeddedInWechatMiniProgram } from '@/utils/hostEnvironment'
|
||||
|
||||
const initialKeyword = ref('')
|
||||
const shouldUseHostNavigation = computed(() => isEmbeddedInWechatMiniProgram())
|
||||
|
||||
onLoad((options: any) => {
|
||||
const keyword = typeof options.keyword === 'string'
|
||||
@@ -119,6 +121,14 @@ onUnmounted(() => {
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
.poi-search-page.host-navigation {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.poi-search-page.host-navigation::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.search-header {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
Reference in New Issue
Block a user