优化代客下单逻辑

This commit is contained in:
gyq
2025-11-18 09:06:04 +08:00
parent 18d2a73073
commit 9904c044c3
5 changed files with 65 additions and 38 deletions

View File

@@ -129,6 +129,12 @@ export const useCartsStore = defineStore("carts", () => {
return [...currentGoods, ...giftGoods, ...oldOrderGoods];
};
// 台桌信息
const tableInfo = ref({})
async function changeTableInfo(info: any) {
tableInfo.value = { ...info }
}
// ------------------------------ 2. Store 内部原有响应式变量 ------------------------------
// 选择用户
const vipUser = ref<{ id?: string | number, isVip?: boolean }>({});
@@ -988,6 +994,11 @@ export const useCartsStore = defineStore("carts", () => {
userPoints.value = 0;
}
// 支付成功后清楚订单/用户信息
function clearHistory() {
vipUser.value = {}
}
return {
disconnect,
dinnerType,
@@ -1047,7 +1058,10 @@ export const useCartsStore = defineStore("carts", () => {
payParamsInit,
limitDiscountRes,
getAllGoodsList,
vipUser
vipUser,
changeTableInfo,
tableInfo,
clearHistory
};
});