H5 前端:商品详情页,接入促销活动

This commit is contained in:
YunaiV
2019-04-17 00:41:10 +08:00
parent 3909a95495
commit 355c53df66
3 changed files with 67 additions and 9 deletions

View File

@@ -244,7 +244,7 @@ public class CartServiceImpl implements CartService {
return presentPrice >= 0 ? presentPrice : sku.getPrice(); // 如果计算优惠价格小于 0 ,则说明无法使用优惠。
}
if (PreferentialTypeEnum.DISCOUNT.getValue().equals(item.getPreferentialType())) { // 打折
return sku.getPrice() * item.getPreferentialValue() / 100;
return sku.getPrice() * item.getPreferentialValue() / 10;
}
throw new IllegalArgumentException(String.format("折扣活动(%s) 的优惠类型不正确", timeLimitedDiscount.toString()));
}