ParentsTabbar.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view>
  3. <u-tabbar v-model="myCurrent" :list="tabbarList" :before-switch="beforeSwitch" active-color="#0DBAC7">
  4. </u-tabbar>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. name: "ParentsTabbar",
  10. props: {
  11. current: 0,
  12. elderStatus: false
  13. },
  14. data() {
  15. return {
  16. activeColor: "#5098FF",
  17. oldindex: this.current,
  18. myCurrent: this.current,
  19. tabbarList: [{
  20. iconPath: "home",
  21. selectedIconPath: "home-fill",
  22. text: '主页 ',
  23. pagePath2: "/pages/parents/homePage/homePage",
  24. },
  25. {
  26. iconPath: "bookmark",
  27. selectedIconPath: "bookmark-fill",
  28. text: '课程',
  29. pagePath2: "/pages/parents/course/course",
  30. }, {
  31. iconPath: "chat",
  32. selectedIconPath: "chat-fill",
  33. text: '消息',
  34. pagePath2: "/pages/parents/messageNotification/messageNotification",
  35. count: 99,
  36. isDot: false,
  37. customIcon: false,
  38. },
  39. {
  40. iconPath: "account",
  41. selectedIconPath: "account-fill",
  42. text: '我的',
  43. pagePath2: "/pages/parents/mine/mine",
  44. }
  45. ],
  46. };
  47. },
  48. methods: {
  49. setcount(c) {
  50. this.myCurrent = c
  51. },
  52. beforeSwitch(index) {
  53. if (index == this.current) {
  54. return false
  55. }
  56. var url = this.tabbarList[index].pagePath2;
  57. uni.navigateTo({
  58. url: url
  59. })
  60. if (index == 1) {
  61. this.myCurrent = this.oldindex;
  62. return false;
  63. } else {
  64. return true;
  65. }
  66. },
  67. },
  68. mounted() {
  69. },
  70. destroyed() {
  71. }
  72. }
  73. </script>
  74. <style>
  75. </style>