@pisell/pisellos 3.0.67 → 3.0.68
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.
|
@@ -24,8 +24,9 @@ export var formatDefaultCapacitys = function formatDefaultCapacitys(_ref) {
|
|
|
24
24
|
if ((capacity === null || capacity === void 0 ? void 0 : capacity.type) === 'package') {
|
|
25
25
|
return (product_bundle || []).map(function (d) {
|
|
26
26
|
var id = d.bundle_product_id;
|
|
27
|
+
var variantId = d.bundle_variant_id;
|
|
27
28
|
var item = ((capacity === null || capacity === void 0 ? void 0 : capacity.package) || []).find(function (item) {
|
|
28
|
-
return item.product_id === id;
|
|
29
|
+
return item.product_id === id || item.product_id === variantId;
|
|
29
30
|
});
|
|
30
31
|
return {
|
|
31
32
|
id: id,
|
|
@@ -343,8 +344,7 @@ export function checkTimeSlotCapacity(timeSlotStart, timeSlotEnd, cartItems, all
|
|
|
343
344
|
resourcesInType.forEach(function (resource) {
|
|
344
345
|
// 过滤出在时间段内的资源时间片
|
|
345
346
|
var availableTimes = resource.times.filter(function (time) {
|
|
346
|
-
|
|
347
|
-
return !dayjs(time.start_at).isAfter(dayjs(timeSlotStart), 'minute') && !dayjs(time.end_at).isBefore(dayjs(timeSlotEnd), 'minute') || dayjs(time.start_at).isBefore(dayjs(timeSlotEnd), 'minute') && dayjs(time.end_at).isAfter(dayjs(timeSlotStart), 'minute') && ((_time$event_list = time.event_list) === null || _time$event_list === void 0 ? void 0 : _time$event_list.length) === 0;
|
|
347
|
+
return !dayjs(time.start_at).isAfter(dayjs(timeSlotStart), 'minute') && !dayjs(time.end_at).isBefore(dayjs(timeSlotEnd), 'minute') || dayjs(time.start_at).isBefore(dayjs(timeSlotEnd), 'minute') && dayjs(time.end_at).isAfter(dayjs(timeSlotStart), 'minute');
|
|
348
348
|
});
|
|
349
349
|
if (availableTimes.length > 0) {
|
|
350
350
|
availableResourceCount++;
|
|
@@ -47,8 +47,9 @@ var formatDefaultCapacitys = ({
|
|
|
47
47
|
if ((capacity == null ? void 0 : capacity.type) === "package") {
|
|
48
48
|
return (product_bundle || []).map((d) => {
|
|
49
49
|
const id = d.bundle_product_id;
|
|
50
|
+
const variantId = d.bundle_variant_id;
|
|
50
51
|
const item = ((capacity == null ? void 0 : capacity.package) || []).find(
|
|
51
|
-
(item2) => item2.product_id === id
|
|
52
|
+
(item2) => item2.product_id === id || item2.product_id === variantId
|
|
52
53
|
);
|
|
53
54
|
return {
|
|
54
55
|
id,
|
|
@@ -248,8 +249,7 @@ function checkTimeSlotCapacity(timeSlotStart, timeSlotEnd, cartItems, allResourc
|
|
|
248
249
|
let availableResourceCount = 0;
|
|
249
250
|
resourcesInType.forEach((resource) => {
|
|
250
251
|
const availableTimes = resource.times.filter((time) => {
|
|
251
|
-
|
|
252
|
-
return !(0, import_dayjs.default)(time.start_at).isAfter((0, import_dayjs.default)(timeSlotStart), "minute") && !(0, import_dayjs.default)(time.end_at).isBefore((0, import_dayjs.default)(timeSlotEnd), "minute") || (0, import_dayjs.default)(time.start_at).isBefore((0, import_dayjs.default)(timeSlotEnd), "minute") && (0, import_dayjs.default)(time.end_at).isAfter((0, import_dayjs.default)(timeSlotStart), "minute") && ((_a2 = time.event_list) == null ? void 0 : _a2.length) === 0;
|
|
252
|
+
return !(0, import_dayjs.default)(time.start_at).isAfter((0, import_dayjs.default)(timeSlotStart), "minute") && !(0, import_dayjs.default)(time.end_at).isBefore((0, import_dayjs.default)(timeSlotEnd), "minute") || (0, import_dayjs.default)(time.start_at).isBefore((0, import_dayjs.default)(timeSlotEnd), "minute") && (0, import_dayjs.default)(time.end_at).isAfter((0, import_dayjs.default)(timeSlotStart), "minute");
|
|
253
253
|
});
|
|
254
254
|
if (availableTimes.length > 0) {
|
|
255
255
|
availableResourceCount++;
|