|
|
@ -1,7 +1,7 @@ |
|
|
<!--底部Tabber组件--> |
|
|
<!--底部Tabber组件--> |
|
|
<template> |
|
|
<template> |
|
|
<view class="main_box"> |
|
|
<view class="main_box"> |
|
|
<fui-tabbar :tabBar="tabBar" :current="current" @click="openView"></fui-tabbar> |
|
|
<fui-tabbar :tabBar="tabBar" :current="tabBerIndex" @click="openView"></fui-tabbar> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -15,7 +15,7 @@ |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
userType:'1',//用户类型|1=教练,2=销售,3=学员 |
|
|
userType:'1',//用户类型|1=教练,2=销售,3=学员 |
|
|
current:'0', |
|
|
tabBerIndex:'0', |
|
|
tabBar: [] |
|
|
tabBar: [] |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
@ -27,30 +27,41 @@ |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
async init(){ |
|
|
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)){ |
|
|
switch (String(this.userType)){ |
|
|
case "1"://教练 |
|
|
case "1"://教练 |
|
|
this.tabBar = [ |
|
|
this.tabBar = [ |
|
|
{ |
|
|
{ |
|
|
text: "首页", |
|
|
text: "首页", |
|
|
urlPath:'pages/student/index/index',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/index/index',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/home.png", |
|
|
iconPath: "/static/images/tabbar/home.png", |
|
|
selectedIconPath: "/static/images/tabbar/home_selected.png" |
|
|
selectedIconPath: "/static/images/tabbar/home_selected.png" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
text: "课表", |
|
|
text: "课表", |
|
|
urlPath:'pages/student/timetable/index',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/timetable/index',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
text: "班级", |
|
|
text: "班级", |
|
|
urlPath:'pages/student/my/my',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/my/my',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
text: "我的", |
|
|
text: "我的", |
|
|
urlPath:'pages/student/my/my',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/my/my',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
} |
|
|
} |
|
|
@ -60,19 +71,19 @@ |
|
|
this.tabBar = [ |
|
|
this.tabBar = [ |
|
|
{ |
|
|
{ |
|
|
text: "首页", |
|
|
text: "首页", |
|
|
urlPath:'pages/student/index/index',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/index/index',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
text: "线索", |
|
|
text: "线索", |
|
|
urlPath:'pages/student/my/my',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/my/my',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
text: "添加", |
|
|
text: "添加", |
|
|
urlPath:'pages/student/my/my',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/my/my',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png", |
|
|
midButton: true, |
|
|
midButton: true, |
|
|
@ -81,13 +92,13 @@ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
text: "数据", |
|
|
text: "数据", |
|
|
urlPath:'pages/student/my/my',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/my/my',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
text: "我的", |
|
|
text: "我的", |
|
|
urlPath:'pages/student/my/my',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/my/my',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
} |
|
|
} |
|
|
@ -97,19 +108,19 @@ |
|
|
this.tabBar = [ |
|
|
this.tabBar = [ |
|
|
{ |
|
|
{ |
|
|
text: "首页", |
|
|
text: "首页", |
|
|
urlPath:'pages/student/index/index',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/index/index',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
text: "课表", |
|
|
text: "课表", |
|
|
urlPath:'pages/student/timetable/index',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/timetable/index',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
text: "我的", |
|
|
text: "我的", |
|
|
urlPath:'pages/student/my/my',//自定义页面跳转路径 |
|
|
urlPath:'/pages/student/my/my',//自定义页面跳转路径 |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
iconPath: "/static/images/tabbar/my.png", |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
selectedIconPath: "/static/images/tabbar/my.png" |
|
|
} |
|
|
} |
|
|
@ -120,6 +131,13 @@ |
|
|
|
|
|
|
|
|
openView(e){ |
|
|
openView(e){ |
|
|
console.log('点击跳转',e) |
|
|
console.log('点击跳转',e) |
|
|
|
|
|
//跳转tabBar页面 |
|
|
|
|
|
uni.setStorageSync('tabBerIndex',e.index) |
|
|
|
|
|
|
|
|
|
|
|
console.log('qqq',e.urlPath) |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url:e.urlPath |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|