增加选择台桌和选择人数
This commit is contained in:
@@ -175,23 +175,27 @@
|
||||
</div>
|
||||
<div class="flex row-between">
|
||||
<!-- <div class="tableId" @click="chooseTableOpen"> -->
|
||||
<div class="tableId">
|
||||
<div class="tableId" @click="chooseTableOpen">
|
||||
{{ table ? "桌台号:" + table.name : "桌台号/取餐号" }}
|
||||
</div>
|
||||
|
||||
<el-button
|
||||
@click="clearCart"
|
||||
type="text"
|
||||
size="mini"
|
||||
:disabled="order.list.length <= 0"
|
||||
>清空</el-button
|
||||
>
|
||||
<!-- <div
|
||||
class="clear cur-pointer color-000 flex"
|
||||
@click="clearCart"
|
||||
>
|
||||
清空
|
||||
</div> -->
|
||||
<div class="u-flex">
|
||||
<div class="u-p-r-14 border-r u-m-r-14">
|
||||
<div class="u-flex cursor-pointer" @click="refToggle('refChooseDinersNumber',true)">
|
||||
<span>就餐人数:{{perpole}}位</span>
|
||||
<span
|
||||
class="el-icon-arrow-right diningPeople_cell_arrow"
|
||||
></span>
|
||||
</div>
|
||||
</div>
|
||||
<el-button
|
||||
@click="clearCart"
|
||||
type="text"
|
||||
size="mini"
|
||||
:disabled="order.list.length <= 0"
|
||||
>清空</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="absolute bottom">
|
||||
@@ -950,8 +954,8 @@
|
||||
<!-- 支付时的键盘弹窗 -->
|
||||
<money-keyboard ref="refMoneyKeyboard" :title="moneyKeyboard.title">
|
||||
</money-keyboard>
|
||||
<!-- 扫码支付 -->
|
||||
<scan-pay
|
||||
<!-- 扫码支付 -->
|
||||
<scan-pay
|
||||
ref="refWxScanCode"
|
||||
defaultTips="请使用扫码枪扫描微信/支付宝收款码"
|
||||
title="扫码支付"
|
||||
@@ -971,6 +975,8 @@
|
||||
<!-- 打折 -->
|
||||
<money-discount ref="refDiscount" @confirm="ChangeDiscount">
|
||||
</money-discount>
|
||||
<!-- 选择人数 -->
|
||||
<choose-diners-number ref="refChooseDinersNumber" @confirm="chooseDinersNumberConfirm"></choose-diners-number>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -983,6 +989,7 @@ import cartItem from "./table-diancan-components/cart-item.vue";
|
||||
import scanPay from "./table-diancan-components/scan-pay.vue";
|
||||
import moneyDiscount from "./table-diancan-components/discount.vue";
|
||||
import orderNote from "./table-diancan-components/note.vue";
|
||||
import chooseDinersNumber from "./table-diancan-components/choose-diners-number.vue";
|
||||
import moneyKeyboard from "./money-keyboard.vue";
|
||||
import dayjs from "dayjs";
|
||||
import {
|
||||
@@ -1018,9 +1025,12 @@ export default {
|
||||
scanPay,
|
||||
moneyDiscount,
|
||||
cartItem,
|
||||
chooseDinersNumber,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//就餐人数
|
||||
perpole:'',
|
||||
//整体点餐页面loading
|
||||
loading: false,
|
||||
//台桌点餐页面打开时带来的参数 isAddGoods 加菜 isPayOrder结账
|
||||
@@ -1415,29 +1425,31 @@ export default {
|
||||
// this.refToggle("refDiscount", true);
|
||||
},
|
||||
methods: {
|
||||
chooseDinersNumberConfirm(e){
|
||||
this.perpole=e
|
||||
},
|
||||
//扫码支付弹窗确认
|
||||
scanPayConfirm(code) {
|
||||
this.createOrder.code = code;
|
||||
if(!code){
|
||||
return this.$message.error("请输入或扫付款码")
|
||||
if (!code) {
|
||||
return this.$message.error("请输入或扫付款码");
|
||||
}
|
||||
this.pays();
|
||||
},
|
||||
payTypeItemClick(item) {
|
||||
console.log(item);
|
||||
console.log(this.vipUser.id);
|
||||
if(item.payType=='vipPay'){
|
||||
return this.refChooseUserOpen()
|
||||
if (item.payType == "vipPay") {
|
||||
return this.refChooseUserOpen();
|
||||
}
|
||||
if (item.payType == "deposit") {
|
||||
//储值卡支付
|
||||
return this.refToggle("refScanCode", true);
|
||||
return this.refToggle("refScanCode", true);
|
||||
}
|
||||
if (item.payType == "scanCode") {
|
||||
//扫码支付
|
||||
return this.refToggle("refWxScanCode", true);
|
||||
return this.refToggle("refWxScanCode", true);
|
||||
}
|
||||
|
||||
},
|
||||
ChangeDiscount(discount) {
|
||||
this.createOrder.discount = discount;
|
||||
@@ -1535,41 +1547,40 @@ export default {
|
||||
},
|
||||
// 支付订单前的处理
|
||||
async payOrder() {
|
||||
|
||||
if(this.order.payType=='vipPay'&&!this.vipUser.id){
|
||||
return this.refChooseUserOpen()
|
||||
if (this.order.payType == "vipPay" && !this.vipUser.id) {
|
||||
return this.refChooseUserOpen();
|
||||
}
|
||||
if(this.order.payType=='scanCode'){
|
||||
return this.refToggle("refWxScanCode", true);
|
||||
if (this.order.payType == "scanCode") {
|
||||
return this.refToggle("refWxScanCode", true);
|
||||
}
|
||||
if(this.order.payType=='deposit'){
|
||||
return this.refToggle("refScanCode", true);
|
||||
if (this.order.payType == "deposit") {
|
||||
return this.refToggle("refScanCode", true);
|
||||
}
|
||||
console.log({
|
||||
orderId: this.createOrder.data.id,
|
||||
payType: this.order.payType,
|
||||
});
|
||||
this.pays()
|
||||
this.pays();
|
||||
},
|
||||
// 支付订单
|
||||
async pays() {
|
||||
this.loading = true;
|
||||
try {
|
||||
const res = await $payOrder({
|
||||
tableId: this.table.tableId,
|
||||
masterId: this.masterId,
|
||||
orderId: this.createOrder.data.id,
|
||||
payType: this.order.payType,
|
||||
vipUserId: this.vipUser.id,
|
||||
discount: this.createOrder.discount,
|
||||
code: this.createOrder.code,
|
||||
});
|
||||
this.loading = false;
|
||||
this.payOrderSuccess();
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
this.loading = true;
|
||||
try {
|
||||
const res = await $payOrder({
|
||||
tableId: this.table.tableId,
|
||||
masterId: this.masterId,
|
||||
orderId: this.createOrder.data.id,
|
||||
payType: this.order.payType,
|
||||
vipUserId: this.vipUser.id,
|
||||
discount: this.createOrder.discount,
|
||||
code: this.createOrder.code,
|
||||
});
|
||||
this.loading = false;
|
||||
this.payOrderSuccess();
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
payOrderSuccess() {
|
||||
this.$notify({
|
||||
title: "支付成功",
|
||||
@@ -2653,7 +2664,9 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.border-r {
|
||||
border-right: 1px solid #ebebeb;
|
||||
}
|
||||
.lh-16 {
|
||||
line-height: 16px;
|
||||
}
|
||||
@@ -2722,6 +2735,9 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
.col-baseline {
|
||||
align-items: baseline;
|
||||
}
|
||||
.cursor-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
.flex-x-y-center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -3517,7 +3533,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
||||
}
|
||||
|
||||
.carts .title .right {
|
||||
font-size: 14.4px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user