This commit is contained in:
2024-09-23 15:59:20 +08:00
6 changed files with 244 additions and 61 deletions

View File

@@ -1,6 +1,11 @@
// 桌台管理
import request from "@/utils/request";
//就餐形式,默认堂食后付费
const useType='dine-in-after'
function getUseType(){
const type=localStorage.getItem("useType")
return type?type:useType
}
/**
* 台桌列表
* @returns
@@ -133,6 +138,7 @@ export function getCart(params) {
method: "get",
params:{
shopId: localStorage.getItem("shopId"),
useType: getUseType(),
...params
}
});
@@ -162,6 +168,7 @@ export function addCart(data) {
method: "post",
data:{
shopId: localStorage.getItem("shopId"),
useType: getUseType(),
...data
}
});
@@ -177,6 +184,7 @@ export function $clearCart(data) {
method: "delete",
data:{
shopId: localStorage.getItem("shopId"),
useType: getUseType(),
...data
}
});
@@ -192,6 +200,7 @@ export function $removeCart(data) {
method: "delete",
data:{
shopId: localStorage.getItem("shopId"),
useType: getUseType(),
...data
}
});
@@ -234,6 +243,7 @@ export function $getMasterId(data) {
method: "get",
params:{
shopId: localStorage.getItem("shopId"),
useType: getUseType(),
...data
}
});
@@ -262,6 +272,7 @@ export function $createOrder(data) {
method: "post",
data:{
shopId: localStorage.getItem("shopId"),
useType: getUseType(),
...data
}
});
@@ -278,6 +289,7 @@ export function $cacheOrder(data) {
method: "post",
data:{
shopId: localStorage.getItem("shopId"),
useType: getUseType(),
...data
}
});
@@ -293,6 +305,7 @@ export function $getCacheOrder(data) {
method: "get",
params:{
shopId: localStorage.getItem("shopId"),
useType: getUseType(),
...data
}
});
@@ -362,6 +375,7 @@ export function $choseCount(data) {
method: "put",
data:{
shopId: localStorage.getItem("shopId"),
useType: getUseType(),
...data
}
});
@@ -403,3 +417,14 @@ export function $printDishes(data) {
});
}
// 就餐模式切换
export function $changeUseType(data) {
return request({
url: '/api/place/choseModel',
method: "put",
data:{
shopId: localStorage.getItem("shopId"),
...data
}
});
}