discounts-item.vue 2.3 KB

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