From 4cf6352494aaa951872df32f2315a5d58ff1ce56 Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Mon, 11 Nov 2024 18:00:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagesOrder/confirm_order/index.vue | 46 +++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/pagesOrder/confirm_order/index.vue b/pagesOrder/confirm_order/index.vue index 5fd0236..8dc6829 100644 --- a/pagesOrder/confirm_order/index.vue +++ b/pagesOrder/confirm_order/index.vue @@ -280,7 +280,7 @@ this.is_type = 1; } this.getProductqueryShop(); - this.getchoseEatModel(); + this.getchoseEatModel('index',0); }, onShow() { let _this = this; @@ -321,10 +321,16 @@ methods: { setPayAmount ( cartLists ) { console.log(cartLists) + let tableFee; + if ( this.is_type == 0 ) { + tableFee = this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0 + } else{ + tableFee = 0 + } if ( this.amountVIP.isVip == 1 && cartLists.memberAmount > 0 ) { - this.listinfo.payAmount = (cartLists.memberAmount+(this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0)).toFixed(2) + this.listinfo.payAmount = (cartLists.memberAmount+tableFee).toFixed(2) } else { - this.listinfo.payAmount = (cartLists.amount+(this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0)).toFixed(2) + this.listinfo.payAmount = (cartLists.amount+tableFee).toFixed(2) } this.isPointsChecked = false; this.getCalcUsablePoints() @@ -529,25 +535,45 @@ * @param {Object} val */ tabClick ( index, item ) { - this.is_type = index; - this.sendType = item.type - this.eatModel = []; - this.eatModel.push(item.val); - this.getchoseEatModel(); + + this.getchoseEatModel('tabClick', index, item); }, /** * 获取堂食/外带菜品数据 */ - async getchoseEatModel () { + async getchoseEatModel ( type , index, item) { let params = { shopId: uni.cache.get('shopId'), - type: this.is_type, + type: index, } if ( this.eatModel == "dine-in" && this.tableCode ) { params.tableId = this.tableCode; } if ( this.shopTableInfo && this.shopTableInfo.seatNum ) { params.num = this.shopTableInfo.seatNum; } let res = await this.api.choseEatModel(params) + + console.log(index) + if ( type == 'tabClick') { + if ( index == 1 ) { + if ( this.listinfo.details.length > 0) { + this.is_type = index; + this.sendType = item.type + this.eatModel = []; + this.eatModel.push(item.val); + } else { + uni.showToast({ + title: "没有可打包商品", + icon: "none", + }) + return; + } + } else { + this.is_type = index; + this.sendType = item.type + this.eatModel = []; + this.eatModel.push(item.val); + } + } this.listinfo.details = res.data.info; this.packFee = res.data.packFee; this.setPayAmount(res.data)