s-coupon-list.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="ss-m-20" :style="{ opacity: disabled ? '0.5' : '1' }">
  3. <view class="content">
  4. <!-- <view
  5. class="tag ss-flex ss-row-center"
  6. :class="
  7. data.status == 'expired' || data.status == 'used' ? 'disabled-bg-color' : 'info-bg-color'
  8. "
  9. >{{ data.type_text }}</view
  10. > -->
  11. <view class="title ss-m-x-30 ss-p-t-18">
  12. <view class="ss-flex ss-row-between">
  13. <view class="value-text ss-flex-1 ss-m-r-10" :class="
  14. data.status == 'expired' || data.status == 'used' ? 'disabled-color' : 'info-color'
  15. ">{{ data.name }}</view>
  16. <view>
  17. <view class="ss-flex ss-col-bottom" :class="
  18. data.status != 'expired' && data.status != 'used' ? 'price-text' : 'disabled-color'
  19. ">
  20. <view class="value-reduce ss-m-b-10" v-if="data.type === 'reduce'">¥</view>
  21. <view class="value-price">{{ data.amount }}</view>
  22. <view class="value-discount ss-m-b-10 ss-m-l-4" v-if="data.type === 'discount'">折</view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="ss-flex ss-row-between ss-m-t-16">
  27. <view class="sellby-text" :class="
  28. data.status == 'expired' || data.status == 'used'
  29. ? 'disabled-color'
  30. : 'subtitle-color'
  31. ">
  32. {{'有效期:' + data.use_start_time.substring(0, 11) }}至
  33. {{ data.use_end_time.substring(0, 11) }}
  34. <!-- {{
  35. type === 'user'
  36. ? '有效期:' + data.use_start_time.substring(0, 11)
  37. : '领取时间:' + data.get_start_time.substring(0, 11)
  38. }}至
  39. {{
  40. type === 'user'
  41. ? data.use_end_time.substring(0, 11)
  42. : data.get_end_time.substring(0, 11)
  43. }} -->
  44. </view>
  45. <view class="value-enough" :class="
  46. data.status == 'expired' || data.status == 'used'
  47. ? 'disabled-color'
  48. : 'subtitle-color'
  49. ">满{{ data.enough }}可用</view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="desc ss-flex ss-row-between">
  54. <view>
  55. <view class="desc-title">
  56. {{ data.description }}
  57. </view>
  58. <view>
  59. <slot name="reason">
  60. </slot>
  61. </view>
  62. </view>
  63. <view>
  64. <slot></slot>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script setup>
  70. import {
  71. reactive
  72. } from 'vue';
  73. import sheep from '@/sheep';
  74. const state = reactive({
  75. stateMap: {
  76. 0: '立即领取',
  77. 1: '去使用',
  78. },
  79. });
  80. // 接受参数
  81. const props = defineProps({
  82. data: {
  83. type: Object,
  84. default: {},
  85. },
  86. disabled: {
  87. type: Boolean,
  88. default: false,
  89. },
  90. type: {
  91. type: String,
  92. default: 'coupon',
  93. },
  94. });
  95. </script>
  96. <style lang="scss" scoped>
  97. .info-bg-color {
  98. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  99. }
  100. .disabled-bg-color {
  101. background: #999;
  102. }
  103. .info-color {
  104. color: #333;
  105. }
  106. .subtitle-color {
  107. color: #666;
  108. }
  109. .disabled-color {
  110. color: #999;
  111. }
  112. .content {
  113. width: 100%;
  114. background: #fff;
  115. border-radius: 20rpx 20rpx 0 0;
  116. -webkit-mask: radial-gradient(circle at 12rpx 100%, #0000 12rpx, red 0) -12rpx;
  117. box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.04);
  118. .tag {
  119. width: 100rpx;
  120. color: #fff;
  121. height: 40rpx;
  122. font-size: 24rpx;
  123. border-radius: 20rpx 0 20rpx 0;
  124. }
  125. .title {
  126. padding-bottom: 22rpx;
  127. border-bottom: 2rpx dashed #d3d3d3;
  128. .value-text {
  129. font-size: 32rpx;
  130. font-weight: 600;
  131. }
  132. .sellby-text {
  133. font-size: 24rpx;
  134. font-weight: 400;
  135. }
  136. .value-price {
  137. font-size: 64rpx;
  138. font-weight: 500;
  139. line-height: normal;
  140. font-family: OPPOSANS;
  141. }
  142. .value-reduce {
  143. line-height: normal;
  144. font-size: 32rpx;
  145. }
  146. .value-discount {
  147. line-height: normal;
  148. font-size: 28rpx;
  149. }
  150. .value-enough {
  151. font-size: 24rpx;
  152. font-weight: 400;
  153. font-family: OPPOSANS;
  154. }
  155. }
  156. }
  157. .desc {
  158. width: 100%;
  159. background: #fff;
  160. -webkit-mask: radial-gradient(circle at 12rpx 0%, #0000 12rpx, red 0) -12rpx;
  161. box-shadow: rgba(#000, 0.1);
  162. box-sizing: border-box;
  163. padding: 24rpx 30rpx;
  164. box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.04);
  165. border-radius: 0 0 20rpx 20rpx;
  166. .desc-title {
  167. font-size: 24rpx;
  168. color: #999;
  169. font-weight: 400;
  170. }
  171. }
  172. .price-text {
  173. color: #ff0000;
  174. }
  175. </style>