Browse Source

fix: 人才小程序首页宫格导航跳转 tabBar 页面使用 switchTab

首页宫格中的"个人信息"和"考勤记录"跳转到的是 tabBar 页面,
必须使用 Taro.switchTab 而不是 navigateTo,否则小程序中无法跳转。

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 1 week ago
parent
commit
d920f57f0e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      mini-talent/src/pages/index/index.tsx

+ 4 - 2
mini-talent/src/pages/index/index.tsx

@@ -167,10 +167,12 @@ const Dashboard: React.FC = () => {
   const handleQuickAction = (action: string) => {
   const handleQuickAction = (action: string) => {
     switch (action) {
     switch (action) {
       case 'personal-info':
       case 'personal-info':
-        Taro.navigateTo({ url: '/pages/personal-info/index' })
+        // 个人信息是 tabBar 页面,必须使用 switchTab
+        Taro.switchTab({ url: '/pages/personal-info/index' })
         break
         break
       case 'attendance':
       case 'attendance':
-        Taro.navigateTo({ url: '/pages/attendance/index' })
+        // 考勤记录是 tabBar 页面,必须使用 switchTab
+        Taro.switchTab({ url: '/pages/attendance/index' })
         break
         break
       case 'employment':
       case 'employment':
         Taro.navigateTo({ url: '/pages/employment/index' })
         Taro.navigateTo({ url: '/pages/employment/index' })