@pisell/pisellos 1.0.18 → 1.0.19
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.
|
@@ -424,7 +424,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
424
424
|
var appliedProducts = appliedDiscountProducts.get(_selectedDiscount.id) || [];
|
|
425
425
|
|
|
426
426
|
// 计算使用折扣卡/商品券以后,单个商品的总 total
|
|
427
|
-
var targetProductTotal = _selectedDiscount.tag === 'good_pass' ? new Decimal(product.
|
|
427
|
+
var targetProductTotal = _selectedDiscount.tag === 'good_pass' ? new Decimal(product.origin_total || 0).minus(new Decimal(product.price || 0)).toNumber() : new Decimal(100).minus(_selectedDiscount.par_value || 0).div(100).mul(new Decimal(product.origin_total || 0)).toNumber();
|
|
428
428
|
var discountDetail = {
|
|
429
429
|
amount: new Decimal(product.total || 0).minus(new Decimal(targetProductTotal)).toNumber(),
|
|
430
430
|
type: _selectedDiscount.tag === 'product_discount_card' ? 'discount_card' : _selectedDiscount.tag,
|
|
@@ -293,7 +293,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
293
293
|
const selectedDiscount2 = applicableDiscounts[i2];
|
|
294
294
|
usedDiscounts.set(selectedDiscount2.id, true);
|
|
295
295
|
const appliedProducts = appliedDiscountProducts.get(selectedDiscount2.id) || [];
|
|
296
|
-
const targetProductTotal = selectedDiscount2.tag === "good_pass" ? new import_decimal.default(product.
|
|
296
|
+
const targetProductTotal = selectedDiscount2.tag === "good_pass" ? new import_decimal.default(product.origin_total || 0).minus(new import_decimal.default(product.price || 0)).toNumber() : new import_decimal.default(100).minus(selectedDiscount2.par_value || 0).div(100).mul(new import_decimal.default(product.origin_total || 0)).toNumber();
|
|
297
297
|
const discountDetail = {
|
|
298
298
|
amount: new import_decimal.default(product.total || 0).minus(new import_decimal.default(targetProductTotal)).toNumber(),
|
|
299
299
|
type: selectedDiscount2.tag === "product_discount_card" ? "discount_card" : selectedDiscount2.tag,
|