diff --git a/pagesCreateOrder/confirm-order/confirm-order.vue b/pagesCreateOrder/confirm-order/confirm-order.vue index 8d34752..bf01677 100644 --- a/pagesCreateOrder/confirm-order/confirm-order.vue +++ b/pagesCreateOrder/confirm-order/confirm-order.vue @@ -369,21 +369,23 @@ // 单品打折 async function discountconfirm(form) { - let str = '' - if (form.notes) { - form.notes.forEach(ele => { - if (ele.checked) { - str = str + ele.name + ',' - } - }) + if (form.discountMoney != '.') { + let str = '' + if (form.notes) { + form.notes.forEach(ele => { + if (ele.checked) { + str = str + ele.name + ',' + } + }) + } + let obj = { + saleAmount: form.discountMoney, + note: str + form.note, + cartId: modelData.data.id + } + const res = await Api.$updatePrice(obj) + getCart() } - let obj = { - saleAmount: form.discountMoney, - note: str + form.note, - cartId: modelData.data.id - } - const res = await Api.$updatePrice(obj) - getCart() } //用餐人数 @@ -449,9 +451,11 @@ skuId } par[key] = !item[key] + + const res = await Api.$updateCart(par) goods.list[index][key] = returnBoolean(res[key]) - + getCart() } //等叫 async function toggleWait(item) { @@ -597,7 +601,6 @@ return ((goodsTotalPrice - discountSaleAmount.value) || 0).toFixed(2) }) const allPrice = computed(() => { - console.log(goodsPrice.value, '调试2121'); const n = goodsPrice.value * 1 + $seatFee.totalAmount return n.toFixed(2) // const goodsTotalPrice = goods.list.reduce((prve, cur) => { @@ -615,8 +618,10 @@ }, 0) return goodsTotalPrice - allPrice.value } else { + console.log(discountSaleAmount.value,'优惠金额') return (discountSaleAmount.value) } + console.log(discountSaleAmount.value,'优惠金额1') return (goodsTotalPrice + discountSaleAmount.value * 1).toFixed(2) }) diff --git a/pagesCreateOrder/index/components/car.vue b/pagesCreateOrder/index/components/car.vue index 65f5681..44f0f26 100644 --- a/pagesCreateOrder/index/components/car.vue +++ b/pagesCreateOrder/index/components/car.vue @@ -6,7 +6,7 @@ - 已添加{{goodsNumber}}件商品 + 已添加{{goodsNumber.toFixed(0)}}件商品 清空