zhengyiming
3 天以前 5a681c9bd93a5a1ad1949fe07b47fc583b12ed61
apps/bMiniApp/src/hooks/router.ts
@@ -1,5 +1,5 @@
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';
@@ -7,10 +7,11 @@
  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);
    Taro.switchTab(option).then(() => {
      systemStore.setTabIndex(index);
    });
    httpLoggerRecord.info({
      message: `[switchTab]`,
      args: [option, { index, TabBarPageRouter }],