Files
cashier_app/pagesCreateOrder/util.js
2025-02-26 19:46:20 +08:00

27 lines
794 B
JavaScript

// 返回购物车未下单的数据
export function getNowCart(carItem,goodsList) {
// console.log("carItem===",carItem)
// console.log("goodsList===",goodsList)
// const nowCart = records.find(v => v.placeNum == 0)
const arr = []
if( carItem.is_temporary != 1 ){
goodsList.map(goodsItem => {
if(carItem.product_id == goodsItem.id){
carItem.lowPrice = goodsItem.lowPrice
carItem.lowMemberPrice = goodsItem.lowMemberPrice
carItem.name = goodsItem.name
carItem.coverImg = goodsItem.coverImg
carItem.packFee = goodsItem.packFee
}
})
carItem.number = parseFloat(carItem.number)
} else {
// 临时菜
carItem.number = parseFloat(carItem.number)
carItem.name = carItem.product_name
carItem.lowPrice = carItem.discount_sale_amount
}
return carItem
}