From 3703bdcb3e0eef4428fb6069649622dd3c60d2c8 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期二, 25 二月 2025 14:30:56 +0800 Subject: [PATCH] fix: 对接 --- apps/taro/src/components/Layout/PageLayout.vue | 45 +++++++++++++++++++++++++++++++-------------- 1 files changed, 31 insertions(+), 14 deletions(-) diff --git a/apps/taro/src/components/Layout/PageLayout.vue b/apps/taro/src/components/Layout/PageLayout.vue index 474d352..9433d41 100644 --- a/apps/taro/src/components/Layout/PageLayout.vue +++ b/apps/taro/src/components/Layout/PageLayout.vue @@ -1,7 +1,7 @@ <template> <Portal.Host> - <div class="page-layout-wrapper" v-bind="$attrs"> - <slot v-if="showNavigationBar" name="navigationBar"> + <div :class="['page-layout-wrapper', { isWeb: isWeb }]" v-bind="$attrs"> + <slot v-if="_showNavigationBar" name="navigationBar"> <CommonNavigationBar v-bind="_commonNavigationBarProps" /> </slot> @@ -45,6 +45,9 @@ import { useAuth } from '@/hooks'; import { Portal } from 'senin-mini/components'; import { usePickProps } from 'senin-mini/hooks'; +import { isWeb, isInAlipay, isInWeChat } from '@/utils/env'; +//@ts-ignore +import { setPageTitle } from '@/utils'; defineOptions({ name: 'PageLayout', @@ -71,7 +74,20 @@ }, }); +setPageTitle(props.title); + const _commonNavigationBarProps = usePickProps(props, commonNavigationBarProps); + +const _showNavigationBar = computed(() => { + if (props.showNavigationBar) { + if (isWeb) { + return !isInAlipay && !isInWeChat; + } + return true; + } else { + return false; + } +}); const { isAuth } = useAuth({ needAuth: props.needAuth, @@ -85,25 +101,15 @@ ); const navigationBarHeight = computed( - () => systemStore.info.statusBarHeight + systemStore.navigationBarHeight + () => (systemStore.info.statusBarHeight || 0) + systemStore.navigationBarHeight ); const scrollViewHeight = computed(() => { let pageHeight = pageHeightWithTabBar.value ? systemStore.pageHeightWithTab : systemStore.pageHeight; - pageHeight = pageHeight + (props.showNavigationBar ? 0 : navigationBarHeight.value); + pageHeight = pageHeight + (_showNavigationBar.value ? 0 : navigationBarHeight.value); return pageHeight + 'px'; -}); - -Taro.getSetting({ - success: function (res) { - if (!res.authSetting['scope.userLocation']) { - Taro.authorize({ - scope: 'scope.userLocation', - }); - } - }, }); </script> @@ -137,5 +143,16 @@ filter: blur(0px); border-radius: 0px 0px 20px 20px; } + + &.isWeb { + height: 100%; + display: flex; + flex-direction: column; + + .page-layout-scroll-view-wrapper { + flex: 1; + min-height: 0; + } + } } </style> -- Gitblit v1.9.1