s-discount-list.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.promotions" :key="index">
  19. <!-- 不展示积分、优惠劵、会员折扣,因为它们已经单独展示了 -->
  20. <view class="ss-flex ss-m-b-40 subtitle" v-if="[1, 2, 3, 4, 5].includes(item.type)">
  21. <view> {{ item.description }} </view>
  22. </view>
  23. </view>
  24. </scroll-view>
  25. </view>
  26. <view class="modal-footer ss-flex">
  27. <button class="confirm-btn ss-reset-button" @tap="emits('close')">确认</button>
  28. </view>
  29. </su-popup>
  30. </template>
  31. <script setup>
  32. import { computed, reactive } from 'vue';
  33. const props = defineProps({
  34. promoInfo: {
  35. type: Array,
  36. default: () => [],
  37. },
  38. goodsList: {
  39. type: Array,
  40. default: () => [],
  41. },
  42. modelValue: {
  43. type: Object,
  44. default() {},
  45. },
  46. show: {
  47. type: Boolean,
  48. default: false,
  49. },
  50. });
  51. const emits = defineEmits(['close']);
  52. const state = reactive({
  53. orderInfo: computed(() => props.modelValue),
  54. });
  55. </script>
  56. <style lang="scss" scoped>
  57. .model-box {
  58. height: 60vh;
  59. }
  60. .model-content {
  61. height: 54vh;
  62. }
  63. .modal-footer {
  64. width: 100%;
  65. height: 120rpx;
  66. background: #fff;
  67. }
  68. .confirm-btn {
  69. width: 710rpx;
  70. margin-left: 20rpx;
  71. height: 80rpx;
  72. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  73. border-radius: 40rpx;
  74. color: #fff;
  75. }
  76. .content-img {
  77. width: 140rpx;
  78. height: 140rpx;
  79. margin-right: 20rpx;
  80. margin-bottom: 20rpx;
  81. }
  82. .subtitle {
  83. font-size: 28rpx;
  84. font-weight: 500;
  85. color: #333333;
  86. }
  87. .price-text {
  88. color: #ff3000;
  89. }
  90. </style>