Просмотр исходного кода

fix(frontend): TabBar 分包冲突 + 自定义TabBar不显示修复

- 移动主包页面到新目录避免分包root前缀冲突:
  pages/health/index → pages/health-main/index
  pages/growth/index → pages/growth-main/index
  pages/profile/profile → pages/profile-main/profile
- 更新 nav.js, custom-tab-bar, pages.json 等 10 处引用
- main.js 添加 custom-tab-bar 显式注册(强制构建编译)
- pages.json 4个Tab页添加 usingComponents 引用 custom-tab-bar
- 修复 checkout.vue ES6 简写方法语法错误
asus 2 месяцев назад
Родитель
Сommit
06b5a67409

+ 6 - 6
cfc-frontend/custom-tab-bar/index.vue

@@ -76,15 +76,15 @@ export default {
       showDimPanel: false,
       showDimPanel: false,
       normalTabs: [
       normalTabs: [
         { text: '首页', pagePath: '/pages/index-home/index', icon: '/static/tab-home.png', selectedIcon: '/static/tab-home-active.png' },
         { text: '首页', pagePath: '/pages/index-home/index', icon: '/static/tab-home.png', selectedIcon: '/static/tab-home-active.png' },
-        { text: '健康', pagePath: '/pages/health/index', icon: '/static/tab-health.png', selectedIcon: '/static/tab-health-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' }
+        { text: '健康', pagePath: '/pages/health-main/index', icon: '/static/tab-health.png', selectedIcon: '/static/tab-health-active.png' },
+        { text: '成长', pagePath: '/pages/growth-main/index', icon: '/static/tab-growth.png', selectedIcon: '/static/tab-growth-active.png' },
+        { text: '我的', pagePath: '/pages/profile-main/profile', icon: '/static/tab-profile.png', selectedIcon: '/static/tab-profile-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' },
         { text: '家庭', pagePath: '/pages/teacher/families', icon: '/static/tab-family.png', selectedIcon: '/static/tab-family-active.png' },
         { text: '家庭', pagePath: '/pages/teacher/families', icon: '/static/tab-family.png', selectedIcon: '/static/tab-family-active.png' },
         { 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-main/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: [
       dimensions: [
@@ -122,7 +122,7 @@ export default {
     switchTab(item, index) {
     switchTab(item, index) {
       this.currentIndex = index
       this.currentIndex = index
       // TabBar 注册页用 switchTab,非 TabBar 页用 redirectTo
       // TabBar 注册页用 switchTab,非 TabBar 页用 redirectTo
-      var tabBarPages = ['/pages/index-home/index', '/pages/health/index', '/pages/growth/index', '/pages/profile/profile']
+      var tabBarPages = ['/pages/index-home/index', '/pages/health-main/index', '/pages/growth-main/index', '/pages/profile-main/profile']
       if (tabBarPages.indexOf(item.pagePath) !== -1) {
       if (tabBarPages.indexOf(item.pagePath) !== -1) {
         uni.switchTab({ url: item.pagePath })
         uni.switchTab({ url: item.pagePath })
       } else {
       } else {
@@ -146,7 +146,7 @@ export default {
       }
       }
       var url = dimMap[dim.code]
       var url = dimMap[dim.code]
       if (!url) return
       if (!url) return
-      var tabBarPages = ['/pages/index-home/index', '/pages/health/index', '/pages/growth/index', '/pages/profile/profile']
+      var tabBarPages = ['/pages/index-home/index', '/pages/health-main/index', '/pages/growth-main/index', '/pages/profile-main/profile']
       if (tabBarPages.indexOf(url) !== -1) {
       if (tabBarPages.indexOf(url) !== -1) {
         uni.switchTab({ url: url })
         uni.switchTab({ url: url })
       } else {
       } else {

+ 2 - 0
cfc-frontend/main.js

@@ -2,11 +2,13 @@ import App from './App'
 import Vue from 'vue'
 import Vue from 'vue'
 import store from './store'
 import store from './store'
 import FamilyEmptyState from './components/FamilyEmptyState/FamilyEmptyState.vue'
 import FamilyEmptyState from './components/FamilyEmptyState/FamilyEmptyState.vue'
+import CustomTabBar from './custom-tab-bar/index.vue'
 import { formatPriceWithSymbol, formatPrice, formatRate, formatScore } from '@/utils/format'
 import { formatPriceWithSymbol, formatPrice, formatRate, formatScore } from '@/utils/format'
 
 
 Vue.config.productionTip = false
 Vue.config.productionTip = false
 
 
 Vue.component('FamilyEmptyState', FamilyEmptyState)
 Vue.component('FamilyEmptyState', FamilyEmptyState)
+Vue.component('custom-tab-bar', CustomTabBar)
 
 
 Vue.prototype.$store = store
 Vue.prototype.$store = store
 Vue.prototype.formatPriceWithSymbol = formatPriceWithSymbol
 Vue.prototype.formatPriceWithSymbol = formatPriceWithSymbol

+ 22 - 10
cfc-frontend/pages.json

@@ -3,25 +3,37 @@
     {
     {
       "path": "pages/index-home/index",
       "path": "pages/index-home/index",
       "style": {
       "style": {
-        "navigationBarTitleText": "首页"
+        "navigationBarTitleText": "首页",
+        "usingComponents": {
+          "custom-tab-bar": "/custom-tab-bar/index"
+        }
       }
       }
     },
     },
     {
     {
-      "path": "pages/health/index",
+      "path": "pages/health-main/index",
       "style": {
       "style": {
-        "navigationBarTitleText": "健康"
+        "navigationBarTitleText": "健康",
+        "usingComponents": {
+          "custom-tab-bar": "/custom-tab-bar/index"
+        }
       }
       }
     },
     },
     {
     {
-      "path": "pages/growth/index",
+      "path": "pages/growth-main/index",
       "style": {
       "style": {
-        "navigationBarTitleText": "成长档案"
+        "navigationBarTitleText": "成长档案",
+        "usingComponents": {
+          "custom-tab-bar": "/custom-tab-bar/index"
+        }
       }
       }
     },
     },
     {
     {
-      "path": "pages/profile/profile",
+      "path": "pages/profile-main/profile",
       "style": {
       "style": {
-        "navigationBarTitleText": "我的"
+        "navigationBarTitleText": "我的",
+        "usingComponents": {
+          "custom-tab-bar": "/custom-tab-bar/index"
+        }
       }
       }
     }
     }
   ],
   ],
@@ -1479,19 +1491,19 @@
         "selectedIconPath": "static/tab-home-active.png"
         "selectedIconPath": "static/tab-home-active.png"
       },
       },
       {
       {
-        "pagePath": "pages/health/index",
+        "pagePath": "pages/health-main/index",
         "text": "健康",
         "text": "健康",
         "iconPath": "static/tab-health.png",
         "iconPath": "static/tab-health.png",
         "selectedIconPath": "static/tab-health-active.png"
         "selectedIconPath": "static/tab-health-active.png"
       },
       },
       {
       {
-        "pagePath": "pages/growth/index",
+        "pagePath": "pages/growth-main/index",
         "text": "成长",
         "text": "成长",
         "iconPath": "static/tab-growth.png",
         "iconPath": "static/tab-growth.png",
         "selectedIconPath": "static/tab-growth-active.png"
         "selectedIconPath": "static/tab-growth-active.png"
       },
       },
       {
       {
-        "pagePath": "pages/profile/profile",
+        "pagePath": "pages/profile-main/profile",
         "text": "我的",
         "text": "我的",
         "iconPath": "static/tab-profile.png",
         "iconPath": "static/tab-profile.png",
         "selectedIconPath": "static/tab-profile-active.png"
         "selectedIconPath": "static/tab-profile-active.png"

+ 0 - 0
cfc-frontend/pages/growth/index.vue → cfc-frontend/pages/growth-main/index.vue


+ 0 - 0
cfc-frontend/pages/health/index.vue → cfc-frontend/pages/health-main/index.vue


+ 1 - 1
cfc-frontend/pages/mind-detail/index.vue

@@ -227,7 +227,7 @@ components: { TabTransition, PageBanner, RadarChart, LoginGuideCard, FamilyEnerg
       funcList: [
       funcList: [
         { icon: '\u{1F4D6}', label: '阅读', needLogin: false, page: '/pages/mind-extra/articles' },
         { icon: '\u{1F4D6}', label: '阅读', needLogin: false, page: '/pages/mind-extra/articles' },
         { icon: '\u{1F4CA}', label: '测评报告', needLogin: true, page: '/pages/mind/emotion-report' },
         { icon: '\u{1F4CA}', label: '测评报告', needLogin: true, page: '/pages/mind/emotion-report' },
-        { icon: '\u{1F4DD}', label: '成长档案', needLogin: true, page: '/pages/growth/index' },
+        { icon: '\u{1F4DD}', label: '成长档案', needLogin: true, page: '/pages/growth-main/index' },
         { icon: '\u{2728}', label: '情绪打卡', needLogin: true, page: '/pages/mind-detail/emotion-checkin' },
         { icon: '\u{2728}', label: '情绪打卡', needLogin: true, page: '/pages/mind-detail/emotion-checkin' },
         { icon: '\u{1F4C8}', label: '情绪趋势', needLogin: true, page: '/pages/mind-detail/emotion-trend' },
         { icon: '\u{1F4C8}', label: '情绪趋势', needLogin: true, page: '/pages/mind-detail/emotion-trend' },
         { icon: '\u{1F9E9}', label: '心理自评', needLogin: true, page: '/pages/mind-detail/screening' },
         { icon: '\u{1F9E9}', label: '心理自评', needLogin: true, page: '/pages/mind-detail/screening' },

+ 1 - 1
cfc-frontend/pages/parent/child-detail.vue

@@ -200,7 +200,7 @@ export default {
     },
     },
     goToGrowth() {
     goToGrowth() {
       uni.navigateTo({
       uni.navigateTo({
-        url: '/pages/growth/index?memberId=' + this.memberId
+        url: '/pages/growth-main/index?memberId=' + this.memberId
       })
       })
     },
     },
     goToCompletionStats() {
     goToCompletionStats() {

+ 4 - 4
cfc-frontend/pages/profile/profile.vue → cfc-frontend/pages/profile-main/profile.vue

@@ -52,10 +52,10 @@
 
 
 <script>
 <script>
 import TabTransition from '../../components/tab-transition.vue'
 import TabTransition from '../../components/tab-transition.vue'
-import ProfileHeader from './components/ProfileHeader.vue'
-import ProfileBadges from './components/ProfileBadges.vue'
-import ProfileGrowth from './components/ProfileGrowth.vue'
-import ProfileMenu from './components/ProfileMenu.vue'
+import ProfileHeader from '../profile/components/ProfileHeader.vue'
+import ProfileBadges from '../profile/components/ProfileBadges.vue'
+import ProfileGrowth from '../profile/components/ProfileGrowth.vue'
+import ProfileMenu from '../profile/components/ProfileMenu.vue'
 import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
 import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
 import HealthBadge from '../../components/HealthBadge.vue'
 import HealthBadge from '../../components/HealthBadge.vue'
 import HealthTimeline from '../../components/HealthTimeline.vue'
 import HealthTimeline from '../../components/HealthTimeline.vue'

+ 7 - 3
cfc-frontend/pages/shop/checkout/checkout.vue

@@ -844,18 +844,22 @@ export default {
     showServicePersonPicker: function() {
     showServicePersonPicker: function() {
       this.showServicePersonModal = true
       this.showServicePersonModal = true
     },
     },
-    showOnlineSlotPicker: function() {
+showOnlineSlotPicker: function() {
       this.showOnlineSlotModal = true
       this.showOnlineSlotModal = true
     },
     },
-    selectPickupLocation(loc) {
+    selectPickupLocation: function(loc) {
       this.selectedPickupLocation = loc
       this.selectedPickupLocation = loc
       this.selectedTimeSlot = null
       this.selectedTimeSlot = null
       this.showPickupLocationModal = false
       this.showPickupLocationModal = false
     },
     },
-    selectTimeSlot(slot) {
+    selectTimeSlot: function(slot) {
       this.selectedTimeSlot = slot
       this.selectedTimeSlot = slot
       this.showTimeSlotModal = false
       this.showTimeSlotModal = false
     },
     },
+    selectServicePerson: function(person) {
+      this.selectedServicePerson = person
+      this.showServicePersonModal = false
+    },
     getImageUrl: function(path) {
     getImageUrl: function(path) {
       return config.API_BASE_URL + path
       return config.API_BASE_URL + path
     }
     }

+ 1 - 1
cfc-frontend/pages/teacher/teacher-home.vue

@@ -203,7 +203,7 @@ export default {
         team: '/pages/teacher/team',
         team: '/pages/teacher/team',
         messages: '/pages/teacher/messages',
         messages: '/pages/teacher/messages',
         orders: '/pages/teacher/orders',
         orders: '/pages/teacher/orders',
-        growth: '/pages/growth/index'
+        growth: '/pages/growth-main/index'
       }
       }
       uni.reLaunch({ url: routes[page] })
       uni.reLaunch({ url: routes[page] })
     }
     }

+ 1 - 1
cfc-frontend/pages/teacher/teacher-profile.vue

@@ -129,7 +129,7 @@ export default {
       uni.navigateTo({ url: '/pages/user-edit/user-edit' })
       uni.navigateTo({ url: '/pages/user-edit/user-edit' })
     },
     },
     goToGrowth() {
     goToGrowth() {
-      uni.reLaunch({ url: '/pages/growth/index' })
+      uni.reLaunch({ url: '/pages/growth-main/index' })
     },
     },
     goToMessages() {
     goToMessages() {
       uni.navigateTo({ url: '/pages/teacher/messages' })
       uni.navigateTo({ url: '/pages/teacher/messages' })

+ 1 - 1
cfc-frontend/pages/wealth/index.vue

@@ -551,7 +551,7 @@ export default {
       })
       })
     },
     },
     goToProfile() {
     goToProfile() {
-      uni.navigateTo({ url: '/pages/profile/profile' })
+      uni.navigateTo({ url: '/pages/profile-main/profile' })
     },
     },
     goToCheckin() {
     goToCheckin() {
       uni.navigateTo({ url: '/pages/wealth-sub/checkin' })
       uni.navigateTo({ url: '/pages/wealth-sub/checkin' })

+ 3 - 3
cfc-frontend/utils/nav.js

@@ -5,9 +5,9 @@
  */
  */
 var TAB_BAR_PAGES = [
 var TAB_BAR_PAGES = [
   '/pages/index-home/index',
   '/pages/index-home/index',
-  '/pages/health/index',
-  '/pages/growth/index',
-  '/pages/profile/profile'
+  '/pages/health-main/index',
+  '/pages/growth-main/index',
+  '/pages/profile-main/profile'
 ]
 ]
 
 
 /**
 /**