user_coupon.vue 765 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <view class="user-coupon">
  3. <tabs :current="active" @change="onChange" :is-scroll="false">
  4. <tab v-for="(item, index) in coupons" :key="index" :name="item.title">
  5. <my-coupons :type="item.type" :btn-type="item.btnType" :i="index" :index="active"></my-coupons>
  6. </tab>
  7. </tabs>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. active: 0,
  15. coupons: [{
  16. title: '可使用',
  17. btnType: 0,
  18. type: 'valid'
  19. }, {
  20. title: '已使用',
  21. btnType: 1,
  22. type: 'used'
  23. }, {
  24. title: '已过期',
  25. btnType: 2,
  26. type: 'expired'
  27. }]
  28. };
  29. },
  30. methods: {
  31. onChange(index) {
  32. this.active = index
  33. }
  34. }
  35. };
  36. </script>
  37. <style>
  38. </style>