优化台桌结算不结算购物车信息

This commit is contained in:
gyq
2026-03-30 18:26:21 +08:00
parent 23b8db63b8
commit d19e1688a5
6 changed files with 168 additions and 22 deletions

View File

@@ -144,6 +144,10 @@ const props = defineProps({
member: {
type: Object,
default: {}
},
type: {
type: String,
default: 'cart' // cart 代客下单 table 桌台结算 order 订单结算
}
});
@@ -244,7 +248,7 @@ async function printOrderLable(isBefore = false) {
// 订单已支付
function paySuccess() {
if (isPrint.value) printOrderLable()
// if (isPrint.value) printOrderLable()
emits('success')
dialogVisible.value = false;
ElMessage.success('支付成功')
@@ -258,9 +262,14 @@ function paySuccess() {
const payCardRef = ref(null)
function show(t) {
goodsStore.payType = props.type
dialogVisible.value = true;
cartInfo.value = { ...goodsStore.cartInfo }
orderList.value = [...goodsStore.cartList, ...goodsStore.orderList.map(item => item.goods).flat()]
if (props.type === 'table') {
orderList.value = goodsStore.orderList.map(item => item.goods).flat()
} else {
orderList.value = [...goodsStore.cartList, ...goodsStore.orderList.map(item => item.goods).flat()]
}
console.log('orderListInfo===================', { ...goodsStore.orderListInfo });