parent
5f1688173f
commit
d6836d240c
|
|
@ -417,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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1122,6 +1122,7 @@ import {
|
|||
$returnCart,
|
||||
$printOrder,
|
||||
tbShopTableGet,
|
||||
$changeUseType
|
||||
} from "@/api/table";
|
||||
import { tbShopCategoryGet } from "@/api/shop";
|
||||
import {
|
||||
|
|
@ -1422,6 +1423,7 @@ export default {
|
|||
},
|
||||
watch: {
|
||||
"useTypes.sel": function (newval, oldval) {
|
||||
console.log(newval)
|
||||
this.setPostPay();
|
||||
this.setUseType();
|
||||
},
|
||||
|
|
@ -1587,18 +1589,30 @@ export default {
|
|||
this.getShopInfo();
|
||||
},
|
||||
methods: {
|
||||
changeOrderUseType(useType){
|
||||
if(useType&&this.order.list.length){
|
||||
$changeUseType({
|
||||
useType,
|
||||
cartIds: this.order.list.map((v) => v.id),
|
||||
})
|
||||
}
|
||||
},
|
||||
//设置用餐类型
|
||||
setUseType() {
|
||||
// 自取
|
||||
let useType='takeout'
|
||||
if (this.useTypes.sel == "takeout") {
|
||||
localStorage.setItem("useType", "takeout");
|
||||
} else {
|
||||
//堂食
|
||||
useType=`dine-in-${this.postPay ? "after" : "before"}`
|
||||
localStorage.setItem(
|
||||
"useType",
|
||||
`dine-in-${this.postPay ? "after" : "before"}`
|
||||
useType
|
||||
);
|
||||
}
|
||||
this.changeOrderUseType(useType)
|
||||
|
||||
},
|
||||
//设置先付后付
|
||||
setPostPay() {
|
||||
|
|
@ -1627,6 +1641,7 @@ export default {
|
|||
if(this.order.old.list.length > 0){
|
||||
return this.$message('下单后不支持更改就餐方式');
|
||||
}
|
||||
console.log(type);
|
||||
this.useTypes.sel = type;
|
||||
},
|
||||
//更改就餐人数
|
||||
|
|
@ -2487,7 +2502,7 @@ export default {
|
|||
.filter((v) => v.specSnap.match(i))
|
||||
.every((v) => {
|
||||
// return isCanBuy(v,this.selGoods.data.isStock)
|
||||
return isCanBuy(v);
|
||||
return !isCanBuy(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue