【功能完善】订单确认价格时,展示具体的优惠信息

pull/102/MERGE
YunaiV 2024-09-16 19:38:48 +08:00
parent ff6769001d
commit 6b6fa0c257
2 changed files with 21 additions and 37 deletions

View File

@ -143,8 +143,7 @@
v-if="state.orderInfo.price.discountPrice > 0"
>
<view class="item-title">活动优惠</view>
<view class="ss-flex ss-col-center">
<!-- @tap="state.showDiscount = true" TODO puhui999折扣后续要把优惠信息打进去 -->
<view class="ss-flex ss-col-center" @tap="state.showDiscount = true">
<text class="item-value text-red">
-{{ fen2yuan(state.orderInfo.price.discountPrice) }}
</text>

View File

@ -1,23 +1,24 @@
<template>
<su-popup :show="show" type="bottom" round="20" @close="emits('close')" showClose backgroundColor="#f2f2f2">
<su-popup
:show="show"
type="bottom"
round="20"
@close="emits('close')"
showClose
backgroundColor="#f2f2f2"
>
<view class="model-box">
<view class="title ss-m-t-38 ss-m-l-20 ss-m-b-40">活动优惠</view>
<scroll-view class="model-content ss-m-l-20" scroll-y :scroll-with-animation="false"
:enable-back-to-top="true">
<scroll-view
class="model-content ss-m-l-20"
scroll-y
:scroll-with-animation="false"
:enable-back-to-top="true"
>
<view v-for="(item, index) in state.orderInfo.promotions" :key="index">
<view class="ss-flex ss-m-b-40 subtitle">
<!-- <view>{{ item.goods_ids.length }}</view>
<view v-if="item.activity_type === 'full_discount'">
{{ item.discount_rule.full }}{{ item.discount_rule.discount }},已减
</view>
<view v-if="item.activity_type === 'full_gift'"></view>
<view v-if="item.activity_type === 'full_reduce'">
{{ item.discount_rule.full }}{{ item.discount_rule.discount }},已减
</view>
<view class="price-text">{{ item.promo_discount_money || '0.00' }}</view> -->
<view>
{{item.description}}
</view>
<!-- 不展示积分优惠劵会员折扣因为它们已经单独展示了 -->
<view class="ss-flex ss-m-b-40 subtitle" v-if="[1, 2, 3, 4, 5, 6].includes(item.type)">
<view> {{ item.description }} </view>
</view>
</view>
</scroll-view>
@ -28,14 +29,7 @@
</su-popup>
</template>
<script setup>
import {
computed,
reactive
} from 'vue';
import sheep from '@/sheep';
import {
fen2yuan
} from '@/sheep/hooks/useGoods';
import { computed, reactive } from 'vue';
const props = defineProps({
promoInfo: {
type: Array,
@ -47,7 +41,7 @@
},
modelValue: {
type: Object,
default () {},
default() {},
},
show: {
type: Boolean,
@ -58,15 +52,6 @@
const state = reactive({
orderInfo: computed(() => props.modelValue),
});
// const getGoodsImg = (e) => {
// let goodsImg = '';
// state.orderInfo.goods_list.forEach((i) => {
// if (e == i.goods_id) {
// goodsImg = i.goods.image;
// }
// });
// return goodsImg;
// };
</script>
<style lang="scss" scoped>
.model-box {
@ -108,4 +93,4 @@
.price-text {
color: #ff3000;
}
</style>
</style>