bottom-bar-index.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view>
  3. <view class="cu-bar tabbar bg-white">
  4. <view class="action" @click="change(0)">
  5. <view class="cuIcon-cu-image">
  6. <block v-if="current == 0">
  7. <view style="height: 42upx;">
  8. <image src="/static/ldt/bottomBar/home_actived.png" style="width: 36upx;height: 35upx;"></image>
  9. </view>
  10. </block>
  11. <block v-else>
  12. <view style="height: 42upx;">
  13. <image src="/static/ldt/bottomBar/home.png" style="width: 36upx;height: 35upx;"></image>
  14. </view>
  15. </block>
  16. </view>
  17. <view :class="current == 0 ? 'text-black':'text-gray'">首页</view>
  18. </view>
  19. <view class="action" @click="change(1)">
  20. <view class="cuIcon-cu-image">
  21. <block v-if="current == 1">
  22. <view style="height: 42upx;">
  23. <image src="/static/ldt/bottomBar/points_actived.png" style="width: 39upx;height: 37upx;"></image>
  24. </view>
  25. </block>
  26. <block v-else>
  27. <view style="height: 42upx;">
  28. <image src="/static/ldt/bottomBar/points.png" style="width: 39upx;height: 37upx;"></image>
  29. </view>
  30. </block>
  31. </view>
  32. <view :class="current == 1 ? 'text-black':'text-gray'">花积分</view>
  33. </view>
  34. <view class="action" @click="change(2)">
  35. <view class="cuIcon-cu-image">
  36. <block v-if="current == 2">
  37. <view style="height: 42upx;">
  38. <image src="/static/ldt/bottomBar/earn_actived.png" style="width: 39upx;height: 40upx;"></image>
  39. </view>
  40. </block>
  41. <block v-else>
  42. <view style="height: 42upx;">
  43. <image src="/static/ldt/bottomBar/earn.png" style="width: 39upx;height: 40upx;"></image>
  44. </view>
  45. </block>
  46. </view>
  47. <view :class="current == 2 ? 'text-black':'text-gray'">赚积分</view>
  48. </view>
  49. <view class="action" @click="change(3)">
  50. <view class="cuIcon-cu-image">
  51. <block v-if="current == 3">
  52. <view style="height: 42upx;">
  53. <image src="/static/ldt/bottomBar/mine_actived.png" style="width: 32upx;height: 37upx;"></image>
  54. </view>
  55. </block>
  56. <block v-else>
  57. <view style="height: 42upx;">
  58. <image src="/static/ldt/bottomBar/mine.png" style="width: 32upx;height: 37upx;"></image>
  59. </view>
  60. </block>
  61. </view>
  62. <view :class="current == 3 ? 'text-black':'text-gray'">我的</view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. data() {
  70. return {
  71. current: 0,
  72. };
  73. },
  74. props: {
  75. },
  76. methods: {
  77. change(index) {
  78. this.current = index;
  79. this.$emit("onTap",index);
  80. },
  81. }
  82. }
  83. </script>
  84. <style>
  85. </style>