diff --git a/components/AQ/AQTabber.vue b/components/AQ/AQTabber.vue index 0bdcac1..b01d7f1 100644 --- a/components/AQ/AQTabber.vue +++ b/components/AQ/AQTabber.vue @@ -1,7 +1,7 @@ @@ -15,7 +15,7 @@ data() { return { userType:'1',//用户类型|1=教练,2=销售,3=学员 - current:'0', + tabBerIndex:'0', tabBar: [] }; }, @@ -27,30 +27,41 @@ methods: { async init(){ + uni.setStorageSync('userType','1') + + let userType = uni.getStorageSync('userType') + let tabBerIndex = uni.getStorageSync('tabBerIndex') + if(tabBerIndex){ + this.tabBerIndex = String(tabBerIndex) + }else{ + this.tabBerIndex = '0' + } + + switch (String(this.userType)){ case "1"://教练 this.tabBar = [ { text: "首页", - urlPath:'pages/student/index/index',//自定义页面跳转路径 + urlPath:'/pages/student/index/index',//自定义页面跳转路径 iconPath: "/static/images/tabbar/home.png", selectedIconPath: "/static/images/tabbar/home_selected.png" }, { text: "课表", - urlPath:'pages/student/timetable/index',//自定义页面跳转路径 + urlPath:'/pages/student/timetable/index',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png" }, { text: "班级", - urlPath:'pages/student/my/my',//自定义页面跳转路径 + urlPath:'/pages/student/my/my',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png" }, { text: "我的", - urlPath:'pages/student/my/my',//自定义页面跳转路径 + urlPath:'/pages/student/my/my',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png" } @@ -60,19 +71,19 @@ this.tabBar = [ { text: "首页", - urlPath:'pages/student/index/index',//自定义页面跳转路径 + urlPath:'/pages/student/index/index',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png" }, { text: "线索", - urlPath:'pages/student/my/my',//自定义页面跳转路径 + urlPath:'/pages/student/my/my',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png" }, { text: "添加", - urlPath:'pages/student/my/my',//自定义页面跳转路径 + urlPath:'/pages/student/my/my',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png", midButton: true, @@ -81,13 +92,13 @@ }, { text: "数据", - urlPath:'pages/student/my/my',//自定义页面跳转路径 + urlPath:'/pages/student/my/my',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png" }, { text: "我的", - urlPath:'pages/student/my/my',//自定义页面跳转路径 + urlPath:'/pages/student/my/my',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png" } @@ -97,19 +108,19 @@ this.tabBar = [ { text: "首页", - urlPath:'pages/student/index/index',//自定义页面跳转路径 + urlPath:'/pages/student/index/index',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png" }, { text: "课表", - urlPath:'pages/student/timetable/index',//自定义页面跳转路径 + urlPath:'/pages/student/timetable/index',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png" }, { text: "我的", - urlPath:'pages/student/my/my',//自定义页面跳转路径 + urlPath:'/pages/student/my/my',//自定义页面跳转路径 iconPath: "/static/images/tabbar/my.png", selectedIconPath: "/static/images/tabbar/my.png" } @@ -120,6 +131,13 @@ openView(e){ console.log('点击跳转',e) + //跳转tabBar页面 + uni.setStorageSync('tabBerIndex',e.index) + + console.log('qqq',e.urlPath) + uni.navigateTo({ + url:e.urlPath + }) }, } } diff --git a/pages/student/my/my.vue b/pages/student/my/my.vue index 8a317b2..426b7c6 100644 --- a/pages/student/my/my.vue +++ b/pages/student/my/my.vue @@ -105,10 +105,14 @@ + +