@pisell/pisellos 2.2.252 → 2.3.1

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";
@@ -5306,6 +5306,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
5306
5306
  _context42.next = 2;
5307
5307
  return this.request.get("/order/sales/".concat(order_id), {
5308
5308
  with: ['products', 'bookings']
5309
+ }, {
5310
+ osServer: true
5309
5311
  });
5310
5312
  case 2:
5311
5313
  res = _context42.sent;
@@ -928,7 +928,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
928
928
  title: discount.format_title,
929
929
  original_amount: product.price || product.origin_total,
930
930
  pre_value: discount.par_value,
931
- product_id: originProduct.id,
931
+ product_id: originProduct.id || originProduct.product_id,
932
932
  discount_product_id: discount.product_id
933
933
  },
934
934
  metadata: {
@@ -1394,7 +1394,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1394
1394
  resource_id: _selectedDiscount.id,
1395
1395
  title: _selectedDiscount.format_title,
1396
1396
  original_amount: product.price,
1397
- product_id: originProduct.id,
1397
+ product_id: originProduct.id || originProduct.product_id,
1398
1398
  percent: _selectedDiscount.par_value,
1399
1399
  discount_product_id: _selectedDiscount.product_id
1400
1400
  },
@@ -1473,6 +1473,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1473
1473
  // 计算折扣后的价格(使用 getDiscountAmount,内部已处理 maxDeductionAmount)
1474
1474
  var discountedPrice = getDiscountAmount(_selectedDiscount2, product.origin_total, product.origin_total);
1475
1475
  var bundleDiscountAmount = new Decimal(product.origin_total || 0).minus(discountedPrice).toNumber();
1476
+ debugger;
1476
1477
  var _discountDetail = {
1477
1478
  amount: bundleDiscountAmount,
1478
1479
  type: 'good_pass',
@@ -1482,7 +1483,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1482
1483
  resource_id: _selectedDiscount2.id,
1483
1484
  title: _selectedDiscount2.format_title,
1484
1485
  original_amount: product.origin_total,
1485
- product_id: product.id,
1486
+ product_id: product.id || product.product_id,
1486
1487
  discount_product_id: _selectedDiscount2.product_id
1487
1488
  },
1488
1489
  metadata: {
@@ -1555,6 +1556,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1555
1556
 
1556
1557
  // 🔥 使用当前的 _id 作为唯一标识
1557
1558
  var _uniqueId = flatItem._id;
1559
+ debugger;
1558
1560
  var _discountDetail2 = {
1559
1561
  amount: fixedAmountPerItem * (product.num || 1),
1560
1562
  type: _selectedDiscount3.tag === 'product_discount_card' ? 'discount_card' : _selectedDiscount3.tag,
@@ -1565,7 +1567,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1565
1567
  resource_id: _selectedDiscount3.id,
1566
1568
  title: _selectedDiscount3.format_title,
1567
1569
  original_amount: product.original_price,
1568
- product_id: product.id,
1570
+ product_id: product.id || product.product_id,
1569
1571
  percent: _selectedDiscount3.par_value,
1570
1572
  discount_product_id: _selectedDiscount3.product_id
1571
1573
  },
@@ -32,10 +32,10 @@ export declare class OrderModule extends BaseModule implements Module {
32
32
  private emitOrdersChanged;
33
33
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
34
34
  /**
35
- * 记录信息日志
36
- * @param title 日志标题
37
- * @param metadata 日志元数据
38
- */
35
+ * 记录信息日志
36
+ * @param title 日志标题
37
+ * @param metadata 日志元数据
38
+ */
39
39
  private logInfo;
40
40
  /**
41
41
  * 记录错误日志
@@ -172,10 +172,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
172
172
  return initialize;
173
173
  }()
174
174
  /**
175
- * 记录信息日志
176
- * @param title 日志标题
177
- * @param metadata 日志元数据
178
- */
175
+ * 记录信息日志
176
+ * @param title 日志标题
177
+ * @param metadata 日志元数据
178
+ */
179
179
  }, {
180
180
  key: "logInfo",
181
181
  value: function logInfo(title, metadata) {
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
311
  date: string;
312
312
  status: string;
313
313
  week: string;
314
- weekNum: 0 | 5 | 1 | 4 | 2 | 3 | 6;
314
+ weekNum: 0 | 1 | 2 | 6 | 3 | 4 | 5;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
@@ -3851,6 +3851,8 @@ var OrderModule = class extends import_BaseModule.BaseModule {
3851
3851
  async getOrderInfo(order_id) {
3852
3852
  const res = await this.request.get(`/order/sales/${order_id}`, {
3853
3853
  with: ["products", "bookings"]
3854
+ }, {
3855
+ osServer: true
3854
3856
  });
3855
3857
  return res;
3856
3858
  }
@@ -630,7 +630,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
630
630
  title: discount.format_title,
631
631
  original_amount: product.price || product.origin_total,
632
632
  pre_value: discount.par_value,
633
- product_id: originProduct.id,
633
+ product_id: originProduct.id || originProduct.product_id,
634
634
  discount_product_id: discount.product_id
635
635
  },
636
636
  metadata: {
@@ -1047,7 +1047,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1047
1047
  resource_id: selectedDiscount2.id,
1048
1048
  title: selectedDiscount2.format_title,
1049
1049
  original_amount: product.price,
1050
- product_id: originProduct.id,
1050
+ product_id: originProduct.id || originProduct.product_id,
1051
1051
  percent: selectedDiscount2.par_value,
1052
1052
  discount_product_id: selectedDiscount2.product_id
1053
1053
  },
@@ -1120,6 +1120,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1120
1120
  product.origin_total
1121
1121
  );
1122
1122
  const bundleDiscountAmount = new import_decimal.default(product.origin_total || 0).minus(discountedPrice).toNumber();
1123
+ debugger;
1123
1124
  const discountDetail = {
1124
1125
  amount: bundleDiscountAmount,
1125
1126
  type: "good_pass",
@@ -1129,7 +1130,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1129
1130
  resource_id: selectedDiscount2.id,
1130
1131
  title: selectedDiscount2.format_title,
1131
1132
  original_amount: product.origin_total,
1132
- product_id: product.id,
1133
+ product_id: product.id || product.product_id,
1133
1134
  discount_product_id: selectedDiscount2.product_id
1134
1135
  },
1135
1136
  metadata: {
@@ -1195,6 +1196,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1195
1196
  fixedAmountPerItem = new import_decimal.default(productOriginTotal).minus(targetProductTotal).toNumber();
1196
1197
  }
1197
1198
  const uniqueId = flatItem._id;
1199
+ debugger;
1198
1200
  const discountDetail = {
1199
1201
  amount: fixedAmountPerItem * (product.num || 1),
1200
1202
  type: selectedDiscount2.tag === "product_discount_card" ? "discount_card" : selectedDiscount2.tag,
@@ -1205,7 +1207,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1205
1207
  resource_id: selectedDiscount2.id,
1206
1208
  title: selectedDiscount2.format_title,
1207
1209
  original_amount: product.original_price,
1208
- product_id: product.id,
1210
+ product_id: product.id || product.product_id,
1209
1211
  percent: selectedDiscount2.par_value,
1210
1212
  discount_product_id: selectedDiscount2.product_id
1211
1213
  },
@@ -32,10 +32,10 @@ export declare class OrderModule extends BaseModule implements Module {
32
32
  private emitOrdersChanged;
33
33
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
34
34
  /**
35
- * 记录信息日志
36
- * @param title 日志标题
37
- * @param metadata 日志元数据
38
- */
35
+ * 记录信息日志
36
+ * @param title 日志标题
37
+ * @param metadata 日志元数据
38
+ */
39
39
  private logInfo;
40
40
  /**
41
41
  * 记录错误日志
@@ -110,10 +110,10 @@ var OrderModule = class extends import_BaseModule.BaseModule {
110
110
  });
111
111
  }
112
112
  /**
113
- * 记录信息日志
114
- * @param title 日志标题
115
- * @param metadata 日志元数据
116
- */
113
+ * 记录信息日志
114
+ * @param title 日志标题
115
+ * @param metadata 日志元数据
116
+ */
117
117
  logInfo(title, metadata) {
118
118
  try {
119
119
  if (this.logger) {
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
311
  date: string;
312
312
  status: string;
313
313
  week: string;
314
- weekNum: 0 | 5 | 1 | 4 | 2 | 3 | 6;
314
+ weekNum: 0 | 1 | 2 | 6 | 3 | 4 | 5;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.252",
4
+ "version": "2.3.1",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",