ParentsTabbar.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. // {
  32. // iconPath: "chat",
  33. // selectedIconPath: "chat-fill",
  34. // text: '消息',
  35. // pagePath2: "/pages/parents/messageNotification/messageNotification",
  36. // count: 99,
  37. // isDot: false,
  38. // customIcon: false,
  39. // },
  40. {
  41. iconPath: "account",
  42. selectedIconPath: "account-fill",
  43. text: '我的',
  44. pagePath2: "/pages/parents/mine/mine",
  45. }
  46. ],
  47. };
  48. },
  49. methods: {
  50. setcount(c) {
  51. this.myCurrent = c
  52. },
  53. beforeSwitch(index) {
  54. if (index == this.current) {
  55. return false
  56. }
  57. var url = this.tabbarList[index].pagePath2;
  58. uni.navigateTo({
  59. url: url
  60. })
  61. if (index == 1) {
  62. this.myCurrent = this.oldindex;
  63. return false;
  64. } else {
  65. return true;
  66. }
  67. },
  68. },
  69. mounted() {
  70. },
  71. destroyed() {
  72. }
  73. }
  74. </script>
  75. <style>
  76. </style>