s-discount-list.vue 2.8 KB

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