s-coupon-card.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="ss-coupon-menu-wrap ss-flex ss-col-center">
  3. <view class="menu-item ss-flex-col ss-row-center ss-col-center" v-for="item in props.list" :key="item.title"
  4. @tap="sheep.$router.go(item.path, { type: item.type })"
  5. :class="item.type === 'all' ? 'menu-wallet' : 'ss-flex-1'">
  6. <image class="item-icon" :src="sheep.$url.static(item.icon)" mode="aspectFit"></image>
  7. <view class="menu-title ss-m-t-28">{{ item.title }}</view>
  8. </view>
  9. </view>
  10. </template>
  11. <script setup>
  12. /**
  13. * 装修组件 - 优惠券菜单
  14. */
  15. import sheep from '@/sheep';
  16. // 接收参数
  17. const props = defineProps({
  18. list: {
  19. type: Array,
  20. default () {
  21. return [{
  22. title: '已领取',
  23. value: '0',
  24. icon: '/static/img/shop/order/nouse_coupon.png',
  25. path: '/pages/coupon/list',
  26. type: 'geted',
  27. },
  28. {
  29. title: '已使用',
  30. value: '0',
  31. icon: '/static/img/shop/order/useend_coupon.png',
  32. path: '/pages/coupon/list',
  33. type: 'used',
  34. },
  35. {
  36. title: '已失效',
  37. value: '0',
  38. icon: '/static/img/shop/order/out_coupon.png',
  39. path: '/pages/coupon/list',
  40. type: 'expired',
  41. },
  42. // {
  43. // title: '领券中心',
  44. // value: '0',
  45. // icon: '/static/img/shop/order/all_coupon.png',
  46. // path: '/pages/coupon/list',
  47. // type: 'all',
  48. // },
  49. ];
  50. },
  51. },
  52. });
  53. </script>
  54. <style lang="scss" scoped>
  55. .ss-coupon-menu-wrap {
  56. .menu-item {
  57. height: 160rpx;
  58. .menu-title {
  59. font-size: 24rpx;
  60. line-height: 24rpx;
  61. color: #333333;
  62. }
  63. .item-icon {
  64. width: 44rpx;
  65. height: 44rpx;
  66. }
  67. }
  68. .menu-wallet {
  69. width: 144rpx;
  70. }
  71. }
  72. </style>