@pisell/pisellos 0.0.399 → 0.0.400

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
  }
@@ -309,7 +309,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
309
309
  date: string;
310
310
  status: string;
311
311
  week: string;
312
- weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
312
+ weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
313
313
  }[]>;
314
314
  submitTimeSlot(timeSlots: TimeSliceItem): void;
315
315
  private getScheduleDataByIds;
@@ -355,7 +355,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
355
355
  };
356
356
  setOtherData(key: string, value: any): void;
357
357
  getOtherData(key: string): any;
358
- getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
358
+ getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
359
359
  /**
360
360
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
361
361
  *
@@ -2729,6 +2729,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2729
2729
  allProductResources === null || allProductResources === void 0 || allProductResources.forEach(function (m) {
2730
2730
  // 遍历所有资源的上工时间片
2731
2731
  var currentResourcesCount = 0;
2732
+ var currentResourcesSummaryCount = 0;
2732
2733
  var currentResourcesTimeSlotCanUsedArr = [];
2733
2734
  // m.times 需要做个过滤,假设 timeSlice.start_at 是 09:30 timeSlice.end_at 是 11:30
2734
2735
  // time 是 time.start_at = 2025-05-26 10:30, time.end_at = 2025-05-26 12:30
@@ -2766,6 +2767,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2766
2767
  if (res.usable && res.remainingCapacity >= count && !m.onlyComputed) {
2767
2768
  currentResourcesCount = res.remainingCapacity;
2768
2769
  }
2770
+ if (res.usable && !m.onlyComputed && res.remainingCapacity >= currentResourcesSummaryCount) {
2771
+ currentResourcesSummaryCount = res.remainingCapacity;
2772
+ }
2769
2773
  currentResourcesTimeSlotCanUsedArr.push(res.usable);
2770
2774
  });
2771
2775
  // 在已经选定时间的情况下,只要canUseTime如果有一个 false 那就不可用
@@ -2779,7 +2783,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2779
2783
  }
2780
2784
  if (!m.onlyComputed) {
2781
2785
  bookingLeft += 1;
2782
- summaryCount += currentResourcesCount;
2786
+ summaryCount += currentResourcesSummaryCount;
2783
2787
  }
2784
2788
  }
2785
2789
  });
@@ -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
  }
@@ -309,7 +309,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
309
309
  date: string;
310
310
  status: string;
311
311
  week: string;
312
- weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
312
+ weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
313
313
  }[]>;
314
314
  submitTimeSlot(timeSlots: TimeSliceItem): void;
315
315
  private getScheduleDataByIds;
@@ -355,7 +355,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
355
355
  };
356
356
  setOtherData(key: string, value: any): void;
357
357
  getOtherData(key: string): any;
358
- getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
358
+ getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
359
359
  /**
360
360
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
361
361
  *
@@ -1918,6 +1918,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
1918
1918
  let summaryCount = 0;
1919
1919
  allProductResources == null ? void 0 : allProductResources.forEach((m) => {
1920
1920
  let currentResourcesCount = 0;
1921
+ let currentResourcesSummaryCount = 0;
1921
1922
  const currentResourcesTimeSlotCanUsedArr = [];
1922
1923
  const mTimes = m.times.filter((n) => {
1923
1924
  return !(0, import_dayjs.default)(n.start_at).isAfter((0, import_dayjs.default)(item.start), "minute") && !(0, import_dayjs.default)(n.end_at).isBefore((0, import_dayjs.default)(item.end), "minute") || (0, import_dayjs.default)(n.start_at).isBefore((0, import_dayjs.default)(item.end), "minute") && (0, import_dayjs.default)(n.end_at).isAfter((0, import_dayjs.default)(item.start), "minute");
@@ -1945,6 +1946,9 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
1945
1946
  if (res.usable && res.remainingCapacity >= count && !m.onlyComputed) {
1946
1947
  currentResourcesCount = res.remainingCapacity;
1947
1948
  }
1949
+ if (res.usable && !m.onlyComputed && res.remainingCapacity >= currentResourcesSummaryCount) {
1950
+ currentResourcesSummaryCount = res.remainingCapacity;
1951
+ }
1948
1952
  currentResourcesTimeSlotCanUsedArr.push(res.usable);
1949
1953
  });
1950
1954
  if (!currentResourcesTimeSlotCanUsedArr.some(
@@ -1956,7 +1960,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
1956
1960
  }
1957
1961
  if (!m.onlyComputed) {
1958
1962
  bookingLeft += 1;
1959
- summaryCount += currentResourcesCount;
1963
+ summaryCount += currentResourcesSummaryCount;
1960
1964
  }
1961
1965
  }
1962
1966
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.399",
4
+ "version": "0.0.400",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",