This commit is contained in:
2024-04-14 20:18:44 +08:00
parent 13fd77f13b
commit 877469ab43
12 changed files with 98 additions and 22 deletions

View File

@@ -161,8 +161,9 @@ const addShoppingCart = () => {
const placeOrder = () => {
showSkuDialog((e: GoodsBean) => {
console.log(e);
const orderBean = {
totalPrice: e.price * e.checkedStock.count,
totalPrice: (e.consumePrice * e.checkedStock.count).toFixed(2),
orderGoods: [e]
};
goPath(`/pages/mall/subs/order/order-confirm?orderBean=${encodeURIComponent(JSON.stringify(orderBean))}`);

View File

@@ -124,7 +124,7 @@
import { assetsUrl, defaultImage } from '@/utils/assets';
import PaymentDialog from '@/components/payment-dialog.vue';
import CouponDialog from '@/pages/mall/subs/components/coupon-dialog.vue';
import { goPath, parseParameter, sortASCII } from '@/utils';
import { goPath, parseParameter, showToast, sortASCII } from '@/utils';
import { hexMD5 } from '@/utils/common/md5';
import { getPaymentList, orderCreate, overPayment } from '@/api/order';
import { CouponBean } from '@/api/user/types';
@@ -198,6 +198,12 @@ const navigateTo = (e: any) => {
};
const createOrder = async () => {
//邮寄
if(tabIndex.value == 1 && !deliveryAddress.value.addrid) {
showToast('请选择收货地址');
return;
}
const params = {
// 'discount': 0,
// 'freePrice': 0,
@@ -217,7 +223,7 @@ const createOrder = async () => {
'stockId': item.checkedStock.stockId,
'originPrice': item.price,
// 'consumePrice': item.price * ((userInfo.value?.levelEntity?.discount || 0) / 100),
'consumePrice': item.price,
'consumePrice': item.consumePrice,
'discount': userInfo.value?.levelEntity?.discount || 0
// 'discountOriginPrice': 0,
// 'produceIntegral': 0,

View File

@@ -85,7 +85,7 @@ watch(checkedAll, (newValue) => {
});
const totalPayPrice = computed(() => {
return shoppingCartList.value.filter(res => res.checked).reduce((a, b) => a + b.price * b.checkedStock.count, 0);
return shoppingCartList.value.filter(res => res.checked).reduce((a, b) => a + b.consumePrice * b.checkedStock.count, 0);
});
const deleteShoppingCart = () => {