@pisell/pisellos 0.0.93 → 0.0.95

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.
@@ -728,9 +728,10 @@ export function getAllSortedDateRanges(schedules) {
728
728
  });
729
729
 
730
730
  // 排序完了,还需要做个去重,如果有开始时间结束时间完全一致的,则只保留一个
731
+ // 需要使用 dayjs 的 isSame 方法来判断
731
732
  var uniqueDateRanges = sortedDateRanges.filter(function (range, index, self) {
732
733
  return index === self.findIndex(function (t) {
733
- return t.start === range.start && t.end === range.end;
734
+ return dayjs(t.start).isSame(dayjs(range.start)) && dayjs(t.end).isSame(dayjs(range.end));
734
735
  });
735
736
  });
736
737
  return uniqueDateRanges;
@@ -216,6 +216,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
216
216
  });
217
217
  if (schedule_ids_data.length) {
218
218
  schedule_ids = schedule_ids_data;
219
+ } else {
220
+ // 后端说如果 schedule_ids 如果为空,需要给[0]
221
+ schedule_ids = [0];
219
222
  }
220
223
  }
221
224
  _context2.next = 4;
@@ -582,7 +582,7 @@ function getAllSortedDateRanges(schedules) {
582
582
  return durationA - durationB;
583
583
  });
584
584
  const uniqueDateRanges = sortedDateRanges.filter(
585
- (range, index, self) => index === self.findIndex((t) => t.start === range.start && t.end === range.end)
585
+ (range, index, self) => index === self.findIndex((t) => (0, import_dayjs.default)(t.start).isSame((0, import_dayjs.default)(range.start)) && (0, import_dayjs.default)(t.end).isSame((0, import_dayjs.default)(range.end)))
586
586
  );
587
587
  return uniqueDateRanges;
588
588
  }
@@ -165,6 +165,8 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
165
165
  const schedule_ids_data = this.store.schedule.getScheduleListByIds(schedule_ids).map((n) => n.id);
166
166
  if (schedule_ids_data.length) {
167
167
  schedule_ids = schedule_ids_data;
168
+ } else {
169
+ schedule_ids = [0];
168
170
  }
169
171
  }
170
172
  const productsData = await this.request.post(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.93",
4
+ "version": "0.0.95",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",