问题修复
This commit is contained in:
@@ -14,7 +14,7 @@ export function returnGoodsPrice(goods, user, shopInfo, limitTimeDiscount) {
|
||||
}
|
||||
//是否可以使用会员价
|
||||
const canUseVipPrice =
|
||||
user && user.isVip && user.isMemberPrice && goods.memberPrice * 1 > 0;
|
||||
user && user.isVip && user.isMemberPrice && goods.memberPrice * 1 > 0 && shopInfo && shopInfo.isMemberPrice;
|
||||
// 商家改价
|
||||
if (goods.discount_sale_amount * 1 > 0) {
|
||||
return goods.salePrice;
|
||||
@@ -98,11 +98,14 @@ export function returnCanDikouGoodsArr(args) {
|
||||
.filter((v) => types.includes(v.type))
|
||||
.reduce((prev, cur) => {
|
||||
// 给每个抵扣商品添加所属优惠券类型
|
||||
const goodsWithType = cur.discount.hasDiscountGoodsArr.map((goods) => ({
|
||||
...goods,
|
||||
couponType: cur.type, // 记录该商品是被哪种类型的优惠券抵扣的
|
||||
}));
|
||||
prev.push(...goodsWithType);
|
||||
if(cur&&cur.discount){
|
||||
const goodsWithType = cur.discount.hasDiscountGoodsArr.map((goods) => ({
|
||||
...goods,
|
||||
couponType: cur.type, // 记录该商品是被哪种类型的优惠券抵扣的
|
||||
}));
|
||||
prev.push(...goodsWithType);
|
||||
}
|
||||
|
||||
return prev;
|
||||
}, []);
|
||||
const arr = _.cloneDeep(canDikouGoodsArr)
|
||||
|
||||
@@ -456,7 +456,7 @@ export function returnCanUseLimitTimeDiscount(
|
||||
}
|
||||
const canUseFoods = (limitTimeDiscount.foods || "").split(",");
|
||||
const goodsCanUse =
|
||||
limitTimeDiscount.foodType == 1 || canUseFoods.includes("" + goods[idKey]);
|
||||
limitTimeDiscount.foodType == 1 || canUseFoods.includes("" + goods[idKey as keyof BaseCartItem]);
|
||||
if (!goodsCanUse) {
|
||||
return false;
|
||||
}
|
||||
@@ -491,7 +491,7 @@ function returnMemberPrice(useVipPrice: boolean, goods: BaseCartItem) {
|
||||
function returnLimitPrice(
|
||||
goods: BaseCartItem,
|
||||
limitTimeDiscount: TimeLimitDiscountConfig | null | undefined,
|
||||
useVipPrice
|
||||
useVipPrice: boolean
|
||||
) {
|
||||
if (!limitTimeDiscount) {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user