Quellcode durchsuchen

revert(frontend): 撤销 tabbar 4Tab 重构, 恢复 5维TabBar(行心身智富)

liaoxg vor 1 Monat
Ursprung
Commit
4322d69b01

+ 32 - 187
cfc-frontend/custom-tab-bar/index.vue

@@ -1,78 +1,54 @@
 <template>
 <template>
   <view class="tab-bar-wrap" v-if="isLoggedIn">
   <view class="tab-bar-wrap" v-if="isLoggedIn">
-    <!-- 普通用户TabBar:4 Tab + 中间五维启动器 -->
+    <!-- 普通用户TabBar -->
     <view v-if="currentRole !== 'teacher'" class="tab-bar">
     <view v-if="currentRole !== 'teacher'" class="tab-bar">
-      <!-- 前2个Tab -->
-      <view v-for="(item, index) in mainTabs.slice(0, 2)" :key="index"
+      <view
+        v-for="(item, index) in normalTabs"
+        :key="index"
         class="tab-item"
         class="tab-item"
         :class="{ active: currentIndex === index }"
         :class="{ active: currentIndex === index }"
-        @click="switchTab(item, index)">
-        <image class="tab-icon" :src="currentIndex === index ? item.selectedIcon : item.icon" mode="aspectFit" />
-        <text class="tab-text">{{ item.text }}</text>
-      </view>
-
-      <!-- 中间五维启动器按钮 -->
-      <view class="tab-center-btn" @click="toggleDimOverlay">
-        <view class="center-btn-inner">
-          <text class="center-btn-icon">⭐</text>
-        </view>
-      </view>
-
-      <!-- 后2个Tab -->
-      <view v-for="(item, index) in mainTabs.slice(2, 4)" :key="index + 2"
-        class="tab-item"
-        :class="{ active: currentIndex === index + 2 }"
-        @click="switchTab(item, index + 2)">
-        <image class="tab-icon" :src="currentIndex === index + 2 ? item.selectedIcon : item.icon" mode="aspectFit" />
+        @click="switchTab(item, index)"
+      >
+        <image
+          class="tab-icon"
+          :src="currentIndex === index ? item.selectedIcon : item.icon"
+          mode="aspectFit"
+        ></image>
         <text class="tab-text">{{ item.text }}</text>
         <text class="tab-text">{{ item.text }}</text>
       </view>
       </view>
     </view>
     </view>
 
 
-    <!-- 规划师TabBar(保持不变) -->
+    <!-- 规划师TabBar -->
     <view v-else class="tab-bar">
     <view v-else class="tab-bar">
-      <view v-for="(item, index) in teacherTabs" :key="index"
+      <view
+        v-for="(item, index) in teacherTabs"
+        :key="index"
         class="tab-item"
         class="tab-item"
         :class="{ active: currentIndex === index }"
         :class="{ active: currentIndex === index }"
-        @click="switchTab(item, index)">
-        <image class="tab-icon" :src="currentIndex === index ? item.selectedIcon : item.icon" mode="aspectFit" />
+        @click="switchTab(item, index)"
+      >
+        <image
+          class="tab-icon"
+          :src="currentIndex === index ? item.selectedIcon : item.icon"
+          mode="aspectFit"
+        ></image>
         <text class="tab-text">{{ item.text }}</text>
         <text class="tab-text">{{ item.text }}</text>
       </view>
       </view>
     </view>
     </view>
-
-    <!-- 五维半屏浮层 -->
-    <view class="dim-overlay-mask" v-if="showDimOverlay" @click="toggleDimOverlay">
-      <view class="dim-overlay" @click.stop>
-        <view class="dim-overlay-header">
-          <text class="dim-overlay-title">五维能量</text>
-          <text class="dim-overlay-close" @click="toggleDimOverlay">✕</text>
-        </view>
-        <view class="dim-grid">
-          <view class="dim-item" v-for="dim in dimensions" :key="dim.code" @click="goDimPage(dim)">
-            <view class="dim-icon-wrap" :style="{ background: dim.bgColor }">
-              <text class="dim-icon">{{ dim.icon }}</text>
-            </view>
-            <text class="dim-name">{{ dim.name }}</text>
-            <text class="dim-title">{{ dim.title }}</text>
-          </view>
-        </view>
-      </view>
-    </view>
   </view>
   </view>
 </template>
 </template>
 
 
 <script>
 <script>
-var nav = require('../utils/nav.js')
-
 export default {
 export default {
   data() {
   data() {
     return {
     return {
       currentIndex: 0,
       currentIndex: 0,
-      showDimOverlay: false,
-      mainTabs: [
-        { text: '首页', pagePath: '/pages/index-home/index', icon: '/static/tab-action.png', selectedIcon: '/static/tab-action-active.png' },
-        { text: '健康', pagePath: '/pages/health/index', icon: '/static/tab-body.png', selectedIcon: '/static/tab-body-active.png' },
-        { text: '成长', pagePath: '/pages/growth/index', icon: '/static/tab-growth.png', selectedIcon: '/static/tab-growth-active.png' },
-        { text: '我的', pagePath: '/pages/profile/profile', icon: '/static/tab-profile.png', selectedIcon: '/static/tab-profile-active.png' }
+      normalTabs: [
+        { text: '行', pagePath: '/pages/index-home/index', icon: '/static/tab-action.png', selectedIcon: '/static/tab-action-active.png' },
+        { text: '心', pagePath: '/pages/mind/index', icon: '/static/tab-mind.png', selectedIcon: '/static/tab-mind-active.png' },
+        { text: '身', pagePath: '/pages/body/index', icon: '/static/tab-body.png', selectedIcon: '/static/tab-body-active.png' },
+        { text: '智', pagePath: '/pages/wisdom/index', icon: '/static/tab-wisdom.png', selectedIcon: '/static/tab-wisdom-active.png' },
+        { text: '富', pagePath: '/pages/wealth/index', icon: '/static/tab-wealth.png', selectedIcon: '/static/tab-wealth-active.png' }
       ],
       ],
       teacherTabs: [
       teacherTabs: [
         { text: '首页', pagePath: '/pages/teacher/index', icon: '/static/tab-action.png', selectedIcon: '/static/tab-action-active.png' },
         { text: '首页', pagePath: '/pages/teacher/index', icon: '/static/tab-action.png', selectedIcon: '/static/tab-action-active.png' },
@@ -80,13 +56,6 @@ export default {
         { text: '团队', pagePath: '/pages/teacher/team', icon: '/static/tab-team.png', selectedIcon: '/static/tab-team-active.png' },
         { text: '团队', pagePath: '/pages/teacher/team', icon: '/static/tab-team.png', selectedIcon: '/static/tab-team-active.png' },
         { text: '成长档案', pagePath: '/pages/growth/index', icon: '/static/tab-growth.png', selectedIcon: '/static/tab-growth-active.png' },
         { text: '成长档案', pagePath: '/pages/growth/index', icon: '/static/tab-growth.png', selectedIcon: '/static/tab-growth-active.png' },
         { text: '我的', pagePath: '/pages/teacher/teacher-profile', icon: '/static/tab-profile.png', selectedIcon: '/static/tab-profile-active.png' }
         { text: '我的', pagePath: '/pages/teacher/teacher-profile', icon: '/static/tab-profile.png', selectedIcon: '/static/tab-profile-active.png' }
-      ],
-      dimensions: [
-        { code: 'action', name: '行', title: '知行合一', icon: '🌿', color: '#10B981', bgColor: 'rgba(16,185,129,0.15)' },
-        { code: 'mind', name: '心', title: '大爱传承', icon: '🔥', color: '#FF6B9D', bgColor: 'rgba(255,107,157,0.15)' },
-        { code: 'body', name: '身', title: '主动健康', icon: '🌏', color: '#FF8C42', bgColor: 'rgba(255,140,66,0.15)' },
-        { code: 'wisdom', name: '智', title: '赋能未来', icon: '⚡', color: '#6366F1', bgColor: 'rgba(99,102,241,0.15)' },
-        { code: 'wealth', name: '富', title: '利他创富', icon: '💧', color: '#F59E0B', bgColor: 'rgba(245,158,11,0.15)' }
       ]
       ]
     }
     }
   },
   },
@@ -105,13 +74,6 @@ export default {
     })
     })
   },
   },
   methods: {
   methods: {
-    toggleDimOverlay() {
-      this.showDimOverlay = !this.showDimOverlay
-    },
-    goDimPage(dim) {
-      this.showDimOverlay = false
-      nav.goDimension(dim.code)
-    },
     updateSelected() {
     updateSelected() {
       const pages = getCurrentPages()
       const pages = getCurrentPages()
       if (pages.length) {
       if (pages.length) {
@@ -122,15 +84,16 @@ export default {
           const idx = this.teacherTabs.findIndex(t => t.pagePath === currentPath)
           const idx = this.teacherTabs.findIndex(t => t.pagePath === currentPath)
           this.currentIndex = idx >= 0 ? idx : 0
           this.currentIndex = idx >= 0 ? idx : 0
         } else {
         } else {
-          const idx = this.mainTabs.findIndex(t => t.pagePath === currentPath)
+          const idx = this.normalTabs.findIndex(t => t.pagePath === currentPath)
           this.currentIndex = idx >= 0 ? idx : 0
           this.currentIndex = idx >= 0 ? idx : 0
         }
         }
       }
       }
     },
     },
     switchTab(item, index) {
     switchTab(item, index) {
       this.currentIndex = index
       this.currentIndex = index
-      // 只有 TabBar 注册页才能用 switchTab
-      const nativeTabPages = ['/pages/index-home/index', '/pages/health/index', '/pages/growth/index', '/pages/profile/profile']
+      // 原生TabBar页使用switchTab,非Tab页使用redirectTo(比reLaunch轻量)
+      // 注意:switchTab 只能跳转 pages.json 中 tabBar.list 注册的页面,否则会触发路由系统错误
+      const nativeTabPages = ['/pages/index-home/index', '/pages/mind/index', '/pages/body/index', '/pages/wisdom/index', '/pages/wealth/index']
       if (nativeTabPages.includes(item.pagePath)) {
       if (nativeTabPages.includes(item.pagePath)) {
         uni.switchTab({ url: item.pagePath })
         uni.switchTab({ url: item.pagePath })
       } else {
       } else {
@@ -156,7 +119,6 @@ export default {
   background: #fff;
   background: #fff;
   padding-bottom: env(safe-area-inset-bottom);
   padding-bottom: env(safe-area-inset-bottom);
   border-top: 1rpx solid #eee;
   border-top: 1rpx solid #eee;
-  align-items: center;
 }
 }
 
 
 .tab-item {
 .tab-item {
@@ -181,121 +143,4 @@ export default {
 .tab-item.active .tab-text {
 .tab-item.active .tab-text {
   color: #F97316;
   color: #F97316;
 }
 }
-
-/* 中间五维启动器按钮 */
-.tab-center-btn {
-  flex: 0 0 auto;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  width: 100rpx;
-  position: relative;
-  top: -20rpx;
-}
-
-.center-btn-inner {
-  width: 88rpx;
-  height: 88rpx;
-  border-radius: 50%;
-  background: linear-gradient(135deg, #F97316, #FB923C);
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  box-shadow: 0 4rpx 16rpx rgba(249,115,22,0.4);
-}
-
-.center-btn-icon {
-  font-size: 40rpx;
-}
-
-/* 五维半屏浮层 */
-.dim-overlay-mask {
-  position: fixed;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  background: rgba(0,0,0,0.5);
-  z-index: 1000;
-  display: flex;
-  align-items: flex-end;
-}
-
-.dim-overlay {
-  width: 100%;
-  background: #fff;
-  border-radius: 32rpx 32rpx 0 0;
-  padding: 40rpx 30rpx 60rpx;
-  animation: slideUp 0.3s ease;
-}
-
-@keyframes slideUp {
-  from { transform: translateY(100%); }
-  to { transform: translateY(0); }
-}
-
-.dim-overlay-header {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 32rpx;
-}
-
-.dim-overlay-title {
-  font-size: 32rpx;
-  font-weight: bold;
-  color: #333;
-}
-
-.dim-overlay-close {
-  font-size: 36rpx;
-  color: #999;
-  padding: 8rpx;
-}
-
-.dim-grid {
-  display: flex;
-  flex-wrap: wrap;
-  gap: 20rpx;
-}
-
-.dim-item {
-  width: calc(33.33% - 14rpx);
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  padding: 24rpx 0;
-  border-radius: 16rpx;
-  background: #f8f9fa;
-}
-
-.dim-item:active {
-  opacity: 0.7;
-}
-
-.dim-icon-wrap {
-  width: 80rpx;
-  height: 80rpx;
-  border-radius: 50%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  margin-bottom: 12rpx;
-}
-
-.dim-icon {
-  font-size: 36rpx;
-}
-
-.dim-name {
-  font-size: 28rpx;
-  font-weight: bold;
-  color: #333;
-}
-
-.dim-title {
-  font-size: 20rpx;
-  color: #999;
-  margin-top: 4rpx;
-}
 </style>
 </style>

+ 41 - 61
cfc-frontend/pages.json

@@ -7,69 +7,31 @@
       }
       }
     },
     },
     {
     {
-      "path": "pages/health/index",
+      "path": "pages/mind/index",
       "style": {
       "style": {
-        "navigationBarTitleText": "健康"
+        "navigationBarTitleText": ""
       }
       }
     },
     },
     {
     {
-      "path": "pages/growth/index",
+      "path": "pages/body/index",
       "style": {
       "style": {
-        "navigationBarTitleText": "成长"
+        "navigationBarTitleText": ""
       }
       }
     },
     },
     {
     {
-      "path": "pages/profile/profile",
+      "path": "pages/wisdom/index",
       "style": {
       "style": {
-        "navigationBarTitleText": "我的"
+        "navigationBarTitleText": "智"
+      }
+    },
+    {
+      "path": "pages/wealth/index",
+      "style": {
+        "navigationBarTitleText": "富"
       }
       }
     }
     }
   ],
   ],
   "subPackages": [
   "subPackages": [
-    {
-      "root": "pages/body",
-      "pages": [
-        {
-          "path": "index",
-          "style": {
-            "navigationBarTitleText": "身"
-          }
-        }
-      ]
-    },
-    {
-      "root": "pages/mind",
-      "pages": [
-        {
-          "path": "index",
-          "style": {
-            "navigationBarTitleText": "心"
-          }
-        }
-      ]
-    },
-    {
-      "root": "pages/wisdom",
-      "pages": [
-        {
-          "path": "index",
-          "style": {
-            "navigationBarTitleText": "智"
-          }
-        }
-      ]
-    },
-    {
-      "root": "pages/wealth",
-      "pages": [
-        {
-          "path": "index",
-          "style": {
-            "navigationBarTitleText": "富"
-          }
-        }
-      ]
-    },
     {
     {
       "root": "pages/teacher",
       "root": "pages/teacher",
       "pages": [
       "pages": [
@@ -424,6 +386,12 @@
     {
     {
       "root": "pages/growth",
       "root": "pages/growth",
       "pages": [
       "pages": [
+        {
+          "path": "index",
+          "style": {
+            "navigationBarTitleText": "成长档案"
+          }
+        },
         {
         {
           "path": "create",
           "path": "create",
           "style": {
           "style": {
@@ -1405,6 +1373,12 @@
     {
     {
       "root": "pages/profile",
       "root": "pages/profile",
       "pages": [
       "pages": [
+        {
+          "path": "profile",
+          "style": {
+            "navigationBarTitleText": "我的"
+          }
+        },
         {
         {
           "path": "index",
           "path": "index",
           "style": {
           "style": {
@@ -1488,27 +1462,33 @@
     "list": [
     "list": [
       {
       {
         "pagePath": "pages/index-home/index",
         "pagePath": "pages/index-home/index",
-        "text": "首页",
+        "text": "",
         "iconPath": "static/tab-action.png",
         "iconPath": "static/tab-action.png",
         "selectedIconPath": "static/tab-action-active.png"
         "selectedIconPath": "static/tab-action-active.png"
       },
       },
       {
       {
-        "pagePath": "pages/health/index",
-        "text": "健康",
+        "pagePath": "pages/mind/index",
+        "text": "心",
+        "iconPath": "/static/tab-mind.png",
+        "selectedIconPath": "/static/tab-mind-active.png"
+      },
+      {
+        "pagePath": "pages/body/index",
+        "text": "身",
         "iconPath": "/static/tab-body.png",
         "iconPath": "/static/tab-body.png",
         "selectedIconPath": "/static/tab-body-active.png"
         "selectedIconPath": "/static/tab-body-active.png"
       },
       },
       {
       {
-        "pagePath": "pages/growth/index",
-        "text": "成长",
-        "iconPath": "static/tab-growth.png",
-        "selectedIconPath": "static/tab-growth-active.png"
+        "pagePath": "pages/wisdom/index",
+        "text": "",
+        "iconPath": "static/tab-wisdom.png",
+        "selectedIconPath": "static/tab-wisdom-active.png"
       },
       },
       {
       {
-        "pagePath": "pages/profile/profile",
-        "text": "我的",
-        "iconPath": "static/tab-profile.png",
-        "selectedIconPath": "static/tab-profile-active.png"
+        "pagePath": "pages/wealth/index",
+        "text": "",
+        "iconPath": "static/tab-wealth.png",
+        "selectedIconPath": "static/tab-wealth-active.png"
       }
       }
     ]
     ]
   },
   },

+ 0 - 261
cfc-frontend/pages/health/index.vue

@@ -1,261 +0,0 @@
-<template>
-  <view class="container">
-    <!-- Tabbar 切换过渡页 -->
-    <tab-transition v-if="showTabTransition" dimCode="body" ref="tabTransition" @close="showTabTransition = false" />
-
-    <!-- 品牌头部 -->
-    <PageBanner theme="body"
-      tagline="主动健康 · 闭环管理"
-      quote="测评→报告→方案→执行→追踪" />
-
-    <!-- 未登录态 -->
-    <template v-if="!isLoggedIn">
-      <LoginGuideCard
-        title="登录后查看全家健康数据"
-        :items="[
-          '查看全家健康报告和身体能量数据',
-          '记录每日健康打卡,获取身体能量',
-          '查看专属健康商品和活动价格'
-        ]" />
-    </template>
-
-    <!-- 登录态 -->
-    <template v-else>
-      <!-- 家庭成员选择条 -->
-      <FamilyMemberStrip
-        :members="familyMembersVisible"
-        :selectedMemberId="selectedMemberId"
-        @select="onFamilyMemberSelect"
-        @removed="loadFamilyMembersVisible" />
-
-      <!-- 闭环入口网格 -->
-      <view class="func-section">
-        <view class="func-grid">
-          <view class="func-item" @click="goReportList">
-            <view class="func-icon-wrap" style="background: rgba(91,155,213,0.15);">
-              <text class="func-icon">📊</text>
-            </view>
-            <text class="func-label">健康报告</text>
-          </view>
-          <view class="func-item" @click="goUploadReport">
-            <view class="func-icon-wrap" style="background: rgba(16,185,129,0.15);">
-              <text class="func-icon">📤</text>
-            </view>
-            <text class="func-label">上传报告</text>
-          </view>
-          <view class="func-item" @click="goCheckin">
-            <view class="func-icon-wrap" style="background: rgba(249,115,22,0.15);">
-              <text class="func-icon">✅</text>
-            </view>
-            <text class="func-label">健康打卡</text>
-          </view>
-          <view class="func-item" @click="goAssessment">
-            <view class="func-icon-wrap" style="background: rgba(99,102,241,0.15);">
-              <text class="func-icon">📋</text>
-            </view>
-            <text class="func-label">申请测评</text>
-          </view>
-          <view class="func-item" @click="goNutrition">
-            <view class="func-icon-wrap" style="background: rgba(245,158,11,0.15);">
-              <text class="func-icon">🍽️</text>
-            </view>
-            <text class="func-label">营养档案</text>
-          </view>
-          <view class="func-item" @click="goDiet">
-            <view class="func-icon-wrap" style="background: rgba(239,68,68,0.15);">
-              <text class="func-icon">🥗</text>
-            </view>
-            <text class="func-label">饮食推荐</text>
-          </view>
-          <view class="func-item" @click="goExercise">
-            <view class="func-icon-wrap" style="background: rgba(34,197,94,0.15);">
-              <text class="func-icon">🏃</text>
-            </view>
-            <text class="func-label">运动</text>
-          </view>
-          <view class="func-item" @click="goSleep">
-            <view class="func-icon-wrap" style="background: rgba(139,92,246,0.15);">
-              <text class="func-icon">😴</text>
-            </view>
-            <text class="func-label">作息</text>
-          </view>
-          <view class="func-item" @click="goMeditation">
-            <view class="func-icon-wrap" style="background: rgba(236,72,153,0.15);">
-              <text class="func-icon">🧘</text>
-            </view>
-            <text class="func-label">冥想</text>
-          </view>
-          <view class="func-item" @click="goTongue">
-            <view class="func-icon-wrap" style="background: rgba(255,140,66,0.15);">
-              <text class="func-icon">👅</text>
-            </view>
-            <text class="func-label">舌诊分析</text>
-          </view>
-          <view class="func-item" @click="goHealthDimensions">
-            <view class="func-icon-wrap" style="background: rgba(6,182,212,0.15);">
-              <text class="func-icon">🌏</text>
-            </view>
-            <text class="func-label">健康维度</text>
-          </view>
-          <view class="func-item" @click="goBodyDetail">
-            <view class="func-icon-wrap" style="background: rgba(249,115,22,0.15);">
-              <text class="func-icon">🔬</text>
-            </view>
-            <text class="func-label">身体能量</text>
-          </view>
-        </view>
-      </view>
-    </template>
-
-    <AIFloatingAvatar />
-  </view>
-</template>
-
-<script>
-import TabTransition from '../../components/tab-transition.vue'
-import PageBanner from '../../components/PageBanner.vue'
-import LoginGuideCard from '../../components/LoginGuideCard.vue'
-import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
-import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
-import { getVisibleFamilyMembers } from '../../utils/api.js'
-
-export default {
-  components: {
-    TabTransition,
-    PageBanner,
-    LoginGuideCard,
-    FamilyMemberStrip,
-    AIFloatingAvatar
-  },
-  data() {
-    return {
-      showTabTransition: true,
-      isLoggedIn: false,
-      familyMembersVisible: [],
-      selectedMemberId: null
-    }
-  },
-  onLoad() {
-    this.isLoggedIn = !!uni.getStorageSync('token')
-    if (this.isLoggedIn) {
-      this.loadFamilyMembersVisible()
-    }
-  },
-  onShow() {
-    this.showTabTransition = true
-    this.isLoggedIn = !!uni.getStorageSync('token')
-    this._watchPageReady()
-  },
-  methods: {
-    loadFamilyMembersVisible() {
-      var self = this
-      getVisibleFamilyMembers().then(function(res) {
-        if (res.code === 200 && res.data) {
-          self.familyMembersVisible = Array.isArray(res.data) ? res.data : (res.data.list || [])
-        }
-      }).catch(function() {})
-    },
-    onFamilyMemberSelect(member) {
-      this.selectedMemberId = member.id
-    },
-    _watchPageReady() {
-      var self = this
-      this.$nextTick(function() {
-        if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
-      })
-    },
-    goReportList() {
-      uni.navigateTo({ url: '/pages/health/report-list' })
-    },
-    goUploadReport() {
-      uni.navigateTo({ url: '/pages/health/report-upload' })
-    },
-    goCheckin() {
-      uni.navigateTo({ url: '/pages/health/daily-checkin' })
-    },
-    goAssessment() {
-      uni.navigateTo({ url: '/pages/assessment/apply' })
-    },
-    goNutrition() {
-      var id = this.selectedMemberId || ''
-      uni.navigateTo({ url: '/pages/health/nutrition-profile?memberId=' + id })
-    },
-    goDiet() {
-      uni.navigateTo({ url: '/pages/meal/recommend' })
-    },
-    goExercise() {
-      uni.navigateTo({ url: '/pages/health/exercise-index' })
-    },
-    goSleep() {
-      uni.navigateTo({ url: '/pages/health/sleep-index' })
-    },
-    goMeditation() {
-      uni.navigateTo({ url: '/pages/health/meditation-index' })
-    },
-    goTongue() {
-      uni.navigateTo({ url: '/pages/health/report-upload?reportType=tongue' })
-    },
-    goHealthDimensions() {
-      var id = this.selectedMemberId || ''
-      uni.navigateTo({ url: '/pages/body-detail/health-dimensions?memberId=' + id })
-    },
-    goBodyDetail() {
-      var id = this.selectedMemberId || ''
-      uni.navigateTo({ url: '/pages/body-detail/health-report?memberId=' + id })
-    }
-  }
-}
-</script>
-
-<style scoped>
-.container {
-  min-height: 100vh;
-  background: #f5f7fa;
-  padding-bottom: 120rpx;
-}
-
-.func-section {
-  margin: 20rpx 30rpx;
-}
-
-.func-grid {
-  display: flex;
-  flex-wrap: wrap;
-  gap: 20rpx;
-}
-
-.func-item {
-  width: calc(25% - 15rpx);
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  padding: 24rpx 0;
-  background: #fff;
-  border-radius: 16rpx;
-  box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.05);
-}
-
-.func-item:active {
-  opacity: 0.7;
-}
-
-.func-icon-wrap {
-  width: 72rpx;
-  height: 72rpx;
-  border-radius: 50%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  margin-bottom: 10rpx;
-}
-
-.func-icon {
-  font-size: 32rpx;
-}
-
-.func-label {
-  font-size: 22rpx;
-  color: #333;
-  text-align: center;
-}
-</style>

+ 5 - 3
cfc-frontend/pages/index-home/index.vue

@@ -379,7 +379,6 @@ import CircleDetail from '../../components/CircleDetail.vue'
 import LoginGuideCard from '../../components/LoginGuideCard.vue'
 import LoginGuideCard from '../../components/LoginGuideCard.vue'
 import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
 import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
 import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getVisibleFamilyMembers, getTodayTasksByCategory, getChildren, getEnergyOverview, getProductsByDomain, getChallengeList, getMyCircles, discoverCircles, joinGeneralCircle, leaveGeneralCircle, switchToFamilyMember, getMyMembership, updateChallengeProgress } from '../../utils/api.js'
 import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getVisibleFamilyMembers, getTodayTasksByCategory, getChildren, getEnergyOverview, getProductsByDomain, getChallengeList, getMyCircles, discoverCircles, joinGeneralCircle, leaveGeneralCircle, switchToFamilyMember, getMyMembership, updateChallengeProgress } from '../../utils/api.js'
-var nav = require('../../utils/nav.js')
 import store from '../../store/index.js'
 import store from '../../store/index.js'
 import config from '@/config.js'
 import config from '@/config.js'
 
 
@@ -870,8 +869,11 @@ export default {
       uni.navigateTo({ url: '/pages/article-center/index?dimension=action' })
       uni.navigateTo({ url: '/pages/article-center/index?dimension=action' })
     },
     },
     onFuncClick: function(item) {
     onFuncClick: function(item) {
-      if (item.page) {
-        nav.goPage(item.page)
+      var nativeTabs = ['/pages/index-home/index', '/pages/body/index', '/pages/mind/index', '/pages/wisdom/index', '/pages/wealth/index']
+      if (nativeTabs.indexOf(item.page) !== -1) {
+        uni.switchTab({ url: item.page })
+      } else {
+        uni.navigateTo({ url: item.page })
       }
       }
     },
     },
 
 

+ 1 - 1
cfc-frontend/pages/wisdom-detail/self-quiz.vue

@@ -450,7 +450,7 @@ export default {
       this.answers = []
       this.answers = []
     },
     },
     goHome: function() {
     goHome: function() {
-      uni.navigateTo({ url: '/pages/wisdom/index' })
+      uni.switchTab({ url: '/pages/wisdom/index' })
     },
     },
     goStep: function(n) {
     goStep: function(n) {
       if (n === this.step) return
       if (n === this.step) return

+ 6 - 2
cfc-frontend/pages/wisdom/index.vue

@@ -156,7 +156,6 @@ import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
 import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
 import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
 import { getVisibleSections, getChildren, getTodayTasksByCategory, getActivityList, getProductsByDomain, getFamilyEnergySandbox, getAssessmentLatestResult, getFeaturedArticles, getDanReportByChild } from '../../utils/api.js'
 import { getVisibleSections, getChildren, getTodayTasksByCategory, getActivityList, getProductsByDomain, getFamilyEnergySandbox, getAssessmentLatestResult, getFeaturedArticles, getDanReportByChild } from '../../utils/api.js'
 import { parseDate } from '../../utils/format.js'
 import { parseDate } from '../../utils/format.js'
-var nav = require('../../utils/nav.js')
 
 
 export default {
 export default {
   components: { TabTransition, PageBanner, LoginGuideCard, RadarChart, FamilyEnergyBar, DimensionTasks, DimensionActivities, DimensionProducts, ArticleBookshelf, AIFloatingAvatar, FamilyMemberStrip },
   components: { TabTransition, PageBanner, LoginGuideCard, RadarChart, FamilyEnergyBar, DimensionTasks, DimensionActivities, DimensionProducts, ArticleBookshelf, AIFloatingAvatar, FamilyMemberStrip },
@@ -379,7 +378,12 @@ export default {
         return
         return
       }
       }
       if (item.page) {
       if (item.page) {
-        nav.goPage(item.page)
+        var nativeTabs = ['/pages/index-home/index', '/pages/body/index', '/pages/mind/index', '/pages/wisdom/index', '/pages/wealth/index']
+        if (nativeTabs.indexOf(item.page) !== -1) {
+          uni.switchTab({ url: item.page })
+        } else {
+          uni.navigateTo({ url: item.page })
+        }
       }
       }
     },
     },
     scrollToSection: function(section) {},
     scrollToSection: function(section) {},

+ 1 - 1
cfc-frontend/pages/wisdom/self-quiz.vue

@@ -450,7 +450,7 @@ export default {
       this.answers = []
       this.answers = []
     },
     },
     goHome: function() {
     goHome: function() {
-      uni.navigateTo({ url: '/pages/wisdom/index' })
+      uni.switchTab({ url: '/pages/wisdom/index' })
     },
     },
     goStep: function(n) {
     goStep: function(n) {
       if (n === this.step) return
       if (n === this.step) return

+ 0 - 54
cfc-frontend/utils/nav.js

@@ -1,54 +0,0 @@
-/**
- * 统一导航工具
- * TabBar 页面列表(4 个功能 Tab)
- */
-var TAB_BAR_PAGES = [
-  '/pages/index-home/index',
-  '/pages/health/index',
-  '/pages/growth/index',
-  '/pages/profile/profile'
-]
-
-/**
- * 五维维度页路径映射
- * 行 = index-home(仍是 TabBar 页)
- * 心/身/智/富 = 分包页(已移出 TabBar)
- */
-var DIMENSION_MAP = {
-  action: '/pages/index-home/index',
-  mind: '/pages/mind/index',
-  body: '/pages/body/index',
-  wisdom: '/pages/wisdom/index',
-  wealth: '/pages/wealth/index'
-}
-
-/**
- * 跳转到五维维度页面
- * @param {String} dimCode 维度编码 action/mind/body/wisdom/wealth
- */
-function goDimension(dimCode) {
-  var url = DIMENSION_MAP[dimCode]
-  if (!url) return
-  goPage(url)
-}
-
-/**
- * 通用页面跳转
- * 自动判断目标是否为 TabBar 页(switchTab)还是分包/普通页(navigateTo)
- * @param {String} url 页面路径,如 '/pages/mind/index'
- */
-function goPage(url) {
-  if (!url) return
-  if (TAB_BAR_PAGES.indexOf(url) !== -1) {
-    uni.switchTab({ url: url })
-  } else {
-    uni.navigateTo({ url: url })
-  }
-}
-
-module.exports = {
-  TAB_BAR_PAGES: TAB_BAR_PAGES,
-  DIMENSION_MAP: DIMENSION_MAP,
-  goDimension: goDimension,
-  goPage: goPage
-}