index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <view>
  3. <!-- 优惠券弹窗 -->
  4. <view class="coupon-window relative" :class="{ on: window}">
  5. <view class="box-1 cover relative">
  6. <view class="box-2 bg--w111-fff relative px-32">
  7. <view class="box-ht cover abs-lt"></view>
  8. <view class="flex-center mt-26 fs-36 lh-60rpx fw-500 relative z-20">
  9. 恭喜获得<text class="red">{{couponList.length}}张</text>优惠券
  10. </view>
  11. <view class="box-item mt-16 flex-between-center relative z-20"
  12. v-for="(item,index) in couponList" :key="index">
  13. <baseMoney
  14. :money="item.coupon_price"
  15. symbolSize="32"
  16. integerSize="52"
  17. decimalSize="32"
  18. color="#e93323"
  19. isCoupon
  20. v-if="item.coupon_type==1"></baseMoney>
  21. <view v-else class="font-color SemiBold fs-42 SemiBold">{{parseFloat(item.coupon_price)/10}}折</view>
  22. <view>
  23. <view class="fs-28 lh-40rpx red w-234 line1">{{item.coupon_title}}</view>
  24. <view class="fs-20 lh-28rpx text--w111-666 mt-8" v-if="item.coupon_time">领取后{{item.coupon_time}}天内可用</view>
  25. <view class="fs-20 lh-28rpx text--w111-666 mt-8" v-else>{{item.start_time ? item.start_time+'-' : ''}}{{item.end_time === 0 ? '不限时': item.end_time}}</view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="box-3 cover abs-lb">
  30. <view class="btn-box flex-center fs-34 fw-500" @tap="goPage">立即领取</view>
  31. </view>
  32. </view>
  33. <text class="iconfont icon-ic_close1 fs-60 text--w111-fff" @tap="close"></text>
  34. </view>
  35. <view class='mask' catchtouchmove="true" :hidden="window==false" @touchmove.stop.prevent></view>
  36. </view>
  37. </template>
  38. <script>
  39. import {HTTP_REQUEST_URL} from '@/config/app';
  40. export default {
  41. props: {
  42. window: {
  43. type: Boolean | String | Number,
  44. default: false,
  45. },
  46. couponList: {
  47. type: Array,
  48. default: function() {
  49. return []
  50. },
  51. },
  52. couponImage: {
  53. type: String,
  54. default: '',
  55. },
  56. },
  57. data() {
  58. return {
  59. imgHost:HTTP_REQUEST_URL
  60. };
  61. },
  62. methods: {
  63. goPage(){
  64. this.$emit('onColse');
  65. uni.navigateTo({
  66. url: '/pages/activity/coupon/index'
  67. })
  68. },
  69. close:function(){
  70. this.$emit('onColse');
  71. }
  72. }
  73. }
  74. </script>
  75. <style scoped lang="scss">
  76. .mask {
  77. z-index: 9999;
  78. }
  79. .coupon-window {
  80. width: 574rpx;
  81. height: 860rpx;
  82. position: fixed;
  83. top: 20%;
  84. z-index: 10000;
  85. left: 50%;
  86. margin-left: -286rpx;
  87. transform: translate3d(0, -200%, 0);
  88. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  89. border-radius: 30rpx 30rpx 0 0;
  90. overflow-x: hidden;
  91. }
  92. .coupon-window.on {
  93. transform: translate3d(0, 0, 0);
  94. }
  95. .box-1{
  96. width: 100%;
  97. height: 462rpx;
  98. position: absolute;
  99. left: 0;
  100. bottom: 108rpx;
  101. background-image: url('@/static/img/new_coupon_bg4.png');
  102. }
  103. .box-2{
  104. width: 524rpx;
  105. max-height: 508rpx;
  106. position: absolute;
  107. left: 50%;
  108. transform: translateX(-50%);
  109. bottom: 188rpx;
  110. border-radius: 40rpx 40rpx 0 0;
  111. overflow-y: auto;
  112. }
  113. .box-3{
  114. width: 100%;
  115. height: 242rpx;
  116. background-image: url('@/static/img/new_coupon_bg3.png');
  117. }
  118. .box-ht{
  119. width: 524rpx;
  120. height: 136rpx;
  121. background-image: url('@/static/img/new_coupon_bg1.png');
  122. }
  123. .box-item{
  124. width: 100%;
  125. height: 140rpx;
  126. background-image: url('@/static/img/new_coupon_bg2.png');
  127. background-size: 100%;
  128. padding: 0 40rpx 0 20rpx;
  129. }
  130. .btn-box{
  131. width: 460rpx;
  132. height: 88rpx;
  133. background: linear-gradient(90deg, #FFD10C 0%, #FEEF4C 100%);
  134. border-radius: 44rpx;
  135. position: absolute;
  136. left: 50%;
  137. transform: translateX(-50%);
  138. bottom: 48rpx;
  139. }
  140. .cover{
  141. background-size: cover;
  142. }
  143. .icon-ic_close1{
  144. position: absolute;
  145. left: 50%;
  146. transform: translateX(-50%);
  147. bottom: 0;
  148. }
  149. .red{
  150. color: #e93323;
  151. }
  152. .SemiBold{
  153. font-family:'SemiBold';
  154. }
  155. </style>