@pisell/pisellos 2.3.38 → 2.3.40
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.
- package/dist/core/index.d.ts +0 -2
- package/dist/core/index.js +0 -7
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -4
- package/dist/model/strategy/adapter/promotion/adapter.js +0 -23
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
- package/dist/model/strategy/adapter/promotion/evaluator.js +6 -279
- package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -86
- package/dist/model/strategy/adapter/promotion/examples.js +0 -99
- package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/dist/model/strategy/adapter/promotion/type.d.ts +2 -90
- package/dist/model/strategy/adapter/promotion/type.js +0 -45
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -5
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +3 -6
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +40 -11
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/Holder/index.d.ts +48 -0
- package/dist/modules/Holder/index.js +640 -0
- package/dist/modules/Holder/types.d.ts +123 -0
- package/dist/modules/Holder/types.js +1 -0
- package/dist/modules/Holder/utils.d.ts +13 -0
- package/dist/modules/Holder/utils.js +34 -0
- package/dist/modules/OpenData/index.d.ts +0 -2
- package/dist/modules/OpenData/index.js +2 -10
- package/dist/modules/Order/index.d.ts +11 -28
- package/dist/modules/Order/index.js +509 -750
- package/dist/modules/Order/types.d.ts +10 -33
- package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +41 -13
- package/dist/modules/Payment/index.d.ts +0 -2
- package/dist/modules/Payment/index.js +50 -79
- package/dist/modules/Payment/types.d.ts +28 -99
- package/dist/modules/Payment/types.js +3 -20
- package/dist/modules/Payment/walletpass.d.ts +1 -25
- package/dist/modules/Payment/walletpass.js +157 -707
- package/dist/modules/Product/types.d.ts +1 -0
- package/dist/modules/ProductList/index.js +33 -14
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.d.ts +0 -1
- package/dist/modules/Rules/index.js +96 -89
- package/dist/modules/SalesSummary/index.js +12 -13
- package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/index.js +15 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
- package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +3 -1
- package/dist/modules/Schedule/index.js +21 -16
- package/dist/modules/Summary/utils.js +38 -13
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/window.d.ts +1 -0
- package/dist/server/index.d.ts +14 -16
- package/dist/server/index.js +1148 -1930
- package/dist/server/modules/order/index.d.ts +4 -54
- package/dist/server/modules/order/index.js +695 -1595
- package/dist/server/modules/order/types.d.ts +3 -11
- package/dist/server/modules/order/types.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +20 -109
- package/dist/solution/BaseSales/index.js +481 -1797
- package/dist/solution/BaseSales/types.d.ts +0 -52
- package/dist/solution/BaseSales/types.js +1 -2
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
- package/dist/solution/BaseSales/utils/cartPromotion.js +31 -90
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/dist/solution/BookingByStep/index.d.ts +17 -2
- package/dist/solution/BookingByStep/index.js +294 -215
- package/dist/solution/BookingByStep/types.d.ts +2 -1
- package/dist/solution/BookingByStep/types.js +3 -1
- package/dist/solution/BookingByStep/utils/capacity.js +17 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/BookingTicket/index.d.ts +4 -8
- package/dist/solution/BookingTicket/index.js +51 -134
- package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -6
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -8
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +82 -172
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
- package/dist/solution/Sales/index.d.ts +0 -1
- package/dist/solution/Sales/index.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +26 -14
- package/dist/solution/ScanOrder/index.js +1148 -756
- package/dist/solution/ScanOrder/types.d.ts +21 -1
- package/dist/solution/ScanOrder/utils.d.ts +8 -0
- package/dist/solution/ScanOrder/utils.js +66 -25
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +125 -87
- package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/dist/solution/UnifiedBookingSales/index.js +1871 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +39 -11
- package/dist/solution/VenueBooking/index.js +1176 -860
- package/dist/solution/VenueBooking/types.d.ts +3 -0
- package/dist/solution/VenueBooking/utils/resource.js +1 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/dist/types/index.d.ts +1 -1
- package/lib/core/index.d.ts +0 -2
- package/lib/core/index.js +0 -4
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -4
- package/lib/model/strategy/adapter/promotion/adapter.js +0 -20
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
- package/lib/model/strategy/adapter/promotion/evaluator.js +0 -235
- package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -86
- package/lib/model/strategy/adapter/promotion/examples.js +0 -91
- package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +0 -2
- package/lib/model/strategy/adapter/promotion/type.d.ts +2 -90
- package/lib/model/strategy/adapter/promotion/type.js +0 -2
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +1 -2
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +1 -2
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +9 -0
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/Holder/index.d.ts +48 -0
- package/lib/modules/Holder/index.js +402 -0
- package/lib/modules/Holder/types.d.ts +123 -0
- package/lib/modules/Holder/types.js +17 -0
- package/lib/modules/Holder/utils.d.ts +13 -0
- package/lib/modules/Holder/utils.js +71 -0
- package/lib/modules/OpenData/index.d.ts +0 -2
- package/lib/modules/OpenData/index.js +1 -6
- package/lib/modules/Order/index.d.ts +11 -28
- package/lib/modules/Order/index.js +86 -196
- package/lib/modules/Order/types.d.ts +10 -33
- package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +40 -16
- package/lib/modules/Payment/index.d.ts +0 -2
- package/lib/modules/Payment/index.js +13 -34
- package/lib/modules/Payment/types.d.ts +28 -99
- package/lib/modules/Payment/types.js +3 -4
- package/lib/modules/Payment/walletpass.d.ts +1 -25
- package/lib/modules/Payment/walletpass.js +21 -470
- package/lib/modules/Product/types.d.ts +1 -0
- package/lib/modules/ProductList/index.js +40 -31
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +148 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +933 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +17 -0
- package/lib/modules/Rules/index.d.ts +0 -1
- package/lib/modules/Rules/index.js +40 -47
- package/lib/modules/SalesSummary/index.js +6 -7
- package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/index.js +13 -1
- package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
- package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +3 -1
- package/lib/modules/Schedule/index.js +10 -8
- package/lib/modules/Summary/utils.js +21 -1
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/window.d.ts +1 -0
- package/lib/server/index.d.ts +14 -16
- package/lib/server/index.js +83 -675
- package/lib/server/modules/order/index.d.ts +4 -54
- package/lib/server/modules/order/index.js +66 -679
- package/lib/server/modules/order/types.d.ts +3 -11
- package/lib/solution/BaseSales/index.d.ts +20 -109
- package/lib/solution/BaseSales/index.js +70 -881
- package/lib/solution/BaseSales/types.d.ts +0 -52
- package/lib/solution/BaseSales/types.js +1 -2
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
- package/lib/solution/BaseSales/utils/cartPromotion.js +12 -63
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/lib/solution/BookingByStep/index.d.ts +17 -2
- package/lib/solution/BookingByStep/index.js +60 -18
- package/lib/solution/BookingByStep/types.d.ts +2 -1
- package/lib/solution/BookingByStep/types.js +5 -0
- package/lib/solution/BookingByStep/utils/capacity.js +20 -1
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/BookingTicket/index.d.ts +4 -8
- package/lib/solution/BookingTicket/index.js +19 -64
- package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -4
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -8
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +4 -36
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/Sales/index.d.ts +0 -1
- package/lib/solution/Sales/index.js +3 -5
- package/lib/solution/ScanOrder/index.d.ts +26 -14
- package/lib/solution/ScanOrder/index.js +449 -190
- package/lib/solution/ScanOrder/types.d.ts +21 -1
- package/lib/solution/ScanOrder/utils.d.ts +8 -0
- package/lib/solution/ScanOrder/utils.js +31 -0
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +14 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/lib/solution/UnifiedBookingSales/index.js +1076 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/lib/solution/UnifiedBookingSales/types.js +33 -0
- package/lib/solution/VenueBooking/index.d.ts +39 -11
- package/lib/solution/VenueBooking/index.js +328 -123
- package/lib/solution/VenueBooking/types.d.ts +3 -0
- package/lib/solution/VenueBooking/utils/resource.js +1 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +3 -1
- package/lib/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/modules/Order/payment-utils.d.ts +0 -26
- package/dist/modules/Order/payment-utils.js +0 -225
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
- package/dist/solution/BookingTicket/utils/weighingProductSku.js +0 -45
- package/dist/utils/payment-number.d.ts +0 -9
- package/dist/utils/payment-number.js +0 -69
- package/lib/modules/Order/payment-utils.d.ts +0 -26
- package/lib/modules/Order/payment-utils.js +0 -224
- package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
- package/lib/solution/BookingTicket/utils/weighingProductSku.js +0 -63
- package/lib/utils/payment-number.d.ts +0 -9
- package/lib/utils/payment-number.js +0 -64
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule } from '../../modules';
|
|
1
|
+
import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule, HolderModule } from '../../modules';
|
|
2
2
|
export interface BookingByStepState {
|
|
3
3
|
cart: CartModule;
|
|
4
4
|
summary: SummaryModule;
|
|
@@ -16,6 +16,7 @@ export interface BookingByStepState {
|
|
|
16
16
|
schedule: ScheduleModule;
|
|
17
17
|
salesSummary?: SalesSummaryModule;
|
|
18
18
|
scanOrderLogger?: ScanOrderLoggerModule;
|
|
19
|
+
holder: HolderModule;
|
|
19
20
|
}
|
|
20
21
|
export declare function createModule<T extends keyof BookingByStepState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingByStepState[T];
|
|
21
22
|
export declare enum BookingByStepHooks {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProductList, CartModule, AccountListModule, DateModule, OrderModule, PaymentModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule } from "../../modules";
|
|
1
|
+
import { ProductList, CartModule, AccountListModule, DateModule, OrderModule, PaymentModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule, HolderModule } from "../../modules";
|
|
2
2
|
export function createModule(moduleName, solutionName, name, version) {
|
|
3
3
|
switch (moduleName) {
|
|
4
4
|
case 'cart':
|
|
@@ -23,6 +23,8 @@ export function createModule(moduleName, solutionName, name, version) {
|
|
|
23
23
|
return new ScheduleModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
24
24
|
case 'scanOrderLogger':
|
|
25
25
|
return new ScanOrderLoggerModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
26
|
+
case 'holder':
|
|
27
|
+
return new HolderModule("".concat(solutionName, "_").concat(name || moduleName), version);
|
|
26
28
|
default:
|
|
27
29
|
throw new Error("Unknown module type: ".concat(moduleName));
|
|
28
30
|
}
|
|
@@ -23,11 +23,27 @@ export var formatDefaultCapacitys = function formatDefaultCapacitys(_ref) {
|
|
|
23
23
|
product_bundle = _ref.product_bundle;
|
|
24
24
|
if ((capacity === null || capacity === void 0 ? void 0 : capacity.type) === 'package') {
|
|
25
25
|
return (product_bundle || []).map(function (d) {
|
|
26
|
+
var _window;
|
|
26
27
|
var id = d.bundle_product_id;
|
|
27
28
|
var variantId = d.bundle_variant_id;
|
|
28
29
|
var item = ((capacity === null || capacity === void 0 ? void 0 : capacity.package) || []).find(function (item) {
|
|
29
|
-
return item.product_id
|
|
30
|
+
return item.product_id == id || item.product_id == variantId;
|
|
30
31
|
});
|
|
32
|
+
if (!item && (_window = window) !== null && _window !== void 0 && _window.sendWarningLog) {
|
|
33
|
+
window.sendWarningLog({
|
|
34
|
+
title: '未找到套餐 capacity 配置',
|
|
35
|
+
content: [{
|
|
36
|
+
key: 'product_id',
|
|
37
|
+
value: id
|
|
38
|
+
}, {
|
|
39
|
+
key: 'variant_id',
|
|
40
|
+
value: variantId
|
|
41
|
+
}, {
|
|
42
|
+
key: 'package',
|
|
43
|
+
value: JSON.stringify((capacity === null || capacity === void 0 ? void 0 : capacity.package) || [])
|
|
44
|
+
}]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
31
47
|
return {
|
|
32
48
|
id: id,
|
|
33
49
|
value: item ? d.num || 0 : 0,
|
|
@@ -19,10 +19,12 @@ export declare function calculateResourceAvailableTime({ resource, timeSlots, cu
|
|
|
19
19
|
* @param countMap 已预约数量映射
|
|
20
20
|
* @returns 最快可用的资源
|
|
21
21
|
*/
|
|
22
|
-
export declare function findFastestAvailableResource({ resources, currentCapacity, countMap, }: {
|
|
22
|
+
export declare function findFastestAvailableResource({ resources, currentCapacity, countMap, targetDate, durationMinutes, }: {
|
|
23
23
|
resources: ResourceItem[];
|
|
24
24
|
currentCapacity?: number;
|
|
25
25
|
countMap?: Record<number, number>;
|
|
26
|
+
targetDate?: string | Dayjs;
|
|
27
|
+
durationMinutes?: number;
|
|
26
28
|
}): ResourceItem | null;
|
|
27
29
|
/**
|
|
28
30
|
* 给定一个时间列表,通过开始和结束时间过滤出符合条件的时间段
|
|
@@ -91,8 +91,14 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
91
91
|
_ref2$currentCapacity = _ref2.currentCapacity,
|
|
92
92
|
currentCapacity = _ref2$currentCapacity === void 0 ? 1 : _ref2$currentCapacity,
|
|
93
93
|
_ref2$countMap = _ref2.countMap,
|
|
94
|
-
countMap = _ref2$countMap === void 0 ? {} : _ref2$countMap
|
|
94
|
+
countMap = _ref2$countMap === void 0 ? {} : _ref2$countMap,
|
|
95
|
+
targetDate = _ref2.targetDate,
|
|
96
|
+
_ref2$durationMinutes = _ref2.durationMinutes,
|
|
97
|
+
durationMinutes = _ref2$durationMinutes === void 0 ? 30 : _ref2$durationMinutes;
|
|
95
98
|
var currentTime = dayjs();
|
|
99
|
+
var resolvedDuration = durationMinutes > 0 ? durationMinutes : 30;
|
|
100
|
+
var targetDay = targetDate ? dayjs(targetDate) : currentTime;
|
|
101
|
+
var isTargetDayToday = targetDay.isSame(currentTime, 'day');
|
|
96
102
|
var fastestTime = null;
|
|
97
103
|
var fastestResources = [];
|
|
98
104
|
console.log('[TimeslotUtils] 查找最快可用资源:', {
|
|
@@ -108,17 +114,18 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
108
114
|
try {
|
|
109
115
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
110
116
|
var _resource = _step2.value;
|
|
111
|
-
//
|
|
112
|
-
var
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
// 获取资源在目标日期且还在工作时间内的时间段
|
|
118
|
+
var targetDayTimes = _resource.times.filter(function (time) {
|
|
119
|
+
var isSameTargetDay = dayjs(time.start_at).isSame(targetDay, 'day');
|
|
120
|
+
if (!isSameTargetDay) return false;
|
|
121
|
+
if (!isTargetDayToday) return true;
|
|
122
|
+
return dayjs(time.end_at).isAfter(currentTime);
|
|
116
123
|
});
|
|
117
|
-
if (
|
|
124
|
+
if (targetDayTimes.length === 0) {
|
|
118
125
|
console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, ") \u4ECA\u65E5\u65E0\u53EF\u7528\u65F6\u95F4\u6BB5"));
|
|
119
126
|
continue;
|
|
120
127
|
}
|
|
121
|
-
var _iterator4 = _createForOfIteratorHelper(
|
|
128
|
+
var _iterator4 = _createForOfIteratorHelper(targetDayTimes),
|
|
122
129
|
_step4;
|
|
123
130
|
try {
|
|
124
131
|
var _loop = function _loop() {
|
|
@@ -128,7 +135,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
128
135
|
var workEndTime = dayjs(time.end_at);
|
|
129
136
|
|
|
130
137
|
// 确定检查的起始时间(当前时间 vs 工作开始时间)
|
|
131
|
-
var nextAvailableTime = currentTime.
|
|
138
|
+
var nextAvailableTime = isTargetDayToday && currentTime.isAfter(workStartTime) ? currentTime : workStartTime;
|
|
132
139
|
console.log("[TimeslotUtils] \u68C0\u67E5\u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, "):"), {
|
|
133
140
|
workTime: "".concat(workStartTime.format('HH:mm'), "-").concat(workEndTime.format('HH:mm')),
|
|
134
141
|
checkStartTime: nextAvailableTime.format('HH:mm:ss'),
|
|
@@ -165,7 +172,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
165
172
|
// 检查资源类型和容量
|
|
166
173
|
if (_resource.resourceType === 'single' || (_resource.capacity || 1) === 1) {
|
|
167
174
|
// 单人预约资源:检查时间冲突
|
|
168
|
-
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(
|
|
175
|
+
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(resolvedDuration, 'minute'))) {
|
|
169
176
|
// 有冲突,使用事件结束时间
|
|
170
177
|
finalAvailableTime = _eventEnd;
|
|
171
178
|
console.log("[TimeslotUtils] \u53D1\u73B0\u65F6\u95F4\u51B2\u7A81\uFF0C\u8C03\u6574\u5230: ".concat(finalAvailableTime.format('HH:mm:ss')));
|
|
@@ -177,7 +184,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
177
184
|
var eventUsedCapacity = _event.pax || 1;
|
|
178
185
|
|
|
179
186
|
// 如果在事件时间范围内,检查容量是否足够
|
|
180
|
-
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(
|
|
187
|
+
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(resolvedDuration, 'minute'))) {
|
|
181
188
|
var totalRequiredCapacity = currentUsedCapacity + currentCapacity + eventUsedCapacity;
|
|
182
189
|
if (totalRequiredCapacity > totalCapacity) {
|
|
183
190
|
// 容量不足,使用事件结束时间
|
|
@@ -194,7 +201,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
194
201
|
} finally {
|
|
195
202
|
_iterator5.f();
|
|
196
203
|
}
|
|
197
|
-
if (finalAvailableTime.isAfter(workEndTime)) {
|
|
204
|
+
if (finalAvailableTime.add(resolvedDuration, 'minute').isAfter(workEndTime)) {
|
|
198
205
|
console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, " \u53EF\u7528\u65F6\u95F4\u8D85\u51FA\u5DE5\u4F5C\u65F6\u95F4\uFF0C\u8DF3\u8FC7"));
|
|
199
206
|
return 0; // continue
|
|
200
207
|
}
|
|
@@ -46,8 +46,6 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
46
46
|
private getIdGeneratorPlugin;
|
|
47
47
|
private loadOpenDataConfig;
|
|
48
48
|
getOpenData(): Promise<OpenDataConfig | null>;
|
|
49
|
-
/** 清除店铺级 OpenData;下一次 getOpenData 时会重新拉取。 */
|
|
50
|
-
clearOpenDataCache(): void;
|
|
51
49
|
private getShortNumberOrDeviceId;
|
|
52
50
|
private configureIdGeneratorFromOpenData;
|
|
53
51
|
private normalizePositiveInteger;
|
|
@@ -191,12 +189,10 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
191
189
|
*/
|
|
192
190
|
getCustomer(): ICustomer | null;
|
|
193
191
|
/**
|
|
194
|
-
* 通过 ids
|
|
195
|
-
*
|
|
192
|
+
* 通过 ids 获取商品列表(不加载到模块中)
|
|
193
|
+
* @returns 商品列表
|
|
196
194
|
*/
|
|
197
|
-
getProductByIds(ids: number[]
|
|
198
|
-
loadMissing?: boolean;
|
|
199
|
-
}): Promise<ProductData[]>;
|
|
195
|
+
getProductByIds(ids: number[]): Promise<ProductData[] | undefined>;
|
|
200
196
|
/**
|
|
201
197
|
* 获取日程时间段点
|
|
202
198
|
* @param params 参数
|
|
@@ -326,7 +322,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
326
322
|
* 获取当前的客户搜索条件
|
|
327
323
|
* @returns 当前搜索条件
|
|
328
324
|
*/
|
|
329
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
325
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
330
326
|
/**
|
|
331
327
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
332
328
|
* @returns 客户状态
|
|
@@ -337,10 +337,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
337
337
|
key: "getOpenData",
|
|
338
338
|
value: function () {
|
|
339
339
|
var _getOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
340
|
+
var _this$store$openData;
|
|
340
341
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
341
342
|
while (1) switch (_context3.prev = _context3.next) {
|
|
342
343
|
case 0:
|
|
343
|
-
return _context3.abrupt("return", this.
|
|
344
|
+
return _context3.abrupt("return", (_this$store$openData = this.store.openData) === null || _this$store$openData === void 0 ? void 0 : _this$store$openData.getOpenData());
|
|
344
345
|
case 1:
|
|
345
346
|
case "end":
|
|
346
347
|
return _context3.stop();
|
|
@@ -351,15 +352,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
351
352
|
return _getOpenData.apply(this, arguments);
|
|
352
353
|
}
|
|
353
354
|
return getOpenData;
|
|
354
|
-
}()
|
|
355
|
-
}, {
|
|
356
|
-
key: "clearOpenDataCache",
|
|
357
|
-
value: function clearOpenDataCache() {
|
|
358
|
-
var _this$store$openData;
|
|
359
|
-
this.loadOpenDataConfigInFlight = null;
|
|
360
|
-
this.otherParams.openData = null;
|
|
361
|
-
(_this$store$openData = this.store.openData) === null || _this$store$openData === void 0 || _this$store$openData.clearCache();
|
|
362
|
-
}
|
|
355
|
+
}()
|
|
363
356
|
}, {
|
|
364
357
|
key: "getShortNumberOrDeviceId",
|
|
365
358
|
value: function () {
|
|
@@ -404,52 +397,49 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
404
397
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
405
398
|
while (1) switch (_context5.prev = _context5.next) {
|
|
406
399
|
case 0:
|
|
407
|
-
// 业务码切换或配置失败时不能复用上一次初始化的短号。
|
|
408
|
-
this.setPaymentNumberDevicePrefix(null);
|
|
409
400
|
openDataConfig = null;
|
|
410
|
-
_context5.prev =
|
|
411
|
-
_context5.next =
|
|
401
|
+
_context5.prev = 1;
|
|
402
|
+
_context5.next = 4;
|
|
412
403
|
return this.loadOpenDataConfig();
|
|
413
|
-
case
|
|
404
|
+
case 4:
|
|
414
405
|
openDataConfig = _context5.sent;
|
|
415
|
-
_context5.next =
|
|
406
|
+
_context5.next = 11;
|
|
416
407
|
break;
|
|
417
|
-
case
|
|
418
|
-
_context5.prev =
|
|
419
|
-
_context5.t0 = _context5["catch"](
|
|
408
|
+
case 7:
|
|
409
|
+
_context5.prev = 7;
|
|
410
|
+
_context5.t0 = _context5["catch"](1);
|
|
420
411
|
console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context5.t0);
|
|
421
412
|
return _context5.abrupt("return");
|
|
422
|
-
case
|
|
413
|
+
case 11:
|
|
423
414
|
// if (!openDataConfig) return;
|
|
424
415
|
idGenerator = this.getIdGeneratorPlugin();
|
|
425
416
|
if (idGenerator !== null && idGenerator !== void 0 && idGenerator.configure) {
|
|
426
|
-
_context5.next =
|
|
417
|
+
_context5.next = 15;
|
|
427
418
|
break;
|
|
428
419
|
}
|
|
429
420
|
console.warn('[BookingTicket] idGenerator 插件不可用,跳过配置');
|
|
430
421
|
return _context5.abrupt("return");
|
|
431
|
-
case
|
|
422
|
+
case 15:
|
|
432
423
|
receiptSequenceLength = this.normalizePositiveInteger((_openDataConfig = openDataConfig) === null || _openDataConfig === void 0 ? void 0 : _openDataConfig['sale.short_number_digits'], 5);
|
|
433
424
|
receiptSequenceStart = this.normalizePositiveInteger((_openDataConfig2 = openDataConfig) === null || _openDataConfig2 === void 0 ? void 0 : _openDataConfig2['sale.short_number_start_number'], 1);
|
|
434
425
|
prefix = this.normalizeIdPrefix((_openDataConfig3 = openDataConfig) === null || _openDataConfig3 === void 0 ? void 0 : _openDataConfig3['sale.short_number_prefix'], '');
|
|
435
426
|
shopOrderPrefix = this.normalizeIdPrefix((_openDataConfig4 = openDataConfig) === null || _openDataConfig4 === void 0 ? void 0 : _openDataConfig4['sale.sale_number_prefix'], '');
|
|
436
427
|
resetReceiptSequenceDaily = typeof ((_openDataConfig5 = openDataConfig) === null || _openDataConfig5 === void 0 ? void 0 : _openDataConfig5['sale.short_number_daily_reset']) === 'boolean' ? (_openDataConfig6 = openDataConfig) === null || _openDataConfig6 === void 0 ? void 0 : _openDataConfig6['sale.short_number_daily_reset'] : false;
|
|
437
428
|
operatingDayBoundary = this.getAppData('operating_day_boundary');
|
|
438
|
-
_context5.next =
|
|
429
|
+
_context5.next = 23;
|
|
439
430
|
return this.getShortNumberOrDeviceId();
|
|
440
|
-
case
|
|
431
|
+
case 23:
|
|
441
432
|
deviceId = _context5.sent;
|
|
442
|
-
this.setPaymentNumberDevicePrefix(deviceId);
|
|
443
433
|
businessCode = this.getBookingTicketBusinessCode();
|
|
444
434
|
if (businessCode) {
|
|
445
|
-
_context5.next =
|
|
435
|
+
_context5.next = 28;
|
|
446
436
|
break;
|
|
447
437
|
}
|
|
448
438
|
console.warn('[BookingTicket] businessCode 缺失,跳过 idGenerator 配置');
|
|
449
439
|
return _context5.abrupt("return");
|
|
450
|
-
case
|
|
451
|
-
_context5.prev =
|
|
452
|
-
_context5.next =
|
|
440
|
+
case 28:
|
|
441
|
+
_context5.prev = 28;
|
|
442
|
+
_context5.next = 31;
|
|
453
443
|
return idGenerator.configure({
|
|
454
444
|
biz: businessCode,
|
|
455
445
|
config: {
|
|
@@ -464,18 +454,18 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
464
454
|
shopOrderPrefix: shopOrderPrefix
|
|
465
455
|
}
|
|
466
456
|
});
|
|
467
|
-
case
|
|
468
|
-
_context5.next =
|
|
457
|
+
case 31:
|
|
458
|
+
_context5.next = 36;
|
|
469
459
|
break;
|
|
470
|
-
case
|
|
471
|
-
_context5.prev =
|
|
472
|
-
_context5.t1 = _context5["catch"](
|
|
460
|
+
case 33:
|
|
461
|
+
_context5.prev = 33;
|
|
462
|
+
_context5.t1 = _context5["catch"](28);
|
|
473
463
|
console.warn('[BookingTicket] idGenerator 配置失败', _context5.t1);
|
|
474
|
-
case
|
|
464
|
+
case 36:
|
|
475
465
|
case "end":
|
|
476
466
|
return _context5.stop();
|
|
477
467
|
}
|
|
478
|
-
}, _callee5, this, [[
|
|
468
|
+
}, _callee5, this, [[1, 7], [28, 33]]);
|
|
479
469
|
}));
|
|
480
470
|
function configureIdGeneratorFromOpenData() {
|
|
481
471
|
return _configureIdGeneratorFromOpenData.apply(this, arguments);
|
|
@@ -1270,88 +1260,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1270
1260
|
}
|
|
1271
1261
|
|
|
1272
1262
|
/**
|
|
1273
|
-
* 通过 ids
|
|
1274
|
-
*
|
|
1263
|
+
* 通过 ids 获取商品列表(不加载到模块中)
|
|
1264
|
+
* @returns 商品列表
|
|
1275
1265
|
*/
|
|
1276
1266
|
}, {
|
|
1277
1267
|
key: "getProductByIds",
|
|
1278
1268
|
value: (function () {
|
|
1279
|
-
var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(ids
|
|
1280
|
-
var _this$getOrderCustome, _this$getOrderCustome2, _this$getOrderCustome3;
|
|
1281
|
-
var normalizedIds, localProducts, localProductIds, missingIds, rawBookingDate, bookingDate, customerId, loadedProducts, productById;
|
|
1269
|
+
var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(ids) {
|
|
1282
1270
|
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1283
1271
|
while (1) switch (_context18.prev = _context18.next) {
|
|
1284
1272
|
case 0:
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
}).filter(function (id) {
|
|
1288
|
-
return Number.isFinite(id);
|
|
1289
|
-
})));
|
|
1290
|
-
_context18.next = 3;
|
|
1291
|
-
return this.store.products.getProductByIds(normalizedIds);
|
|
1292
|
-
case 3:
|
|
1293
|
-
_context18.t0 = _context18.sent;
|
|
1294
|
-
if (_context18.t0) {
|
|
1295
|
-
_context18.next = 6;
|
|
1296
|
-
break;
|
|
1297
|
-
}
|
|
1298
|
-
_context18.t0 = [];
|
|
1299
|
-
case 6:
|
|
1300
|
-
localProducts = _context18.t0;
|
|
1301
|
-
if (options !== null && options !== void 0 && options.loadMissing) {
|
|
1302
|
-
_context18.next = 9;
|
|
1303
|
-
break;
|
|
1304
|
-
}
|
|
1305
|
-
return _context18.abrupt("return", localProducts);
|
|
1306
|
-
case 9:
|
|
1307
|
-
localProductIds = new Set(localProducts.map(function (product) {
|
|
1308
|
-
return Number(product.id);
|
|
1309
|
-
}));
|
|
1310
|
-
missingIds = normalizedIds.filter(function (id) {
|
|
1311
|
-
return !localProductIds.has(id);
|
|
1312
|
-
});
|
|
1313
|
-
if (missingIds.length) {
|
|
1314
|
-
_context18.next = 13;
|
|
1315
|
-
break;
|
|
1316
|
-
}
|
|
1317
|
-
return _context18.abrupt("return", localProducts);
|
|
1318
|
-
case 13:
|
|
1319
|
-
rawBookingDate = this.getBookingDate();
|
|
1320
|
-
bookingDate = rawBookingDate && dayjs(rawBookingDate).isValid() ? dayjs(rawBookingDate) : null;
|
|
1321
|
-
customerId = Number((_this$getOrderCustome = (_this$getOrderCustome2 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome2 === void 0 ? void 0 : _this$getOrderCustome2.id) !== null && _this$getOrderCustome !== void 0 ? _this$getOrderCustome : (_this$getOrderCustome3 = this.getOrderCustomer()) === null || _this$getOrderCustome3 === void 0 ? void 0 : _this$getOrderCustome3.customer_id);
|
|
1322
|
-
_context18.next = 18;
|
|
1323
|
-
return this.store.products.loadProducts(_objectSpread(_objectSpread({
|
|
1324
|
-
product_ids: missingIds,
|
|
1325
|
-
with_count: ['bundleGroup', 'optionGroup'],
|
|
1326
|
-
with_schedule: 1,
|
|
1327
|
-
cacheId: this.cacheId
|
|
1328
|
-
}, bookingDate ? {
|
|
1329
|
-
schedule_date: bookingDate.format('YYYY-MM-DD'),
|
|
1330
|
-
schedule_datetime: bookingDate.format('YYYY-MM-DD HH:mm:ss')
|
|
1331
|
-
} : {}), Number.isFinite(customerId) && customerId > 0 ? {
|
|
1332
|
-
customer_id: customerId
|
|
1333
|
-
} : {}));
|
|
1334
|
-
case 18:
|
|
1335
|
-
loadedProducts = _context18.sent;
|
|
1336
|
-
productById = new Map();
|
|
1337
|
-
[].concat(_toConsumableArray(localProducts), _toConsumableArray(loadedProducts || [])).forEach(function (product) {
|
|
1338
|
-
var productId = Number(product.id);
|
|
1339
|
-
if (Number.isFinite(productId)) {
|
|
1340
|
-
productById.set(productId, product);
|
|
1341
|
-
}
|
|
1342
|
-
});
|
|
1343
|
-
return _context18.abrupt("return", normalizedIds.map(function (id) {
|
|
1344
|
-
return productById.get(id);
|
|
1345
|
-
}).filter(function (product) {
|
|
1346
|
-
return Boolean(product);
|
|
1347
|
-
}));
|
|
1348
|
-
case 22:
|
|
1273
|
+
return _context18.abrupt("return", this.store.products.getProductByIds(ids));
|
|
1274
|
+
case 1:
|
|
1349
1275
|
case "end":
|
|
1350
1276
|
return _context18.stop();
|
|
1351
1277
|
}
|
|
1352
1278
|
}, _callee18, this);
|
|
1353
1279
|
}));
|
|
1354
|
-
function getProductByIds(_x13
|
|
1280
|
+
function getProductByIds(_x13) {
|
|
1355
1281
|
return _getProductByIds.apply(this, arguments);
|
|
1356
1282
|
}
|
|
1357
1283
|
return getProductByIds;
|
|
@@ -1385,7 +1311,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1385
1311
|
}
|
|
1386
1312
|
}, _callee19, this);
|
|
1387
1313
|
}));
|
|
1388
|
-
function getScheduleTimePoints(
|
|
1314
|
+
function getScheduleTimePoints(_x14) {
|
|
1389
1315
|
return _getScheduleTimePoints.apply(this, arguments);
|
|
1390
1316
|
}
|
|
1391
1317
|
return getScheduleTimePoints;
|
|
@@ -1775,7 +1701,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1775
1701
|
}
|
|
1776
1702
|
}, _callee23, this, [[0, 7]]);
|
|
1777
1703
|
}));
|
|
1778
|
-
function changeCustomerPage(
|
|
1704
|
+
function changeCustomerPage(_x15, _x16) {
|
|
1779
1705
|
return _changeCustomerPage.apply(this, arguments);
|
|
1780
1706
|
}
|
|
1781
1707
|
return changeCustomerPage;
|
|
@@ -1898,7 +1824,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1898
1824
|
var localSearch = function localSearch(v) {
|
|
1899
1825
|
return _this5.store.products.findProductsByCodeOrBarcode(v);
|
|
1900
1826
|
};
|
|
1901
|
-
var scanCallback = handleGlobalScan(this.request, localSearch);
|
|
1827
|
+
var scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
|
|
1902
1828
|
var safeCallback = function safeCallback(d) {
|
|
1903
1829
|
try {
|
|
1904
1830
|
callback(d);
|
|
@@ -2067,8 +1993,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2067
1993
|
}, {
|
|
2068
1994
|
key: "getBookingConfig",
|
|
2069
1995
|
value: function getBookingConfig() {
|
|
2070
|
-
|
|
2071
|
-
return (_this$store$bookingCo = this.store.bookingContext) === null || _this$store$bookingCo === void 0 ? void 0 : _this$store$bookingCo.getBookingConfig();
|
|
1996
|
+
return this.store.bookingContext.getBookingConfig();
|
|
2072
1997
|
}
|
|
2073
1998
|
|
|
2074
1999
|
/** 写入资源全集(来源:`/form/schedule`),同步派生 resourcesOriginMap。 */
|
|
@@ -2229,10 +2154,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2229
2154
|
}, {
|
|
2230
2155
|
key: "buildAddProductCtx",
|
|
2231
2156
|
value: function buildAddProductCtx(extra) {
|
|
2232
|
-
var _extra$date2, _ref12, _this$
|
|
2157
|
+
var _extra$date2, _ref12, _this$getOrderCustome, _this$getOrderCustome2, _this$store$order$get4, _extra$presetStartTim2;
|
|
2233
2158
|
var bookingContextState = this.store.bookingContext.getState();
|
|
2234
2159
|
var date = (_extra$date2 = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date2 !== void 0 ? _extra$date2 : bookingContextState.date;
|
|
2235
|
-
var orderCustomerId = (_ref12 = (_this$
|
|
2160
|
+
var orderCustomerId = (_ref12 = (_this$getOrderCustome = (_this$getOrderCustome2 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome2 === void 0 ? void 0 : _this$getOrderCustome2.id) !== null && _this$getOrderCustome !== void 0 ? _this$getOrderCustome : (_this$store$order$get4 = this.store.order.getTempOrder()) === null || _this$store$order$get4 === void 0 ? void 0 : _this$store$order$get4.customer_id) !== null && _ref12 !== void 0 ? _ref12 : undefined;
|
|
2236
2161
|
return _objectSpread({
|
|
2237
2162
|
bookingConfig: bookingContextState.bookingConfig,
|
|
2238
2163
|
resourcesOrigin: bookingContextState.resourcesOrigin,
|
|
@@ -2349,7 +2274,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2349
2274
|
}
|
|
2350
2275
|
}, _callee27, this);
|
|
2351
2276
|
}));
|
|
2352
|
-
function updateProductInOrder(
|
|
2277
|
+
function updateProductInOrder(_x17) {
|
|
2353
2278
|
return _updateProductInOrder.apply(this, arguments);
|
|
2354
2279
|
}
|
|
2355
2280
|
return updateProductInOrder;
|
|
@@ -2392,7 +2317,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2392
2317
|
localSearch = function localSearch(v) {
|
|
2393
2318
|
return _this6.store.products.findProductsByCodeOrBarcode(v);
|
|
2394
2319
|
};
|
|
2395
|
-
scanCallback = handleGlobalScan(this.request, localSearch);
|
|
2320
|
+
scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
|
|
2396
2321
|
_context28.next = 9;
|
|
2397
2322
|
return scanCallback({
|
|
2398
2323
|
type: 'nativeScanner',
|
|
@@ -2437,12 +2362,6 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2437
2362
|
},
|
|
2438
2363
|
addProductToOrder: function addProductToOrder(product, booking) {
|
|
2439
2364
|
return _this6.addProductToOrder(product, booking);
|
|
2440
|
-
},
|
|
2441
|
-
refreshWalletAssets: function refreshWalletAssets(params) {
|
|
2442
|
-
return _this6.refreshWalletAssets(params);
|
|
2443
|
-
},
|
|
2444
|
-
scanWalletAsset: function scanWalletAsset(scanCode) {
|
|
2445
|
-
return _this6.scanWalletAsset(scanCode);
|
|
2446
2365
|
}
|
|
2447
2366
|
}, formatted, bridge);
|
|
2448
2367
|
case 16:
|
|
@@ -2464,7 +2383,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2464
2383
|
}
|
|
2465
2384
|
}, _callee28, this, [[4, 21]]);
|
|
2466
2385
|
}));
|
|
2467
|
-
function handleGlobalScanCode(
|
|
2386
|
+
function handleGlobalScanCode(_x18, _x19) {
|
|
2468
2387
|
return _handleGlobalScanCode.apply(this, arguments);
|
|
2469
2388
|
}
|
|
2470
2389
|
return handleGlobalScanCode;
|
|
@@ -2562,7 +2481,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2562
2481
|
}
|
|
2563
2482
|
}, _callee29, this);
|
|
2564
2483
|
}));
|
|
2565
|
-
function addAddTimeProductToBooking(
|
|
2484
|
+
function addAddTimeProductToBooking(_x20) {
|
|
2566
2485
|
return _addAddTimeProductToBooking.apply(this, arguments);
|
|
2567
2486
|
}
|
|
2568
2487
|
return addAddTimeProductToBooking;
|
|
@@ -2665,7 +2584,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2665
2584
|
}
|
|
2666
2585
|
}, _callee30, this, [[13, 31, 34, 37]]);
|
|
2667
2586
|
}));
|
|
2668
|
-
function addAddTimeProductsToBooking(
|
|
2587
|
+
function addAddTimeProductsToBooking(_x21) {
|
|
2669
2588
|
return _addAddTimeProductsToBooking.apply(this, arguments);
|
|
2670
2589
|
}
|
|
2671
2590
|
return addAddTimeProductsToBooking;
|
|
@@ -2682,24 +2601,22 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2682
2601
|
while (1) switch (_context31.prev = _context31.next) {
|
|
2683
2602
|
case 0:
|
|
2684
2603
|
_ref19 = _args31.length > 1 && _args31[1] !== undefined ? _args31[1] : {}, _ref19$cover = _ref19.cover, cover = _ref19$cover === void 0 ? false : _ref19$cover;
|
|
2685
|
-
|
|
2686
|
-
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
|
|
2604
|
+
_get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
|
|
2687
2605
|
cover: cover
|
|
2688
2606
|
});
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
_context31.next = 6;
|
|
2607
|
+
if (!(params !== null && params !== void 0 && params.businessCode)) {
|
|
2608
|
+
_context31.next = 5;
|
|
2692
2609
|
break;
|
|
2693
2610
|
}
|
|
2694
|
-
_context31.next =
|
|
2611
|
+
_context31.next = 5;
|
|
2695
2612
|
return this.configureIdGeneratorFromOpenData();
|
|
2696
|
-
case
|
|
2613
|
+
case 5:
|
|
2697
2614
|
case "end":
|
|
2698
2615
|
return _context31.stop();
|
|
2699
2616
|
}
|
|
2700
2617
|
}, _callee31, this);
|
|
2701
2618
|
}));
|
|
2702
|
-
function setOtherParams(
|
|
2619
|
+
function setOtherParams(_x22) {
|
|
2703
2620
|
return _setOtherParams.apply(this, arguments);
|
|
2704
2621
|
}
|
|
2705
2622
|
return setOtherParams;
|
|
@@ -2770,7 +2687,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2770
2687
|
}
|
|
2771
2688
|
}, _callee32, this);
|
|
2772
2689
|
}));
|
|
2773
|
-
function handlePrintWristband(
|
|
2690
|
+
function handlePrintWristband(_x23) {
|
|
2774
2691
|
return _handlePrintWristband.apply(this, arguments);
|
|
2775
2692
|
}
|
|
2776
2693
|
return handlePrintWristband;
|
|
@@ -2845,7 +2762,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2845
2762
|
}
|
|
2846
2763
|
}, _callee33, this);
|
|
2847
2764
|
}));
|
|
2848
|
-
function handleRedeem(
|
|
2765
|
+
function handleRedeem(_x24) {
|
|
2849
2766
|
return _handleRedeem.apply(this, arguments);
|
|
2850
2767
|
}
|
|
2851
2768
|
return handleRedeem;
|
|
@@ -7,7 +7,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import dayjs from 'dayjs';
|
|
8
8
|
import { cacheItemToBookingInput, derivePresetStartTimeFromDate, getProductExtend, getIsAutoClose, isSessionProduct, isBookingProduct, applySessionTimesToExtend, hasActualResourceSelection, productNeedsResourceExtend } from "../../../modules/BookingContext";
|
|
9
9
|
import { transformBaseProductToOrderProduct } from "../../BaseSales/utils/transformBaseProductToOrderProduct";
|
|
10
|
-
import { buildProductSkuFromCacheItem } from "./weighingProductSku";
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* cart.addProduct 两阶段决策(与 ticketBooking `handleSelectProduct` 对齐):
|
|
@@ -323,16 +322,11 @@ function buildBasePayloadFromCacheItem(cacheItem, ctx) {
|
|
|
323
322
|
var quantity = (ctx === null || ctx === void 0 ? void 0 : ctx.quantity) != null && ctx.quantity > 0 ? ctx.quantity : (_cacheItem$_extend$qu = cacheItem === null || cacheItem === void 0 || (_cacheItem$_extend2 = cacheItem._extend) === null || _cacheItem$_extend2 === void 0 ? void 0 : _cacheItem$_extend2.quantity) !== null && _cacheItem$_extend$qu !== void 0 ? _cacheItem$_extend$qu : 1;
|
|
324
323
|
var resolvedPid = (_cacheItem$product_id = cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.product_id) !== null && _cacheItem$product_id !== void 0 ? _cacheItem$product_id : cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.id;
|
|
325
324
|
var extend = (cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem._extend) || {};
|
|
326
|
-
var productSku = buildProductSkuFromCacheItem(cacheItem);
|
|
327
325
|
return {
|
|
328
326
|
id: (_cacheItem$id = cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.id) !== null && _cacheItem$id !== void 0 ? _cacheItem$id : cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.product_id,
|
|
329
327
|
product_id: resolvedPid,
|
|
330
328
|
variant_id: (_ref5 = (_other$product_varian = other === null || other === void 0 ? void 0 : other.product_variant_id) !== null && _other$product_varian !== void 0 ? _other$product_varian : other === null || other === void 0 ? void 0 : other.variant_id) !== null && _ref5 !== void 0 ? _ref5 : 0,
|
|
331
329
|
quantity: quantity,
|
|
332
|
-
// 规格弹窗本次选择是 option 权威源,避免目录/旧订单里的空 option 覆盖它。
|
|
333
|
-
product_sku: productSku ? _objectSpread(_objectSpread({}, productSku), {}, {
|
|
334
|
-
option: (other === null || other === void 0 ? void 0 : other.option) || []
|
|
335
|
-
}) : undefined,
|
|
336
330
|
option: (other === null || other === void 0 ? void 0 : other.option) || [],
|
|
337
331
|
bundle: (other === null || other === void 0 ? void 0 : other.bundle) || (extend === null || extend === void 0 || (_extend$skuValue = extend.skuValue) === null || _extend$skuValue === void 0 ? void 0 : _extend$skuValue.bundle) || (extend === null || extend === void 0 || (_extend$_skuValue = extend._skuValue) === null || _extend$_skuValue === void 0 ? void 0 : _extend$_skuValue.bundle) || [],
|
|
338
332
|
unique: other === null || other === void 0 ? void 0 : other.unique,
|
|
@@ -24,14 +24,6 @@ export interface GlobalScanApplyHost {
|
|
|
24
24
|
cacheItem: any;
|
|
25
25
|
};
|
|
26
26
|
addProductToOrder(product: any, booking?: any): Promise<any>;
|
|
27
|
-
refreshWalletAssets?(params?: {
|
|
28
|
-
preserveSelection?: boolean;
|
|
29
|
-
}): Promise<any>;
|
|
30
|
-
scanWalletAsset?(code: string): Promise<{
|
|
31
|
-
type: 'walletCode' | 'normalCode';
|
|
32
|
-
asset?: any;
|
|
33
|
-
selected: boolean;
|
|
34
|
-
}>;
|
|
35
27
|
}
|
|
36
28
|
/**
|
|
37
29
|
* 应用全局扫码格式化结果:设客户 / 加车 / 开单 / 弹窗链。
|