s-coupon-card.vue 1.9 KB

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