@pisell/pisellos 0.0.563 → 0.0.566
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.
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// 导出评估器
|
|
2
|
-
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
-
|
|
4
|
-
// 导出适配器
|
|
5
|
-
export { PromotionAdapter } from "./adapter";
|
|
6
|
-
export { default } from "./adapter";
|
|
7
|
-
|
|
8
|
-
// 导出策略配置示例常量
|
|
9
|
-
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY } from "./examples";
|
|
@@ -1174,7 +1174,7 @@ export var getSurcharge = function getSurcharge(_ref14, options) {
|
|
|
1174
1174
|
var _item2$item;
|
|
1175
1175
|
var originSurchargeFee = new Decimal(_item2.item.surcharge_fee || 0);
|
|
1176
1176
|
// 保留两位小数
|
|
1177
|
-
var surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, Decimal.
|
|
1177
|
+
var surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, Decimal.ROUND_HALF_UP).toNumber();
|
|
1178
1178
|
productTotalSurcharge = productTotalSurcharge.plus(new Decimal(surchargeFee).times(itemQuantity).toNumber());
|
|
1179
1179
|
_item2.item.surcharge_fee = surchargeFee;
|
|
1180
1180
|
_item2.item.relation_surcharge_ids = [].concat(_toConsumableArray(((_item2$item = _item2.item) === null || _item2$item === void 0 ? void 0 : _item2$item.relation_surcharge_ids) || []), [id]);
|
|
@@ -1182,7 +1182,7 @@ export var getSurcharge = function getSurcharge(_ref14, options) {
|
|
|
1182
1182
|
var _item2$item2;
|
|
1183
1183
|
var _originSurchargeFee = new Decimal(_item2.item.surcharge_fee || 0);
|
|
1184
1184
|
// 保留两位小数
|
|
1185
|
-
var _surchargeFee = _originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, Decimal.
|
|
1185
|
+
var _surchargeFee = _originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, Decimal.ROUND_HALF_UP).toNumber();
|
|
1186
1186
|
productTotalSurcharge = productTotalSurcharge.plus(new Decimal(_surchargeFee).times(itemQuantity).toNumber());
|
|
1187
1187
|
_item2.item.surcharge_fee = _surchargeFee;
|
|
1188
1188
|
_item2.item.relation_surcharge_ids = [].concat(_toConsumableArray(((_item2$item2 = _item2.item) === null || _item2$item2 === void 0 ? void 0 : _item2$item2.relation_surcharge_ids) || []), [id]);
|
|
@@ -746,13 +746,13 @@ var getSurcharge = ({ service, addons, bookingDetail, bookingId }, options) => {
|
|
|
746
746
|
if (open_product !== 0) {
|
|
747
747
|
if (item.isMain) {
|
|
748
748
|
const originSurchargeFee = new import_decimal.default(item.item.surcharge_fee || 0);
|
|
749
|
-
const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.
|
|
749
|
+
const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber();
|
|
750
750
|
productTotalSurcharge = productTotalSurcharge.plus(new import_decimal.default(surchargeFee).times(itemQuantity).toNumber());
|
|
751
751
|
item.item.surcharge_fee = surchargeFee;
|
|
752
752
|
item.item.relation_surcharge_ids = [...((_c = item.item) == null ? void 0 : _c.relation_surcharge_ids) || [], id];
|
|
753
753
|
} else {
|
|
754
754
|
const originSurchargeFee = new import_decimal.default(item.item.surcharge_fee || 0);
|
|
755
|
-
const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.
|
|
755
|
+
const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber();
|
|
756
756
|
productTotalSurcharge = productTotalSurcharge.plus(new import_decimal.default(surchargeFee).times(itemQuantity).toNumber());
|
|
757
757
|
item.item.surcharge_fee = surchargeFee;
|
|
758
758
|
item.item.relation_surcharge_ids = [...((_d = item.item) == null ? void 0 : _d.relation_surcharge_ids) || [], id];
|