
// 返回购物车未下单的数据
export function getNowCart(carItem,goodsList,user) {
	// console.log("carItem===",carItem)
	// console.log("goodsList===",goodsList)
	// const nowCart = records.find(v => v.placeNum == 0)
	console.log("carItem===",carItem)

	const arr = []
	if( carItem.is_temporary != 1 ){
		carItem.isGrounding = false;
		goodsList.map(goodsItem => {
			if(carItem.product_id == goodsItem.id){
				goodsItem.skuList.map(item=>{
					if(carItem.sku_id == item.id){
						carItem.lowPrice = item.lowPrice||item.salePrice
						carItem.lowMemberPrice = item.memberPrice
						carItem.memberPrice = item.memberPrice
						carItem.specInfo = item.specInfo
						carItem.salePrice = item.lowPrice
						
					}
				})
				carItem.name = goodsItem.name
				carItem.coverImg = goodsItem.coverImg
				carItem.packFee = goodsItem.packFee
				carItem.groupType = goodsItem.groupType
				carItem.type = goodsItem.type
				carItem.isGrounding = true;
			}
			carItem.number = parseFloat(carItem.number)
		})
	} else {
		// 临时菜
		carItem.number = parseFloat(carItem.number)
		carItem.name = carItem.product_name
		carItem.lowPrice = carItem.discount_sale_amount
		carItem.discount_sale_amount = carItem.discount_sale_amount?carItem.discount_sale_amount*1:0
		carItem.discountSaleAmount = carItem.discount_sale_amount

		// carItem.discount_sale_amount = 0
	}
	return carItem
}