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 } }