@pisell/pisellos 2.1.49 → 2.1.50

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.
@@ -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(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -142,10 +142,15 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
142
142
  // 遍历处理后的产品列表,检查是否有产品使用了新折扣
143
143
  result.productList.forEach(function (product) {
144
144
  var _this2$hooks$getProdu = _this2.hooks.getProduct(product),
145
- discount_list = _this2$hooks$getProdu.discount_list;
146
- if (discount_list && discount_list.length > 0) {
145
+ discount_list = _this2$hooks$getProdu.discount_list,
146
+ bundle = _this2$hooks$getProdu.bundle;
147
+ var allDiscountList = _toConsumableArray(discount_list || []);
148
+ (bundle || []).forEach(function (item) {
149
+ allDiscountList.push.apply(allDiscountList, _toConsumableArray((item === null || item === void 0 ? void 0 : item.discount_list) || []));
150
+ });
151
+ if (allDiscountList && allDiscountList.length > 0) {
147
152
  // 检查是否有使用新折扣的情况
148
- var usedNewDiscount = discount_list.some(function (discount) {
153
+ var usedNewDiscount = allDiscountList.some(function (discount) {
149
154
  var _discount$discount;
150
155
  return newDiscountIds.includes(discount === null || discount === void 0 || (_discount$discount = discount.discount) === null || _discount$discount === void 0 ? void 0 : _discount$discount.resource_id);
151
156
  });
@@ -342,7 +342,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
342
342
  };
343
343
  setOtherData(key: string, value: any): void;
344
344
  getOtherData(key: string): any;
345
- getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
345
+ getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
346
346
  /**
347
347
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
348
348
  *
@@ -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(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -95,9 +95,13 @@ var RulesModule = class extends import_BaseModule.BaseModule {
95
95
  let hasApplicableDiscount = false;
96
96
  const newDiscountIds = newDiscountList.map((discount) => discount.id);
97
97
  result.productList.forEach((product) => {
98
- const { discount_list } = this.hooks.getProduct(product);
99
- if (discount_list && discount_list.length > 0) {
100
- const usedNewDiscount = discount_list.some(
98
+ const { discount_list, bundle } = this.hooks.getProduct(product);
99
+ const allDiscountList = [...discount_list || []];
100
+ (bundle || []).forEach((item) => {
101
+ allDiscountList.push(...(item == null ? void 0 : item.discount_list) || []);
102
+ });
103
+ if (allDiscountList && allDiscountList.length > 0) {
104
+ const usedNewDiscount = allDiscountList.some(
101
105
  (discount) => {
102
106
  var _a;
103
107
  return newDiscountIds.includes((_a = discount == null ? void 0 : discount.discount) == null ? void 0 : _a.resource_id);
@@ -342,7 +342,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
342
342
  };
343
343
  setOtherData(key: string, value: any): void;
344
344
  getOtherData(key: string): any;
345
- getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
345
+ getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
346
346
  /**
347
347
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
348
348
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.1.49",
4
+ "version": "2.1.50",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",