couponDialog.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <!-- 新人礼弹窗 -->
  3. <view class="coupon_modal" @touchmove.stop.prevent="moveStop" v-if="couponModal">
  4. <view class="mask"></view>
  5. <view class="_container"
  6. :style="{'background-image': `url(${urlDomain}crmebimage/presets/coupon_modal_bg.png)`}">
  7. <view class="_tit">新人专属大礼包</view>
  8. <view class="_look">优惠券将发放至个人账户,可在“我的优惠券”查看</view>
  9. <scroll-view :scroll-top="0" scroll-y="true" class="_box">
  10. <view class="_item acea-row row-middle" v-for="item in couponList" :key="item.id"
  11. :style="{'background-image': `url(${urlDomain}crmebimage/presets/coupon_item_bg.png)`}">
  12. <view class="_price_box">
  13. <view class="_price">¥{{item.money}}</view>
  14. <view class="_man">满{{item.minPrice}}可用</view>
  15. </view>
  16. <view class="flex-1 _desc">
  17. <view v-if="item.category === 3" class="_text line1">全平台通用</view>
  18. <view v-else class="_text line1">仅限指定{{item.category | couponTypeFilter}}可用</view>
  19. <view v-if="item.isFixedTime" class="_end line1">
  20. {{ $util.getTime(item.useStartTime) + ' ~ ' + $util.getTime(item.useEndTime) + '可用' }}
  21. </view>
  22. <view v-else class="_end line1">{{ '领取后' + item.day + '天内可用' }}</view>
  23. </view>
  24. </view>
  25. </scroll-view>
  26. <view class="_btn" @click="close()"
  27. :style="{'background-image': `url(${urlDomain}crmebimage/presets/coupon_modal_btn.png)`}"></view>
  28. <span class="guanbi iconfont icon-cha2" @click="close()"></span>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. // +----------------------------------------------------------------------
  34. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  35. // +----------------------------------------------------------------------
  36. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  37. // +----------------------------------------------------------------------
  38. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  39. // +----------------------------------------------------------------------
  40. // | Author: CRMEB Team <admin@crmeb.com>
  41. // +----------------------------------------------------------------------
  42. export default {
  43. name: "couponDialog",
  44. props: {
  45. //图片域名地址
  46. urlDomain: {
  47. type: String,
  48. default: ""
  49. },
  50. //弹窗是否弹起
  51. couponModal: {
  52. type: Boolean,
  53. default: false
  54. }
  55. },
  56. computed: {
  57. //优惠券列表
  58. couponList() {
  59. let list = this.$Cache.get('newGift') ? JSON.parse(this.$Cache.get('newGift')) : [];
  60. return list;
  61. }
  62. },
  63. methods: {
  64. close() {
  65. this.$emit('on-close')
  66. },
  67. getTime(time){
  68. this.$util.getTime(time);
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .coupon_modal {
  75. ._container {
  76. position: fixed;
  77. left: 50%;
  78. top: 50%;
  79. transform: translate(-50%, -50%);
  80. width: 630rpx;
  81. height: 844rpx;
  82. background-size: cover;
  83. z-index: 33;
  84. ._tit {
  85. text-align: center;
  86. height: 42rpx;
  87. font-size: 42rpx;
  88. font-family: PingFang SC-Semibold, PingFang SC;
  89. font-weight: 600;
  90. color: #FFE9BE;
  91. line-height: 42rpx;
  92. text-shadow: 0px 2rpx 2rpx rgba(0, 0, 0, 0.2);
  93. margin-top: 226rpx;
  94. }
  95. ._look {
  96. text-align: center;
  97. font-size: 22rpx;
  98. color: #fff;
  99. margin: 20rpx auto 28rpx;
  100. }
  101. ._box {
  102. width: 540rpx;
  103. height: 370rpx;
  104. margin: auto;
  105. }
  106. ._item {
  107. width: 100%;
  108. height: 140rpx;
  109. border-radius: 14rpx;
  110. background-size: cover;
  111. padding: 10rpx 0;
  112. ._price_box {
  113. width: 200rpx;
  114. padding: 0 20rpx;
  115. text-align: center;
  116. border-right: 1px dashed #E6E6E6;
  117. ._price {
  118. font-size: 34rpx;
  119. color: #E93323;
  120. font-weight: 600;
  121. }
  122. ._man {
  123. font-size: 22rpx;
  124. color: #666;
  125. margin-top: 10rpx;
  126. }
  127. }
  128. ._desc {
  129. padding: 0 30rpx;
  130. ._text {
  131. width: 280rpx;
  132. font-size: 32rpx;
  133. color: #282828;
  134. font-weight: 600;
  135. }
  136. ._end {
  137. width: 280rpx;
  138. margin-top: 20rpx;
  139. font-size: 22rpx;
  140. color: #999;
  141. }
  142. }
  143. ~._item {
  144. margin-top: 20rpx;
  145. }
  146. }
  147. ._btn {
  148. width: 320rpx;
  149. height: 76rpx;
  150. background-size: cover;
  151. margin: 26rpx auto 0;
  152. }
  153. .guanbi {
  154. font-size: 50rpx;
  155. color: #fff;
  156. font-weight: bold;
  157. position: absolute;
  158. bottom: -70rpx;
  159. left: 50%;
  160. transform: translateX(-50%);
  161. }
  162. }
  163. }
  164. </style>