s-discount-list.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <su-popup
  3. :show="show"
  4. type="bottom"
  5. round="20"
  6. @close="emits('close')"
  7. showClose
  8. backgroundColor="#f2f2f2"
  9. >
  10. <view class="model-box">
  11. <view class="title ss-m-t-38 ss-m-l-20 ss-m-b-40">活动优惠</view>
  12. <scroll-view
  13. class="model-content ss-m-l-20"
  14. scroll-y
  15. :scroll-with-animation="false"
  16. :enable-back-to-top="true"
  17. >
  18. <view v-for="(item, index) in state.orderInfo.promo_infos" :key="index">
  19. <view class="ss-flex ss-m-b-40 subtitle">
  20. <view>共{{ item.goods_ids.length }}件,</view>
  21. <view v-if="item.activity_type === 'full_discount'">
  22. 满{{ item.discount_rule.full }}打{{ item.discount_rule.discount }}折,已减
  23. </view>
  24. <view v-if="item.activity_type === 'full_gift'">满赠</view>
  25. <view v-if="item.activity_type === 'full_reduce'">
  26. 满{{ item.discount_rule.full }}减{{ item.discount_rule.discount }},已减
  27. </view>
  28. <view class="price-text">¥{{ item.promo_discount_money || '0.00' }}</view>
  29. </view>
  30. <scroll-view class="scroll-box" scroll-x scroll-anchoring>
  31. <view class="ss-flex">
  32. <view v-for="i in item.goods_ids" :key="i">
  33. <image class="content-img" :src="sheep.$url.cdn(getGoodsImg(i))" />
  34. </view>
  35. </view>
  36. </scroll-view>
  37. </view>
  38. </scroll-view>
  39. </view>
  40. <view class="modal-footer ss-flex">
  41. <button class="confirm-btn ss-reset-button" @tap="emits('close')">确认</button>
  42. </view>
  43. </su-popup>
  44. </template>
  45. <script setup>
  46. import { computed, reactive } from 'vue';
  47. import sheep from '@/sheep';
  48. const props = defineProps({
  49. promoInfo: {
  50. type: Array,
  51. default: () => [],
  52. },
  53. goodsList: {
  54. type: Array,
  55. default: () => [],
  56. },
  57. modelValue: {
  58. type: Object,
  59. default() {},
  60. },
  61. show: {
  62. type: Boolean,
  63. default: false,
  64. },
  65. });
  66. const emits = defineEmits(['close']);
  67. const state = reactive({
  68. orderInfo: computed(() => props.modelValue),
  69. });
  70. const getGoodsImg = (e) => {
  71. let goodsImg = '';
  72. state.orderInfo.goods_list.forEach((i) => {
  73. if (e == i.goods_id) {
  74. goodsImg = i.goods.image;
  75. }
  76. });
  77. return goodsImg;
  78. };
  79. </script>
  80. <style lang="scss" scoped>
  81. .model-box {
  82. height: 60vh;
  83. }
  84. .model-content {
  85. height: 54vh;
  86. }
  87. .modal-footer {
  88. width: 100%;
  89. height: 120rpx;
  90. background: #fff;
  91. }
  92. .confirm-btn {
  93. width: 710rpx;
  94. margin-left: 20rpx;
  95. height: 80rpx;
  96. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  97. border-radius: 40rpx;
  98. color: #fff;
  99. }
  100. .content-img {
  101. width: 140rpx;
  102. height: 140rpx;
  103. margin-right: 20rpx;
  104. margin-bottom: 20rpx;
  105. }
  106. .subtitle {
  107. font-size: 28rpx;
  108. font-weight: 500;
  109. color: #333333;
  110. }
  111. .price-text {
  112. color: #ff3000;
  113. }
  114. </style>