s-activity-pop.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <!-- 商品信息:满减送等营销活动的弹窗 -->
  2. <template>
  3. <su-popup :show="show" type="bottom" round="20" @close="emits('close')" showClose>
  4. <view class="model-box">
  5. <view class="title ss-m-t-16 ss-m-l-20 ss-flex">优惠</view>
  6. <view v-if="state.rewardActivity && state.rewardActivity.id > 0">
  7. <view class="titleLi">促销</view>
  8. <scroll-view
  9. class="model-content"
  10. scroll-y
  11. :scroll-with-animation="false"
  12. :enable-back-to-top="true"
  13. >
  14. <view
  15. class="actBox"
  16. v-for="(item, index) in state.rewardActivity.ruleDescriptions"
  17. :key="index"
  18. >
  19. <view
  20. class="boxCont ss-flex ss-col-top ss-m-b-40"
  21. @tap="onGoodsList(state.rewardActivity)"
  22. >
  23. <view class="model-content-tag ss-flex ss-row-center">满减</view>
  24. <view class="model-content-title">
  25. <view class="contBu">
  26. <text>{{ item }}</text>
  27. </view>
  28. <view class="ss-m-b-24 cotBu-txt">
  29. {{ sheep.$helper.timeFormat(state.rewardActivity.startTime, 'yyyy.mm.dd') }}
  30. -
  31. {{ sheep.$helper.timeFormat(state.rewardActivity.endTime, 'yyyy.mm.dd') }}
  32. </view>
  33. </view>
  34. <text class="cicon-forward" />
  35. </view>
  36. </view>
  37. </scroll-view>
  38. </view>
  39. <view class="titleLi">可领优惠券</view>
  40. <scroll-view
  41. class="model-content"
  42. scroll-y
  43. :scroll-with-animation="false"
  44. :enable-back-to-top="true"
  45. >
  46. <view class="actBox" v-for="item in state.couponInfo" :key="item.id">
  47. <view class="boxCont ss-flex ss-col-top ss-m-b-40">
  48. <view class="model-content-tag2">
  49. <view class="usePrice"> ¥{{ fen2yuan(item.discountPrice) }} </view>
  50. <view class="impose"> 满¥{{ fen2yuan(item.usePrice) }}可用 </view>
  51. </view>
  52. <view class="model-content-title2">
  53. <view class="contBu">
  54. {{ item.name }}
  55. </view>
  56. <view class="ss-m-b-24 cotBu-txt">
  57. {{
  58. item.validityType == 1
  59. ? sheep.$helper.timeFormat(item.validStartTime, 'yyyy.mm.dd') -
  60. sheep.$helper.timeFormat(item.validEndTime, 'yyyy.mm.dd')
  61. : '领取后' + item.fixedStartTerm + '-' + item.fixedEndTerm + '天可用'
  62. }}
  63. </view>
  64. </view>
  65. <view class="coupon" @click.stop="getBuy(item.id)" v-if="item.canTake"> 立即领取 </view>
  66. <view class="coupon2" v-else> 已领取 </view>
  67. </view>
  68. </view>
  69. </scroll-view>
  70. </view>
  71. </su-popup>
  72. </template>
  73. <script setup>
  74. import sheep from '@/sheep';
  75. import { computed, reactive } from 'vue';
  76. import { fen2yuan } from '@/sheep/hooks/useGoods';
  77. const props = defineProps({
  78. modelValue: {
  79. type: Object,
  80. default() {},
  81. },
  82. show: {
  83. type: Boolean,
  84. default: false,
  85. },
  86. });
  87. const emits = defineEmits(['close']);
  88. const state = reactive({
  89. rewardActivity: computed(() => props.modelValue.rewardActivity),
  90. couponInfo: computed(() => props.modelValue.couponInfo),
  91. });
  92. // 领取优惠劵
  93. const getBuy = (id) => {
  94. emits('get', id);
  95. };
  96. function onGoodsList(e) {
  97. sheep.$router.go('/pages/activity/index', {
  98. activityId: e.id,
  99. });
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .model-box {
  104. height: 60vh;
  105. .title {
  106. justify-content: center;
  107. font-size: 36rpx;
  108. height: 80rpx;
  109. font-weight: bold;
  110. color: #333333;
  111. }
  112. }
  113. .model-content {
  114. height: fit-content;
  115. max-height: 350rpx;
  116. padding: 0 20rpx;
  117. box-sizing: border-box;
  118. margin-top: 20rpx;
  119. .model-content-tag {
  120. // background: rgba(#ff6911, 0.1);
  121. font-size: 35rpx;
  122. font-weight: 500;
  123. color: #ff6911;
  124. line-height: 150rpx;
  125. width: 200rpx;
  126. height: 150rpx;
  127. text-align: center;
  128. // border-radius: 5rpx;
  129. }
  130. .model-content-title {
  131. width: 450rpx;
  132. height: 150rpx;
  133. font-size: 26rpx;
  134. font-weight: 500;
  135. color: #333333;
  136. overflow: hidden;
  137. }
  138. .cicon-forward {
  139. font-size: 28rpx;
  140. color: #999999;
  141. margin: 0 auto;
  142. }
  143. }
  144. // 新增的
  145. .titleLi {
  146. margin: 10rpx 0 10rpx 20rpx;
  147. font-size: 26rpx;
  148. }
  149. .actBox {
  150. width: 700rpx;
  151. height: 150rpx;
  152. background-color: #fff2f2;
  153. margin: 10rpx auto;
  154. border-radius: 10rpx;
  155. }
  156. .boxCont {
  157. width: 700rpx;
  158. height: 150rpx;
  159. align-items: center;
  160. }
  161. .contBu {
  162. height: 80rpx;
  163. line-height: 80rpx;
  164. overflow: hidden;
  165. font-size: 30rpx;
  166. white-space: nowrap;
  167. text-overflow: ellipsis;
  168. -o-text-overflow: ellipsis;
  169. }
  170. .cotBu-txt {
  171. height: 70rpx;
  172. line-height: 70rpx;
  173. font-size: 25rpx;
  174. color: #999999;
  175. }
  176. .model-content-tag2 {
  177. font-size: 35rpx;
  178. font-weight: 500;
  179. color: #ff6911;
  180. width: 200rpx;
  181. height: 150rpx;
  182. text-align: center;
  183. }
  184. .usePrice {
  185. width: 200rpx;
  186. height: 90rpx;
  187. line-height: 100rpx;
  188. // background-color: red;
  189. }
  190. .impose {
  191. width: 200rpx;
  192. height: 50rpx;
  193. // line-height: 75rpx;
  194. font-size: 23rpx;
  195. // background-color: gold;
  196. }
  197. .model-content-title2 {
  198. width: 330rpx;
  199. height: 150rpx;
  200. font-size: 26rpx;
  201. font-weight: 500;
  202. color: #333333;
  203. overflow: hidden;
  204. }
  205. .coupon {
  206. width: 150rpx;
  207. height: 50rpx;
  208. line-height: 50rpx;
  209. background-color: rgb(255, 68, 68);
  210. color: white;
  211. border-radius: 30rpx;
  212. text-align: center;
  213. font-size: 25rpx;
  214. }
  215. .coupon2 {
  216. width: 150rpx;
  217. height: 50rpx;
  218. line-height: 50rpx;
  219. background-color: rgb(203, 192, 191);
  220. color: white;
  221. border-radius: 30rpx;
  222. text-align: center;
  223. font-size: 25rpx;
  224. }
  225. </style>