@pisell/pisellos 0.0.64 → 0.0.65
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.
|
@@ -44,9 +44,10 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
44
44
|
collection?: number | string[];
|
|
45
45
|
schedule_ids?: number[];
|
|
46
46
|
}): Promise<any>;
|
|
47
|
-
loadProductByScheduleDate({ date, product_ids, }: {
|
|
47
|
+
loadProductByScheduleDate({ date, product_ids, category_ids, }: {
|
|
48
48
|
date: string;
|
|
49
49
|
product_ids?: number[];
|
|
50
|
+
category_ids?: number[];
|
|
50
51
|
}): Promise<any>;
|
|
51
52
|
loadAllSchedule(): Promise<void>;
|
|
52
53
|
loadScheduleAvailableDate({ startDate, endDate, custom_page_id, }: {
|
|
@@ -243,11 +243,11 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
243
243
|
key: "loadProductByScheduleDate",
|
|
244
244
|
value: function () {
|
|
245
245
|
var _loadProductByScheduleDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref2) {
|
|
246
|
-
var date, product_ids, scheduleList, scheduleIds;
|
|
246
|
+
var date, product_ids, _ref2$category_ids, category_ids, scheduleList, scheduleIds;
|
|
247
247
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
248
248
|
while (1) switch (_context3.prev = _context3.next) {
|
|
249
249
|
case 0:
|
|
250
|
-
date = _ref2.date, product_ids = _ref2.product_ids;
|
|
250
|
+
date = _ref2.date, product_ids = _ref2.product_ids, _ref2$category_ids = _ref2.category_ids, category_ids = _ref2$category_ids === void 0 ? [] : _ref2$category_ids;
|
|
251
251
|
scheduleList = this.store.schedule.getAvailabilityScheduleDateList(); // 缓存下这次选择的结果,如果是先选日期再选 duration 类商品,后面用得到
|
|
252
252
|
this.setDateRange([{
|
|
253
253
|
date: date,
|
|
@@ -268,7 +268,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
268
268
|
_context3.next = 6;
|
|
269
269
|
return this.loadProducts({
|
|
270
270
|
schedule_ids: scheduleIds,
|
|
271
|
-
product_ids: product_ids
|
|
271
|
+
product_ids: product_ids,
|
|
272
|
+
category_ids: category_ids
|
|
272
273
|
});
|
|
273
274
|
case 6:
|
|
274
275
|
return _context3.abrupt("return", _context3.sent);
|
|
@@ -44,9 +44,10 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
44
44
|
collection?: number | string[];
|
|
45
45
|
schedule_ids?: number[];
|
|
46
46
|
}): Promise<any>;
|
|
47
|
-
loadProductByScheduleDate({ date, product_ids, }: {
|
|
47
|
+
loadProductByScheduleDate({ date, product_ids, category_ids, }: {
|
|
48
48
|
date: string;
|
|
49
49
|
product_ids?: number[];
|
|
50
|
+
category_ids?: number[];
|
|
50
51
|
}): Promise<any>;
|
|
51
52
|
loadAllSchedule(): Promise<void>;
|
|
52
53
|
loadScheduleAvailableDate({ startDate, endDate, custom_page_id, }: {
|
|
@@ -187,7 +187,8 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
187
187
|
}
|
|
188
188
|
async loadProductByScheduleDate({
|
|
189
189
|
date,
|
|
190
|
-
product_ids
|
|
190
|
+
product_ids,
|
|
191
|
+
category_ids = []
|
|
191
192
|
}) {
|
|
192
193
|
const scheduleList = this.store.schedule.getAvailabilityScheduleDateList();
|
|
193
194
|
this.setDateRange([
|
|
@@ -195,7 +196,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
195
196
|
{ date, status: "available", week: "", weekNum: 0 }
|
|
196
197
|
]);
|
|
197
198
|
const scheduleIds = scheduleList.filter((n) => n.date === date).flatMap((n) => n.schedule_id);
|
|
198
|
-
return await this.loadProducts({ schedule_ids: scheduleIds, product_ids });
|
|
199
|
+
return await this.loadProducts({ schedule_ids: scheduleIds, product_ids, category_ids });
|
|
199
200
|
}
|
|
200
201
|
// 加载当前店铺下所有 schedule
|
|
201
202
|
async loadAllSchedule() {
|