From 1173416e6c43a7529927d1b39e82cf4056e908e4 Mon Sep 17 00:00:00 2001 From: ch Date: Wed, 25 May 2022 15:35:32 +0800 Subject: [PATCH] =?UTF-8?q?pref:=E8=B4=AD=E7=89=A9=E8=BD=A6=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=A4=9A=E7=B1=BB=E5=9E=8B=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/cart/components/PageCtx.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pages/cart/components/PageCtx.vue b/src/pages/cart/components/PageCtx.vue index e3804a7..8381f43 100644 --- a/src/pages/cart/components/PageCtx.vue +++ b/src/pages/cart/components/PageCtx.vue @@ -301,7 +301,16 @@ export default { * 结算选中的商品 */ handleOrder() { - const ids = this.checkedIds; + const ids = this.checkedIds; + // 检查是否同时选中实物商品跟虚拟商品,不可以同时结账 + const baseType = this.list.find(i => ids[0] === i.id).productType; + for(let id of ids){ + const item = this.list.find(i => id === i.id); + if(item.productType != baseType){ + uni.$u.toast('虚拟商品跟实物商品不能同时结算哦~'); + return false; + } + } if (ids.length) { this.$Router.push({ path : '/orderSubmit',