s-coupon-card.vue 1.6 KB

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