两种商品总量计算规则
This commit is contained in:
		
							parent
							
								
									f7411ecf55
								
							
						
					
					
						commit
						11ff80ec4c
					
				@ -94,11 +94,14 @@ export default {
 | 
				
			|||||||
      // 总数量
 | 
					      // 总数量
 | 
				
			||||||
      totalCount(){
 | 
					      totalCount(){
 | 
				
			||||||
          let totalCount = 0
 | 
					          let totalCount = 0
 | 
				
			||||||
          this.cartList.forEach(item => {
 | 
					        // 京东规则 
 | 
				
			||||||
              if(item.goods_select){
 | 
					        //   this.cartList.forEach(item => {
 | 
				
			||||||
                  totalCount += item.goods_count
 | 
					        //       if(item.goods_select){
 | 
				
			||||||
              }
 | 
					        //           totalCount += item.goods_count
 | 
				
			||||||
          })
 | 
					        //       }
 | 
				
			||||||
 | 
					        //   })
 | 
				
			||||||
 | 
					        // 淘宝规则 
 | 
				
			||||||
 | 
					         totalCount = this.cartList.filter(item=>item.goods_select).length
 | 
				
			||||||
          return totalCount
 | 
					          return totalCount
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user