@pisell/pisellos 2.0.31 → 2.0.32

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.
@@ -2848,18 +2848,19 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2848
2848
  // TODO 优化关于为什么要放在接口后,因为在获取时间切片的时候还需要读一次接口数据,其实可以直接从这个结果里拿了,需要优化
2849
2849
  cache = (_this$store$currentPr5 = this.store.currentProduct) === null || _this$store$currentPr5 === void 0 ? void 0 : _this$store$currentPr5.getOtherParams()['timeSlotBySchedule'];
2850
2850
  if (!cache) {
2851
- _context32.next = 15;
2851
+ _context32.next = 16;
2852
2852
  break;
2853
2853
  }
2854
2854
  if (!(dayjs(params.startDate).isSameOrAfter(dayjs(cache.startDate), 'day') && dayjs(params.endDate).isSameOrBefore(dayjs(cache.endDate), 'day'))) {
2855
- _context32.next = 15;
2855
+ _context32.next = 16;
2856
2856
  break;
2857
2857
  }
2858
+ this.store.date.setDateList(cache.dateList);
2858
2859
  return _context32.abrupt("return", {
2859
2860
  dateList: cache.dateList,
2860
2861
  firstAvailableDate: cache.firstAvailableDate
2861
2862
  });
2862
- case 15:
2863
+ case 16:
2863
2864
  // 2. 商品 schedule 数据,确定日程在每一天的时间片
2864
2865
  // 3. 把后端返回的和 schedule 的数据进行合并,确定每一天的可用和使用情况
2865
2866
  dates = [];
@@ -2986,22 +2987,22 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2986
2987
  }
2987
2988
  }, _loop3);
2988
2989
  });
2989
- case 23:
2990
+ case 24:
2990
2991
  if (!(dayjs(currentDate).isBefore(dayjs(endDate), 'day') || dayjs(currentDate).isSame(dayjs(endDate), 'day'))) {
2991
- _context32.next = 29;
2992
+ _context32.next = 30;
2992
2993
  break;
2993
2994
  }
2994
- return _context32.delegateYield(_loop3(), "t0", 25);
2995
- case 25:
2995
+ return _context32.delegateYield(_loop3(), "t0", 26);
2996
+ case 26:
2996
2997
  if (!_context32.t0) {
2997
- _context32.next = 27;
2998
+ _context32.next = 28;
2998
2999
  break;
2999
3000
  }
3000
- return _context32.abrupt("break", 29);
3001
- case 27:
3002
- _context32.next = 23;
3001
+ return _context32.abrupt("break", 30);
3002
+ case 28:
3003
+ _context32.next = 24;
3003
3004
  break;
3004
- case 29:
3005
+ case 30:
3005
3006
  // 最终把资源数据也加到日期内
3006
3007
  dates = handleAvailableDateByResource(res.data, dates);
3007
3008
  this.store.date.setDateList(dates);
@@ -3017,7 +3018,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
3017
3018
  dateList: dates,
3018
3019
  firstAvailableDate: firstAvailableDate
3019
3020
  });
3020
- case 33:
3021
+ case 34:
3021
3022
  case "end":
3022
3023
  return _context32.stop();
3023
3024
  }
@@ -2010,6 +2010,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
2010
2010
  const cache = (_c = this.store.currentProduct) == null ? void 0 : _c.getOtherParams()["timeSlotBySchedule"];
2011
2011
  if (cache) {
2012
2012
  if ((0, import_dayjs.default)(params.startDate).isSameOrAfter((0, import_dayjs.default)(cache.startDate), "day") && (0, import_dayjs.default)(params.endDate).isSameOrBefore((0, import_dayjs.default)(cache.endDate), "day")) {
2013
+ this.store.date.setDateList(cache.dateList);
2013
2014
  return {
2014
2015
  dateList: cache.dateList,
2015
2016
  firstAvailableDate: cache.firstAvailableDate
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.0.31",
4
+ "version": "2.0.32",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",