| | |
| | | import { commonNavigationBarProps } from '../NavigationBar/commonNavigationBar'; |
| | | import { useSystemStore } from '@/stores/modules/system'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { TabBarPageRouter } from '@/constants'; |
| | | import { TabBarPageRouterList } from '@/constants'; |
| | | import { useAuth } from '@/hooks'; |
| | | import { Portal } from 'senin-mini/components'; |
| | | import { usePickProps } from 'senin-mini/hooks'; |
| | |
| | | const router = Taro.useRouter(); |
| | | |
| | | const pageHeightWithTabBar = computed(() => |
| | | Object.values(TabBarPageRouter).some((x) => x.toLowerCase() === router.path.toLowerCase()) |
| | | TabBarPageRouterList.some((x) => x.toLowerCase() === router.path.toLowerCase()) |
| | | ); |
| | | |
| | | const navigationBarHeight = computed( |
| | |
| | | Workbenches: '/pages/workbenches/workbenches', |
| | | Mine: '/pages/mine/index', |
| | | }; |
| | | |
| | | export const TabBarPageRouterList = [ |
| | | TabBarPageRouter.Home, |
| | | TabBarPageRouter.Workbenches, |
| | | TabBarPageRouter.Mine, |
| | | ]; |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { TabBarPageRouter } from '@/constants'; |
| | | import { TabBarPageRouter, TabBarPageRouterList } from '@/constants'; |
| | | import { useSystemStore } from '@/stores/modules/system'; |
| | | import { httpLoggerRecord } from '@12333/utils'; |
| | | |
| | |
| | | const systemStore = useSystemStore(); |
| | | |
| | | const switchTab = (option: Taro.switchTab.Option) => { |
| | | const index = Object.values(TabBarPageRouter).findIndex((x) => option.url.includes(x)); |
| | | const index = TabBarPageRouterList.findIndex((x) => option.url.includes(x)); |
| | | console.log('index: ', index); |
| | | systemStore.setTabIndex(index); |
| | | Taro.switchTab(option); |
| | |
| | | import { TabBarPageRouter } from '@/constants'; |
| | | import { TabBarPageRouterList } from '@/constants'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { useSystemStoreWithOut } from '@/stores/modules/system'; |
| | | |
| | |
| | | Taro.navigateBack({ delta: delta }); |
| | | } else { |
| | | Taro.switchTab({ |
| | | url: Object.values(TabBarPageRouter)[systemStore.activeTab], |
| | | url: TabBarPageRouterList[systemStore.activeTab], |
| | | }); |
| | | } |
| | | } |
| | |
| | | Task: '/pages/task/task', |
| | | Mine: '/pages/mine/index', |
| | | }; |
| | | |
| | | export const TabBarPageRouterList = [ |
| | | TabBarPageRouter.Home, |
| | | TabBarPageRouter.Task, |
| | | TabBarPageRouter.Mine, |
| | | ]; |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { TabBarPageRouter } from '@/constants'; |
| | | import { TabBarPageRouter, TabBarPageRouterList } from '@/constants'; |
| | | import { useSystemStore } from '@/stores/modules/system'; |
| | | |
| | | export function useSwitchTab() { |
| | | const systemStore = useSystemStore(); |
| | | |
| | | const switchTab = (option: Taro.switchTab.Option) => { |
| | | const index = Object.values(TabBarPageRouter).findIndex((x) => option.url.includes(x)); |
| | | const index = TabBarPageRouterList.findIndex((x) => option.url.includes(x)); |
| | | console.log('index: ', index); |
| | | systemStore.setTabIndex(index); |
| | | Taro.switchTab(option); |
| | |
| | | import { TabBarPageRouter } from '@/constants'; |
| | | import { TabBarPageRouterList } from '@/constants'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { useSystemStoreWithOut } from '@/stores/modules/system'; |
| | | |
| | |
| | | Taro.navigateBack({ delta: delta }); |
| | | } else { |
| | | Taro.switchTab({ |
| | | url: Object.values(TabBarPageRouter)[systemStore.activeTab], |
| | | url: TabBarPageRouterList[systemStore.activeTab], |
| | | }); |
| | | } |
| | | } |