优化代客下单逻辑
This commit is contained in:
@@ -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
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user