index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view>
  3. <u-tabbar
  4. :border="false"
  5. :value="value"
  6. activeColor="#A10808"
  7. :placeholder="false"
  8. :customStyle="barStyle"
  9. class="tabBar"
  10. @click="clickBar"
  11. @change="changBar"
  12. >
  13. <u-tabbar-item text="文创">
  14. <image
  15. class="u-page__item__slot-icon"
  16. slot="active-icon"
  17. src="@/static/icon/taskBar/home_active.png"
  18. >
  19. </image>
  20. <image
  21. class="u-page__item__slot-icon"
  22. slot="inactive-icon"
  23. src="@/static/icon/taskBar/home.png"
  24. ></image>
  25. </u-tabbar-item>
  26. <u-tabbar-item text="活动">
  27. <image
  28. class="u-page__item__slot-icon"
  29. slot="active-icon"
  30. src="@/static/icon/taskBar/act_active.png"
  31. >
  32. </image>
  33. <image
  34. class="u-page__item__slot-icon"
  35. slot="inactive-icon"
  36. src="@/static/icon/taskBar/act.png"
  37. ></image>
  38. </u-tabbar-item>
  39. <!-- <u-tabbar-item text="生活">
  40. <image
  41. class="u-page__item__slot-icon"
  42. slot="active-icon"
  43. src="@/static/icon/taskBar/life_active.png"
  44. >
  45. </image>
  46. <image
  47. class="u-page__item__slot-icon"
  48. slot="inactive-icon"
  49. src="@/static/icon/taskBar/life.png"
  50. ></image>
  51. </u-tabbar-item> -->
  52. <u-tabbar-item text="我的">
  53. <image
  54. class="u-page__item__slot-icon"
  55. slot="active-icon"
  56. src="@/static/icon/taskBar/my_active.png"
  57. >
  58. </image>
  59. <image
  60. class="u-page__item__slot-icon"
  61. slot="inactive-icon"
  62. src="@/static/icon/taskBar/my.png"
  63. ></image>
  64. </u-tabbar-item>
  65. </u-tabbar>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. props:{
  71. value:{
  72. type:Number,
  73. default:0
  74. }
  75. },
  76. data() {
  77. return {
  78. barStyle: {
  79. borderRadius: "32rpx 32rpx 0 0",
  80. boxShadow: "0rpx -6rpx 12rpx 2rpx rgba(0,0,0,0.09)",
  81. },
  82. list: [
  83. {
  84. text: "文创",
  85. pagePath: "pages/index/index",
  86. },
  87. {
  88. text: "活动",
  89. pagePath: "pages/activity/index",
  90. },
  91. // {
  92. // text: "生活",
  93. // pagePath: "pages/life/index",
  94. // },
  95. {
  96. text: "我的",
  97. pagePath: "pages/my/index",
  98. },
  99. ],
  100. };
  101. },
  102. methods: {
  103. changBar(e) {
  104. uni.switchTab({
  105. url:"/"+ this.list[e].pagePath,
  106. });
  107. },
  108. },
  109. };
  110. </script>
  111. <style lang="scss" scoped>
  112. .u-page__item__slot-icon {
  113. width: 23px;
  114. height: 23px;
  115. }
  116. </style>