|
@@ -45,10 +45,10 @@ export default {
|
|
|
currentIndex: 0,
|
|
currentIndex: 0,
|
|
|
normalTabs: [
|
|
normalTabs: [
|
|
|
{ text: '行', pagePath: '/pages/index-home/index', icon: '/static/tab-action.png', selectedIcon: '/static/tab-action-active.png' },
|
|
{ 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/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/wisdom/index', icon: '/static/tab-wisdom.png', selectedIcon: '/static/tab-wisdom-active.png' },
|
|
|
- { text: '心', pagePath: '/pages/mind/index', icon: '/static/tab-mind.png', selectedIcon: '/static/tab-mind-active.png' },
|
|
|
|
|
- { text: '富', pagePath: '/pages/profile/profile', icon: '/static/tab-wealth.png', selectedIcon: '/static/tab-wealth-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' },
|
|
@@ -92,7 +92,8 @@ export default {
|
|
|
switchTab(item, index) {
|
|
switchTab(item, index) {
|
|
|
this.currentIndex = index
|
|
this.currentIndex = index
|
|
|
// 原生TabBar页使用switchTab,非Tab页使用redirectTo(比reLaunch轻量)
|
|
// 原生TabBar页使用switchTab,非Tab页使用redirectTo(比reLaunch轻量)
|
|
|
- const nativeTabPages = ['/pages/index-home/index', '/pages/body/index', '/pages/wisdom/index', '/pages/mind/index', '/pages/profile/profile']
|
|
|
|
|
|
|
+ // 注意: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 {
|