| | |
| | | <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> |
| | | |
| | |
| | | import { useSystemStore } from '@/stores/modules/system'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { TabBarPageRouter } from '@/constants'; |
| | | import { useAuth } from '@/hooks'; |
| | | import { useAuth, useTabRouteEnhance } 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', |
| | |
| | | }, |
| | | }); |
| | | |
| | | setPageTitle(props.title); |
| | | |
| | | useTabRouteEnhance(); |
| | | |
| | | 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, |
| | |
| | | ); |
| | | |
| | | 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> |
| | | |
| | |
| | | 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> |