@pisell/pisellos 2.2.102 → 2.2.103

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.
@@ -0,0 +1,9 @@
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";
@@ -20,7 +20,8 @@ var defaultStrategyMetadataCustom = {
20
20
  allowCrossProduct: true,
21
21
  applicableProductLimit: 0,
22
22
  deductTaxAndFee: true,
23
- maxPassesPerItem: 0
23
+ maxPassesPerItem: 0,
24
+ deductOptionPrice: false
24
25
  };
25
26
 
26
27
  /**
@@ -43,6 +43,8 @@ export interface Voucher {
43
43
  applicableProductLimit: number;
44
44
  /** 单订单行每单位可用同一 Wallet Pass 券次数;该行总券次上限 = maxPassesPerItem × 该行 quantity(按行唯一键区分)。0 表示不限制。 */
45
45
  maxPassesPerItem: number;
46
+ /** 是否抵扣单规格价格 (Option Price),默认 false。开启后折扣范围包含 option 的 add_price */
47
+ deductOptionPrice: boolean;
46
48
  };
47
49
  }
48
50
  /**
@@ -62,6 +64,13 @@ export interface Product {
62
64
  main_product_original_price?: number;
63
65
  /** 主商品折扣后金额,不包含套餐子商品 */
64
66
  main_product_selling_price?: number;
67
+ /** 单规格(Option)列表 */
68
+ product_options?: {
69
+ id: number;
70
+ add_price: number | string;
71
+ num: number;
72
+ [key: string]: any;
73
+ }[];
65
74
  /** 主商品税费 */
66
75
  tax_fee: number;
67
76
  metadata: {
@@ -138,6 +147,8 @@ export interface EvaluatorInput {
138
147
  applicableProductLimit: number;
139
148
  /** 单订单行每单位可用同一 Wallet Pass 券次数;行总上限 = maxPassesPerItem × 该行 quantity(按行唯一键计)。0 表示不限制。 */
140
149
  maxPassesPerItem: number;
150
+ /** 是否抵扣单规格价格 (Option Price),默认 false */
151
+ deductOptionPrice: boolean;
141
152
  }>[];
142
153
  }
143
154
  /**
@@ -119,6 +119,8 @@ export interface Discount {
119
119
  allowCrossProduct?: boolean;
120
120
  /** 可用商品数量上限 */
121
121
  applicableProductLimit?: number;
122
+ /** 是否抵扣单规格价格 (Option Price) */
123
+ deductOptionPrice?: boolean;
122
124
  };
123
125
  applicableProductIds?: number[];
124
126
  applicableProductDetails: ApplicableProductDetails[];
@@ -23,7 +23,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
23
23
  */
24
24
  private logError;
25
25
  createOrder(params: CommitOrderParams['query']): {
26
- type: "appointment_booking" | "virtual";
26
+ type: "virtual" | "appointment_booking";
27
27
  platform: string;
28
28
  sales_channel: string;
29
29
  order_sales_channel: string;
@@ -1,4 +1,7 @@
1
+ var _excluded = ["_original_add_price"];
1
2
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
2
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
7
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@@ -485,11 +488,13 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
485
488
 
486
489
  // 转换 sortedFlattenedList 为 Product 格式
487
490
  var productsForEvaluate = sortedFlattenedList.map(function (item) {
491
+ var _item$product;
488
492
  return {
489
493
  product_id: item.id,
490
494
  price: item.price || 0,
491
495
  quantity: item.quantity || item.num || 1,
492
- selling_price: item.price || 0
496
+ selling_price: item.price || 0,
497
+ product_options: item.type === 'main' ? (_item$product = item.product) === null || _item$product === void 0 ? void 0 : _item$product.options : undefined
493
498
  };
494
499
  });
495
500
 
@@ -826,6 +831,53 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
826
831
  // 🔥 用于存储扁平化商品处理结果的Map
827
832
  var processedFlatItemsMap = new Map();
828
833
 
834
+ // 🔥 Option 折扣辅助函数
835
+ var applyDiscountToOptions = function applyDiscountToOptions(options, discount) {
836
+ if (!(options !== null && options !== void 0 && options.length)) return {
837
+ discountedOptions: options,
838
+ optionDiscountAmount: 0
839
+ };
840
+ var optionDiscountAmount = 0;
841
+ var discountedOptions = options.map(function (option) {
842
+ var _ref5, _option$num, _option$_original_add;
843
+ var addPrice = Number(option.add_price || 0);
844
+ if (addPrice <= 0) return option;
845
+ var discountedPrice = getDiscountAmount(discount, addPrice, addPrice);
846
+ var optQty = Number((_ref5 = (_option$num = option.num) !== null && _option$num !== void 0 ? _option$num : option.quantity) !== null && _ref5 !== void 0 ? _ref5 : 1);
847
+ optionDiscountAmount = new Decimal(optionDiscountAmount).plus(new Decimal(addPrice).minus(discountedPrice).mul(optQty)).toNumber();
848
+ return _objectSpread(_objectSpread({}, option), {}, {
849
+ _original_add_price: (_option$_original_add = option._original_add_price) !== null && _option$_original_add !== void 0 ? _option$_original_add : option.add_price,
850
+ add_price: discountedPrice
851
+ });
852
+ });
853
+ return {
854
+ discountedOptions: discountedOptions,
855
+ optionDiscountAmount: optionDiscountAmount
856
+ };
857
+ };
858
+ var restoreOptionPrices = function restoreOptionPrices(options) {
859
+ if (!(options !== null && options !== void 0 && options.length)) return options;
860
+ return options.map(function (option) {
861
+ if (option._original_add_price !== undefined) {
862
+ var _original_add_price = option._original_add_price,
863
+ rest = _objectWithoutProperties(option, _excluded);
864
+ return _objectSpread(_objectSpread({}, rest), {}, {
865
+ add_price: _original_add_price
866
+ });
867
+ }
868
+ return option;
869
+ });
870
+ };
871
+ var getOptionTotal = function getOptionTotal(options) {
872
+ if (!(options !== null && options !== void 0 && options.length)) return 0;
873
+ return options.reduce(function (sum, opt) {
874
+ var _ref6, _opt$add_price, _ref7, _opt$num;
875
+ var unit = Number((_ref6 = (_opt$add_price = opt.add_price) !== null && _opt$add_price !== void 0 ? _opt$add_price : opt.price) !== null && _ref6 !== void 0 ? _ref6 : 0);
876
+ var n = Number((_ref7 = (_opt$num = opt.num) !== null && _opt$num !== void 0 ? _opt$num : opt.quantity) !== null && _ref7 !== void 0 ? _ref7 : 1);
877
+ return new Decimal(sum).plus(new Decimal(unit).mul(n)).toNumber();
878
+ }, 0);
879
+ };
880
+
829
881
  // 然后再处理应用哪些优惠券,此时只考虑filteredDiscountList中的优惠券
830
882
  // 🔥 使用扁平化后的列表进行处理
831
883
  sortedFlattenedList.forEach(function (flatItem, index) {
@@ -955,8 +1007,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
955
1007
  var _product$discount_lis5, _product11, _product11$every;
956
1008
  // 主商品:判断自身是否手动折扣
957
1009
  isManualDiscount = typeof product.isManualDiscount === 'boolean' ? product.isManualDiscount : product.total != product.origin_total && (product.bundle || []).every(function (item) {
958
- var _ref5;
959
- return !((_ref5 = item.discount_list || []) !== null && _ref5 !== void 0 && _ref5.length);
1010
+ var _ref8;
1011
+ return !((_ref8 = item.discount_list || []) !== null && _ref8 !== void 0 && _ref8.length);
960
1012
  }) && (!((_product$discount_lis5 = product.discount_list) !== null && _product$discount_lis5 !== void 0 && _product$discount_lis5.length) || ((_product11 = product) === null || _product11 === void 0 || (_product11 = _product11.discount_list) === null || _product11 === void 0 || (_product11$every = _product11.every) === null || _product11$every === void 0 ? void 0 : _product11$every.call(_product11, function (item) {
961
1013
  return item.type === 'product';
962
1014
  })));
@@ -969,8 +1021,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
969
1021
  if (parentProduct) {
970
1022
  var _parentProduct$discou, _parentProduct$discou2, _parentProduct$discou3;
971
1023
  isManualDiscount = typeof parentProduct.isManualDiscount === 'boolean' ? parentProduct.isManualDiscount : parentProduct.total != parentProduct.origin_total && (parentProduct.bundle || []).every(function (item) {
972
- var _ref6;
973
- return !((_ref6 = item.discount_list || []) !== null && _ref6 !== void 0 && _ref6.length);
1024
+ var _ref9;
1025
+ return !((_ref9 = item.discount_list || []) !== null && _ref9 !== void 0 && _ref9.length);
974
1026
  }) && (!((_parentProduct$discou = parentProduct.discount_list) !== null && _parentProduct$discou !== void 0 && _parentProduct$discou.length) || (parentProduct === null || parentProduct === void 0 || (_parentProduct$discou2 = parentProduct.discount_list) === null || _parentProduct$discou2 === void 0 || (_parentProduct$discou3 = _parentProduct$discou2.every) === null || _parentProduct$discou3 === void 0 ? void 0 : _parentProduct$discou3.call(_parentProduct$discou2, function (item) {
975
1027
  return item.type === 'product';
976
1028
  })));
@@ -1037,7 +1089,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1037
1089
  // 如果没有适用的优惠券,或者手动折扣,则不适用优惠券
1038
1090
  if (applicableDiscounts.length === 0 || isManualDiscount || isBoolean(product.vouchersApplicable) && !product.vouchersApplicable) {
1039
1091
  if (flatItem.type === 'main') {
1040
- // 主商品:保持原有逻辑
1092
+ // 主商品:保持原有逻辑,还原 option 价格
1093
+ var restoredOptions = restoreOptionPrices(product.options);
1041
1094
  if (product.isClient) {
1042
1095
  processedProductsMap.set(product._id, [_this3.hooks.setProduct(originProduct, _objectSpread(_objectSpread({}, isManualDiscount ? {} : {
1043
1096
  origin_total: getProductOriginTotalPrice({
@@ -1045,7 +1098,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1045
1098
  original_price: product.original_price
1046
1099
  },
1047
1100
  bundle: product.bundle,
1048
- options: product.options
1101
+ options: restoredOptions
1049
1102
  }),
1050
1103
  variant: originProduct._productInit.variant,
1051
1104
  original_price: originProduct._productInit.original_price,
@@ -1054,15 +1107,16 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1054
1107
  price: product.price
1055
1108
  },
1056
1109
  bundle: product.bundle,
1057
- options: product.options
1110
+ options: restoredOptions
1058
1111
  }),
1059
- price: product.price
1112
+ price: product.price,
1113
+ options: restoredOptions
1060
1114
  }), {}, {
1061
1115
  discount_list: _this3.filterDiscountListByType(product.discount_list, 'promotion')
1062
1116
  }))]);
1063
1117
  } else {
1064
- var _ref7, _product$_promotion$f, _product12, _product$origin_total;
1065
- var total = product.inPromotion ? (_ref7 = (_product$_promotion$f = (_product12 = product) === null || _product12 === void 0 || (_product12 = _product12._promotion) === null || _product12 === void 0 ? void 0 : _product12.finalPrice) !== null && _product$_promotion$f !== void 0 ? _product$_promotion$f : product.origin_total) !== null && _ref7 !== void 0 ? _ref7 : product.total : (_product$origin_total = product.origin_total) !== null && _product$origin_total !== void 0 ? _product$origin_total : product.total;
1118
+ var _ref10, _product$_promotion$f, _product12, _product$origin_total;
1119
+ var total = product.inPromotion ? (_ref10 = (_product$_promotion$f = (_product12 = product) === null || _product12 === void 0 || (_product12 = _product12._promotion) === null || _product12 === void 0 ? void 0 : _product12.finalPrice) !== null && _product$_promotion$f !== void 0 ? _product$_promotion$f : product.origin_total) !== null && _ref10 !== void 0 ? _ref10 : product.total : (_product$origin_total = product.origin_total) !== null && _product$origin_total !== void 0 ? _product$origin_total : product.total;
1066
1120
  var main_product_selling_price = product.price;
1067
1121
  if ((product.discount_list || []).some(function (item) {
1068
1122
  return item.type === 'promotion';
@@ -1078,7 +1132,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1078
1132
  _id: product._id.split('___')[0] + '___' + index,
1079
1133
  total: total,
1080
1134
  price: product.price,
1081
- main_product_selling_price: main_product_selling_price
1135
+ main_product_selling_price: main_product_selling_price,
1136
+ options: restoredOptions
1082
1137
  }), {}, {
1083
1138
  discount_list: _this3.filterDiscountListByType(product.discount_list, 'promotion')
1084
1139
  }))]);
@@ -1135,7 +1190,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1135
1190
  }));
1136
1191
  }
1137
1192
  for (var i = 0; i < splitCount; i++) {
1138
- var _originProduct, _selectedDiscount$met, _selectedDiscount$met2;
1193
+ var _originProduct, _selectedDiscount$con, _product$options, _product$options2, _selectedDiscount$met, _selectedDiscount$met2;
1139
1194
  // 如果用过折扣卡,也就不存在拆分的情况了,这里直接使用上面计算出来的折扣卡
1140
1195
  var _selectedDiscount = selectedDiscountCard || applicableDiscounts[i];
1141
1196
  // 标记优惠券为已使用
@@ -1165,27 +1220,46 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1165
1220
  var isOrderLevel = isOrderLevelFixedAmountDiscount(_selectedDiscount);
1166
1221
  var orderLevelAllocation = isOrderLevel ? orderLevelDiscountAllocations.get(_selectedDiscount.id) : null;
1167
1222
  var productAllocation = orderLevelAllocation === null || orderLevelAllocation === void 0 ? void 0 : orderLevelAllocation.get(flatItem._id);
1168
- var targetProductTotal = void 0;
1223
+ var isDeductOptionPrice = !!((_selectedDiscount$con = _selectedDiscount.config) !== null && _selectedDiscount$con !== void 0 && _selectedDiscount$con.deductOptionPrice);
1224
+
1225
+ // 主商品折后价(不含 option);勿与 option 合计混在同一变量,否则 main_product_selling_price 错误
1226
+ var mainProductSellingPrice = void 0;
1169
1227
  var amount = void 0;
1170
1228
  var productDiscountDifference = void 0;
1229
+ var discountedOptions = product.options;
1230
+ var optionDiscountAmount = 0;
1171
1231
  if (isOrderLevel && productAllocation) {
1172
1232
  // order_level:使用预计算的分摊金额
1173
1233
  amount = productAllocation.discountAmount;
1174
1234
  productDiscountDifference = productAllocation.difference;
1175
- targetProductTotal = Math.max(new Decimal(product.price).minus(amount).toNumber(), 0);
1235
+ mainProductSellingPrice = Math.max(new Decimal(product.price).minus(amount).toNumber(), 0);
1176
1236
  } else {
1177
1237
  // item_level 或其他类型:使用原有逻辑
1178
- targetProductTotal = getDiscountAmount(_selectedDiscount, product.price, product.price);
1179
- amount = new Decimal(product.price).minus(new Decimal(targetProductTotal)).toNumber();
1238
+ mainProductSellingPrice = getDiscountAmount(_selectedDiscount, product.price, product.price);
1239
+ amount = new Decimal(product.price).minus(new Decimal(mainProductSellingPrice)).toNumber();
1240
+ }
1241
+ if (isDeductOptionPrice && (_product$options = product.options) !== null && _product$options !== void 0 && _product$options.length) {
1242
+ var optionResult = applyDiscountToOptions(product.options, _selectedDiscount);
1243
+ discountedOptions = optionResult.discountedOptions;
1244
+ optionDiscountAmount = optionResult.optionDiscountAmount;
1180
1245
  }
1246
+
1247
+ // total = 主商品折后 + option 行合计;开启 option 抵扣时必须用 discountedOptions,不能用未折扣的 product.options 再算一遍
1248
+ var optionsForLineTotal = isDeductOptionPrice && (_product$options2 = product.options) !== null && _product$options2 !== void 0 && _product$options2.length ? discountedOptions : product.options;
1249
+ var optionsLineTotal = getOptionTotal(optionsForLineTotal || []);
1250
+ var _total2 = new Decimal(mainProductSellingPrice).plus(optionsLineTotal).toNumber();
1251
+
1252
+ // discount_list.amount / fixed_amount:行级总优惠 = 主商品优惠 + option 优惠(与 total 变化一致)
1253
+ var mainProductDiscountAmount = amount;
1254
+ var lineDiscountAmount = new Decimal(mainProductDiscountAmount).plus(optionDiscountAmount).toNumber();
1181
1255
  var discountType = _selectedDiscount.tag || _selectedDiscount.type;
1182
1256
  var isGoodPass = discountType === 'good_pass';
1183
1257
  var discountDetail = {
1184
- amount: amount,
1258
+ amount: lineDiscountAmount,
1185
1259
  type: _selectedDiscount.tag === 'product_discount_card' ? 'discount_card' : discountType,
1186
1260
  discount: {
1187
1261
  discount_card_type: _selectedDiscount === null || _selectedDiscount === void 0 || (_selectedDiscount$met = _selectedDiscount.metadata) === null || _selectedDiscount$met === void 0 ? void 0 : _selectedDiscount$met.discount_card_type,
1188
- fixed_amount: amount,
1262
+ fixed_amount: lineDiscountAmount,
1189
1263
  discount_calculation_mode: _selectedDiscount === null || _selectedDiscount === void 0 || (_selectedDiscount$met2 = _selectedDiscount.metadata) === null || _selectedDiscount$met2 === void 0 ? void 0 : _selectedDiscount$met2.discount_calculation_mode,
1190
1264
  resource_id: _selectedDiscount.id,
1191
1265
  title: _selectedDiscount.format_title,
@@ -1197,40 +1271,38 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1197
1271
  // 前端使用的num数量,为了计算优惠金额
1198
1272
  _num: isGoodPass ? 1 : product.num,
1199
1273
  config: _selectedDiscount === null || _selectedDiscount === void 0 ? void 0 : _selectedDiscount.config,
1200
- metadata: _objectSpread({
1274
+ metadata: _objectSpread(_objectSpread({
1201
1275
  num: 1
1202
1276
  }, productDiscountDifference !== undefined && {
1203
1277
  product_discount_difference: productDiscountDifference
1278
+ }), {}, {
1279
+ /** 仅主商品上的优惠金额(不含 option) */
1280
+ mainProductDiscountAmount: mainProductDiscountAmount,
1281
+ optionDiscountAmount: optionDiscountAmount
1204
1282
  })
1205
1283
  };
1206
1284
  appliedProducts.push(discountDetail);
1207
1285
  appliedDiscountProducts.set(_selectedDiscount.id, appliedProducts);
1208
- var _total2 = targetProductTotal;
1209
- if (product.options) {
1210
- _total2 = product.options.reduce(function (accumulator, currentValue) {
1211
- var currentPrice = new Decimal(currentValue.price || 0);
1212
- var currentNum = new Decimal(currentValue.num || 0);
1213
- return accumulator.add(currentPrice.mul(currentNum));
1214
- }, new Decimal(_total2)).toNumber();
1215
- }
1216
1286
 
1217
1287
  // 记录应用了优惠券的商品
1218
1288
  // 后续更新价格改为 getProductTotalPrice getProductOriginTotalPrice逻辑
1219
1289
  if (product.isClient) {
1220
1290
  arr.push(_this3.hooks.setProduct(originProduct, {
1221
1291
  discount_list: [discountDetail],
1222
- price: _selectedDiscount.tag === 'good_pass' ? 0 : product.price,
1292
+ // good_pass:主商品价以折后价为准;勿用 product.price - amount(amount option 优惠时会算错)
1293
+ price: isGoodPass ? mainProductSellingPrice : product.price,
1223
1294
  quantity: isNeedSplit ? 1 : product.quantity,
1224
1295
  origin_total: getProductOriginTotalPrice({
1225
1296
  product: {
1226
1297
  original_price: product.original_price
1227
1298
  },
1228
1299
  bundle: product.bundle,
1229
- options: product.options
1300
+ options: restoreOptionPrices(product.options)
1230
1301
  }),
1231
1302
  variant: originProduct._productInit.variant,
1232
1303
  original_price: new Decimal(product.price || 0).toNumber(),
1233
- total: _total2
1304
+ total: _total2,
1305
+ options: discountedOptions
1234
1306
  }));
1235
1307
  } else {
1236
1308
  arr.push(_this3.hooks.setProduct(originProduct, {
@@ -1240,7 +1312,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1240
1312
  quantity: isNeedSplit ? 1 : product.quantity,
1241
1313
  total: _total2,
1242
1314
  origin_total: productOriginTotal,
1243
- main_product_selling_price: targetProductTotal
1315
+ main_product_selling_price: mainProductSellingPrice,
1316
+ options: discountedOptions
1244
1317
  }));
1245
1318
  }
1246
1319
  }
@@ -1336,18 +1409,18 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1336
1409
  var _isOrderLevel = isOrderLevelFixedAmountDiscount(_selectedDiscount3);
1337
1410
  var _orderLevelAllocation = _isOrderLevel ? orderLevelDiscountAllocations.get(_selectedDiscount3.id) : null;
1338
1411
  var _productAllocation = _orderLevelAllocation === null || _orderLevelAllocation === void 0 ? void 0 : _orderLevelAllocation.get(flatItem._id);
1339
- var _targetProductTotal;
1412
+ var targetProductTotal;
1340
1413
  var fixedAmountPerItem;
1341
1414
  var _productDiscountDifference;
1342
1415
  if (_isOrderLevel && _productAllocation) {
1343
1416
  // order_level:使用预计算的单价折扣金额(已经是单价,无需再除以数量)
1344
1417
  fixedAmountPerItem = _productAllocation.discountAmount;
1345
1418
  _productDiscountDifference = _productAllocation.difference;
1346
- _targetProductTotal = Math.max(new Decimal(_productOriginTotal).minus(fixedAmountPerItem).toNumber(), 0);
1419
+ targetProductTotal = Math.max(new Decimal(_productOriginTotal).minus(fixedAmountPerItem).toNumber(), 0);
1347
1420
  } else {
1348
1421
  // item_level 或其他类型:使用原有逻辑
1349
- _targetProductTotal = getDiscountAmount(_selectedDiscount3, _productOriginTotal, _productOriginTotal);
1350
- fixedAmountPerItem = new Decimal(_productOriginTotal).minus(_targetProductTotal).toNumber();
1422
+ targetProductTotal = getDiscountAmount(_selectedDiscount3, _productOriginTotal, _productOriginTotal);
1423
+ fixedAmountPerItem = new Decimal(_productOriginTotal).minus(targetProductTotal).toNumber();
1351
1424
  }
1352
1425
 
1353
1426
  // 🔥 使用当前的 _id 作为唯一标识
@@ -1382,7 +1455,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1382
1455
  _appliedProducts2.push(_discountDetail2);
1383
1456
  appliedDiscountProducts.set(_selectedDiscount3.id, _appliedProducts2);
1384
1457
  processedItems.push(_objectSpread(_objectSpread({}, flatItem), {}, {
1385
- total: _targetProductTotal,
1458
+ total: targetProductTotal,
1386
1459
  price: new Decimal(_productOriginTotal || 0).minus(fixedAmountPerItem).toNumber(),
1387
1460
  discount_list: [_discountDetail2],
1388
1461
  processed: true
@@ -1401,8 +1474,9 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1401
1474
  // 获取主商品处理结果
1402
1475
  var mainProductArr = processedProductsMap.get(product._id);
1403
1476
  if (!mainProductArr || mainProductArr.length === 0) {
1404
- // 如果没有处理结果,返回默认商品
1477
+ // 如果没有处理结果,返回默认商品(还原 option 价格)
1405
1478
  var getDefaultProduct = function getDefaultProduct() {
1479
+ var restoredOptions = restoreOptionPrices(product.options);
1406
1480
  if (product.isClient) {
1407
1481
  return _this3.hooks.setProduct(originProduct, {
1408
1482
  discount_list: _this3.filterDiscountListByType(product.discount_list, 'promotion'),
@@ -1412,7 +1486,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1412
1486
  original_price: product.original_price
1413
1487
  },
1414
1488
  bundle: product.bundle,
1415
- options: product.options
1489
+ options: restoredOptions
1416
1490
  }),
1417
1491
  variant: originProduct._productInit.variant,
1418
1492
  original_price: originProduct._productInit.original_price,
@@ -1421,15 +1495,17 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1421
1495
  price: product.price
1422
1496
  },
1423
1497
  bundle: product.bundle,
1424
- options: product.options
1425
- })
1498
+ options: restoredOptions
1499
+ }),
1500
+ options: restoredOptions
1426
1501
  });
1427
1502
  } else {
1428
1503
  return _this3.hooks.setProduct(originProduct, {
1429
1504
  discount_list: _this3.filterDiscountListByType(product.discount_list, 'promotion'),
1430
1505
  total: product.total,
1431
1506
  origin_total: product.origin_total,
1432
- price: product.price
1507
+ price: product.price,
1508
+ options: restoreOptionPrices(product.options)
1433
1509
  });
1434
1510
  }
1435
1511
  };
@@ -61,6 +61,7 @@ export interface RulesParamsHooks {
61
61
  quantity?: number;
62
62
  bundle?: any[];
63
63
  main_product_selling_price?: string | number;
64
+ options?: any[];
64
65
  }) => Record<string, any>;
65
66
  }
66
67
  export {};
@@ -42,7 +42,8 @@ var defaultStrategyMetadataCustom = {
42
42
  allowCrossProduct: true,
43
43
  applicableProductLimit: 0,
44
44
  deductTaxAndFee: true,
45
- maxPassesPerItem: 0
45
+ maxPassesPerItem: 0,
46
+ deductOptionPrice: false
46
47
  };
47
48
  var WalletPassEvaluator = class {
48
49
  constructor() {
@@ -43,6 +43,8 @@ export interface Voucher {
43
43
  applicableProductLimit: number;
44
44
  /** 单订单行每单位可用同一 Wallet Pass 券次数;该行总券次上限 = maxPassesPerItem × 该行 quantity(按行唯一键区分)。0 表示不限制。 */
45
45
  maxPassesPerItem: number;
46
+ /** 是否抵扣单规格价格 (Option Price),默认 false。开启后折扣范围包含 option 的 add_price */
47
+ deductOptionPrice: boolean;
46
48
  };
47
49
  }
48
50
  /**
@@ -62,6 +64,13 @@ export interface Product {
62
64
  main_product_original_price?: number;
63
65
  /** 主商品折扣后金额,不包含套餐子商品 */
64
66
  main_product_selling_price?: number;
67
+ /** 单规格(Option)列表 */
68
+ product_options?: {
69
+ id: number;
70
+ add_price: number | string;
71
+ num: number;
72
+ [key: string]: any;
73
+ }[];
65
74
  /** 主商品税费 */
66
75
  tax_fee: number;
67
76
  metadata: {
@@ -138,6 +147,8 @@ export interface EvaluatorInput {
138
147
  applicableProductLimit: number;
139
148
  /** 单订单行每单位可用同一 Wallet Pass 券次数;行总上限 = maxPassesPerItem × 该行 quantity(按行唯一键计)。0 表示不限制。 */
140
149
  maxPassesPerItem: number;
150
+ /** 是否抵扣单规格价格 (Option Price),默认 false */
151
+ deductOptionPrice: boolean;
141
152
  }>[];
142
153
  }
143
154
  /**
@@ -119,6 +119,8 @@ export interface Discount {
119
119
  allowCrossProduct?: boolean;
120
120
  /** 可用商品数量上限 */
121
121
  applicableProductLimit?: number;
122
+ /** 是否抵扣单规格价格 (Option Price) */
123
+ deductOptionPrice?: boolean;
122
124
  };
123
125
  applicableProductIds?: number[];
124
126
  applicableProductDetails: ApplicableProductDetails[];
@@ -23,7 +23,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
23
23
  */
24
24
  private logError;
25
25
  createOrder(params: CommitOrderParams['query']): {
26
- type: "appointment_booking" | "virtual";
26
+ type: "virtual" | "appointment_booking";
27
27
  platform: string;
28
28
  sales_channel: string;
29
29
  order_sales_channel: string;
@@ -353,12 +353,16 @@ var RulesModule = class extends import_BaseModule.BaseModule {
353
353
  available_product_type: (_a = discount.limited_relation_product_data) == null ? void 0 : _a.type,
354
354
  available_product_ids: (_b = discount.limited_relation_product_data) == null ? void 0 : _b.product_ids
355
355
  };
356
- const productsForEvaluate = sortedFlattenedList.map((item) => ({
357
- product_id: item.id,
358
- price: item.price || 0,
359
- quantity: item.quantity || item.num || 1,
360
- selling_price: item.price || 0
361
- }));
356
+ const productsForEvaluate = sortedFlattenedList.map((item) => {
357
+ var _a2;
358
+ return {
359
+ product_id: item.id,
360
+ price: item.price || 0,
361
+ quantity: item.quantity || item.num || 1,
362
+ selling_price: item.price || 0,
363
+ product_options: item.type === "main" ? (_a2 = item.product) == null ? void 0 : _a2.options : void 0
364
+ };
365
+ });
362
366
  const result = evaluator.checkVoucherAvailability({
363
367
  orderTotalAmount,
364
368
  products: productsForEvaluate,
@@ -584,8 +588,47 @@ var RulesModule = class extends import_BaseModule.BaseModule {
584
588
  });
585
589
  });
586
590
  const processedFlatItemsMap = /* @__PURE__ */ new Map();
591
+ const applyDiscountToOptions = (options2, discount) => {
592
+ if (!(options2 == null ? void 0 : options2.length))
593
+ return { discountedOptions: options2, optionDiscountAmount: 0 };
594
+ let optionDiscountAmount = 0;
595
+ const discountedOptions = options2.map((option) => {
596
+ const addPrice = Number(option.add_price || 0);
597
+ if (addPrice <= 0)
598
+ return option;
599
+ const discountedPrice = (0, import_utils.getDiscountAmount)(discount, addPrice, addPrice);
600
+ const optQty = Number(option.num ?? option.quantity ?? 1);
601
+ optionDiscountAmount = new import_decimal.default(optionDiscountAmount).plus(new import_decimal.default(addPrice).minus(discountedPrice).mul(optQty)).toNumber();
602
+ return {
603
+ ...option,
604
+ _original_add_price: option._original_add_price ?? option.add_price,
605
+ add_price: discountedPrice
606
+ };
607
+ });
608
+ return { discountedOptions, optionDiscountAmount };
609
+ };
610
+ const restoreOptionPrices = (options2) => {
611
+ if (!(options2 == null ? void 0 : options2.length))
612
+ return options2;
613
+ return options2.map((option) => {
614
+ if (option._original_add_price !== void 0) {
615
+ const { _original_add_price, ...rest } = option;
616
+ return { ...rest, add_price: _original_add_price };
617
+ }
618
+ return option;
619
+ });
620
+ };
621
+ const getOptionTotal = (options2) => {
622
+ if (!(options2 == null ? void 0 : options2.length))
623
+ return 0;
624
+ return options2.reduce((sum, opt) => {
625
+ const unit = Number(opt.add_price ?? opt.price ?? 0);
626
+ const n = Number(opt.num ?? opt.quantity ?? 1);
627
+ return new import_decimal.default(sum).plus(new import_decimal.default(unit).mul(n)).toNumber();
628
+ }, 0);
629
+ };
587
630
  sortedFlattenedList.forEach((flatItem, index) => {
588
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
631
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
589
632
  let product, originProduct;
590
633
  if (flatItem.type === "main") {
591
634
  product = flatItem.product;
@@ -784,6 +827,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
784
827
  }
785
828
  if (applicableDiscounts.length === 0 || isManualDiscount || (0, import_lodash_es.isBoolean)(product.vouchersApplicable) && !product.vouchersApplicable) {
786
829
  if (flatItem.type === "main") {
830
+ const restoredOptions = restoreOptionPrices(product.options);
787
831
  if (product.isClient) {
788
832
  processedProductsMap.set(product._id, [
789
833
  this.hooks.setProduct(originProduct, {
@@ -793,7 +837,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
793
837
  original_price: product.original_price
794
838
  },
795
839
  bundle: product.bundle,
796
- options: product.options
840
+ options: restoredOptions
797
841
  }),
798
842
  variant: originProduct._productInit.variant,
799
843
  original_price: originProduct._productInit.original_price,
@@ -802,9 +846,10 @@ var RulesModule = class extends import_BaseModule.BaseModule {
802
846
  price: product.price
803
847
  },
804
848
  bundle: product.bundle,
805
- options: product.options
849
+ options: restoredOptions
806
850
  }),
807
- price: product.price
851
+ price: product.price,
852
+ options: restoredOptions
808
853
  },
809
854
  discount_list: this.filterDiscountListByType(product.discount_list, "promotion")
810
855
  })
@@ -825,7 +870,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
825
870
  _id: product._id.split("___")[0] + "___" + index,
826
871
  total,
827
872
  price: product.price,
828
- main_product_selling_price
873
+ main_product_selling_price,
874
+ options: restoredOptions
829
875
  },
830
876
  discount_list: this.filterDiscountListByType(product.discount_list, "promotion")
831
877
  })
@@ -891,26 +937,46 @@ var RulesModule = class extends import_BaseModule.BaseModule {
891
937
  const isOrderLevel = (0, import_utils3.isOrderLevelFixedAmountDiscount)(selectedDiscount2);
892
938
  const orderLevelAllocation = isOrderLevel ? orderLevelDiscountAllocations.get(selectedDiscount2.id) : null;
893
939
  const productAllocation = orderLevelAllocation == null ? void 0 : orderLevelAllocation.get(flatItem._id);
894
- let targetProductTotal;
940
+ const isDeductOptionPrice = !!((_x = selectedDiscount2.config) == null ? void 0 : _x.deductOptionPrice);
941
+ let mainProductSellingPrice;
895
942
  let amount;
896
943
  let productDiscountDifference;
944
+ let discountedOptions = product.options;
945
+ let optionDiscountAmount = 0;
897
946
  if (isOrderLevel && productAllocation) {
898
947
  amount = productAllocation.discountAmount;
899
948
  productDiscountDifference = productAllocation.difference;
900
- targetProductTotal = Math.max(new import_decimal.default(product.price).minus(amount).toNumber(), 0);
949
+ mainProductSellingPrice = Math.max(new import_decimal.default(product.price).minus(amount).toNumber(), 0);
901
950
  } else {
902
- targetProductTotal = (0, import_utils.getDiscountAmount)(selectedDiscount2, product.price, product.price);
903
- amount = new import_decimal.default(product.price).minus(new import_decimal.default(targetProductTotal)).toNumber();
951
+ mainProductSellingPrice = (0, import_utils.getDiscountAmount)(
952
+ selectedDiscount2,
953
+ product.price,
954
+ product.price
955
+ );
956
+ amount = new import_decimal.default(product.price).minus(new import_decimal.default(mainProductSellingPrice)).toNumber();
957
+ }
958
+ if (isDeductOptionPrice && ((_y = product.options) == null ? void 0 : _y.length)) {
959
+ const optionResult = applyDiscountToOptions(
960
+ product.options,
961
+ selectedDiscount2
962
+ );
963
+ discountedOptions = optionResult.discountedOptions;
964
+ optionDiscountAmount = optionResult.optionDiscountAmount;
904
965
  }
966
+ const optionsForLineTotal = isDeductOptionPrice && ((_z = product.options) == null ? void 0 : _z.length) ? discountedOptions : product.options;
967
+ const optionsLineTotal = getOptionTotal(optionsForLineTotal || []);
968
+ const total = new import_decimal.default(mainProductSellingPrice).plus(optionsLineTotal).toNumber();
969
+ const mainProductDiscountAmount = amount;
970
+ const lineDiscountAmount = new import_decimal.default(mainProductDiscountAmount).plus(optionDiscountAmount).toNumber();
905
971
  const discountType = selectedDiscount2.tag || selectedDiscount2.type;
906
972
  const isGoodPass = discountType === "good_pass";
907
973
  const discountDetail = {
908
- amount,
974
+ amount: lineDiscountAmount,
909
975
  type: selectedDiscount2.tag === "product_discount_card" ? "discount_card" : discountType,
910
976
  discount: {
911
- discount_card_type: (_x = selectedDiscount2 == null ? void 0 : selectedDiscount2.metadata) == null ? void 0 : _x.discount_card_type,
912
- fixed_amount: amount,
913
- discount_calculation_mode: (_y = selectedDiscount2 == null ? void 0 : selectedDiscount2.metadata) == null ? void 0 : _y.discount_calculation_mode,
977
+ discount_card_type: (_A = selectedDiscount2 == null ? void 0 : selectedDiscount2.metadata) == null ? void 0 : _A.discount_card_type,
978
+ fixed_amount: lineDiscountAmount,
979
+ discount_calculation_mode: (_B = selectedDiscount2 == null ? void 0 : selectedDiscount2.metadata) == null ? void 0 : _B.discount_calculation_mode,
914
980
  resource_id: selectedDiscount2.id,
915
981
  title: selectedDiscount2.format_title,
916
982
  original_amount: product.price,
@@ -924,35 +990,32 @@ var RulesModule = class extends import_BaseModule.BaseModule {
924
990
  metadata: {
925
991
  num: 1,
926
992
  // 🔥 order_level 分摊差值
927
- ...productDiscountDifference !== void 0 && { product_discount_difference: productDiscountDifference }
993
+ ...productDiscountDifference !== void 0 && { product_discount_difference: productDiscountDifference },
994
+ /** 仅主商品上的优惠金额(不含 option) */
995
+ mainProductDiscountAmount,
996
+ optionDiscountAmount
928
997
  }
929
998
  };
930
999
  appliedProducts.push(discountDetail);
931
1000
  appliedDiscountProducts.set(selectedDiscount2.id, appliedProducts);
932
- let total = targetProductTotal;
933
- if (product.options) {
934
- total = product.options.reduce((accumulator, currentValue) => {
935
- const currentPrice = new import_decimal.default(currentValue.price || 0);
936
- const currentNum = new import_decimal.default(currentValue.num || 0);
937
- return accumulator.add(currentPrice.mul(currentNum));
938
- }, new import_decimal.default(total)).toNumber();
939
- }
940
1001
  if (product.isClient) {
941
1002
  arr.push(
942
1003
  this.hooks.setProduct(originProduct, {
943
1004
  discount_list: [discountDetail],
944
- price: selectedDiscount2.tag === "good_pass" ? 0 : product.price,
1005
+ // good_pass:主商品价以折后价为准;勿用 product.price - amount(amount option 优惠时会算错)
1006
+ price: isGoodPass ? mainProductSellingPrice : product.price,
945
1007
  quantity: isNeedSplit ? 1 : product.quantity,
946
1008
  origin_total: (0, import_utils2.getProductOriginTotalPrice)({
947
1009
  product: {
948
1010
  original_price: product.original_price
949
1011
  },
950
1012
  bundle: product.bundle,
951
- options: product.options
1013
+ options: restoreOptionPrices(product.options)
952
1014
  }),
953
1015
  variant: originProduct._productInit.variant,
954
1016
  original_price: new import_decimal.default(product.price || 0).toNumber(),
955
- total
1017
+ total,
1018
+ options: discountedOptions
956
1019
  })
957
1020
  );
958
1021
  } else {
@@ -964,7 +1027,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
964
1027
  quantity: isNeedSplit ? 1 : product.quantity,
965
1028
  total,
966
1029
  origin_total: productOriginTotal,
967
- main_product_selling_price: targetProductTotal
1030
+ main_product_selling_price: mainProductSellingPrice,
1031
+ options: discountedOptions
968
1032
  })
969
1033
  );
970
1034
  }
@@ -994,7 +1058,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
994
1058
  type: "good_pass",
995
1059
  discount: {
996
1060
  fixed_amount: product.origin_total,
997
- discount_calculation_mode: (_z = selectedDiscount2 == null ? void 0 : selectedDiscount2.metadata) == null ? void 0 : _z.discount_calculation_mode,
1061
+ discount_calculation_mode: (_C = selectedDiscount2 == null ? void 0 : selectedDiscount2.metadata) == null ? void 0 : _C.discount_calculation_mode,
998
1062
  resource_id: selectedDiscount2.id,
999
1063
  title: selectedDiscount2.format_title,
1000
1064
  original_amount: product.origin_total,
@@ -1068,9 +1132,9 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1068
1132
  amount: fixedAmountPerItem * (product.num || 1),
1069
1133
  type: selectedDiscount2.tag === "product_discount_card" ? "discount_card" : selectedDiscount2.tag,
1070
1134
  discount: {
1071
- discount_card_type: (_A = selectedDiscount2 == null ? void 0 : selectedDiscount2.metadata) == null ? void 0 : _A.discount_card_type,
1135
+ discount_card_type: (_D = selectedDiscount2 == null ? void 0 : selectedDiscount2.metadata) == null ? void 0 : _D.discount_card_type,
1072
1136
  fixed_amount: fixedAmountPerItem,
1073
- discount_calculation_mode: (_B = selectedDiscount2 == null ? void 0 : selectedDiscount2.metadata) == null ? void 0 : _B.discount_calculation_mode,
1137
+ discount_calculation_mode: (_E = selectedDiscount2 == null ? void 0 : selectedDiscount2.metadata) == null ? void 0 : _E.discount_calculation_mode,
1074
1138
  resource_id: selectedDiscount2.id,
1075
1139
  title: selectedDiscount2.format_title,
1076
1140
  original_amount: product.original_price,
@@ -1086,7 +1150,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1086
1150
  ...productDiscountDifference !== void 0 && { product_discount_difference: productDiscountDifference }
1087
1151
  },
1088
1152
  config: selectedDiscount2 == null ? void 0 : selectedDiscount2.config,
1089
- _num: (product.num || 1) * (((_C = flatItem == null ? void 0 : flatItem.parentProduct) == null ? void 0 : _C.num) || 1)
1153
+ _num: (product.num || 1) * (((_F = flatItem == null ? void 0 : flatItem.parentProduct) == null ? void 0 : _F.num) || 1)
1090
1154
  };
1091
1155
  const appliedProducts = appliedDiscountProducts.get(selectedDiscount2.id) || [];
1092
1156
  appliedProducts.push(discountDetail);
@@ -1109,6 +1173,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1109
1173
  const mainProductArr = processedProductsMap2.get(product._id);
1110
1174
  if (!mainProductArr || mainProductArr.length === 0) {
1111
1175
  const getDefaultProduct = () => {
1176
+ const restoredOptions = restoreOptionPrices(product.options);
1112
1177
  if (product.isClient) {
1113
1178
  return this.hooks.setProduct(originProduct, {
1114
1179
  discount_list: this.filterDiscountListByType(product.discount_list, "promotion"),
@@ -1118,7 +1183,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1118
1183
  original_price: product.original_price
1119
1184
  },
1120
1185
  bundle: product.bundle,
1121
- options: product.options
1186
+ options: restoredOptions
1122
1187
  }),
1123
1188
  variant: originProduct._productInit.variant,
1124
1189
  original_price: originProduct._productInit.original_price,
@@ -1127,15 +1192,17 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1127
1192
  price: product.price
1128
1193
  },
1129
1194
  bundle: product.bundle,
1130
- options: product.options
1131
- })
1195
+ options: restoredOptions
1196
+ }),
1197
+ options: restoredOptions
1132
1198
  });
1133
1199
  } else {
1134
1200
  return this.hooks.setProduct(originProduct, {
1135
1201
  discount_list: this.filterDiscountListByType(product.discount_list, "promotion"),
1136
1202
  total: product.total,
1137
1203
  origin_total: product.origin_total,
1138
- price: product.price
1204
+ price: product.price,
1205
+ options: restoreOptionPrices(product.options)
1139
1206
  });
1140
1207
  }
1141
1208
  };
@@ -61,6 +61,7 @@ export interface RulesParamsHooks {
61
61
  quantity?: number;
62
62
  bundle?: any[];
63
63
  main_product_selling_price?: string | number;
64
+ options?: any[];
64
65
  }) => Record<string, any>;
65
66
  }
66
67
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.102",
4
+ "version": "2.2.103",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",