gf-tabbar.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view>
  3. <u-tabbar :list="list" active-color="#1E7DFF" inactive-color="#CCCCCC"></u-tabbar>
  4. </view>
  5. </template>
  6. <script>
  7. import { mapState } from "vuex"
  8. export default {
  9. name: "gf-tabbar",
  10. data() {
  11. return {
  12. list: [{
  13. "iconPath": "/static/images/index.png",
  14. "pagePath": "/pages/index/index",
  15. "selectedIconPath": "/static/images/index1.png",
  16. "text": "首页"
  17. },
  18. {
  19. "iconPath": "/static/images/video.png",
  20. "pagePath": "/pages/video/video",
  21. "selectedIconPath": "/static/images/video1.png",
  22. "text": "视频"
  23. },
  24. {
  25. "iconPath": "/static/images/mine.png",
  26. "pagePath": "/pages/mine/mine",
  27. "selectedIconPath": "/static/images/mine1.png",
  28. "text": "我的"
  29. }
  30. ]
  31. };
  32. },
  33. created() {
  34. if (this.config.report_switch == 1) {
  35. this.list = [{
  36. "iconPath": "/static/images/index.png",
  37. "pagePath": "/pages/index/index",
  38. "selectedIconPath": "/static/images/index1.png",
  39. "text": "首页"
  40. },
  41. {
  42. "iconPath": "/static/images/video.png",
  43. "pagePath": "/pages/video/video",
  44. "selectedIconPath": "/static/images/video1.png",
  45. "text": "视频"
  46. },
  47. {
  48. "iconPath": "/static/images/baobei.png",
  49. "pagePath": "/pages/baobei/baobei",
  50. "selectedIconPath": "/static/images/baobei1.png",
  51. "text": "客户报备"
  52. },
  53. {
  54. "iconPath": "/static/images/mine.png",
  55. "pagePath": "/pages/mine/mine",
  56. "selectedIconPath": "/static/images/mine1.png",
  57. "text": "我的"
  58. }
  59. ]
  60. }
  61. },
  62. computed: {
  63. ...mapState(['config'])
  64. },
  65. watch: {
  66. config: {
  67. handler(val) {
  68. if (val.report_switch == 1) {
  69. this.list = [{
  70. "iconPath": "/static/images/index.png",
  71. "pagePath": "/pages/index/index",
  72. "selectedIconPath": "/static/images/index1.png",
  73. "text": "首页"
  74. },
  75. {
  76. "iconPath": "/static/images/video.png",
  77. "pagePath": "/pages/video/video",
  78. "selectedIconPath": "/static/images/video1.png",
  79. "text": "视频"
  80. },
  81. {
  82. "iconPath": "/static/images/baobei.png",
  83. "pagePath": "/pages/baobei/baobei",
  84. "selectedIconPath": "/static/images/baobei1.png",
  85. "text": "客户报备"
  86. },
  87. {
  88. "iconPath": "/static/images/mine.png",
  89. "pagePath": "/pages/mine/mine",
  90. "selectedIconPath": "/static/images/mine1.png",
  91. "text": "我的"
  92. }
  93. ]
  94. }
  95. },
  96. deep: true
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss">
  102. </style>