From 11ff80ec4c4689641aa2f746bc0d5d4971a5e09f Mon Sep 17 00:00:00 2001 From: "jqtmviyu@gmail.com" Date: Fri, 5 Mar 2021 01:39:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A4=E7=A7=8D=E5=95=86=E5=93=81=E6=80=BB?= =?UTF-8?q?=E9=87=8F=E8=AE=A1=E7=AE=97=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/cart/cart.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pages/cart/cart.vue b/src/pages/cart/cart.vue index 8a88e8e..37e2e0c 100644 --- a/src/pages/cart/cart.vue +++ b/src/pages/cart/cart.vue @@ -94,11 +94,14 @@ export default { // 总数量 totalCount(){ let totalCount = 0 - this.cartList.forEach(item => { - if(item.goods_select){ - totalCount += item.goods_count - } - }) + // 京东规则 + // this.cartList.forEach(item => { + // if(item.goods_select){ + // totalCount += item.goods_count + // } + // }) + // 淘宝规则 + totalCount = this.cartList.filter(item=>item.goods_select).length return totalCount } }