From ff1e6f60e08d6acd7154a55c047b386d972b8e28 Mon Sep 17 00:00:00 2001
From: duan <1004387497@qq.com>
Date: Wed, 4 Dec 2024 09:38:18 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E8=AF=BE=E4=B8=8B=E5=8D=95bug?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../confirm-order/components/discount.vue | 6 ++-
.../confirm-order/confirm-order.vue | 45 ++++++++++---------
2 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/pagesCreateOrder/confirm-order/components/discount.vue b/pagesCreateOrder/confirm-order/components/discount.vue
index 231ffae..863cffe 100644
--- a/pagesCreateOrder/confirm-order/components/discount.vue
+++ b/pagesCreateOrder/confirm-order/components/discount.vue
@@ -34,7 +34,6 @@
-
元
@@ -70,7 +69,10 @@
确认
- 取消
+
+
+
+
diff --git a/pagesCreateOrder/confirm-order/confirm-order.vue b/pagesCreateOrder/confirm-order/confirm-order.vue
index f2f258d..8d34752 100644
--- a/pagesCreateOrder/confirm-order/confirm-order.vue
+++ b/pagesCreateOrder/confirm-order/confirm-order.vue
@@ -136,10 +136,15 @@
:key="index">
-
+
+
+ 临时菜
+
-
+
@@ -217,7 +222,7 @@
+ @tap="toggleWait(item)">{{item.isWaitCall?'取消等叫':'等叫'}}
-
+
@@ -363,7 +369,6 @@
// 单品打折
async function discountconfirm(form) {
- console.log(form, '调试111111')
let str = ''
if (form.notes) {
form.notes.forEach(ele => {
@@ -378,6 +383,7 @@
cartId: modelData.data.id
}
const res = await Api.$updatePrice(obj)
+ getCart()
}
//用餐人数
@@ -445,19 +451,17 @@
par[key] = !item[key]
const res = await Api.$updateCart(par)
goods.list[index][key] = returnBoolean(res[key])
- if (key == 'isPack') {
- getCart()
- }
+
}
//等叫
async function toggleWait(item) {
- item.isWait = !item.isWait
+ item.isWaitCall = !item.isWaitCall
let obj = {
cartId: item.id,
isGift: item.isGift,
isPack: item.isPack,
isPrint: item.isPrint,
- isWaitCall: item.isWait,
+ isWaitCall: item.isWaitCall,
masterId: option.masterId,
num: item.number, // 0会删除此商品
productId: item.productId,
@@ -467,7 +471,6 @@
let res = await Api.$updateCart(obj)
}
// 打印
-
async function toggisPrint(item) {
item.isPrint = !item.isPrint
let obj = {
@@ -475,7 +478,7 @@
isGift: item.isGift,
isPack: item.isPack,
isPrint: item.isPrint,
- isWaitCall: item.isWait,
+ isWaitCall: item.isWaitCall,
masterId: option.masterId,
num: item.number, // 0会删除此商品
productId: item.productId,
@@ -578,11 +581,11 @@
const isVip = computed(() => {
return $shop.value.isMemberPrice && user.value && user.value.id && user.value.isVip
})
- const discountSaleAmount=computed(()=>{
+ const discountSaleAmount = computed(() => {
return goods.list.filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0)
- .reduce((a, b) => {
- return a + b.number * b.discountSaleAmount;
- }, 0);
+ .reduce((a, b) => {
+ return a + b.number * b.discountSaleAmount;
+ }, 0);
})
const goodsPrice = computed(() => {
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
@@ -591,10 +594,10 @@
const tpackFee = cur.isPack ? cur.packFee * 1 : 0
return prve + (cur.isGift ? 0 : tPrice) + tpackFee
}, 0)
- return ((goodsTotalPrice-discountSaleAmount.value) || 0).toFixed(2)
+ return ((goodsTotalPrice - discountSaleAmount.value) || 0).toFixed(2)
})
const allPrice = computed(() => {
- console.log(goodsPrice.value,'调试2121');
+ console.log(goodsPrice.value, '调试2121');
const n = goodsPrice.value * 1 + $seatFee.totalAmount
return n.toFixed(2)
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
@@ -603,9 +606,9 @@
// return (goodsTotalPrice + ($seatFee.totalAmount || 0)).toFixed(2)
})
const youhui = computed(() => {
- let goodsTotalPrice=0
+ let goodsTotalPrice = 0
if (user.value && user.value.id && user.value.isVip) {
- goodsTotalPrice = goods.list.reduce((prve, cur) => {
+ goodsTotalPrice = goods.list.reduce((prve, cur) => {
const tPrice = cur.salePrice * cur.number
const tpackFee = cur.isPack ? cur.packFee * 1 : 0
return prve + tPrice + tpackFee
@@ -614,7 +617,7 @@
} else {
return (discountSaleAmount.value)
}
- return (goodsTotalPrice+discountSaleAmount.value*1).toFixed(2)
+ return (goodsTotalPrice + discountSaleAmount.value * 1).toFixed(2)
})
function setGoodsItem(key, val) {