两种商品总量计算规则
This commit is contained in:
parent
f7411ecf55
commit
11ff80ec4c
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user