s-coupon-card.vue 1.9 KB

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