@pisell/pisellos 0.0.187 → 0.0.189
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.
|
@@ -423,6 +423,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
423
423
|
}));
|
|
424
424
|
}
|
|
425
425
|
for (var _i = 0; _i < splitCount; _i++) {
|
|
426
|
+
var _originProduct$_produ;
|
|
426
427
|
// 如果用过折扣卡,也就不存在拆分的情况了,这里直接使用上面计算出来的折扣卡
|
|
427
428
|
var _selectedDiscount = selectedDiscountCard || applicableDiscounts[_i];
|
|
428
429
|
// 标记优惠券为已使用
|
|
@@ -435,7 +436,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
435
436
|
var productOriginTotal = product.origin_total || product.total || 0;
|
|
436
437
|
// 如果 origin_total 有值,并且 product.total 有值,并且 origin_total 和 originProduct.origin_total 一样,则优先使用 product.total
|
|
437
438
|
// 因为用户端会涉及到划线价的概念
|
|
438
|
-
|
|
439
|
+
// 如果 originProduct._productInit.original_price 有值,则代表有划线价
|
|
440
|
+
if (Number((originProduct === null || originProduct === void 0 || (_originProduct$_produ = originProduct._productInit) === null || _originProduct$_produ === void 0 ? void 0 : _originProduct$_produ.original_price) || 0) > 0 && product.origin_total && product.total && product.origin_total !== product.total) {
|
|
439
441
|
productOriginTotal = product.total;
|
|
440
442
|
}
|
|
441
443
|
|
|
@@ -207,7 +207,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
207
207
|
});
|
|
208
208
|
console.log(sortedProductList, "sortedProductListsortedProductList");
|
|
209
209
|
sortedProductList.forEach((originProduct, i) => {
|
|
210
|
-
var _a, _b, _c, _d, _e, _f;
|
|
210
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
211
211
|
const product = this.hooks.getProduct(originProduct);
|
|
212
212
|
if ((product == null ? void 0 : product.booking_id) && ((_a = product.discount_list) == null ? void 0 : _a.length) && ((_b = product == null ? void 0 : product.discount_list) == null ? void 0 : _b.every((discount) => discount.id && ["good_pass", "discount_card", "product_discount_card"].includes(discount.tag || discount.type)))) {
|
|
213
213
|
processedProductsMap.set(product._id, [originProduct]);
|
|
@@ -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
|
|
301
|
+
if (Number(((_g = originProduct == null ? void 0 : originProduct._productInit) == null ? void 0 : _g.original_price) || 0) > 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();
|