12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <view>
- <u-tabbar v-model="myCurrent" :list="tabbarList" :before-switch="beforeSwitch" active-color="#0DBAC7">
- </u-tabbar>
- </view>
- </template>
- <script>
- export default {
- name: "YouthTabbar",
- props: {
- current: 0,
- elderStatus: false
- },
- data() {
- return {
- activeColor: "#5098FF",
- oldindex: this.current,
- myCurrent: this.current,
- tabbarList: [{
- iconPath: "home",
- selectedIconPath: "home-fill",
- text: '主页 ',
- pagePath2: "/pages/youth/homePage/homePage",
- },
- {
- iconPath: "bookmark",
- selectedIconPath: "bookmark-fill",
- text: '课程',
- pagePath2: "/pages/youth/course/course",
- },
- // {
- // iconPath: "chat",
- // selectedIconPath: "chat-fill",
- // text: '消息',
- // pagePath2: "/pages/parents/messageNotification/messageNotification",
- // count: 99,
- // isDot: false,
- // customIcon: false,
- // },
- {
- iconPath: "shopping-cart",
- selectedIconPath: "shopping-cart-fill",
- text: '购物车',
- pagePath2: "/pages/youth/course/shoppingCar",
- },
- {
- iconPath: "account",
- selectedIconPath: "account-fill",
- text: '我的',
- pagePath2: "/pages/youth/mine/mine",
- }
- ],
- };
- },
- methods: {
- setcount(c) {
- this.myCurrent = c
- },
- beforeSwitch(index) {
- if (index == this.current) {
- return false
- }
- var url = this.tabbarList[index].pagePath2;
- uni.navigateTo({
- url: url
- })
- if (index == 1) {
- this.myCurrent = this.oldindex;
- return false;
- } else {
- return true;
- }
- },
- },
- mounted() {
- },
- destroyed() {
- }
- }
- </script>
- <style>
- </style>
|