coupon-record.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <script setup lang="ts">
  2. import Card from '@/components/card.vue'
  3. import dayjs from 'dayjs'
  4. import used from '@designer-hub/assets/src/libs/assets/used'
  5. import expired from '@designer-hub/assets/src/libs/assets/expired'
  6. import invalid from '@designer-hub/assets/src/libs/assets/invalid'
  7. import { CouponStatus } from '@/core/libs/models'
  8. const props = withDefaults(
  9. defineProps<{
  10. option?: {
  11. materialId: number
  12. couponImgUrl: any
  13. materialsName: string
  14. validityStartDate: number
  15. validityEndDate: number
  16. brandPoints: number
  17. }
  18. canSelect?: boolean
  19. selected?: boolean
  20. }>(),
  21. {
  22. canSelect: false,
  23. selected: false,
  24. },
  25. )
  26. </script>
  27. <template>
  28. <div
  29. class="mx-3.5 p-4 bg-[rgba(255,255,255,0.7)] rounded-2xl shadow-[0px_5px_8px_0px_rgba(21,3,3,0.03)]"
  30. >
  31. <div class="relative">
  32. <div class="flex gap-3">
  33. <div class="w-[68px] h-[68px] bg-[#f6f6f6] rounded-2.5 overflow-hidden">
  34. <!-- <template v-if="option.couponType === 1">-->
  35. <!-- <div class="bg-[#fff8f8] w-full h-full flex flex-col items-center justify-center">-->
  36. <!-- <div class="text-[#ff7878] text-[26px] font-normal font-['PingFang_SC']">-->
  37. <!-- {{ options.brandPoints }}-->
  38. <!-- </div>-->
  39. <!-- <div class="text-[#ff7878] text-base font-normal font-['PingFang_SC']">积分</div>-->
  40. <!-- </div>-->
  41. <!-- </template>-->
  42. <!-- <template v-else>-->
  43. <wd-img width="100%" height="100%" :src="option.couponImgUrl"></wd-img>
  44. <!-- </template>-->
  45. </div>
  46. <div class="flex-1 flex flex-col justify-around">
  47. <div class="flex items-center gap-1">
  48. <div
  49. class="px-[3px] rounded border border-solid border-[#ff3636] justify-center items-center gap-2.5 inline-flex"
  50. >
  51. <div
  52. class="text-[#ff3e3e] text-[10px] font-normal font-['PingFang_SC'] leading-normal"
  53. >
  54. {{ option.materialsName }}
  55. </div>
  56. </div>
  57. <div class="text-black text-sm font-normal font-['PingFang_SC'] leading-normal">
  58. <!-- GELATO咖啡兑换券 -->
  59. {{ option.couponName }}
  60. </div>
  61. </div>
  62. <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
  63. <!-- 有效期:-->
  64. <!-- 2024/04/01-2024/05/30 -->
  65. {{ dayjs(option.validityStartDate).format('YYYY/MM/DD') }}-{{
  66. dayjs(option.validityEndDate).format('YYYY/MM/DD')
  67. }}
  68. </div>
  69. <!-- <div-->
  70. <!-- class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal flex items-center"-->
  71. <!-- @click.stop="emits('clickInstruction', options)"-->
  72. <!-- >-->
  73. <!-- 使用说明-->
  74. <!-- <wd-icon name="arrow-right" size="14"></wd-icon>-->
  75. <!-- </div>-->
  76. </div>
  77. <div class="flex items-center" v-if="canSelect">
  78. <div
  79. class="w-4 h-4 rounded-full border border-black/60 border-solid"
  80. :class="`${selected ? 'bg-black' : ''}`"
  81. ></div>
  82. </div>
  83. </div>
  84. <div class="absolute top--4 right--4">
  85. <wd-img width="58" height="58" :src="used"></wd-img>
  86. </div>
  87. </div>
  88. </div>
  89. </template>