更换正式环境,测试修改
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export function isTui(item) {
|
||||
console.log("isTui",item.status);
|
||||
// console.log("isTui",item.status);
|
||||
return item.status == 'return' || item.status == 'refund' || item.status == 'refunding'
|
||||
}
|
||||
//是否使用会员价
|
||||
@@ -22,11 +22,7 @@ export function returnProductCouponPrice(coup, goodsArr, vipUser) {
|
||||
|
||||
//返回新的商品列表,过滤掉退菜的,退单的商品
|
||||
export function returnNewGoodsList(arr) {
|
||||
let goods_list = []
|
||||
Object.values(arr).forEach(item=>{
|
||||
goods_list = [...goods_list,...item]
|
||||
})
|
||||
return goods_list.filter(v => !isTui(v))
|
||||
return uni.$utils.objToArrary(arr).filter(v => !isTui(v))
|
||||
}
|
||||
//根据当前购物车商品以及数量,已选券对应商品数量,判断该商品券是否可用
|
||||
export function returnCoupCanUse(goodsArr = [], coup, selCoupArr = []) {
|
||||
@@ -38,10 +34,10 @@ export function returnCoupCanUse(goodsArr = [], coup, selCoupArr = []) {
|
||||
return false
|
||||
}
|
||||
const findGoodsTotalNumber = findGoods.reduce((prve, cur) => {
|
||||
return prve + cur.num * 1
|
||||
return prve + cur.num
|
||||
}, 0)
|
||||
const selCoupNumber = selCoupArr.filter(v => v.proId == coup.proId).reduce((prve, cur) => {
|
||||
return prve + cur.num * 1
|
||||
return prve + 1
|
||||
}, 0)
|
||||
if (selCoupNumber >= findGoodsTotalNumber) {
|
||||
return false
|
||||
@@ -59,9 +55,10 @@ export function returnProductCoupon(coup, goodsArr, vipUser, selCoupArr = []) {
|
||||
use: false
|
||||
}
|
||||
}
|
||||
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
||||
const price = item ? (isUseVipPrice(vipUser,item) ? memberPrice : item.price) : 0;
|
||||
const discountAmount = (price * coup.num).toFixed(2)
|
||||
let memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
||||
let price = item ? (isUseVipPrice(vipUser,item) ? memberPrice : item.price) : 0;
|
||||
price = item.discountSaleAmount ? item.discountSaleAmount : price
|
||||
const discountAmount = (price * 1).toFixed(2)
|
||||
|
||||
// const canUse = !coup.use ? false : (discountAmount > 0 && returnCoupCanUse(goodsArr, coup, selCoupArr))
|
||||
// const canUse=discountAmount>0
|
||||
@@ -90,9 +87,10 @@ export function returnProductAllCoup(coupArr, goodsArr, vipUser) {
|
||||
}
|
||||
//返回商品实际支付价格
|
||||
export function returnProductPayPrice(goods,vipUser){
|
||||
let memberPrice = goods.memberPrice ? goods.memberPrice : goods.unitPrice;
|
||||
let price = isUseVipPrice(vipUser,goods) ? memberPrice : goods.unitPrice;
|
||||
price = goods.memberPrice != goods.unitPrice&& goods.price != goods.unitPrice ? goods.unitPrice : price
|
||||
console.log(goods)
|
||||
let memberPrice = goods.memberPrice ? goods.memberPrice : goods.price;
|
||||
let price = isUseVipPrice(vipUser,goods) ? memberPrice : goods.price;
|
||||
price = goods.discountSaleAmount ? goods.discountSaleAmount : price
|
||||
return price
|
||||
}
|
||||
//返回商品券抵扣的商品价格
|
||||
@@ -129,11 +127,7 @@ export function returnProCoupStartIndex(coupArr,index){
|
||||
}
|
||||
//返回商品数量从0到n每一个对应的价格对照表
|
||||
export function returnGoodsPayPriceMap(goodsArr){
|
||||
let goods_arr = []
|
||||
Object.values(goodsArr).forEach(item=>{
|
||||
goods_arr = [...goods_arr,...Object.values(item)]
|
||||
})
|
||||
return goods_arr.reduce((prve,cur)=>{
|
||||
return goodsArr.reduce((prve,cur)=>{
|
||||
if(!prve.hasOwnProperty(cur.productId)){
|
||||
prve[cur.productId]=[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user