@pisell/pisellos 2.3.181 → 2.3.182

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, ITEM_REWARD_STRATEGY } from "./examples";
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "normal" | "session";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -1245,11 +1245,13 @@ function buildFees(params) {
1245
1245
  var itemDiscountAmount = new Decimal(toMoneyNumber(productExpectAmount !== null && productExpectAmount !== void 0 ? productExpectAmount : 0)).minus(toMoneyNumber(productOriginalAmount));
1246
1246
  return {
1247
1247
  fees: fees,
1248
- countFee: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
1248
+ countFee: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
1249
1249
  total_amount: formatMoney((_firstPresentValue3 = firstPresentValue(summary.total_amount, order.total_amount)) !== null && _firstPresentValue3 !== void 0 ? _firstPresentValue3 : 0, currencySymbol),
1250
1250
  original_item_amount: formatMoney(productOriginalAmount, currencySymbol),
1251
- product_expect_amount: formatMoney(productExpectAmount !== null && productExpectAmount !== void 0 ? productExpectAmount : 0, currencySymbol),
1252
- item_discount_amount: formatCalculatedMoney(itemDiscountAmount, currencySymbol),
1251
+ product_expect_amount: formatMoney(productExpectAmount !== null && productExpectAmount !== void 0 ? productExpectAmount : 0, currencySymbol)
1252
+ }, isNonZero(itemDiscountAmount) ? {
1253
+ item_discount_amount: formatCalculatedMoney(itemDiscountAmount, currencySymbol)
1254
+ } : {}), {}, {
1253
1255
  expect_amount: formatMoney(financials.totalAmount, currencySymbol),
1254
1256
  product_quantity: toNumber(firstPresentValue(summary.product_quantity, products.reduce(function (sum, product) {
1255
1257
  return sum + product.product_quantity;
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
328
328
  date: string;
329
329
  status: string;
330
330
  week: string;
331
- weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
331
+ weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
332
332
  }[]>;
333
333
  submitTimeSlot(timeSlots: TimeSliceItem): void;
334
334
  private getScheduleDataByIds;
@@ -375,7 +375,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
375
375
  };
376
376
  setOtherData(key: string, value: any): void;
377
377
  getOtherData(key: string): any;
378
- getProductTypeById(id: number): Promise<"duration" | "normal" | "session">;
378
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
379
379
  /**
380
380
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
381
381
  *
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "normal" | "session";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -1190,7 +1190,9 @@ function buildFees(params) {
1190
1190
  total_amount: formatMoney(firstPresentValue(summary.total_amount, order.total_amount) ?? 0, currencySymbol),
1191
1191
  original_item_amount: formatMoney(productOriginalAmount, currencySymbol),
1192
1192
  product_expect_amount: formatMoney(productExpectAmount ?? 0, currencySymbol),
1193
- item_discount_amount: formatCalculatedMoney(itemDiscountAmount, currencySymbol),
1193
+ ...(isNonZero(itemDiscountAmount) ? {
1194
+ item_discount_amount: formatCalculatedMoney(itemDiscountAmount, currencySymbol)
1195
+ } : {}),
1194
1196
  expect_amount: formatMoney(financials.totalAmount, currencySymbol),
1195
1197
  product_quantity: toNumber(firstPresentValue(summary.product_quantity, products.reduce((sum, product) => sum + product.product_quantity, 0)), 0),
1196
1198
  has_pay: formatMoney(financials.orderPaidAmount, currencySymbol),
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
328
328
  date: string;
329
329
  status: string;
330
330
  week: string;
331
- weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
331
+ weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
332
332
  }[]>;
333
333
  submitTimeSlot(timeSlots: TimeSliceItem): void;
334
334
  private getScheduleDataByIds;
@@ -375,7 +375,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
375
375
  };
376
376
  setOtherData(key: string, value: any): void;
377
377
  getOtherData(key: string): any;
378
- getProductTypeById(id: number): Promise<"duration" | "normal" | "session">;
378
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
379
379
  /**
380
380
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
381
381
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.3.181",
4
+ "version": "2.3.182",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",