parent
d6836d240c
commit
6afa9a3c48
|
|
@ -1122,7 +1122,7 @@ import {
|
||||||
$returnCart,
|
$returnCart,
|
||||||
$printOrder,
|
$printOrder,
|
||||||
tbShopTableGet,
|
tbShopTableGet,
|
||||||
$changeUseType
|
$changeUseType,
|
||||||
} from "@/api/table";
|
} from "@/api/table";
|
||||||
import { tbShopCategoryGet } from "@/api/shop";
|
import { tbShopCategoryGet } from "@/api/shop";
|
||||||
import {
|
import {
|
||||||
|
|
@ -1423,7 +1423,7 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"useTypes.sel": function (newval, oldval) {
|
"useTypes.sel": function (newval, oldval) {
|
||||||
console.log(newval)
|
console.log(newval);
|
||||||
this.setPostPay();
|
this.setPostPay();
|
||||||
this.setUseType();
|
this.setUseType();
|
||||||
},
|
},
|
||||||
|
|
@ -1589,30 +1589,26 @@ export default {
|
||||||
this.getShopInfo();
|
this.getShopInfo();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeOrderUseType(useType){
|
changeOrderUseType(useType) {
|
||||||
if(useType&&this.order.list.length){
|
if (useType && this.order.list.length) {
|
||||||
$changeUseType({
|
$changeUseType({
|
||||||
useType,
|
useType,
|
||||||
cartIds: this.order.list.map((v) => v.id),
|
cartIds: this.order.list.map((v) => v.id),
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//设置用餐类型
|
//设置用餐类型
|
||||||
setUseType() {
|
setUseType() {
|
||||||
// 自取
|
// 自取
|
||||||
let useType='takeout'
|
let useType = "takeout";
|
||||||
if (this.useTypes.sel == "takeout") {
|
if (this.useTypes.sel == "takeout") {
|
||||||
localStorage.setItem("useType", "takeout");
|
localStorage.setItem("useType", "takeout");
|
||||||
} else {
|
} else {
|
||||||
//堂食
|
//堂食
|
||||||
useType=`dine-in-${this.postPay ? "after" : "before"}`
|
useType = `dine-in-${this.postPay ? "after" : "before"}`;
|
||||||
localStorage.setItem(
|
localStorage.setItem("useType", useType);
|
||||||
"useType",
|
|
||||||
useType
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
this.changeOrderUseType(useType)
|
this.changeOrderUseType(useType);
|
||||||
|
|
||||||
},
|
},
|
||||||
//设置先付后付
|
//设置先付后付
|
||||||
setPostPay() {
|
setPostPay() {
|
||||||
|
|
@ -1638,8 +1634,8 @@ export default {
|
||||||
},
|
},
|
||||||
//更改就餐方式
|
//更改就餐方式
|
||||||
changeUseType(type) {
|
changeUseType(type) {
|
||||||
if(this.order.old.list.length > 0){
|
if (this.order.old.list.length > 0) {
|
||||||
return this.$message('下单后不支持更改就餐方式');
|
return this.$message("下单后不支持更改就餐方式");
|
||||||
}
|
}
|
||||||
console.log(type);
|
console.log(type);
|
||||||
this.useTypes.sel = type;
|
this.useTypes.sel = type;
|
||||||
|
|
@ -1902,6 +1898,8 @@ export default {
|
||||||
},
|
},
|
||||||
//生成订单
|
//生成订单
|
||||||
toCreateOrderDebounce(isNowPay) {
|
toCreateOrderDebounce(isNowPay) {
|
||||||
|
console.log(this.createOrder.status);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.createOrder.status != "" &&
|
this.createOrder.status != "" &&
|
||||||
this.createOrder.status != "success"
|
this.createOrder.status != "success"
|
||||||
|
|
@ -1914,7 +1912,9 @@ export default {
|
||||||
async toCreateOrder(isNowPay = false) {
|
async toCreateOrder(isNowPay = false) {
|
||||||
console.log(this.order);
|
console.log(this.order);
|
||||||
console.log(this.order.orderId);
|
console.log(this.order.orderId);
|
||||||
const res = await $createOrder({
|
let res=''
|
||||||
|
try {
|
||||||
|
res = await $createOrder({
|
||||||
masterId: this.order.masterId || this.masterId,
|
masterId: this.order.masterId || this.masterId,
|
||||||
vipUserId: this.vipUser.id,
|
vipUserId: this.vipUser.id,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
|
|
@ -1922,6 +1922,13 @@ export default {
|
||||||
postPay: this.postPay,
|
postPay: this.postPay,
|
||||||
orderld: this.order.orderId,
|
orderld: this.order.orderId,
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if(!res){
|
||||||
|
this.createOrder.status = "success";
|
||||||
|
return
|
||||||
|
}
|
||||||
//后付款
|
//后付款
|
||||||
console.log(this.postPay);
|
console.log(this.postPay);
|
||||||
console.log(isNowPay);
|
console.log(isNowPay);
|
||||||
|
|
@ -2569,7 +2576,7 @@ export default {
|
||||||
this.key = "";
|
this.key = "";
|
||||||
this.order.orderId = "";
|
this.order.orderId = "";
|
||||||
this.perpole = "";
|
this.perpole = "";
|
||||||
this.useTypes.sel='dine-in'
|
this.useTypes.sel = "dine-in";
|
||||||
},
|
},
|
||||||
//获取购物车数据
|
//获取购物车数据
|
||||||
async getCart() {
|
async getCart() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue