index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view :style="colorStyle">
  3. <view class='coupon-window' :class='window==true?"on":""'>
  4. <image class="co-bag" :src="imgHost + '/statics/images/co-bag.png'" mode=""></image>
  5. <view class='couponWinList'>
  6. <view class='item acea-row row-between-wrapper' v-for="(item,index) in couponList" :key="index">
  7. <view class='money font-color'>{{$t(`¥`)}}<text class='num'>{{item.coupon_price}}</text></view>
  8. <view class='text'>
  9. <view class='name'>{{$t(`购物满`)}}{{item.use_min_price}}{{$t(`减`)}}{{item.coupon_price}}</view>
  10. <view v-if="item.coupon_time">{{$t(`领取后`)}}{{item.coupon_time}}{{$t(`天内可用`)}}</view>
  11. <view v-else>
  12. {{item.start_time ? item.start_time+'-' : ''}}{{item.end_time === 0 ? $t(`不限时`) : item.end_time}}
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class='lid'>
  18. <navigator v-if="window" hover-class='none' url='/pages/users/user_get_coupon/index' class='bnt'>{{$t(`立即领取`)}}</navigator>
  19. <view class='iconfont icon-guanbi3' @click="close"></view>
  20. </view>
  21. </view>
  22. <view class='mask' catchtouchmove="true" :hidden="window==false"></view>
  23. </view>
  24. </template>
  25. <script>
  26. import colors from "@/mixins/color";
  27. import {HTTP_REQUEST_URL} from '@/config/app';
  28. export default {
  29. props: {
  30. window: {
  31. type: Boolean | String | Number,
  32. default: false,
  33. },
  34. couponList: {
  35. type: Array,
  36. default: function() {
  37. return []
  38. },
  39. },
  40. couponImage: {
  41. type: String,
  42. default: '',
  43. },
  44. },
  45. mixins: [colors],
  46. data() {
  47. return {
  48. imgHost:HTTP_REQUEST_URL
  49. };
  50. },
  51. methods: {
  52. close: function() {
  53. this.$emit('onColse');
  54. }
  55. }
  56. }
  57. </script>
  58. <style scoped lang="scss">
  59. .mask {
  60. z-index: 9999;
  61. }
  62. .coupon-window {
  63. width: 572rpx;
  64. height: 760rpx;
  65. position: fixed;
  66. top: 20%;
  67. z-index: 10000;
  68. left: 50%;
  69. margin-left: -286rpx;
  70. transform: translate3d(0, -200%, 0);
  71. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  72. border-radius: 30rpx 30rpx 0 0;
  73. overflow-x: hidden;
  74. }
  75. .co-bag {
  76. width: 100%;
  77. height: 250rpx;
  78. z-index: 33333;
  79. top: -40rpx;
  80. position: absolute;
  81. }
  82. .coupon-window:after {
  83. width: 900rpx;
  84. height: 650rpx;
  85. position: absolute;
  86. top: 0%;
  87. left: 50%;
  88. z-index: 11111;
  89. margin-left: -450rpx;
  90. content: '';
  91. border-radius: 50% 50% 0 0;
  92. background: var(--view-theme);
  93. }
  94. .coupon-window.on {
  95. transform: translate3d(0, 0, 0);
  96. }
  97. .coupon-window .couponWinList {
  98. width: 480rpx;
  99. margin: 157rpx 0 0 50rpx;
  100. height: 340rpx;
  101. overflow-y: scroll;
  102. }
  103. .coupon-window .couponWinList .item {
  104. width: 100%;
  105. height: 120rpx;
  106. background-color: #fff;
  107. position: relative;
  108. margin-bottom: 17rpx;
  109. position: relative;
  110. z-index: 99999;
  111. }
  112. .coupon-window .couponWinList .item .left {
  113. border-right: 1px dashed #ccc;
  114. }
  115. .coupon-window .couponWinList .label {
  116. width: 28rpx;
  117. height: 64rpx;
  118. display: block;
  119. position: absolute;
  120. top: 0;
  121. right: 12rpx;
  122. }
  123. .coupon-window .couponWinList .item::after {
  124. content: '';
  125. position: absolute;
  126. width: 18rpx;
  127. height: 18rpx;
  128. border-radius: 50%;
  129. background-color: var(--view-theme);
  130. left: 25.5%;
  131. bottom: 0;
  132. margin-bottom: -9rpx;
  133. }
  134. .coupon-window .couponWinList .item::before {
  135. content: '';
  136. position: absolute;
  137. width: 18rpx;
  138. height: 18rpx;
  139. border-radius: 50%;
  140. background-color: var(--view-theme);
  141. left: 25.5%;
  142. top: 0;
  143. margin-top: -9rpx;
  144. }
  145. .coupon-window .couponWinList .item .money {
  146. width: 130rpx;
  147. text-align: center;
  148. font-size: 26rpx;
  149. font-weight: bold;
  150. }
  151. .coupon-window .couponWinList .item .min_money {
  152. color: #ccc;
  153. font-size: 18rpx;
  154. text-align: center;
  155. }
  156. .coupon-window .couponWinList .item .money .num {
  157. font-size: 40rpx;
  158. }
  159. .coupon-window .couponWinList .item .text {
  160. width: 349rpx;
  161. font-size: 22rpx;
  162. color: #ccc;
  163. padding: 0 29rpx;
  164. box-sizing: border-box;
  165. }
  166. .coupon-window .couponWinList .item .text .image {
  167. width: 32rpx;
  168. height: 32rpx;
  169. display: inline-block;
  170. vertical-align: bottom;
  171. margin-right: 10rpx;
  172. }
  173. .coupon-window .couponWinList .item .text .name {
  174. font-size: 26rpx;
  175. color: var(--view-priceColor);
  176. font-weight: bold;
  177. margin-bottom: 9rpx;
  178. width: 250rpx;
  179. }
  180. .coupon-window .lid {
  181. background: rgba(255, 255, 255, 0.2);
  182. width: 582rpx;
  183. height: 224rpx;
  184. position: fixed;
  185. z-index: 22222;
  186. left: 50%;
  187. top: 0%;
  188. margin: 424rpx 0 0 -296rpx;
  189. }
  190. .coupon-window .lid:after {
  191. width: 920rpx;
  192. height: 280rpx;
  193. position: absolute;
  194. top: -100%;
  195. left: 50%;
  196. z-index: 22222;
  197. margin-left: -460rpx;
  198. content: '';
  199. border-radius: 0 0 50% 50%;
  200. background: var(--view-theme);
  201. }
  202. .coupon-window .lid .bnt {
  203. font-size: 29rpx;
  204. width: 440rpx;
  205. height: 80rpx;
  206. border-radius: 40rpx;
  207. background: linear-gradient(90deg, #FFCA52 0%, #FE960F 100%);
  208. text-align: center;
  209. line-height: 80rpx;
  210. font-weight: bold;
  211. margin: 98rpx auto 0 auto;
  212. color: #fff;
  213. }
  214. .coupon-window .lid .iconfont {
  215. color: #fff;
  216. font-size: 60rpx;
  217. text-align: center;
  218. margin-top: 87rpx;
  219. }
  220. </style>