@pisell/pisellos 0.0.293 → 0.0.294
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.
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
};
|
|
327
327
|
setOtherData(key: string, value: any): void;
|
|
328
328
|
getOtherData(key: string): any;
|
|
329
|
-
getProductTypeById(id: number): Promise<"
|
|
329
|
+
getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
|
|
330
330
|
/**
|
|
331
331
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
332
332
|
*
|
|
@@ -2601,17 +2601,21 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2601
2601
|
});
|
|
2602
2602
|
// 这里为什么要设置个 map,因为有可能日程有重叠,所以要把重叠的 event_list 去除
|
|
2603
2603
|
var mSet = new Map();
|
|
2604
|
-
|
|
2605
|
-
//
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2604
|
+
mTimes.forEach(function (n) {
|
|
2605
|
+
// acc += n.event_list?.reduce((acc: any, curr: any) => acc + curr.pax, 0);
|
|
2606
|
+
// mSet.set(n)
|
|
2607
|
+
n.event_list.forEach(function (m) {
|
|
2608
|
+
// 需要确认 m 的时间段是否和 item 的时间段有交集
|
|
2609
|
+
if (isConflict({
|
|
2610
|
+
start_at: m.start_at,
|
|
2611
|
+
end_at: m.end_at
|
|
2612
|
+
}, {
|
|
2613
|
+
start_at: dayjs(item.start),
|
|
2614
|
+
end_at: dayjs(item.end)
|
|
2615
|
+
})) {
|
|
2616
|
+
mSet.set(m.id, m.pax || 1);
|
|
2617
|
+
}
|
|
2618
|
+
});
|
|
2615
2619
|
});
|
|
2616
2620
|
acc += Array.from(mSet.values()).reduce(function (acc, curr) {
|
|
2617
2621
|
return acc + curr;
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
};
|
|
327
327
|
setOtherData(key: string, value: any): void;
|
|
328
328
|
getOtherData(key: string): any;
|
|
329
|
-
getProductTypeById(id: number): Promise<"
|
|
329
|
+
getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
|
|
330
330
|
/**
|
|
331
331
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
332
332
|
*
|
|
@@ -1829,13 +1829,15 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
1829
1829
|
return !(0, import_dayjs.default)(n2.start_at).isAfter((0, import_dayjs.default)(item.start), "minute") && !(0, import_dayjs.default)(n2.end_at).isBefore((0, import_dayjs.default)(item.end), "minute") || (0, import_dayjs.default)(n2.start_at).isBefore((0, import_dayjs.default)(item.end), "minute") && (0, import_dayjs.default)(n2.end_at).isAfter((0, import_dayjs.default)(item.start), "minute");
|
|
1830
1830
|
});
|
|
1831
1831
|
const mSet = /* @__PURE__ */ new Map();
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1832
|
+
mTimes.forEach((n2) => {
|
|
1833
|
+
n2.event_list.forEach((m) => {
|
|
1834
|
+
if ((0, import_resources.isConflict)(
|
|
1835
|
+
{ start_at: m.start_at, end_at: m.end_at },
|
|
1836
|
+
{ start_at: (0, import_dayjs.default)(item.start), end_at: (0, import_dayjs.default)(item.end) }
|
|
1837
|
+
)) {
|
|
1838
|
+
mSet.set(m.id, m.pax || 1);
|
|
1839
|
+
}
|
|
1840
|
+
});
|
|
1839
1841
|
});
|
|
1840
1842
|
acc += Array.from(mSet.values()).reduce((acc2, curr2) => acc2 + curr2, 0);
|
|
1841
1843
|
return acc;
|