| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { TabBarPageRouter } from '@/constants'; |
| | | import { useSystemStore } from '@/stores/modules/system'; |
| | | import { httpLoggerRecord } from '@12333/utils'; |
| | | |
| | | export function useSwitchTab() { |
| | | const systemStore = useSystemStore(); |
| | |
| | | console.log('index: ', index); |
| | | systemStore.setTabIndex(index); |
| | | Taro.switchTab(option); |
| | | httpLoggerRecord.info({ |
| | | message: `[switchTab]`, |
| | | args: [option, { index, TabBarPageRouter }], |
| | | }); |
| | | }; |
| | | return switchTab; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | export const httpLoggerRecord = new HttpLoggerRecord({ |
| | | const Options: LoggerRecordOptions = { |
| | | moduleName: getUtilsConfig().appName, |
| | | enableStorage: true, |
| | | loggerStorageAdapter() { |
| | |
| | | getPageUrl() { |
| | | return Taro.getCurrentInstance()?.router?.path ?? ''; |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | export const defaultLoggerRecord = new LoggerRecord(Options); |
| | | |
| | | export const httpLoggerRecord = new HttpLoggerRecord(Options); |