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

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

View File

@ -1,23 +1,24 @@
<template> <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="model-box">
<view class="title ss-m-t-38 ss-m-l-20 ss-m-b-40">活动优惠</view> <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" <scroll-view
:enable-back-to-top="true"> 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 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 class="ss-flex ss-m-b-40 subtitle" v-if="[1, 2, 3, 4, 5, 6].includes(item.type)">
<view v-if="item.activity_type === 'full_discount'"> <view> {{ item.description }} </view>
{{ 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> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -28,14 +29,7 @@
</su-popup> </su-popup>
</template> </template>
<script setup> <script setup>
import { import { computed, reactive } from 'vue';
computed,
reactive
} from 'vue';
import sheep from '@/sheep';
import {
fen2yuan
} from '@/sheep/hooks/useGoods';
const props = defineProps({ const props = defineProps({
promoInfo: { promoInfo: {
type: Array, type: Array,
@ -58,15 +52,6 @@
const state = reactive({ const state = reactive({
orderInfo: computed(() => props.modelValue), 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.model-box { .model-box {