discounts-item.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="coupon" >
  3. <view class="chuo" v-if="data.status==1">
  4. 已使用
  5. </view>
  6. <view class="chuo" v-else-if="data.status==3">
  7. 已过期
  8. </view>
  9. <view class="left">
  10. <view class="discount">
  11. <text>¥</text>
  12. <text>{{ data.amount }}</text>
  13. </view>
  14. <view class="standard">满{{ data.min_amount }}可用</view>
  15. </view>
  16. <view class="right">
  17. <view class="title">{{ data.title }}</view>
  18. <view class="date">有效期至 {{ formatDateF(data.limit_time*1000) }}</view>
  19. </view>
  20. <view class="select" v-if="select"></view>
  21. </view>
  22. </template>
  23. <script>
  24. import { formatDate } from '@/utils/tools.js'
  25. const app = getApp();
  26. export default {
  27. props: {
  28. select:{
  29. type:Boolean,
  30. default:false
  31. },
  32. data: {
  33. type: Object,
  34. default: () => {
  35. return {};
  36. }
  37. },
  38. },
  39. data() {
  40. return {
  41. };
  42. },
  43. methods: {
  44. formatDateF(v){
  45. return formatDate(v);
  46. },
  47. },
  48. onLoad() {
  49. this.getUserCouponList();
  50. }
  51. };
  52. </script>
  53. <style lang="scss" scoped>
  54. .coupon {
  55. width: 100%;
  56. height: 174rpx;
  57. background-size: cover;
  58. margin-bottom: 30rpx;
  59. display: flex;
  60. justify-content: flex-start;
  61. align-items: flex-end;
  62. padding-bottom: 34rpx;
  63. position: relative;
  64. .left {
  65. margin-right: 60rpx;
  66. margin-left: 50rpx;
  67. .discount {
  68. text:nth-child(1) {
  69. font-size: 22rpx;
  70. color: $app-theme-text-money-color;
  71. }
  72. text:nth-child(2) {
  73. font-size: 64rpx;
  74. color: $app-theme-text-money-color;
  75. }
  76. }
  77. .standard {
  78. font-size: 20rpx;
  79. color: $app-theme-card-gray-color;
  80. }
  81. }
  82. .right {
  83. .title {
  84. font-size: 32rpx;
  85. color: $app-theme-text-black-color;
  86. margin-bottom: 32rpx;
  87. }
  88. .date {
  89. font-size: 20rpx;
  90. color: $app-theme-card-gray-color;
  91. }
  92. }
  93. .select {
  94. height: 60rpx;
  95. width: 60rpx;
  96. background-image: url('@/pages-mine/static/discounts-select.png');
  97. background-size: cover;
  98. position: absolute;
  99. top: 4rpx;
  100. right: 4rpx;
  101. z-index: $app-zIndex-absolute;
  102. }
  103. }
  104. .chuo{
  105. position: absolute;
  106. width: 90rpx;
  107. height: 90rpx;
  108. border-radius: 50%;
  109. color: #fff;
  110. display: flex;
  111. align-items: center;
  112. justify-content: center;
  113. background-color: rgba(0, 0, 0, .5);
  114. top: 40rpx;
  115. right: 40rpx;
  116. transform: rotate(30deg);
  117. font-size: 24rpx;
  118. }
  119. </style>