智慧教务系统UniApp前端项目(使用中2025-0517)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

131 lines
3.9 KiB

<!--底部Tabber组件-->
<template>
<view class="main_box">
<fui-tabbar :tabBar="tabBar" :current="current" @click="openView"></fui-tabbar>
</view>
</template>
<script>
export default {
name: "AQTabber",
components: {
fuiTabbar
},
data() {
return {
userType: '1', //用户类型|1=教练,2=销售,3=学员
current: '0',
tabBar: []
};
},
created() {
console.log(123)
this.init()
},
methods: {
async init() {
switch (String(this.userType)) {
case "1": //教练
this.tabBar = [{
text: "首页",
urlPath: 'pages/student/index/index', //自定义页面跳转路径
iconPath: "/static/images/tabbar/home.png",
selectedIconPath: "/static/images/tabbar/home_selected.png"
},
{
text: "课表",
urlPath: 'pages/student/timetable/index', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png"
},
{
text: "班级",
urlPath: 'pages/student/my/my', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png"
},
{
text: "我的",
urlPath: 'pages/student/my/my', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png"
}
]
break;
case "2": //销售
this.tabBar = [{
text: "首页",
urlPath: 'pages/student/index/index', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png"
},
{
text: "线索",
urlPath: 'pages/student/my/my', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png"
},
{
text: "添加",
urlPath: 'pages/student/my/my', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png",
midButton: true,
width: 96,
height: 96
},
{
text: "数据",
urlPath: 'pages/student/my/my', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png"
},
{
text: "我的",
urlPath: 'pages/student/my/my', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png"
}
]
break;
case "3": //学员
this.tabBar = [{
text: "首页",
urlPath: 'pages/student/index/index', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png"
},
{
text: "课表",
urlPath: 'pages/student/timetable/index', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png"
},
{
text: "我的",
urlPath: 'pages/student/my/my', //自定义页面跳转路径
iconPath: "/static/images/tabbar/my.png",
selectedIconPath: "/static/images/tabbar/my.png"
}
]
break;
}
},
openView(e) {
console.log('点击跳转', e)
},
}
}
</script>
<style lang="less" scoped>
.fui-wrap {
//为防止标签栏遮住页面内容,页面底部需留白高度不低于标签栏高度。非Nvue端和头条小程序如果fixedHeight属性没有设置为true,则页面外层还需加入以下样式(或者在页面最底部加入`fui-safe-area` 组件)兼容异形屏:
/* #ifndef APP-NVUE */
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
/* #endif */
}
</style>