@pisell/pisellos 0.0.117 → 0.0.119

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.
@@ -85,7 +85,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
85
85
  item._origin.sub_type = durationType;
86
86
  }
87
87
  // 购物车是否为普通商品
88
- if (isNormalProduct(item._origin.product)) {
88
+ if (isNormalProduct(item._origin)) {
89
89
  var _order$relation_forms;
90
90
  order.relation_products.push(item._origin.product);
91
91
  var relationForms = item._origin.relation_forms || [];
@@ -252,4 +252,5 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
252
252
  isCartAllNormalProducts(): boolean;
253
253
  isCartHasDurationProduct(): boolean;
254
254
  isTargetNormalProduct(product: ProductData): boolean;
255
+ isTargetCartIdNormalProduct(id: string): boolean | undefined;
255
256
  }
@@ -2490,7 +2490,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2490
2490
  if (currentResourcesCount >= count) {
2491
2491
  count = currentResourcesCount;
2492
2492
  }
2493
- bookingLeft += 1;
2493
+ if (!m.onlyComputed) {
2494
+ bookingLeft += 1;
2495
+ }
2494
2496
  }
2495
2497
  });
2496
2498
  var startDayJs = dayjs(item.start);
@@ -3116,6 +3118,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
3116
3118
  value: function isTargetNormalProduct(product) {
3117
3119
  return isNormalProduct(product);
3118
3120
  }
3121
+ }, {
3122
+ key: "isTargetCartIdNormalProduct",
3123
+ value: function isTargetCartIdNormalProduct(id) {
3124
+ var cartItem = this.store.cart.getItems().find(function (n) {
3125
+ return n._id === id;
3126
+ });
3127
+ return cartItem && isNormalProduct(cartItem._productOrigin);
3128
+ }
3119
3129
  }]);
3120
3130
  return BookingByStepImpl;
3121
3131
  }(BaseModule);
@@ -58,7 +58,7 @@ var OrderModule = class extends import_BaseModule.BaseModule {
58
58
  item._origin.duration = duration;
59
59
  item._origin.sub_type = durationType;
60
60
  }
61
- if ((0, import_utils2.isNormalProduct)(item._origin.product)) {
61
+ if ((0, import_utils2.isNormalProduct)(item._origin)) {
62
62
  order.relation_products.push(item._origin.product);
63
63
  const relationForms = item._origin.relation_forms || [];
64
64
  order.relation_forms.push(...relationForms);
@@ -252,4 +252,5 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
252
252
  isCartAllNormalProducts(): boolean;
253
253
  isCartHasDurationProduct(): boolean;
254
254
  isTargetNormalProduct(product: ProductData): boolean;
255
+ isTargetCartIdNormalProduct(id: string): boolean | undefined;
255
256
  }
@@ -1733,7 +1733,9 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
1733
1733
  if (currentResourcesCount >= count) {
1734
1734
  count = currentResourcesCount;
1735
1735
  }
1736
- bookingLeft += 1;
1736
+ if (!m.onlyComputed) {
1737
+ bookingLeft += 1;
1738
+ }
1737
1739
  }
1738
1740
  });
1739
1741
  const startDayJs = (0, import_dayjs.default)(item.start);
@@ -2178,6 +2180,10 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
2178
2180
  isTargetNormalProduct(product) {
2179
2181
  return (0, import_utils4.isNormalProduct)(product);
2180
2182
  }
2183
+ isTargetCartIdNormalProduct(id) {
2184
+ const cartItem = this.store.cart.getItems().find((n) => n._id === id);
2185
+ return cartItem && (0, import_utils4.isNormalProduct)(cartItem._productOrigin);
2186
+ }
2181
2187
  };
2182
2188
  // Annotate the CommonJS export names for ESM import in node:
2183
2189
  0 && (module.exports = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.117",
4
+ "version": "0.0.119",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",