@pisell/pisellos 0.0.118 → 0.0.120

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.
@@ -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
  }
@@ -1430,7 +1430,10 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
1430
1430
  key: "checkCartItems",
1431
1431
  value: function checkCartItems(type) {
1432
1432
  var _this8 = this;
1433
- var cartItems = this.store.cart.getItems();
1433
+ // 预约流程中普通商品无需检测这些东西
1434
+ var cartItems = this.store.cart.getItems().filter(function (n) {
1435
+ return !isNormalProduct(n._productOrigin);
1436
+ });
1434
1437
  var errorCartItemIds = [];
1435
1438
  cartItems.forEach(function (cartItem) {
1436
1439
  var result = _this8.store.cart.checkCartItemByType(cartItem, type);
@@ -2490,7 +2493,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2490
2493
  if (currentResourcesCount >= count) {
2491
2494
  count = currentResourcesCount;
2492
2495
  }
2493
- bookingLeft += 1;
2496
+ if (!m.onlyComputed) {
2497
+ bookingLeft += 1;
2498
+ }
2494
2499
  }
2495
2500
  });
2496
2501
  var startDayJs = dayjs(item.start);
@@ -3116,6 +3121,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
3116
3121
  value: function isTargetNormalProduct(product) {
3117
3122
  return isNormalProduct(product);
3118
3123
  }
3124
+ }, {
3125
+ key: "isTargetCartIdNormalProduct",
3126
+ value: function isTargetCartIdNormalProduct(id) {
3127
+ var cartItem = this.store.cart.getItems().find(function (n) {
3128
+ return n._id === id;
3129
+ });
3130
+ return cartItem && isNormalProduct(cartItem._productOrigin);
3131
+ }
3119
3132
  }]);
3120
3133
  return BookingByStepImpl;
3121
3134
  }(BaseModule);
@@ -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
  }
@@ -779,7 +779,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
779
779
  * @returns 不符合条件的购物车商品ID列表
780
780
  */
781
781
  checkCartItems(type) {
782
- const cartItems = this.store.cart.getItems();
782
+ const cartItems = this.store.cart.getItems().filter((n) => !(0, import_utils4.isNormalProduct)(n._productOrigin));
783
783
  const errorCartItemIds = [];
784
784
  cartItems.forEach((cartItem) => {
785
785
  const result = this.store.cart.checkCartItemByType(cartItem, type);
@@ -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.118",
4
+ "version": "0.0.120",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",