123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <template>
- <u-tabbar v-model="current" :before-switch="beforeSwitch" :list="list" @change="change" active-color="#007aff"
- :height="Headers"></u-tabbar>
- </template>
- <script>
- import config from "@/common/config";
- export default {
- name: "myTabbar",
- options: {
- styleIsolation: "shared"
- },
- data() {
- return {
- list: [{
- pagePath: "/pages/index/index",
- iconPath: require("@/static/modIcon/home-1.png"),
- selectedIconPath: require("@/static/modIcon/home.png"),
- text: "首页",
- },
- {
- pagePath: "/pages/course/index",
- iconPath: require("@/static/modIcon/choose-1.png"),
- selectedIconPath: require("@/static/modIcon/choose.png"),
- text: "选购",
- },
- {
- pagePath: "/pages/learn/index",
- iconPath: require("@/static/modIcon/study-1.png"),
- selectedIconPath: require("@/static/modIcon/study.png"),
- text: "学习",
- },
- {
- pagePath: "/pages/questionBank/index",
- iconPath: require("@/static/modIcon/practice-1.png"),
- selectedIconPath: require("@/static/modIcon/practice.png"),
- text: "练习",
- },
- // {
- // pagePath: "/pages/information/index",
- // iconPath: config.BASE_IMG_URL + "/web/icon/nav4.png",
- // selectedIconPath: config.BASE_IMG_URL + "/web/icon/nav4_on.png",
- // text: "资料",
- // },
- {
- pagePath: "/pages/wd/index",
- iconPath: require("@/static/modIcon/my-1.png"),
- selectedIconPath: require("@/static/modIcon/my.png"),
- text: "我的",
- },
- ],
- current: 0,
- Headers: "100rpx"
- };
- },
- mounted() {
- },
- onShow() {},
- methods: {
- beforeSwitch(index) {
- return true; // 或者根据逻辑返回false
- },
- change(index) {
- this.current = index;
- // if (index === 4) {
- // this.toInformation();
- // }
- },
- toInformation() {
- uni.reLaunch({
- url: "/pages/information/index",
- });
- },
- },
- };
- </script>
- <style lang="scss">
- .u-tabbar {
- ::v-deep &__content {
- z-index: 10000 !important;
- }
- }
- </style>
|