@pisell/pisellos 0.0.143 → 0.0.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -350,7 +350,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
350
350
|
|
|
351
351
|
// 记录实际应用了优惠券的商品信息
|
|
352
352
|
var appliedProducts = appliedDiscountProducts.get(selectedDiscount.id) || [];
|
|
353
|
-
var targetProductPrice = selectedDiscount.tag === 'good_pass' ? '0' : new Decimal(selectedDiscount.par_value || 0).div(100).mul(new Decimal(product.price || 0)).toFixed(2);
|
|
353
|
+
var targetProductPrice = selectedDiscount.tag === 'good_pass' ? '0' : new Decimal(100).minus(selectedDiscount.par_value || 0).div(100).mul(new Decimal(product.price || 0)).toFixed(2);
|
|
354
354
|
var discountDetail = {
|
|
355
355
|
amount: selectedDiscount.tag === 'product_discount_card' ? new Decimal(product.price || 0).minus(new Decimal(targetProductPrice)).toNumber() : product.price,
|
|
356
356
|
type: selectedDiscount.tag === 'product_discount_card' ? 'discount_card' : selectedDiscount.tag,
|
|
@@ -251,7 +251,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
251
251
|
}
|
|
252
252
|
usedDiscounts.set(selectedDiscount.id, true);
|
|
253
253
|
const appliedProducts = appliedDiscountProducts.get(selectedDiscount.id) || [];
|
|
254
|
-
const targetProductPrice = selectedDiscount.tag === "good_pass" ? "0" : new import_decimal.default(selectedDiscount.par_value || 0).div(100).mul(new import_decimal.default(product.price || 0)).toFixed(2);
|
|
254
|
+
const targetProductPrice = selectedDiscount.tag === "good_pass" ? "0" : new import_decimal.default(100).minus(selectedDiscount.par_value || 0).div(100).mul(new import_decimal.default(product.price || 0)).toFixed(2);
|
|
255
255
|
const discountDetail = {
|
|
256
256
|
amount: selectedDiscount.tag === "product_discount_card" ? new import_decimal.default(product.price || 0).minus(new import_decimal.default(targetProductPrice)).toNumber() : product.price,
|
|
257
257
|
type: selectedDiscount.tag === "product_discount_card" ? "discount_card" : selectedDiscount.tag,
|