@pisell/pisellos 2.2.277 → 2.2.279

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.
Files changed (191) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  2. package/dist/modules/BaseModule.d.ts +1 -0
  3. package/dist/modules/BaseModule.js +24 -28
  4. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +7 -3
  5. package/dist/modules/BookingContext/utils/productExtend.js +5 -9
  6. package/dist/modules/BookingContext/utils/timeSlices.js +24 -3
  7. package/dist/modules/Customer/index.d.ts +4 -0
  8. package/dist/modules/Customer/index.js +91 -59
  9. package/dist/modules/Customer/types.d.ts +2 -0
  10. package/dist/modules/Discount/index.d.ts +1 -0
  11. package/dist/modules/Discount/index.js +40 -11
  12. package/dist/modules/Discount/types.d.ts +1 -0
  13. package/dist/modules/Holder/index.d.ts +48 -0
  14. package/dist/modules/Holder/index.js +640 -0
  15. package/dist/modules/Holder/types.d.ts +123 -0
  16. package/dist/modules/Holder/types.js +1 -0
  17. package/dist/modules/Holder/utils.d.ts +13 -0
  18. package/dist/modules/Holder/utils.js +34 -0
  19. package/dist/modules/OpenData/index.js +2 -2
  20. package/dist/modules/Order/index.d.ts +32 -4
  21. package/dist/modules/Order/index.js +868 -675
  22. package/dist/modules/Order/types.d.ts +22 -1
  23. package/dist/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
  24. package/dist/modules/Order/utils/discountProductLineIdentity.js +227 -0
  25. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
  26. package/dist/modules/Order/utils/orderCollectionIdentity.js +75 -0
  27. package/dist/modules/Order/utils.d.ts +10 -0
  28. package/dist/modules/Order/utils.js +71 -34
  29. package/dist/modules/Payment/index.d.ts +4 -0
  30. package/dist/modules/Payment/index.js +14 -4
  31. package/dist/modules/Payment/walletpass.js +48 -13
  32. package/dist/modules/Product/types.d.ts +1 -0
  33. package/dist/modules/ProductList/index.js +33 -13
  34. package/dist/modules/Quotation/index.d.ts +1 -1
  35. package/dist/modules/Quotation/index.js +2 -2
  36. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  37. package/dist/modules/ResourcePlanner/index.js +181 -0
  38. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  39. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  40. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  41. package/dist/modules/ResourcePlanner/types.js +1 -0
  42. package/dist/modules/Rules/index.js +153 -56
  43. package/dist/modules/SalesSummary/index.js +12 -13
  44. package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
  45. package/dist/modules/ScanOrderLogger/index.js +15 -2
  46. package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
  47. package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
  48. package/dist/modules/Schedule/index.d.ts +3 -1
  49. package/dist/modules/Schedule/index.js +21 -16
  50. package/dist/modules/Summary/utils.js +38 -13
  51. package/dist/modules/index.d.ts +2 -0
  52. package/dist/modules/index.js +3 -1
  53. package/dist/plugins/window.d.ts +1 -0
  54. package/dist/server/index.d.ts +20 -0
  55. package/dist/server/index.js +1101 -909
  56. package/dist/server/modules/order/index.d.ts +2 -0
  57. package/dist/server/modules/order/index.js +261 -96
  58. package/dist/server/modules/order/types.d.ts +1 -1
  59. package/dist/server/utils/small-ticket.js +2 -1
  60. package/dist/solution/BaseSales/index.d.ts +10 -1
  61. package/dist/solution/BaseSales/index.js +201 -148
  62. package/dist/solution/BaseSales/utils/cartPromotion.js +19 -1
  63. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
  64. package/dist/solution/BaseSales/utils.js +31 -20
  65. package/dist/solution/BookingByStep/index.d.ts +16 -1
  66. package/dist/solution/BookingByStep/index.js +294 -215
  67. package/dist/solution/BookingByStep/types.d.ts +2 -1
  68. package/dist/solution/BookingByStep/types.js +3 -1
  69. package/dist/solution/BookingByStep/utils/capacity.js +17 -1
  70. package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  71. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  72. package/dist/solution/BookingTicket/index.d.ts +6 -2
  73. package/dist/solution/BookingTicket/index.js +125 -77
  74. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  75. package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
  76. package/dist/solution/ScanOrder/index.d.ts +26 -14
  77. package/dist/solution/ScanOrder/index.js +1142 -739
  78. package/dist/solution/ScanOrder/types.d.ts +21 -1
  79. package/dist/solution/ScanOrder/utils.d.ts +8 -0
  80. package/dist/solution/ScanOrder/utils.js +97 -45
  81. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  82. package/dist/solution/ShopDiscount/index.js +125 -87
  83. package/dist/solution/UnifiedBookingSales/index.d.ts +204 -0
  84. package/dist/solution/UnifiedBookingSales/index.js +2211 -0
  85. package/dist/solution/UnifiedBookingSales/types.d.ts +150 -0
  86. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  87. package/dist/solution/VenueBooking/index.d.ts +39 -11
  88. package/dist/solution/VenueBooking/index.js +1167 -841
  89. package/dist/solution/VenueBooking/types.d.ts +3 -0
  90. package/dist/solution/VenueBooking/utils/resource.js +1 -0
  91. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  92. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
  93. package/dist/solution/index.d.ts +1 -0
  94. package/dist/solution/index.js +2 -1
  95. package/dist/types/index.d.ts +1 -0
  96. package/lib/model/strategy/adapter/promotion/index.js +51 -0
  97. package/lib/modules/BaseModule.d.ts +1 -0
  98. package/lib/modules/BaseModule.js +24 -37
  99. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -0
  100. package/lib/modules/BookingContext/utils/productExtend.js +4 -3
  101. package/lib/modules/BookingContext/utils/timeSlices.js +18 -3
  102. package/lib/modules/Customer/index.d.ts +4 -0
  103. package/lib/modules/Customer/index.js +11 -0
  104. package/lib/modules/Customer/types.d.ts +2 -0
  105. package/lib/modules/Discount/index.d.ts +1 -0
  106. package/lib/modules/Discount/index.js +9 -0
  107. package/lib/modules/Discount/types.d.ts +1 -0
  108. package/lib/modules/Holder/index.d.ts +48 -0
  109. package/lib/modules/Holder/index.js +402 -0
  110. package/lib/modules/Holder/types.d.ts +123 -0
  111. package/lib/modules/Holder/types.js +17 -0
  112. package/lib/modules/Holder/utils.d.ts +13 -0
  113. package/lib/modules/Holder/utils.js +71 -0
  114. package/lib/modules/OpenData/index.js +1 -1
  115. package/lib/modules/Order/index.d.ts +32 -4
  116. package/lib/modules/Order/index.js +372 -156
  117. package/lib/modules/Order/types.d.ts +22 -1
  118. package/lib/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
  119. package/lib/modules/Order/utils/discountProductLineIdentity.js +170 -0
  120. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
  121. package/lib/modules/Order/utils/orderCollectionIdentity.js +70 -0
  122. package/lib/modules/Order/utils.d.ts +10 -0
  123. package/lib/modules/Order/utils.js +39 -6
  124. package/lib/modules/Payment/index.d.ts +4 -0
  125. package/lib/modules/Payment/index.js +7 -0
  126. package/lib/modules/Payment/walletpass.js +27 -1
  127. package/lib/modules/Product/types.d.ts +1 -0
  128. package/lib/modules/ProductList/index.js +49 -31
  129. package/lib/modules/Quotation/index.d.ts +1 -1
  130. package/lib/modules/Quotation/index.js +2 -2
  131. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  132. package/lib/modules/ResourcePlanner/index.js +148 -0
  133. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  134. package/lib/modules/ResourcePlanner/planner.js +933 -0
  135. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  136. package/lib/modules/ResourcePlanner/types.js +17 -0
  137. package/lib/modules/Rules/index.js +117 -25
  138. package/lib/modules/SalesSummary/index.js +6 -7
  139. package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
  140. package/lib/modules/ScanOrderLogger/index.js +13 -1
  141. package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
  142. package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
  143. package/lib/modules/Schedule/index.d.ts +3 -1
  144. package/lib/modules/Schedule/index.js +10 -8
  145. package/lib/modules/Summary/utils.js +21 -1
  146. package/lib/modules/index.d.ts +2 -0
  147. package/lib/modules/index.js +5 -1
  148. package/lib/plugins/window.d.ts +1 -0
  149. package/lib/server/index.d.ts +20 -0
  150. package/lib/server/index.js +124 -19
  151. package/lib/server/modules/order/index.d.ts +2 -0
  152. package/lib/server/modules/order/index.js +75 -5
  153. package/lib/server/modules/order/types.d.ts +1 -1
  154. package/lib/server/utils/small-ticket.js +1 -1
  155. package/lib/solution/BaseSales/index.d.ts +10 -1
  156. package/lib/solution/BaseSales/index.js +73 -29
  157. package/lib/solution/BaseSales/utils/cartPromotion.js +18 -0
  158. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -0
  159. package/lib/solution/BaseSales/utils.js +29 -18
  160. package/lib/solution/BookingByStep/index.d.ts +16 -1
  161. package/lib/solution/BookingByStep/index.js +60 -18
  162. package/lib/solution/BookingByStep/types.d.ts +2 -1
  163. package/lib/solution/BookingByStep/types.js +5 -0
  164. package/lib/solution/BookingByStep/utils/capacity.js +20 -1
  165. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  166. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  167. package/lib/solution/BookingTicket/index.d.ts +6 -2
  168. package/lib/solution/BookingTicket/index.js +63 -16
  169. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  170. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  171. package/lib/solution/ScanOrder/index.d.ts +26 -14
  172. package/lib/solution/ScanOrder/index.js +449 -182
  173. package/lib/solution/ScanOrder/types.d.ts +21 -1
  174. package/lib/solution/ScanOrder/utils.d.ts +8 -0
  175. package/lib/solution/ScanOrder/utils.js +60 -18
  176. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  177. package/lib/solution/ShopDiscount/index.js +14 -0
  178. package/lib/solution/UnifiedBookingSales/index.d.ts +204 -0
  179. package/lib/solution/UnifiedBookingSales/index.js +1273 -0
  180. package/lib/solution/UnifiedBookingSales/types.d.ts +150 -0
  181. package/lib/solution/UnifiedBookingSales/types.js +33 -0
  182. package/lib/solution/VenueBooking/index.d.ts +39 -11
  183. package/lib/solution/VenueBooking/index.js +322 -110
  184. package/lib/solution/VenueBooking/types.d.ts +3 -0
  185. package/lib/solution/VenueBooking/utils/resource.js +1 -0
  186. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  187. package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
  188. package/lib/solution/index.d.ts +1 -0
  189. package/lib/solution/index.js +3 -1
  190. package/lib/types/index.d.ts +1 -0
  191. package/package.json +1 -1
@@ -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 === id || item.product_id === variantId;
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 todayTimes = _resource.times.filter(function (time) {
113
- var isToday = dayjs(time.start_at).isSame(currentTime, 'day');
114
- var isStillWorking = dayjs(time.end_at).isAfter(currentTime);
115
- return isToday && isStillWorking;
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 (todayTimes.length === 0) {
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(todayTimes),
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.isBefore(workStartTime) ? workStartTime : 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(30, 'minute'))) {
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(30, 'minute'))) {
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
  }
@@ -29,6 +29,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
29
29
  private addTimeProductsCatalog;
30
30
  private orderCustomerDiscountRefreshInFlight;
31
31
  private orderCustomerDiscountRefreshCustomerId;
32
+ private orderCustomerPromotionRefreshInFlight;
32
33
  private loadOpenDataConfigInFlight;
33
34
  /**
34
35
  * 在 BaseSales 默认模块清单(products/order/salesSummary/schedule)基础上追加 customer + bookingContext。
@@ -63,6 +64,8 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
63
64
  scanPromotionCode(code: string, customerId?: number): Promise<BaseSalesScanCodeResult>;
64
65
  private hydrateOrderCustomerFromScanDiscounts;
65
66
  private getDiscountCustomerId;
67
+ resolveCustomerById(customerId: string | number): Promise<ICustomer | null>;
68
+ /** 兼容既有优惠码扫码逻辑。 */
66
69
  private resolveCustomerByDiscountCustomerId;
67
70
  private findCustomerById;
68
71
  private normalizeCustomer;
@@ -282,7 +285,8 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
282
285
  restoreOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
283
286
  /** 内部:基于 OrderModule 当前状态构造一份 OrderCustomerChangePayload。 */
284
287
  private buildOrderCustomerPayload;
285
- private refreshDiscountConfigAfterOrderCustomerChange;
288
+ protected refreshDiscountConfigAfterOrderCustomerChange(customerId: number | null): Promise<void>;
289
+ protected waitForOrderCustomerPromotionRefresh(): Promise<void>;
286
290
  /**
287
291
  * 获取客户分页信息
288
292
  * @returns 分页信息
@@ -326,7 +330,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
326
330
  * 获取当前的客户搜索条件
327
331
  * @returns 当前搜索条件
328
332
  */
329
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
333
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
330
334
  /**
331
335
  * 获取客户列表状态(包含滚动加载相关状态)
332
336
  * @returns 客户状态
@@ -52,6 +52,7 @@ import { resolveBestAddTimePlan as _resolveBestAddTimePlan } from "./utils/resol
52
52
  import { createUuidV4 } from "../../modules/Order/utils";
53
53
  var OPEN_DATA_SECTION_CODES = ['sale', 'reservation', 'fulfillment', 'menu', 'workflow'];
54
54
  var OPEN_DATA_CACHE_TTL = 5 * 60 * 1000;
55
+ var USER_PLATFORM = ['pc', 'h5'];
55
56
 
56
57
  /**
57
58
  * 读取已有 booking 的协议唯一值,用于加时商品行绑定原预约。
@@ -178,6 +179,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
178
179
  _defineProperty(_assertThisInitialized(_this), "addTimeProductsCatalog", []);
179
180
  _defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshInFlight", null);
180
181
  _defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshCustomerId", null);
182
+ _defineProperty(_assertThisInitialized(_this), "orderCustomerPromotionRefreshInFlight", null);
181
183
  _defineProperty(_assertThisInitialized(_this), "loadOpenDataConfigInFlight", null);
182
184
  return _this;
183
185
  }
@@ -400,35 +402,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
400
402
  value: function () {
401
403
  var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
402
404
  var _openDataConfig, _openDataConfig2, _openDataConfig3, _openDataConfig4, _openDataConfig5, _openDataConfig6;
403
- var openDataConfig, idGenerator, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode;
405
+ var idGenerator, openDataConfig, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode;
404
406
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
405
407
  while (1) switch (_context5.prev = _context5.next) {
406
408
  case 0:
407
409
  // 业务码切换或配置失败时不能复用上一次初始化的短号。
408
410
  this.setPaymentNumberDevicePrefix(null);
409
- openDataConfig = null;
410
- _context5.prev = 2;
411
- _context5.next = 5;
412
- return this.loadOpenDataConfig();
413
- case 5:
414
- openDataConfig = _context5.sent;
415
- _context5.next = 12;
416
- break;
417
- case 8:
418
- _context5.prev = 8;
419
- _context5.t0 = _context5["catch"](2);
420
- console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context5.t0);
421
- return _context5.abrupt("return");
422
- case 12:
423
- // if (!openDataConfig) return;
424
411
  idGenerator = this.getIdGeneratorPlugin();
425
412
  if (idGenerator !== null && idGenerator !== void 0 && idGenerator.configure) {
426
- _context5.next = 16;
413
+ _context5.next = 5;
427
414
  break;
428
415
  }
429
416
  console.warn('[BookingTicket] idGenerator 插件不可用,跳过配置');
430
417
  return _context5.abrupt("return");
418
+ case 5:
419
+ openDataConfig = null;
420
+ _context5.prev = 6;
421
+ _context5.next = 9;
422
+ return this.loadOpenDataConfig();
423
+ case 9:
424
+ openDataConfig = _context5.sent;
425
+ _context5.next = 16;
426
+ break;
427
+ case 12:
428
+ _context5.prev = 12;
429
+ _context5.t0 = _context5["catch"](6);
430
+ console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context5.t0);
431
+ return _context5.abrupt("return");
431
432
  case 16:
433
+ // if (!openDataConfig) return;
432
434
  receiptSequenceLength = this.normalizePositiveInteger((_openDataConfig = openDataConfig) === null || _openDataConfig === void 0 ? void 0 : _openDataConfig['sale.short_number_digits'], 5);
433
435
  receiptSequenceStart = this.normalizePositiveInteger((_openDataConfig2 = openDataConfig) === null || _openDataConfig2 === void 0 ? void 0 : _openDataConfig2['sale.short_number_start_number'], 1);
434
436
  prefix = this.normalizeIdPrefix((_openDataConfig3 = openDataConfig) === null || _openDataConfig3 === void 0 ? void 0 : _openDataConfig3['sale.short_number_prefix'], '');
@@ -475,7 +477,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
475
477
  case "end":
476
478
  return _context5.stop();
477
479
  }
478
- }, _callee5, this, [[2, 8], [30, 35]]);
480
+ }, _callee5, this, [[6, 12], [30, 35]]);
479
481
  }));
480
482
  function configureIdGeneratorFromOpenData() {
481
483
  return _configureIdGeneratorFromOpenData.apply(this, arguments);
@@ -559,7 +561,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
559
561
  key: "scanPromotionCode",
560
562
  value: function () {
561
563
  var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(code, customerId) {
562
- var raw, scannedList, extractedCustomerId, hasOrderCustomer, tempOrder;
564
+ var raw, scannedList, extractedCustomerId, hasOrderCustomer, isUserPlatform, tempOrder;
563
565
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
564
566
  while (1) switch (_context7.prev = _context7.next) {
565
567
  case 0:
@@ -575,33 +577,34 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
575
577
  raw = _context7.sent;
576
578
  scannedList = raw.scannedDiscountList || [];
577
579
  extractedCustomerId = this.getDiscountCustomerId(scannedList);
578
- hasOrderCustomer = Boolean(this.store.order.getOrderCustomer()); // 缺 Holder 等场景 isAvailable=false,但仍需把 Pass 归属客户带入订单,供 Holder 弹窗使用。
579
- if (!(!hasOrderCustomer && extractedCustomerId)) {
580
- _context7.next = 11;
580
+ hasOrderCustomer = Boolean(this.store.order.getOrderCustomer());
581
+ isUserPlatform = USER_PLATFORM.includes(this.otherParams.platform); // Holder 等场景 isAvailable=false,但仍需把 Pass 归属客户带入订单,供 Holder 弹窗使用。
582
+ if (!(!hasOrderCustomer && extractedCustomerId && !isUserPlatform)) {
583
+ _context7.next = 12;
581
584
  break;
582
585
  }
583
- _context7.next = 11;
586
+ _context7.next = 12;
584
587
  return this.hydrateOrderCustomerFromScanDiscounts(scannedList);
585
- case 11:
588
+ case 12:
586
589
  if (!raw.isAvailable) {
587
- _context7.next = 18;
590
+ _context7.next = 19;
588
591
  break;
589
592
  }
590
- _context7.next = 14;
593
+ _context7.next = 15;
591
594
  return this.store.order.recalculateSummary({
592
595
  createIfMissing: true
593
596
  });
594
- case 14:
597
+ case 15:
595
598
  this.store.order.persistTempOrder();
596
599
  tempOrder = this.store.order.ensureTempOrder();
597
- _context7.next = 18;
600
+ _context7.next = 19;
598
601
  return this.effectsEmit('onDiscountApplied', {
599
602
  productList: tempOrder.products || [],
600
603
  discountList: this.store.order.getDiscountList(),
601
604
  selectedDiscountList: tempOrder.discount_list || [],
602
605
  tempOrder: tempOrder
603
606
  });
604
- case 18:
607
+ case 19:
605
608
  return _context7.abrupt("return", _objectSpread(_objectSpread({
606
609
  isAvailable: raw.isAvailable
607
610
  }, raw.isAccepted !== undefined ? {
@@ -611,7 +614,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
611
614
  unavailableReason: raw.unavailableReason,
612
615
  scannedDiscountList: raw.scannedDiscountList
613
616
  }));
614
- case 19:
617
+ case 20:
615
618
  case "end":
616
619
  return _context7.stop();
617
620
  }
@@ -688,11 +691,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
688
691
  return null;
689
692
  }
690
693
  }, {
691
- key: "resolveCustomerByDiscountCustomerId",
694
+ key: "resolveCustomerById",
692
695
  value: function () {
693
- var _resolveCustomerByDiscountCustomerId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(customerId) {
696
+ var _resolveCustomerById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(customerId) {
694
697
  var _result$list;
695
- var localCustomers, localCustomer, normalizedLocalCustomer, result, remoteCustomer;
698
+ var localCustomers, localCustomer, normalizedLocalCustomer, result, remoteCustomer, detailCustomer;
696
699
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
697
700
  while (1) switch (_context9.prev = _context9.next) {
698
701
  case 0:
@@ -714,18 +717,42 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
714
717
  case 7:
715
718
  result = _context9.sent;
716
719
  remoteCustomer = this.findCustomerById((result === null || result === void 0 ? void 0 : result.list) || [], customerId) || (result === null || result === void 0 || (_result$list = result.list) === null || _result$list === void 0 ? void 0 : _result$list[0]) || null;
717
- return _context9.abrupt("return", remoteCustomer ? this.normalizeCustomer(remoteCustomer) : null);
718
- case 10:
720
+ if (!remoteCustomer) {
721
+ _context9.next = 11;
722
+ break;
723
+ }
724
+ return _context9.abrupt("return", this.normalizeCustomer(remoteCustomer));
725
+ case 11:
726
+ _context9.prev = 11;
727
+ _context9.next = 14;
728
+ return this.store.customer.queryCustomerDetail(customerId);
729
+ case 14:
730
+ detailCustomer = _context9.sent;
731
+ return _context9.abrupt("return", detailCustomer ? this.normalizeCustomer(detailCustomer) : null);
732
+ case 18:
733
+ _context9.prev = 18;
734
+ _context9.t0 = _context9["catch"](11);
735
+ console.warn('[BookingTicket] resolveCustomerById detail request failed', {
736
+ customerId: customerId,
737
+ error: _context9.t0
738
+ });
739
+ return _context9.abrupt("return", null);
740
+ case 22:
719
741
  case "end":
720
742
  return _context9.stop();
721
743
  }
722
- }, _callee9, this);
744
+ }, _callee9, this, [[11, 18]]);
723
745
  }));
724
- function resolveCustomerByDiscountCustomerId(_x6) {
725
- return _resolveCustomerByDiscountCustomerId.apply(this, arguments);
746
+ function resolveCustomerById(_x6) {
747
+ return _resolveCustomerById.apply(this, arguments);
726
748
  }
727
- return resolveCustomerByDiscountCustomerId;
728
- }()
749
+ return resolveCustomerById;
750
+ }() /** 兼容既有优惠码扫码逻辑。 */
751
+ }, {
752
+ key: "resolveCustomerByDiscountCustomerId",
753
+ value: function resolveCustomerByDiscountCustomerId(customerId) {
754
+ return this.resolveCustomerById(customerId);
755
+ }
729
756
  }, {
730
757
  key: "findCustomerById",
731
758
  value: function findCustomerById() {
@@ -1532,7 +1559,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1532
1559
  }, {
1533
1560
  key: "setOrderCustomer",
1534
1561
  value: function setOrderCustomer(customer) {
1535
- var _this$store$order$get3;
1562
+ var _this$store$order$get3,
1563
+ _this3 = this;
1536
1564
  if (!customer) {
1537
1565
  this.clearOrderCustomer();
1538
1566
  return;
@@ -1561,8 +1589,17 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1561
1589
  this.core.effects.emit("".concat(this.name, ":onOrderCustomerChange"), next);
1562
1590
  this.refreshDiscountConfigAfterOrderCustomerChange(patch.customer_id);
1563
1591
  // 客户切换可能改变可用促销/赠品;触发一次重算(recursion-safe)。
1564
- void this.store.order.applyPromotion().catch(function (error) {
1592
+ var promotionRefreshTask = this.store.order.applyPromotion().then(function () {
1593
+ return undefined;
1594
+ });
1595
+ this.orderCustomerPromotionRefreshInFlight = promotionRefreshTask;
1596
+ void promotionRefreshTask.then(function () {
1597
+ if (_this3.orderCustomerPromotionRefreshInFlight !== promotionRefreshTask) return;
1598
+ _this3.orderCustomerPromotionRefreshInFlight = null;
1599
+ }, function (error) {
1565
1600
  console.error('[BookingTicket] applyPromotion after customer change failed', error);
1601
+ if (_this3.orderCustomerPromotionRefreshInFlight !== promotionRefreshTask) return;
1602
+ _this3.orderCustomerPromotionRefreshInFlight = null;
1566
1603
  });
1567
1604
  }
1568
1605
 
@@ -1592,7 +1629,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1592
1629
  value: function clearOrderCustomer() {
1593
1630
  var _discountModule$setOr,
1594
1631
  _discountModule$setDi,
1595
- _this3 = this;
1632
+ _this4 = this;
1596
1633
  this.store.order.clearOrderCustomer();
1597
1634
  this.discountConfigCacheKey = null;
1598
1635
  this.hasManualDiscountSelection = false;
@@ -1605,9 +1642,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1605
1642
  createIfMissing: true
1606
1643
  }).then(function () {
1607
1644
  var _discountModule$getDi;
1608
- var tempOrder = _this3.store.order.ensureTempOrder();
1609
- _this3.store.order.persistTempOrder();
1610
- return _this3.effectsEmit('onDiscountApplied', {
1645
+ var tempOrder = _this4.store.order.ensureTempOrder();
1646
+ _this4.store.order.persistTempOrder();
1647
+ return _this4.effectsEmit('onDiscountApplied', {
1611
1648
  productList: tempOrder.products || [],
1612
1649
  discountList: (discountModule === null || discountModule === void 0 || (_discountModule$getDi = discountModule.getDiscountList) === null || _discountModule$getDi === void 0 ? void 0 : _discountModule$getDi.call(discountModule)) || [],
1613
1650
  selectedDiscountList: tempOrder.discount_list || [],
@@ -1668,14 +1705,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1668
1705
  }, {
1669
1706
  key: "refreshDiscountConfigAfterOrderCustomerChange",
1670
1707
  value: function refreshDiscountConfigAfterOrderCustomerChange(customerId) {
1671
- var _this4 = this;
1672
- if (!customerId || customerId === 1) return;
1708
+ var _this5 = this;
1709
+ if (!customerId || customerId === 1) return Promise.resolve();
1673
1710
  if (this.orderCustomerDiscountRefreshInFlight && this.orderCustomerDiscountRefreshCustomerId === customerId) {
1674
- return;
1711
+ return this.orderCustomerDiscountRefreshInFlight;
1675
1712
  }
1676
1713
  var previousRefresh = this.orderCustomerDiscountRefreshInFlight;
1677
1714
  var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1678
- var currentCustomer;
1715
+ var _this5$store$order$ge, _this5$store$order, _this5$getOrderIdenti;
1716
+ var currentCustomer, tempOrder, orderId, action;
1679
1717
  return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1680
1718
  while (1) switch (_context22.prev = _context22.next) {
1681
1719
  case 0:
@@ -1688,18 +1726,22 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1688
1726
  return undefined;
1689
1727
  });
1690
1728
  case 3:
1691
- currentCustomer = _this4.store.order.getOrderCustomer();
1729
+ currentCustomer = _this5.store.order.getOrderCustomer();
1692
1730
  if (!(!currentCustomer || Number(currentCustomer.customer_id) !== customerId)) {
1693
1731
  _context22.next = 6;
1694
1732
  break;
1695
1733
  }
1696
1734
  return _context22.abrupt("return");
1697
1735
  case 6:
1698
- _context22.next = 8;
1699
- return _this4.loadDiscountConfig({
1700
- customerId: customerId
1736
+ tempOrder = (_this5$store$order$ge = (_this5$store$order = _this5.store.order).getTempOrder) === null || _this5$store$order$ge === void 0 ? void 0 : _this5$store$order$ge.call(_this5$store$order);
1737
+ orderId = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) || ((_this5$getOrderIdenti = _this5.getOrderIdentity) === null || _this5$getOrderIdenti === void 0 || (_this5$getOrderIdenti = _this5$getOrderIdenti.call(_this5)) === null || _this5$getOrderIdenti === void 0 ? void 0 : _this5$getOrderIdenti.orderId);
1738
+ action = !orderId || String(orderId).startsWith('local_order') ? 'create' : 'edit';
1739
+ _context22.next = 11;
1740
+ return _this5.loadDiscountConfig({
1741
+ customerId: customerId,
1742
+ action: action
1701
1743
  });
1702
- case 8:
1744
+ case 11:
1703
1745
  case "end":
1704
1746
  return _context22.stop();
1705
1747
  }
@@ -1710,10 +1752,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1710
1752
  refreshTask.catch(function (error) {
1711
1753
  console.error('Failed to load discount config after customer change:', error);
1712
1754
  }).finally(function () {
1713
- if (_this4.orderCustomerDiscountRefreshInFlight !== refreshTask) return;
1714
- _this4.orderCustomerDiscountRefreshInFlight = null;
1715
- _this4.orderCustomerDiscountRefreshCustomerId = null;
1755
+ if (_this5.orderCustomerDiscountRefreshInFlight !== refreshTask) return;
1756
+ _this5.orderCustomerDiscountRefreshInFlight = null;
1757
+ _this5.orderCustomerDiscountRefreshCustomerId = null;
1716
1758
  });
1759
+ return refreshTask;
1760
+ }
1761
+ }, {
1762
+ key: "waitForOrderCustomerPromotionRefresh",
1763
+ value: function waitForOrderCustomerPromotionRefresh() {
1764
+ return this.orderCustomerPromotionRefreshInFlight || Promise.resolve();
1717
1765
  }
1718
1766
 
1719
1767
  /**
@@ -1897,11 +1945,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1897
1945
  }, {
1898
1946
  key: "scanGlobalListener",
1899
1947
  value: function scanGlobalListener(callback) {
1900
- var _this5 = this;
1948
+ var _this6 = this;
1901
1949
  var localSearch = function localSearch(v) {
1902
- return _this5.store.products.findProductsByCodeOrBarcode(v);
1950
+ return _this6.store.products.findProductsByCodeOrBarcode(v);
1903
1951
  };
1904
- var scanCallback = handleGlobalScan(this.request, localSearch);
1952
+ var scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
1905
1953
  var safeCallback = function safeCallback(d) {
1906
1954
  try {
1907
1955
  callback(d);
@@ -2375,7 +2423,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2375
2423
  key: "handleGlobalScanCode",
2376
2424
  value: (function () {
2377
2425
  var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(code, bridge) {
2378
- var _this6 = this;
2426
+ var _this7 = this;
2379
2427
  var trimmed, _bridge$onNotify, _bridge$refresh, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result7, _bridge$onNotify3;
2380
2428
  return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2381
2429
  while (1) switch (_context28.prev = _context28.next) {
@@ -2393,9 +2441,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2393
2441
  case 4:
2394
2442
  _context28.prev = 4;
2395
2443
  localSearch = function localSearch(v) {
2396
- return _this6.store.products.findProductsByCodeOrBarcode(v);
2444
+ return _this7.store.products.findProductsByCodeOrBarcode(v);
2397
2445
  };
2398
- scanCallback = handleGlobalScan(this.request, localSearch);
2446
+ scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
2399
2447
  _context28.next = 9;
2400
2448
  return scanCallback({
2401
2449
  type: 'nativeScanner',
@@ -2417,35 +2465,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2417
2465
  _context28.next = 16;
2418
2466
  return applyGlobalScan({
2419
2467
  setOrderCustomer: function setOrderCustomer(customer) {
2420
- return _this6.setOrderCustomer(customer);
2468
+ return _this7.setOrderCustomer(customer);
2421
2469
  },
2422
2470
  getOrderCustomerSnapshot: function getOrderCustomerSnapshot() {
2423
- return _this6.getOrderCustomerSnapshot();
2471
+ return _this7.getOrderCustomerSnapshot();
2424
2472
  },
2425
2473
  getBusinessCode: function getBusinessCode() {
2426
- var _this6$otherParams;
2427
- return (_this6$otherParams = _this6.otherParams) === null || _this6$otherParams === void 0 ? void 0 : _this6$otherParams.businessCode;
2474
+ var _this7$otherParams;
2475
+ return (_this7$otherParams = _this7.otherParams) === null || _this7$otherParams === void 0 ? void 0 : _this7$otherParams.businessCode;
2428
2476
  },
2429
2477
  buildAddProductCtx: function buildAddProductCtx(extra) {
2430
- return _this6.buildAddProductCtx(extra);
2478
+ return _this7.buildAddProductCtx(extra);
2431
2479
  },
2432
2480
  decideAddProduct: function decideAddProduct(item, options) {
2433
- return _this6.decideAddProduct(item, options);
2481
+ return _this7.decideAddProduct(item, options);
2434
2482
  },
2435
2483
  decideAfterDetail: function decideAfterDetail(cacheItem, options) {
2436
- return _this6.decideAfterDetail(cacheItem, options);
2484
+ return _this7.decideAfterDetail(cacheItem, options);
2437
2485
  },
2438
2486
  transformDetailToProductAndBooking: function transformDetailToProductAndBooking(input) {
2439
- return _this6.transformDetailToProductAndBooking(input);
2487
+ return _this7.transformDetailToProductAndBooking(input);
2440
2488
  },
2441
2489
  addProductToOrder: function addProductToOrder(product, booking) {
2442
- return _this6.addProductToOrder(product, booking);
2490
+ return _this7.addProductToOrder(product, booking);
2443
2491
  },
2444
2492
  refreshWalletAssets: function refreshWalletAssets(params) {
2445
- return _this6.refreshWalletAssets(params);
2493
+ return _this7.refreshWalletAssets(params);
2446
2494
  },
2447
2495
  scanWalletAsset: function scanWalletAsset(scanCode) {
2448
- return _this6.scanWalletAsset(scanCode);
2496
+ return _this7.scanWalletAsset(scanCode);
2449
2497
  }
2450
2498
  }, formatted, bridge);
2451
2499
  case 16:
@@ -2584,7 +2632,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2584
2632
  key: "addAddTimeProductsToBooking",
2585
2633
  value: (function () {
2586
2634
  var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(input) {
2587
- var _this7 = this,
2635
+ var _this8 = this,
2588
2636
  _input$bookingPatch;
2589
2637
  var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
2590
2638
  return _regeneratorRuntime().wrap(function _callee30$(_context30) {
@@ -2599,7 +2647,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2599
2647
  case 3:
2600
2648
  orderLines = (input.products || []).map(function (line) {
2601
2649
  return {
2602
- product: _this7.buildAddTimeOrderLine(line, bookingUid)
2650
+ product: _this8.buildAddTimeOrderLine(line, bookingUid)
2603
2651
  };
2604
2652
  });
2605
2653
  if (this.store.order) {
@@ -2,9 +2,11 @@ import { RequestPlugin } from '../../../../plugins';
2
2
  /**
3
3
  * 处理全局扫码
4
4
  * @param request 请求插件
5
+ * @param localSearch 本地商品搜索
6
+ * @param channel 当前销售渠道
5
7
  * @returns 处理结果
6
8
  */
7
- export declare const handleGlobalScan: (request: RequestPlugin, localSearch: (v: string) => any[]) => (scanResult: {
9
+ export declare const handleGlobalScan: (request: RequestPlugin, localSearch: (v: string) => any[], channel?: string) => (scanResult: {
8
10
  type: string;
9
11
  value: string;
10
12
  }) => Promise<any>;