更新桌台列表页面

代客下单修改部分样式,修复创建订单后未刷新订单问题
This commit is contained in:
2024-09-12 14:08:03 +08:00
parent 6795f2ccd3
commit c95c630a75
6 changed files with 256 additions and 79 deletions

View File

@@ -146,7 +146,7 @@
<div class="order">
<div class="relative u-flex u-flex-col u-row-between">
<div class="w-full" style="padding-right: 14px">
<div class="choose-user flex">
<div class="choose-user flex u-m-l-20">
<el-button
type="primary"
v-if="vipUser.id === ''"
@@ -173,7 +173,7 @@
</div>
</template>
</div>
<div class="flex row-between table-list">
<div class="flex row-between table-list u-m-l-20">
<!-- <div class="tableId" @click="chooseTableOpen"> -->
<el-popover
placement="right"
@@ -224,7 +224,7 @@
</div>
</div>
<div class="order-list-all" style="flex: 1; overflow-y: scroll">
<div class="order-list-all u-p-l-20" style="flex: 1; overflow-y: scroll">
<div class="list">
<!-- 当前购物车列表 -->
<template v-if="order.list.length">
@@ -284,7 +284,8 @@
</div>
<div class="w-full bottom">
<div class="flex row-right youhui" v-if="giftLen">
<div class="border-top">
<div class="flex row-right youhui" v-if="giftLen">
<span> 已优惠{{ allGiftMoney | to2 }} </span>
<i class="el-icon-arrow-right"></i>
</div>
@@ -312,7 +313,7 @@
<span>加菜/返回</span>
</button>
<div style="width: 15px"></div>
<button class="my-btn flex-1 success" @click="payOrder">
<button class="my-btn flex-1 primary" @click="payOrder">
<span>立即支付</span>
</button>
</template>
@@ -341,6 +342,9 @@
</div>
</template>
</div>
</div>
</div>
</div>
@@ -401,14 +405,14 @@
<div
class="btn"
:class="{ disabled: !order.list.length }"
:class="{ disabled: !order.list.length||order.old.list.length }"
@click="saveOrder"
>
存单
</div>
<div
class="btn relative"
:class="{ disabled: !prveOrder.list.length }"
:class="{ disabled: !prveOrder.list.length ||order.old.list.length }"
@click="cacheOrderShow"
>
取单
@@ -438,12 +442,19 @@
<div class="btn" @click="refNoteShow">整单备注</div>
<div
class="btn"
:class="{ disabled:order.placeNum<=0||order.old.selIndex<0 }"
@click="orderBtnsClick('returnCart')"
>
退菜
</div>
<!-- <div
class="btn"
:class="{ disabled: order.old.list.length <= 0 }"
@click="orderBtnsClick('returnCart')"
>
撤单
</div>
</div> -->
</div>
</div>
<div class="goods">
@@ -1275,10 +1286,8 @@ export default {
return result.substring(0, result.length - 1);
},
allPrice() {
const oldPrice = this.order.old.list
.filter((v) => v.isGift !== "true")
.reduce((a, b) => {
const bTotal = b.info.reduce((prve, cur) => {
const oldPrice = this.order.old.list.reduce((a, b) => {
const bTotal = b.info.filter((v) => v.isGift !== "true").reduce((prve, cur) => {
return prve + cur.number * cur.salePrice;
}, 0);
return a + bTotal;
@@ -1724,6 +1733,7 @@ export default {
console.log(isNowPay);
console.log(this.postPay && isNowPay);
this.createOrder.status = "success";
this.getCart()
if (this.postPay && !isNowPay) {
this.$notify({
title: "下单成功",
@@ -2364,16 +2374,25 @@ export default {
},
//获取购物车数据
async getCart() {
this.order.list=[]
this.order.old.list=[]
const res = await getCart({
...this.order.query,
masterId: this.masterId,
tableId: this.table.tableId,
});
if (this.key|| res.records.length) {
this.order.old.list = res.records;
} else {
this.order.list = res.records;
for(let i in res.records){
if(res.records[i].placeNum==0){
this.order.list = res.records[i].info;
}else{
this.order.old.list.push(res.records[i]);
}
}
// if (this.key|| res.records.length) {
// this.order.old.list = res.records;
// } else {
// this.order.list = res.records;
// }
},
showSelGoods(item) {
console.log(item);
@@ -3316,19 +3335,20 @@ input[type="number"]::-webkit-outer-spin-button {
border-bottom: 1px solid #ebebeb;
margin-bottom: 10px;
}
.order-list-all{
}
.order {
border-radius: 6px;
display: flex;
padding-left: 12px;
.bottom {
left: 0;
right: 0;
box-sizing: border-box;
padding: 14px;
bottom: 0;
padding:0 14px 14px 14px;
background-color: #fff;
z-index: 10;
border-top: 1px solid #ebebeb;
.border-top{
padding-top: 14px;
border-top: 1px solid #ebebeb;
}
}
.list {
@@ -3385,6 +3405,7 @@ input[type="number"]::-webkit-outer-spin-button {
color: #fff;
text-align: center;
line-height: 17px;
z-index: 2;
}
&.active {
background-color: rgba(0, 0, 0, 0.04);