From 19b6e2fa09648c443337064a9dd9cb38dbaf9b53 Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Sun, 29 Sep 2024 13:35:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E5=8D=95=E9=80=89=E6=8B=A9=E4=BA=BA?= =?UTF-8?q?=E6=95=B0=E6=9D=A1=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/components/diamond.vue | 2 +- pages/index/indexs.vue | 2 +- pages/order_food/order_food.vue | 6 +++--- pagesOrder/confirm_order/index.vue | 29 +++++++++++++++++++++-------- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/pages/index/components/diamond.vue b/pages/index/components/diamond.vue index 36e302c..106878f 100644 --- a/pages/index/components/diamond.vue +++ b/pages/index/components/diamond.vue @@ -61,7 +61,7 @@ let data = await this.api.productqueryShop({ code: uni.cache.get('tableCode'), }) - if ( !data.data.shopTableInfo.choseCount ) { + if ( data.data.shopTableInfo && !data.data.shopTableInfo.choseCount ) { uni.pro.navigateTo('/pagesOrder/orderAMeal/index', { tableCode: tableCode, shopId: data.data.storeInfo.id, diff --git a/pages/index/indexs.vue b/pages/index/indexs.vue index a72cc6b..7087ae0 100644 --- a/pages/index/indexs.vue +++ b/pages/index/indexs.vue @@ -73,7 +73,7 @@ }) console.log() - if ( !data.data.shopTableInfo.choseCount ) { + if ( data.data.shopTableInfo && !data.data.shopTableInfo.choseCount ) { uni.pro.navigateTo('/pagesOrder/orderAMeal/index', { tableCode: tableCode, shopId: data.data.storeInfo.id, diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue index 83a53e3..9210489 100644 --- a/pages/order_food/order_food.vue +++ b/pages/order_food/order_food.vue @@ -534,7 +534,7 @@ if (this.shopId) {params.shopId = this.shopId} let res = await this.api.productqueryShop(params) if (res.code == 0) { - if ( !res.data.shopTableInfo.choseCount && this.tableCode && !this.dinersNum ) { + if ( res.data.shopTableInfo && !res.data.shopTableInfo.choseCount) { uni.pro.navigateTo('/pagesOrder/orderAMeal/index', { tableCode: this.tableCode, shopId: res.data.storeInfo.id, @@ -687,8 +687,8 @@ "shopId": this.shopId, "note": item.note, "userId": uni.cache.get('userInfo').id, - "tableId": this.tableCode, } + if (this.shopInfo.storeInfo.eatModel.indexOf('dine-in') != -1) { params.tableId = this.tableCode;} this.addCart(params); }, @@ -951,8 +951,8 @@ "note": item.note, "shopId": this.shopId, "userId": uni.cache.get('userInfo').id, - "tableId": this.tableCode, } + if (this.shopInfo.storeInfo.eatModel.indexOf('dine-in') != -1) { params.tableId = this.tableCode;} //添加到购物车 this.addCart(params); } else { diff --git a/pagesOrder/confirm_order/index.vue b/pagesOrder/confirm_order/index.vue index 4ee157a..67c7833 100644 --- a/pagesOrder/confirm_order/index.vue +++ b/pagesOrder/confirm_order/index.vue @@ -16,7 +16,7 @@ - + {{item.title}} @@ -187,8 +187,8 @@ }, is_type: 1, is_typeList: [ - { title: "送餐到桌", type: "table", val: "dine-in", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1_active.png"}, - { title: "打包外带", type: "takeself", val: "take-out", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2_active.png"}, + { title: "送餐到桌", show: false, type: "table", val: "dine-in", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1_active.png"}, + { title: "打包外带", show: false, type: "takeself", val: "take-out", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2_active.png"}, ], sendType: "table", eatModel: [], @@ -249,10 +249,8 @@ this.listinfo.name = this.storeInfo.shopName; this.listinfo.details = JSON.parse(e.cartLists).data; this.listinfo.payAmount = JSON.parse(e.cartLists).amount; - if ( e.tableCode ) { this.tableCode = e.tableCode; } - if ( e.dinersNum ) { - this.dinersNum = e.dinersNum; - } + if ( e.tableCode ) { this.tableCode = e.tableCode;} + if ( e.dinersNum ) { this.dinersNum = e.dinersNum;} if ( this.storeInfo.eatModel.indexOf("dine-in") != -1 ) { this.eatModel = ["dine-in"] @@ -271,6 +269,13 @@ this.handlemessage() } this.getAount() + + this.is_typeList.map((item)=>{ + console.log(this.storeInfo.eatModel.indexOf(item.val)) + if ( this.storeInfo.eatModel.indexOf(item.val) != -1) { + item.show = true; + } + }) }, methods: { @@ -306,6 +311,7 @@ if (this.shopId) {params.shopId = this.shopId} let res = await this.api.productqueryShop(params) this.shopTableInfo = res.data.shopTableInfo; + this.storeInfo = res.data.storeInfo; }, /** @@ -491,6 +497,13 @@ }) return; } + if ( this.sendType == 'table' && !this.tableCode) { + uni.showToast({ + title: "请选择桌台", + icon: "none", + }) + return; + } if ( this.listinfo.details.length == 0) { uni.showToast({ title: "购物车为空,请添加商品", @@ -767,7 +780,7 @@ display: flex; justify-content: space-between; align-items: center; - border-radius: 22rpx; + border-radius: 22rpx 22rpx 0 0; background-color: $uni-bg-color; .tab_item{ width: 50%;