@pisell/pisellos 2.0.45 → 2.0.46

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.
@@ -272,7 +272,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
272
272
  value: (function () {
273
273
  var _loadProductByScheduleDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref2) {
274
274
  var _schedule$product_ids;
275
- var date, _ref2$product_ids, product_ids, _ref2$category_ids, category_ids, scheduleList, schedule, otherProductsIds, allProductIds;
275
+ var date, _ref2$product_ids, product_ids, _ref2$category_ids, category_ids, scheduleList, newProductIds, schedule, otherProductsIds, allProductIds;
276
276
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
277
277
  while (1) switch (_context3.prev = _context3.next) {
278
278
  case 0:
@@ -289,27 +289,38 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
289
289
  week: '',
290
290
  weekNum: 0
291
291
  }]);
292
+ newProductIds = []; // const scheduleIds = scheduleList
293
+ // .filter((n) => n.date === date)
294
+ // .flatMap((n) => n.schedule_id)
295
+ // .filter((n) => n !== null && n !== undefined);
296
+ // 如果外面没传 product_ids,尝试从对应 schedule 里拿 product_ids
297
+ // if (!product_ids?.length) {
298
+ // const schedule = scheduleList.find((n) => n.date === date);
299
+ // if (schedule && schedule.product_ids?.length) {
300
+ // product_ids = schedule.product_ids;
301
+ // }
302
+ // }
292
303
  // V2接口修改后,只能从schedule 接口里拿数据,不可以从外面拿,外面给的是装修数据
293
304
  schedule = scheduleList.find(function (n) {
294
305
  return n.date === date;
295
306
  });
296
307
  if (schedule && (_schedule$product_ids = schedule.product_ids) !== null && _schedule$product_ids !== void 0 && _schedule$product_ids.length) {
297
- product_ids = schedule.product_ids;
308
+ newProductIds = schedule.product_ids;
298
309
  }
299
310
  // 尝试去拿schedule 里的 other_product_ids 和 product_ids 拼在一起去重
300
311
  otherProductsIds = this.store.schedule.getOtherProductsIds() || [];
301
- allProductIds = [].concat(_toConsumableArray(product_ids), _toConsumableArray(otherProductsIds)).filter(function (n, index, self) {
312
+ allProductIds = [].concat(_toConsumableArray(newProductIds), _toConsumableArray(otherProductsIds)).filter(function (n, index, self) {
302
313
  return self.indexOf(n) === index;
303
314
  });
304
- _context3.next = 9;
315
+ _context3.next = 10;
305
316
  return this.loadProducts({
306
317
  product_ids: allProductIds,
307
318
  category_ids: category_ids,
308
319
  schedule_date: date
309
320
  });
310
- case 9:
311
- return _context3.abrupt("return", _context3.sent);
312
321
  case 10:
322
+ return _context3.abrupt("return", _context3.sent);
323
+ case 11:
313
324
  case "end":
314
325
  return _context3.stop();
315
326
  }
@@ -217,12 +217,13 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
217
217
  { date, status: "available", week: "", weekNum: 0 },
218
218
  { date, status: "available", week: "", weekNum: 0 }
219
219
  ]);
220
+ let newProductIds = [];
220
221
  const schedule = scheduleList.find((n) => n.date === date);
221
222
  if (schedule && ((_a = schedule.product_ids) == null ? void 0 : _a.length)) {
222
- product_ids = schedule.product_ids;
223
+ newProductIds = schedule.product_ids;
223
224
  }
224
225
  const otherProductsIds = this.store.schedule.getOtherProductsIds() || [];
225
- const allProductIds = [...product_ids, ...otherProductsIds].filter(
226
+ const allProductIds = [...newProductIds, ...otherProductsIds].filter(
226
227
  (n, index, self) => self.indexOf(n) === index
227
228
  );
228
229
  return await this.loadProducts({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.0.45",
4
+ "version": "2.0.46",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",