完成订单详情

This commit is contained in:
wwz
2025-03-13 09:15:51 +08:00
parent 7dde4ed754
commit e6ca187e5a
14 changed files with 219 additions and 176 deletions

View File

@@ -203,10 +203,12 @@
// 计算购物车商品费用
const totalPrices = computed(() => {
let combinedArray = [];
for (const key in props.orderinfo.detailMap) {
if (props.orderinfo.detailMap.hasOwnProperty(key)) {
combinedArray = props.orderinfo.detailMap[key];
let subArray = props.orderinfo .detailMap[key];
combinedArray = [...combinedArray, ...subArray]
}
}
// 购物车总数价格
@@ -214,13 +216,12 @@
// 是否启用会员价 0否1是
if (shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1) {
// memberPrice会员价
return total + parseFloat(item.memberPrice) * parseFloat(item.num);
return total + (parseFloat(item.memberPrice) * parseFloat(item.num - item.returnNum));
} else {
// salePrice销售价
return total + parseFloat(item.price) * parseFloat(item.num);
return total + (parseFloat(item.price) * parseFloat(item.num - item.returnNum));
}
}, 0);
console.log(cartone)
// 购物车总数价格
let cart = props.cartList.reduce((total, item) => {
// 是否启用会员价 0否1是
@@ -246,7 +247,6 @@
tableFeeTotals = Math.ceil(parseFloat(dinersNum) * parseFloat(tableFee) *
100) / 100;
}
console.log(tableFeeTotals)
return Math.floor(tableFeeTotals * 100) / 100 ? Math.floor(tableFeeTotals * 100) / 100 : 0;
});
@@ -266,7 +266,6 @@
// 监听送餐/打包切换
const tabClick = (item, index) => {
is_type.value = index
console.log(props.cartList)
// this.getchoseEatModel('tabClick', index, item);
}
@@ -295,10 +294,9 @@
remark: remark.value, //备注
placeNum: props.orderinfo.placeNum + 1, //当前订单下单次数
waitCall: '', //是否等叫 0 否 1 等叫
orderId: props.orderinfo.id
orderId: props.orderinfo.id,
userId: uni.cache.get('userInfo').id || '' //
})
console.log(res)
// 清空购物车
emits('customevent', {
type: 'shopping',