|
|
@@ -50,7 +50,7 @@ export default {
|
|
|
{ text: '我的', pagePath: '/pages/profile/profile', icon: '/static/tab-profile.png', selectedIcon: '/static/tab-profile-active.png' }
|
|
|
],
|
|
|
teacherTabs: [
|
|
|
- { text: '首页', pagePath: '/pages/teacher/teacher-home', icon: '/static/tab-home.png', selectedIcon: '/static/tab-home-active.png' },
|
|
|
+ { text: '首页', pagePath: '/pages/teacher/index', icon: '/static/tab-home.png', selectedIcon: '/static/tab-home-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/growth/index', icon: '/static/tab-growth.png', selectedIcon: '/static/tab-growth-active.png' },
|
|
|
@@ -90,7 +90,13 @@ export default {
|
|
|
},
|
|
|
switchTab(item, index) {
|
|
|
this.currentIndex = index
|
|
|
- uni.reLaunch({ url: item.pagePath })
|
|
|
+ // 原生TabBar页使用switchTab,非Tab页使用redirectTo(比reLaunch轻量)
|
|
|
+ const nativeTabPages = ['/pages/index/index', '/pages/discover/index', '/pages/shop/index', '/pages/profile/profile']
|
|
|
+ if (nativeTabPages.includes(item.pagePath)) {
|
|
|
+ uni.switchTab({ url: item.pagePath })
|
|
|
+ } else {
|
|
|
+ uni.redirectTo({ url: item.pagePath })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -133,6 +139,6 @@ export default {
|
|
|
}
|
|
|
|
|
|
.tab-item.active .tab-text {
|
|
|
- color: #FF6B6B;
|
|
|
+ color: #F97316;
|
|
|
}
|
|
|
</style>
|