app-coupon-center.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view class="app-coupon-center">
  3. <view class="app-coupon-item"
  4. v-for="(item, index) in list"
  5. :key="index"
  6. @click="jump(item)"
  7. >
  8. <view class="app-top dir-left-nowrap main-between" :class="{'app-unexpired': item.is_receive === '0', 'app-received': item.is_receive > '0'}">
  9. <view class="app-text dir-left-nowrap main-left">
  10. <view class="app-price">
  11. <text class="app-symbol">¥</text>
  12. <text class="app-number">{{item.sub_price}}</text>
  13. </view>
  14. <view class="app-amount dir-top-nowrap main-left">
  15. <text>优惠券</text>
  16. <text>满{{item.min_price}}使用</text>
  17. </view>
  18. </view>
  19. <view class="app-button">
  20. <app-button type="important"
  21. height="56"
  22. background="#ffffff"
  23. round
  24. :color="`${item.is_receive === '0' ? '#ff4544' : item.is_receive > '0' ? '#999999' : ''}`"
  25. fontSize="28"
  26. @click="use(item.id)"
  27. >{{item.is_receive === '0' ? '立即领取' : item.is_receive > '0' ? '已领取' : ''}}</app-button>
  28. </view>
  29. </view>
  30. <view class="app-bottom dir-top-nowrap main-between">
  31. <text class="app-time">
  32. 有效时间: {{item.begin_time}} - {{item.end_time}}
  33. </text>
  34. <text class="app-range">
  35. 适用范围: {{setRange(item.appoint_type)}}
  36. </text>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import jump from '../../../core/jump.js';
  43. export default {
  44. name: 'app-coupon-center',
  45. props: {
  46. list: {
  47. type: Array,
  48. default: function() {
  49. return [
  50. {
  51. appoint_type: "",
  52. begin_time: "",
  53. cat: [],
  54. couponGoods: [],
  55. created_at: "",
  56. deleted_at: "",
  57. desc: "",
  58. discount: "",
  59. end_time: "",
  60. expire_day: "",
  61. expire_type: "",
  62. goods: [],
  63. id: "",
  64. is_delete: "",
  65. is_member: "",
  66. is_receive: "",
  67. mall_id: "",
  68. min_price: "",
  69. name: "",
  70. pic_url: "",
  71. rule: "",
  72. sort: "",
  73. sub_price: "",
  74. total_count: "",
  75. type: "",
  76. updated_at: "",
  77. }
  78. ]
  79. }
  80. }
  81. },
  82. methods: {
  83. setRange: function(appoint_type) {
  84. if (appoint_type === '1') {
  85. return '限品类';
  86. } else if (appoint_type === '2') {
  87. return '限商品';
  88. } else if (appoint_type === '3') {
  89. return '全场通用';
  90. }
  91. },
  92. jump(item) {
  93. jump({
  94. open_type: 'navigate',
  95. url: `/pages/coupon/details/details?id=${item.id}`
  96. });
  97. },
  98. use() {
  99. }
  100. }
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. .app-coupon-center {
  105. width: #{750rpx};
  106. overflow: hidden;
  107. .app-coupon-item {
  108. margin: #{20rpx} #{24rpx} #{0} #{24rpx};
  109. width: #{702rpx};
  110. height: #{160+112rpx};
  111. .app-top {
  112. width: #{702rpx};
  113. height: #{160rpx};
  114. background-size: 100% 100%;
  115. background-repeat: no-repeat;
  116. .app-button {
  117. width: #{160+24rpx};
  118. padding-right: #{24rpx};
  119. padding-top: #{48rpx};
  120. /deep/ button {
  121. padding: 0 #{10rpx} !important;
  122. }
  123. }
  124. .app-text {
  125. width: #{702-160-24rpx};
  126. height: #{160rpx};
  127. margin-left: #{24rpx};
  128. .app-price {
  129. padding-top: #{52rpx};
  130. color: #ffffff;
  131. .app-symbol {
  132. font-size: #{36rpx};
  133. }
  134. .app-number {
  135. font-size: #{72rpx};
  136. }
  137. }
  138. .app-amount {
  139. padding-top: #{50rpx};
  140. color: #ffffff;
  141. font-size: #{28rpx};
  142. margin-left: #{20rpx};
  143. }
  144. }
  145. }
  146. .app-unexpired {
  147. background-image: url("../../../static/image/icon/unexpired-coupon.png");
  148. }
  149. .app-received {
  150. background-image: url("../../../static/image/icon/received-coupon.png");
  151. }
  152. .app-bottom {
  153. width: #{702rpx};
  154. height: #{112rpx};
  155. border-left: #{1rpx} solid #cfcfcf;
  156. border-bottom: #{1rpx} solid #cfcfcf;
  157. border-right: #{1rpx} solid #cfcfcf;
  158. border-bottom-left-radius: #{16rpx};
  159. border-bottom-right-radius: #{16rpx};
  160. text {
  161. font-size: #{24rpx};
  162. color: #666666;
  163. margin-left: #{24rpx};
  164. }
  165. .app-time {
  166. margin-top: #{24rpx};
  167. }
  168. .app-range {
  169. margin-bottom: #{32rpx};
  170. }
  171. }
  172. }
  173. }
  174. </style>