fix: 代客下单优化购物车以及优惠价格展示,修复后付费去结账未生成订单问题

This commit is contained in:
2025-03-14 10:47:19 +08:00
parent 814ca603d7
commit c371df05ce
4 changed files with 195 additions and 169 deletions

View File

@@ -122,6 +122,8 @@
</template>
<script setup>
import { customTruncateToTwoDecimals } from "@/views/tool/Instead/util";
const props = defineProps({
useVipPrice: {
type: Boolean,
@@ -173,7 +175,7 @@ const props = defineProps({
},
});
function to2(n) {
return n.toFixed(2);
return customTruncateToTwoDecimals(n);
}
let number = ref(0);

View File

@@ -73,15 +73,15 @@
<template #content>
<div class="u-flex color-000 u-font-14 u-row-between">
<span class="font-bold">会员优惠</span>
<span class="u-m-l-30">{{ carts.vipDiscount }}</span>
<span class="u-m-l-30">{{ carts.giftMoney(carts.vipDiscount) }}</span>
</div>
<div class="u-flex color-000 u-font-14 u-row-between">
<span class="font-bold">赠送</span>
<span class="u-m-l-30">{{ carts.giftMoney }}</span>
<span class="u-m-l-30">{{ customTruncateToTwoDecimals(carts.giftMoney) }}</span>
</div>
<div class="u-flex color-000 u-font-14 u-row-between">
<span class="font-bold">单品改价优惠</span>
<span class="u-m-l-30">{{ carts.singleDiscount }}</span>
<span class="u-m-l-30">{{ customTruncateToTwoDecimals(carts.singleDiscount) }}</span>
</div>
</template>
<div class="yiyouhui">{{ carts.yiyouhui }}</div>
@@ -159,7 +159,7 @@
<script setup>
import cartsItem from "./item.vue";
import extraFee from "./extra-fee.vue";
import { customTruncateToTwoDecimals } from "@/views/tool/Instead/util";
import { useCartsStore } from "@/store/modules/carts";
import { useUserStore } from "@/store/modules/user";