@pisell/pisellos 1.0.31 → 1.0.33
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.
|
@@ -435,9 +435,10 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
435
435
|
|
|
436
436
|
// 优先从 origin_total拿,可能会拿不到(比如用户端预约在没有配置 original_price 的情况下)
|
|
437
437
|
var productOriginTotal = product.origin_total || product.total || 0;
|
|
438
|
-
// 如果 origin_total 有值,并且 product.total
|
|
438
|
+
// 如果 origin_total 有值,并且 product.total 有值,并且 origin_total 和 originProduct.origin_total 一样,则优先使用 product.total
|
|
439
439
|
// 因为用户端会涉及到划线价的概念
|
|
440
|
-
|
|
440
|
+
// 如果 originProduct._productInit.original_price 有值,则代表有划线价
|
|
441
|
+
if (Number(originProduct._productInit.original_price) > 0 && product.origin_total && product.total && product.origin_total !== product.total) {
|
|
441
442
|
productOriginTotal = product.total;
|
|
442
443
|
}
|
|
443
444
|
|
|
@@ -298,7 +298,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
298
298
|
usedDiscounts.set(selectedDiscount2.id, true);
|
|
299
299
|
const appliedProducts = appliedDiscountProducts.get(selectedDiscount2.id) || [];
|
|
300
300
|
let productOriginTotal = product.origin_total || product.total || 0;
|
|
301
|
-
if (product.origin_total && product.total && product.origin_total !== product.total) {
|
|
301
|
+
if (Number(originProduct._productInit.original_price) > 0 && product.origin_total && product.total && product.origin_total !== product.total) {
|
|
302
302
|
productOriginTotal = product.total;
|
|
303
303
|
}
|
|
304
304
|
const targetProductTotal = selectedDiscount2.tag === "good_pass" ? new import_decimal.default(productOriginTotal).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(productOriginTotal)).toNumber();
|