From f663db95f3723ef2ca3089525c41b938ae2e8955 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Thu, 28 Nov 2024 18:26:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=99=90=E5=88=B6=EF=BC=8C=E5=BD=93=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E4=B8=BA0=E6=97=B6=E7=A6=81=E6=AD=A2=E6=8C=82=E8=B4=A6?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=B8=B4=E6=97=B6=E8=8F=9C=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tool/Instead/components/cart-item.vue | 6 ++++ src/views/tool/Instead/index.vue | 35 +++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/views/tool/Instead/components/cart-item.vue b/src/views/tool/Instead/components/cart-item.vue index d275783..b472feb 100644 --- a/src/views/tool/Instead/components/cart-item.vue +++ b/src/views/tool/Instead/components/cart-item.vue @@ -18,6 +18,12 @@ > {{ item.name }} +
+ 临时菜 +
diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index 59c1e8b..f19c65a 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -1069,7 +1069,9 @@ :disabledPayType="disabledPayType" > - 挂账 + 挂账
立即支付 @@ -2105,7 +2107,7 @@ export default { watch: { yinFuJinE: function (newval) { if (newval <= 0) { - this.disabledPayType = ["scanCode", "deposit"]; + this.disabledPayType = ["scanCode", "deposit","creditBuyer"]; } else { this.disabledPayType = []; } @@ -3882,7 +3884,8 @@ export default { //设置购物车数据 setCart(res) { console.log(res); - const { seatFee } = res; + try { + const { seatFee } = res; this.order.seatFee = seatFee ? { ...seatFee, @@ -3901,6 +3904,32 @@ export default { this.order.old.list = oldCart ? oldCart : []; // this.order.gift.list = returnGiftArr(res.records); console.log(this.order.old.list); + } catch (error) { + //当购物车数据发生错误时会导致页面报错购物车商品不展示 + this.$confirm('购物车数据结构错误,是否清空购物车商品?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + $clearCart({ + masterId: this.masterId, + tableId: this.table.tableId, + }).then((res) => { + this.order.list = []; + this.changeOrderSel(-1); + this.$message({ + type: "success", + message: "清除成功!", + }); + }); + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消' + }); + }); + } + }, //获取购物车数据 async getCart() {