@pisell/pisellos 3.0.3 → 3.0.5

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.
@@ -146,7 +146,7 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
146
146
  case 5:
147
147
  // 1.生成当前月份的所有日期,默认都是可用的
148
148
  dates = generateMonthDates(start_date, end_date); // 如果没有资源或者结束日期在今天之前,则所有日期均不可用
149
- if (!(!(resource_ids !== null && resource_ids !== void 0 && resource_ids.length) || dayjs(end_date).isBefore(dayjs()))) {
149
+ if (!(!(resource_ids !== null && resource_ids !== void 0 && resource_ids.length) || dayjs(end_date).isBefore(dayjs().startOf('day')))) {
150
150
  _context4.next = 8;
151
151
  break;
152
152
  }
@@ -681,6 +681,12 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
681
681
  key: "updateCart",
682
682
  value: function updateCart(params) {
683
683
  var _this5 = this;
684
+ if (params.resources) {
685
+ params.resources = params.resources.map(function (n) {
686
+ n.capacity = 1;
687
+ return n;
688
+ });
689
+ }
684
690
  this.store.cart.updateItem(params);
685
691
  var targetCartItem = this.store.cart.getItem(params._id);
686
692
  if (!targetCartItem) {
@@ -85,7 +85,7 @@ var DateModule = class extends import_BaseModule.BaseModule {
85
85
  return [];
86
86
  }
87
87
  let dates = (0, import_utils.generateMonthDates)(start_date, end_date);
88
- if (!(resource_ids == null ? void 0 : resource_ids.length) || (0, import_dayjs.default)(end_date).isBefore((0, import_dayjs.default)())) {
88
+ if (!(resource_ids == null ? void 0 : resource_ids.length) || (0, import_dayjs.default)(end_date).isBefore((0, import_dayjs.default)().startOf("day"))) {
89
89
  return (0, import_utils.disableAllDates)(dates);
90
90
  }
91
91
  try {
@@ -295,6 +295,12 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
295
295
  }
296
296
  // 更新购物车
297
297
  updateCart(params) {
298
+ if (params.resources) {
299
+ params.resources = params.resources.map((n) => {
300
+ n.capacity = 1;
301
+ return n;
302
+ });
303
+ }
298
304
  this.store.cart.updateItem(params);
299
305
  const targetCartItem = this.store.cart.getItem(params._id);
300
306
  if (!targetCartItem) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "3.0.3",
4
+ "version": "3.0.5",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",