@pisell/pisellos 0.0.567 → 0.0.568

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 (228) hide show
  1. package/dist/core/index.js +6 -9
  2. package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -2
  3. package/dist/model/strategy/adapter/walletPass/example.js +3 -26
  4. package/dist/model/strategy/adapter/walletPass/utils.js +0 -3
  5. package/dist/model/strategy/strategy-example.js +5 -19
  6. package/dist/modules/Cart/index.js +0 -3
  7. package/dist/modules/Cart/utils/cartProduct.js +0 -1
  8. package/dist/modules/Date/index.js +1 -5
  9. package/dist/modules/Discount/index.js +1 -4
  10. package/dist/modules/OpenData/index.js +0 -2
  11. package/dist/modules/Order/index.d.ts +1 -1
  12. package/dist/modules/Order/index.js +14 -41
  13. package/dist/modules/Payment/index.js +142 -270
  14. package/dist/modules/Payment/walletpass.js +4 -5
  15. package/dist/modules/Rules/index.js +0 -7
  16. package/dist/modules/Schedule/utils.js +0 -1
  17. package/dist/modules/Step/index.js +0 -1
  18. package/dist/plugins/request.js +1 -4
  19. package/dist/plugins/window.js +2 -6
  20. package/dist/server/index.js +88 -121
  21. package/dist/server/modules/menu/index.js +32 -41
  22. package/dist/server/modules/products/index.js +29 -49
  23. package/dist/server/modules/quotation/index.js +29 -38
  24. package/dist/server/modules/resource/index.js +3 -4
  25. package/dist/server/modules/schedule/index.js +32 -40
  26. package/dist/server/utils/product.js +0 -1
  27. package/dist/solution/BookingByStep/index.d.ts +1 -1
  28. package/dist/solution/BookingByStep/index.js +7 -59
  29. package/dist/solution/BookingByStep/utils/capacity.js +1 -11
  30. package/dist/solution/BookingByStep/utils/resources.js +1 -3
  31. package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
  32. package/dist/solution/BookingTicket/index.d.ts +1 -1
  33. package/dist/solution/BookingTicket/index.js +5 -7
  34. package/dist/solution/BookingTicket/utils/scan/handleScan.js +25 -31
  35. package/dist/solution/BookingTicket/utils/scan/index.js +6 -10
  36. package/dist/solution/BuyTickets/index.js +9 -12
  37. package/dist/solution/Checkout/index.js +177 -246
  38. package/dist/solution/Checkout/utils/index.js +4 -16
  39. package/dist/solution/RegisterAndLogin/index.js +30 -76
  40. package/dist/solution/ScanOrder/index.js +50 -60
  41. package/dist/solution/ShopDiscount/index.js +2 -7
  42. package/dist/solution/VenueBooking/index.d.ts +5 -0
  43. package/dist/solution/VenueBooking/index.js +364 -327
  44. package/dist/utils/task.js +15 -18
  45. package/dist/utils/watch.js +0 -1
  46. package/lib/apis/picoding.js +2 -0
  47. package/lib/core/index.js +130 -131
  48. package/lib/effects/index.js +46 -57
  49. package/lib/index.js +92 -53
  50. package/lib/model/index.js +14 -21
  51. package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
  52. package/lib/model/strategy/adapter/dataVariant/evaluator.js +162 -236
  53. package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
  54. package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
  55. package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
  56. package/lib/model/strategy/adapter/index.js +100 -64
  57. package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
  58. package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
  59. package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
  60. package/lib/model/strategy/adapter/itemRule/index.js +83 -57
  61. package/lib/model/strategy/adapter/itemRule/type.js +97 -36
  62. package/lib/model/strategy/adapter/promotion/adapter.js +84 -63
  63. package/lib/model/strategy/adapter/promotion/evaluator.js +381 -231
  64. package/lib/model/strategy/adapter/promotion/examples.js +139 -159
  65. package/lib/model/strategy/adapter/promotion/index.js +1 -49
  66. package/lib/model/strategy/adapter/promotion/type.js +199 -35
  67. package/lib/model/strategy/adapter/type.js +4 -16
  68. package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -152
  69. package/lib/model/strategy/adapter/walletPass/example.js +217 -190
  70. package/lib/model/strategy/adapter/walletPass/index.js +75 -51
  71. package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
  72. package/lib/model/strategy/adapter/walletPass/type.js +4 -16
  73. package/lib/model/strategy/adapter/walletPass/utils.js +652 -402
  74. package/lib/model/strategy/engine.js +270 -168
  75. package/lib/model/strategy/index.js +49 -34
  76. package/lib/model/strategy/strategy-example.js +243 -239
  77. package/lib/model/strategy/type.js +100 -40
  78. package/lib/modules/Account/index.js +39 -53
  79. package/lib/modules/Account/types.js +20 -33
  80. package/lib/modules/AccountList/index.js +116 -154
  81. package/lib/modules/AccountList/types.js +30 -31
  82. package/lib/modules/AccountList/utils.js +18 -30
  83. package/lib/modules/BaseModule.js +22 -45
  84. package/lib/modules/Cart/index.js +170 -124
  85. package/lib/modules/Cart/types.js +46 -51
  86. package/lib/modules/Cart/utils/cartAccount.js +40 -39
  87. package/lib/modules/Cart/utils/cartDate.js +56 -61
  88. package/lib/modules/Cart/utils/cartDiscount.js +28 -33
  89. package/lib/modules/Cart/utils/cartNote.js +27 -32
  90. package/lib/modules/Cart/utils/cartProduct.js +306 -241
  91. package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
  92. package/lib/modules/Cart/utils/cartResource.js +72 -78
  93. package/lib/modules/Cart/utils/changePrice.js +26 -62
  94. package/lib/modules/Cart/utils/index.js +106 -48
  95. package/lib/modules/Customer/constants.js +13 -34
  96. package/lib/modules/Customer/index.js +216 -153
  97. package/lib/modules/Customer/types.js +38 -35
  98. package/lib/modules/Date/index.js +116 -115
  99. package/lib/modules/Date/types.js +16 -28
  100. package/lib/modules/Date/utils.js +174 -123
  101. package/lib/modules/Discount/index.js +117 -113
  102. package/lib/modules/Discount/types.js +9 -31
  103. package/lib/modules/Guests/index.js +30 -56
  104. package/lib/modules/Guests/types.js +23 -33
  105. package/lib/modules/Holder/index.js +209 -189
  106. package/lib/modules/Holder/types.js +4 -16
  107. package/lib/modules/Holder/utils.js +20 -49
  108. package/lib/modules/OpenData/index.js +63 -74
  109. package/lib/modules/OpenData/types.js +4 -16
  110. package/lib/modules/OpenData/utils.js +44 -78
  111. package/lib/modules/Order/index.d.ts +1 -1
  112. package/lib/modules/Order/index.js +332 -320
  113. package/lib/modules/Order/types.js +24 -33
  114. package/lib/modules/Order/utils.js +350 -284
  115. package/lib/modules/Payment/cash.js +20 -33
  116. package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
  117. package/lib/modules/Payment/eftpos.js +16 -30
  118. package/lib/modules/Payment/index.js +566 -432
  119. package/lib/modules/Payment/mx51.js +1 -0
  120. package/lib/modules/Payment/types.js +216 -107
  121. package/lib/modules/Payment/utils.js +50 -47
  122. package/lib/modules/Payment/walletpass.js +221 -203
  123. package/lib/modules/Product/index.js +51 -46
  124. package/lib/modules/Product/types.js +4 -16
  125. package/lib/modules/Product/utils.js +32 -33
  126. package/lib/modules/ProductList/index.js +111 -110
  127. package/lib/modules/ProductList/types.js +9 -31
  128. package/lib/modules/Quotation/index.js +60 -82
  129. package/lib/modules/Quotation/types.js +4 -16
  130. package/lib/modules/Resource/index.js +27 -59
  131. package/lib/modules/Resource/types.js +22 -32
  132. package/lib/modules/Resource/utils.js +30 -38
  133. package/lib/modules/Rules/index.js +1172 -872
  134. package/lib/modules/Rules/types.js +17 -40
  135. package/lib/modules/SalesSummary/index.js +59 -68
  136. package/lib/modules/SalesSummary/types.js +4 -16
  137. package/lib/modules/SalesSummary/utils.js +176 -193
  138. package/lib/modules/ScanOrderLogger/index.js +59 -79
  139. package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
  140. package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
  141. package/lib/modules/ScanOrderLogger/types.js +4 -16
  142. package/lib/modules/Schedule/getDateIsInSchedule.js +334 -167
  143. package/lib/modules/Schedule/index.js +97 -107
  144. package/lib/modules/Schedule/type.js +4 -16
  145. package/lib/modules/Schedule/types.js +4 -16
  146. package/lib/modules/Schedule/utils.js +433 -291
  147. package/lib/modules/Step/index.js +40 -52
  148. package/lib/modules/Step/tyeps.js +4 -16
  149. package/lib/modules/Summary/index.js +66 -70
  150. package/lib/modules/Summary/types.js +4 -16
  151. package/lib/modules/Summary/utils.js +782 -429
  152. package/lib/modules/index.js +212 -57
  153. package/lib/plugins/app.js +4 -16
  154. package/lib/plugins/index.js +36 -25
  155. package/lib/plugins/request.js +137 -126
  156. package/lib/plugins/shopStore.js +4 -16
  157. package/lib/plugins/user.js +4 -16
  158. package/lib/plugins/window.js +171 -179
  159. package/lib/server/index.js +882 -623
  160. package/lib/server/modules/index.js +85 -59
  161. package/lib/server/modules/menu/index.js +146 -122
  162. package/lib/server/modules/menu/types.js +18 -31
  163. package/lib/server/modules/order/index.js +195 -231
  164. package/lib/server/modules/order/types.js +107 -32
  165. package/lib/server/modules/order/utils/filterBookings.js +174 -140
  166. package/lib/server/modules/order/utils/filterOrders.js +89 -60
  167. package/lib/server/modules/products/index.js +430 -335
  168. package/lib/server/modules/products/types.js +41 -34
  169. package/lib/server/modules/quotation/index.js +76 -77
  170. package/lib/server/modules/quotation/types.js +21 -31
  171. package/lib/server/modules/resource/index.js +216 -187
  172. package/lib/server/modules/resource/types.js +42 -33
  173. package/lib/server/modules/schedule/index.js +134 -119
  174. package/lib/server/modules/schedule/types.js +14 -21
  175. package/lib/server/modules/schedule/utils.js +334 -163
  176. package/lib/server/types.js +4 -16
  177. package/lib/server/utils/index.js +25 -23
  178. package/lib/server/utils/product.js +196 -139
  179. package/lib/server/utils/schedule.js +34 -41
  180. package/lib/server/utils/time.js +40 -49
  181. package/lib/solution/BookingByStep/index.d.ts +1 -1
  182. package/lib/solution/BookingByStep/index.js +1530 -1343
  183. package/lib/solution/BookingByStep/types.js +40 -99
  184. package/lib/solution/BookingByStep/utils/capacity.js +192 -160
  185. package/lib/solution/BookingByStep/utils/products.js +42 -52
  186. package/lib/solution/BookingByStep/utils/resources.js +527 -330
  187. package/lib/solution/BookingByStep/utils/stock.js +65 -44
  188. package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
  189. package/lib/solution/BookingTicket/index.d.ts +1 -1
  190. package/lib/solution/BookingTicket/index.js +147 -122
  191. package/lib/solution/BookingTicket/types.js +38 -64
  192. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +64 -80
  193. package/lib/solution/BookingTicket/utils/scan/handleScan.js +82 -80
  194. package/lib/solution/BookingTicket/utils/scan/index.js +90 -94
  195. package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
  196. package/lib/solution/BuyTickets/index.js +67 -70
  197. package/lib/solution/BuyTickets/types.js +22 -38
  198. package/lib/solution/Checkout/index.js +1451 -1158
  199. package/lib/solution/Checkout/types.js +91 -61
  200. package/lib/solution/Checkout/utils/index.js +227 -158
  201. package/lib/solution/PlaceOrder/index.js +55 -0
  202. package/lib/solution/RegisterAndLogin/config.js +493 -460
  203. package/lib/solution/RegisterAndLogin/index.js +633 -630
  204. package/lib/solution/RegisterAndLogin/types.js +189 -76
  205. package/lib/solution/RegisterAndLogin/utils.js +183 -125
  206. package/lib/solution/Sales/index.js +218 -200
  207. package/lib/solution/Sales/types.js +27 -33
  208. package/lib/solution/ScanOrder/index.js +803 -840
  209. package/lib/solution/ScanOrder/types.js +34 -34
  210. package/lib/solution/ScanOrder/utils.js +372 -331
  211. package/lib/solution/ShopDiscount/index.js +230 -236
  212. package/lib/solution/ShopDiscount/types.js +15 -37
  213. package/lib/solution/ShopDiscount/utils.js +309 -172
  214. package/lib/solution/VenueBooking/index.d.ts +5 -0
  215. package/lib/solution/VenueBooking/index.js +886 -929
  216. package/lib/solution/VenueBooking/types.js +20 -40
  217. package/lib/solution/VenueBooking/utils/dateSummary.js +22 -54
  218. package/lib/solution/VenueBooking/utils/resource.js +31 -54
  219. package/lib/solution/VenueBooking/utils/slotMerge.js +88 -106
  220. package/lib/solution/VenueBooking/utils/smartPricing.js +112 -100
  221. package/lib/solution/VenueBooking/utils/timeSlot.js +133 -132
  222. package/lib/solution/VenueBooking/utils.js +130 -67
  223. package/lib/solution/index.js +102 -37
  224. package/lib/store/createStore.js +32 -29
  225. package/lib/types/index.js +4 -16
  226. package/lib/utils/task.js +36 -36
  227. package/lib/utils/watch.js +81 -47
  228. package/package.json +2 -1
@@ -284,33 +284,29 @@ export function isProduction() {
284
284
  */
285
285
  export var logger = {
286
286
  info: function info(message) {
287
- var _console;
288
287
  for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
289
288
  args[_key3 - 1] = arguments[_key3];
290
289
  }
291
- (_console = console).log.apply(_console, ["[Checkout] ".concat(message)].concat(args));
292
290
  },
293
291
  warn: function warn(message) {
294
- var _console2;
292
+ var _console;
295
293
  for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
296
294
  args[_key4 - 1] = arguments[_key4];
297
295
  }
298
- (_console2 = console).warn.apply(_console2, ["[Checkout] ".concat(message)].concat(args));
296
+ (_console = console).warn.apply(_console, ["[Checkout] ".concat(message)].concat(args));
299
297
  },
300
298
  error: function error(message) {
301
- var _console3;
299
+ var _console2;
302
300
  for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
303
301
  args[_key5 - 1] = arguments[_key5];
304
302
  }
305
- (_console3 = console).error.apply(_console3, ["[Checkout] ".concat(message)].concat(args));
303
+ (_console2 = console).error.apply(_console2, ["[Checkout] ".concat(message)].concat(args));
306
304
  },
307
305
  debug: function debug(message) {
308
306
  if (!isProduction()) {
309
- var _console4;
310
307
  for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
311
308
  args[_key6 - 1] = arguments[_key6];
312
309
  }
313
- (_console4 = console).debug.apply(_console4, ["[Checkout] ".concat(message)].concat(args));
314
310
  }
315
311
  }
316
312
  };
@@ -424,14 +420,6 @@ export function extractAmountFromCartSummary(cartSummary) {
424
420
  break;
425
421
  }
426
422
  });
427
- console.log('[Checkout] 从购物车小计提取金额信息:', {
428
- totalAmount: result.totalAmount,
429
- subTotal: result.subTotal,
430
- taxAmount: result.taxAmount,
431
- discountAmount: result.discountAmount,
432
- shopDiscountAmount: result.shopDiscountAmount,
433
- roundingAmount: result.roundingAmount
434
- });
435
423
  return result;
436
424
  }
437
425
 
@@ -331,10 +331,9 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
331
331
  case 13:
332
332
  // 预先调用获取区号的方法,初始内存缓存
333
333
  this.getCountries();
334
- console.log('[RegisterAndLogin] 初始化完成');
335
- _context4.next = 17;
334
+ _context4.next = 16;
336
335
  return this.core.effects.emit(RegisterAndLoginHooks.onInited, {});
337
- case 17:
336
+ case 16:
338
337
  case "end":
339
338
  return _context4.stop();
340
339
  }
@@ -2250,63 +2249,46 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
2250
2249
  return _regeneratorRuntime().wrap(function _callee35$(_context35) {
2251
2250
  while (1) switch (_context35.prev = _context35.next) {
2252
2251
  case 0:
2253
- console.log('[RegisterAndLogin] Facebook 登录开始', {
2254
- tokenLength: (token === null || token === void 0 ? void 0 : token.length) || 0,
2255
- timestamp: Date.now()
2256
- });
2257
- _context35.next = 3;
2252
+ _context35.next = 2;
2258
2253
  return this.initFacebookSDK(token);
2259
- case 3:
2260
- console.log('[RegisterAndLogin] Facebook SDK 初始化完成,准备调用 FB.login');
2254
+ case 2:
2261
2255
  return _context35.abrupt("return", new Promise(function (resolve, reject) {
2262
- console.log('[RegisterAndLogin] 调用 FB.login', {
2263
- scope: 'email,public_profile'
2264
- });
2265
2256
  window.FB.login( /*#__PURE__*/function () {
2266
2257
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(response) {
2267
2258
  var result;
2268
2259
  return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2269
2260
  while (1) switch (_context34.prev = _context34.next) {
2270
2261
  case 0:
2271
- console.log('[RegisterAndLogin] FB.login 回调触发', {
2272
- hasAuthResponse: Boolean(response === null || response === void 0 ? void 0 : response.authResponse),
2273
- status: response === null || response === void 0 ? void 0 : response.status
2274
- });
2275
2262
  if (!response.authResponse) {
2276
- _context34.next = 17;
2263
+ _context34.next = 14;
2277
2264
  break;
2278
2265
  }
2279
- _context34.prev = 2;
2280
- // 直接调用 /auth/facebook/login 接口
2281
- console.log('[RegisterAndLogin] 调用后端 facebookLogin 接口');
2282
- _context34.next = 6;
2266
+ _context34.prev = 1;
2267
+ _context34.next = 4;
2283
2268
  return _this2.apiCaller.call('facebookLogin', {
2284
2269
  token: response.authResponse.accessToken
2285
2270
  });
2286
- case 6:
2271
+ case 4:
2287
2272
  result = _context34.sent;
2288
- console.log('[RegisterAndLogin] facebookLogin 接口返回成功', {
2289
- hasResult: Boolean(result)
2290
- });
2291
2273
  resolve(result);
2292
- _context34.next = 15;
2274
+ _context34.next = 12;
2293
2275
  break;
2294
- case 11:
2295
- _context34.prev = 11;
2296
- _context34.t0 = _context34["catch"](2);
2276
+ case 8:
2277
+ _context34.prev = 8;
2278
+ _context34.t0 = _context34["catch"](1);
2297
2279
  console.error('[RegisterAndLogin] facebookLogin 接口调用失败', _context34.t0);
2298
2280
  reject(_context34.t0);
2299
- case 15:
2300
- _context34.next = 19;
2281
+ case 12:
2282
+ _context34.next = 16;
2301
2283
  break;
2302
- case 17:
2284
+ case 14:
2303
2285
  console.warn('[RegisterAndLogin] FB.login 用户取消授权或无 authResponse', response);
2304
2286
  reject(new Error('facebook_login_cancel'));
2305
- case 19:
2287
+ case 16:
2306
2288
  case "end":
2307
2289
  return _context34.stop();
2308
2290
  }
2309
- }, _callee34, null, [[2, 11]]);
2291
+ }, _callee34, null, [[1, 8]]);
2310
2292
  }));
2311
2293
  return function (_x31) {
2312
2294
  return _ref.apply(this, arguments);
@@ -2315,7 +2297,7 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
2315
2297
  scope: 'email,public_profile'
2316
2298
  });
2317
2299
  }));
2318
- case 5:
2300
+ case 3:
2319
2301
  case "end":
2320
2302
  return _context35.stop();
2321
2303
  }
@@ -2338,20 +2320,14 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
2338
2320
  return _regeneratorRuntime().wrap(function _callee37$(_context37) {
2339
2321
  while (1) switch (_context37.prev = _context37.next) {
2340
2322
  case 0:
2341
- // 先加载 Apple SDK
2342
- console.log('[RegisterAndLogin] Apple 登录开始', {
2343
- tokenLength: (token === null || token === void 0 ? void 0 : token.length) || 0,
2344
- timestamp: Date.now()
2345
- });
2346
- _context37.next = 3;
2323
+ _context37.next = 2;
2347
2324
  return this.initAppleSDK();
2348
- case 3:
2349
- console.log('[RegisterAndLogin] Apple SDK 初始化完成');
2325
+ case 2:
2350
2326
  return _context37.abrupt("return", new Promise(function (resolve, reject) {
2351
2327
  try {
2352
2328
  var _AppleID, _AppleID2;
2353
2329
  // 动态创建 Apple 登录按钮元素
2354
- console.log('[RegisterAndLogin] 创建临时 Apple SignIn 按钮节点');
2330
+
2355
2331
  var appleSignInDiv = document.createElement('div');
2356
2332
  appleSignInDiv.id = 'appleid-signin-temp';
2357
2333
  appleSignInDiv.setAttribute('data-color', 'black');
@@ -2368,11 +2344,8 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
2368
2344
 
2369
2345
  // 将元素添加到 body 中
2370
2346
  document.body.appendChild(appleSignInDiv);
2371
- console.log('[RegisterAndLogin] Apple SignIn 按钮已添加到文档');
2372
-
2373
2347
  // 初始化 Apple ID 按钮
2374
2348
  if ((_AppleID = window.AppleID) !== null && _AppleID !== void 0 && (_AppleID = _AppleID.auth) !== null && _AppleID !== void 0 && _AppleID.init) {
2375
- console.log('[RegisterAndLogin] 调用 AppleID.auth.init');
2376
2349
  window.AppleID.auth.init({
2377
2350
  clientId: token,
2378
2351
  // 使用传入的 token 作为 clientId
@@ -2387,7 +2360,6 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
2387
2360
 
2388
2361
  // 直接调用 Apple ID 登录,并处理 Promise
2389
2362
  if ((_AppleID2 = window.AppleID) !== null && _AppleID2 !== void 0 && (_AppleID2 = _AppleID2.auth) !== null && _AppleID2 !== void 0 && _AppleID2.signIn) {
2390
- console.log('[RegisterAndLogin] 调用 AppleID.auth.signIn');
2391
2363
  window.AppleID.auth.signIn().then( /*#__PURE__*/function () {
2392
2364
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(authResult) {
2393
2365
  var _authResult$authoriza, _authResult$authoriza2, authorizationCode, identityToken, result;
@@ -2399,44 +2371,29 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
2399
2371
  if (document.body.contains(appleSignInDiv)) {
2400
2372
  document.body.removeChild(appleSignInDiv);
2401
2373
  }
2402
- console.log('[RegisterAndLogin] Apple SignIn 成功,临时节点已移除', {
2403
- hasAuthorization: Boolean(authResult === null || authResult === void 0 ? void 0 : authResult.authorization),
2404
- hasUser: Boolean(authResult === null || authResult === void 0 ? void 0 : authResult.user)
2405
- });
2406
-
2407
2374
  // 获取授权码或令牌
2408
2375
  authorizationCode = (_authResult$authoriza = authResult.authorization) === null || _authResult$authoriza === void 0 ? void 0 : _authResult$authoriza.code;
2409
- identityToken = (_authResult$authoriza2 = authResult.authorization) === null || _authResult$authoriza2 === void 0 ? void 0 : _authResult$authoriza2.id_token;
2410
- console.log('[RegisterAndLogin] Apple 授权结果解析', {
2411
- hasAuthorizationCode: Boolean(authorizationCode),
2412
- hasIdentityToken: Boolean(identityToken)
2413
- });
2414
-
2415
- // 使用授权码或身份令牌调用后端接口
2416
- console.log('[RegisterAndLogin] 调用后端 appleLogin 接口');
2417
- _context36.next = 9;
2376
+ identityToken = (_authResult$authoriza2 = authResult.authorization) === null || _authResult$authoriza2 === void 0 ? void 0 : _authResult$authoriza2.id_token; // 使用授权码或身份令牌调用后端接口
2377
+ _context36.next = 6;
2418
2378
  return _this3.apiCaller.call('appleLogin', {
2419
2379
  code: identityToken || authorizationCode,
2420
2380
  login_channel: _this3.channel
2421
2381
  });
2422
- case 9:
2382
+ case 6:
2423
2383
  result = _context36.sent;
2424
- console.log('[RegisterAndLogin] appleLogin 接口返回成功', {
2425
- hasResult: Boolean(result)
2426
- });
2427
2384
  resolve(result);
2428
- _context36.next = 18;
2385
+ _context36.next = 14;
2429
2386
  break;
2430
- case 14:
2431
- _context36.prev = 14;
2387
+ case 10:
2388
+ _context36.prev = 10;
2432
2389
  _context36.t0 = _context36["catch"](0);
2433
2390
  console.error('[RegisterAndLogin] 处理 Apple 登录结果失败', _context36.t0);
2434
2391
  reject(_context36.t0);
2435
- case 18:
2392
+ case 14:
2436
2393
  case "end":
2437
2394
  return _context36.stop();
2438
2395
  }
2439
- }, _callee36, null, [[0, 14]]);
2396
+ }, _callee36, null, [[0, 10]]);
2440
2397
  }));
2441
2398
  return function (_x33) {
2442
2399
  return _ref2.apply(this, arguments);
@@ -2458,7 +2415,7 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
2458
2415
  reject(error);
2459
2416
  }
2460
2417
  }));
2461
- case 5:
2418
+ case 3:
2462
2419
  case "end":
2463
2420
  return _context37.stop();
2464
2421
  }
@@ -2620,7 +2577,6 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
2620
2577
  } catch (error) {
2621
2578
  console.warn('[RegisterAndLogin] localStorage 更新失败:', error);
2622
2579
  }
2623
- console.log('[RegisterAndLogin] 国家数据已更新');
2624
2580
  }
2625
2581
  }
2626
2582
  _context39.next = 10;
@@ -2650,8 +2606,6 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
2650
2606
  _context40.next = 2;
2651
2607
  return this.core.effects.emit(RegisterAndLoginHooks.onDestroy, {});
2652
2608
  case 2:
2653
- console.log('[RegisterAndLogin] 已销毁');
2654
- case 3:
2655
2609
  case "end":
2656
2610
  return _context40.stop();
2657
2611
  }
@@ -165,12 +165,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
165
165
  payload: payload,
166
166
  extra: extra
167
167
  });
168
- } else {
169
- console.log('[ScanOrder][log-fallback]', params.title, {
170
- payload: payload,
171
- extra: extra
172
- });
173
- }
168
+ } else {}
174
169
  return _context.abrupt("return");
175
170
  case 6:
176
171
  _context.next = 8;
@@ -574,50 +569,48 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
574
569
  })
575
570
  });
576
571
  this.registerCustomerLoginListeners();
577
- console.log('[ScanOrder] 初始化开始');
578
- _context7.prev = 32;
579
- _context7.next = 35;
572
+ _context7.prev = 31;
573
+ _context7.next = 34;
580
574
  return (_this$store$order = this.store.order) === null || _this$store$order === void 0 ? void 0 : _this$store$order.recalculateSummary({
581
575
  createIfMissing: false
582
576
  });
583
- case 35:
577
+ case 34:
584
578
  (_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || _this$store$order2.persistTempOrder();
585
- _context7.next = 38;
579
+ _context7.next = 37;
586
580
  return this.loadRuntimeConfigs();
587
- case 38:
581
+ case 37:
588
582
  if (!this.store.schedule) {
589
- _context7.next = 47;
583
+ _context7.next = 46;
590
584
  break;
591
585
  }
592
- _context7.prev = 39;
593
- _context7.next = 42;
586
+ _context7.prev = 38;
587
+ _context7.next = 41;
594
588
  return this.store.schedule.loadAllSchedule();
595
- case 42:
596
- _context7.next = 47;
589
+ case 41:
590
+ _context7.next = 46;
597
591
  break;
598
- case 44:
599
- _context7.prev = 44;
600
- _context7.t0 = _context7["catch"](39);
592
+ case 43:
593
+ _context7.prev = 43;
594
+ _context7.t0 = _context7["catch"](38);
601
595
  console.warn('[ScanOrder] loadAllSchedule 失败,operating_hours 判定将跳过', _context7.t0);
602
- case 47:
603
- _context7.next = 49;
596
+ case 46:
597
+ _context7.next = 48;
604
598
  return this.refreshItemRuleQuantityLimits();
605
- case 49:
599
+ case 48:
606
600
  this.store.status = 'ready';
607
- console.log('[ScanOrder] 初始化完成');
608
- _context7.next = 53;
601
+ _context7.next = 51;
609
602
  return this.core.effects.emit(ScanOrderHooks.onInited, {
610
603
  status: this.store.status
611
604
  });
612
- case 53:
605
+ case 51:
613
606
  this.logMethodSuccess('initialize', {
614
607
  status: this.store.status
615
608
  });
616
- _context7.next = 63;
609
+ _context7.next = 61;
617
610
  break;
618
- case 56:
619
- _context7.prev = 56;
620
- _context7.t1 = _context7["catch"](32);
611
+ case 54:
612
+ _context7.prev = 54;
613
+ _context7.t1 = _context7["catch"](31);
621
614
  this.store.status = 'error';
622
615
  this.store.error = _context7.t1 instanceof Error ? _context7.t1.message : '初始化失败';
623
616
  console.error('[ScanOrder] 初始化失败', _context7.t1);
@@ -625,11 +618,11 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
625
618
  status: this.store.status
626
619
  });
627
620
  throw _context7.t1;
628
- case 63:
621
+ case 61:
629
622
  case "end":
630
623
  return _context7.stop();
631
624
  }
632
- }, _callee7, this, [[32, 56], [39, 44]]);
625
+ }, _callee7, this, [[31, 54], [38, 43]]);
633
626
  }));
634
627
  function initialize(_x5) {
635
628
  return _initialize.apply(this, arguments);
@@ -652,9 +645,8 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
652
645
  return this.destroyRegisteredChildModules();
653
646
  case 6:
654
647
  _get(_getPrototypeOf(ScanOrderImpl.prototype), "destroy", this).call(this);
655
- console.log('[ScanOrder] 已销毁');
656
648
  this.logMethodSuccess('destroy');
657
- case 9:
649
+ case 8:
658
650
  case "end":
659
651
  return _context8.stop();
660
652
  }
@@ -674,27 +666,26 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
674
666
  case 0:
675
667
  this.logMethodStart('retryInit');
676
668
  // TODO: 细化重试策略(指数退避、最大重试次数)后替换当前实现
677
- console.log('[ScanOrder] retryInit 调用');
678
- _context9.next = 4;
669
+ _context9.next = 3;
679
670
  return this.core.effects.emit(ScanOrderHooks.onRetryInit, {});
680
- case 4:
681
- _context9.prev = 4;
682
- _context9.next = 7;
671
+ case 3:
672
+ _context9.prev = 3;
673
+ _context9.next = 6;
683
674
  return this.initialize(this.core, this.initializeOptions);
684
- case 7:
675
+ case 6:
685
676
  this.logMethodSuccess('retryInit');
686
- _context9.next = 14;
677
+ _context9.next = 13;
687
678
  break;
688
- case 10:
689
- _context9.prev = 10;
690
- _context9.t0 = _context9["catch"](4);
679
+ case 9:
680
+ _context9.prev = 9;
681
+ _context9.t0 = _context9["catch"](3);
691
682
  this.logMethodError('retryInit', _context9.t0);
692
683
  throw _context9.t0;
693
- case 14:
684
+ case 13:
694
685
  case "end":
695
686
  return _context9.stop();
696
687
  }
697
- }, _callee9, this, [[4, 10]]);
688
+ }, _callee9, this, [[3, 9]]);
698
689
  }));
699
690
  function retryInit() {
700
691
  return _retryInit.apply(this, arguments);
@@ -710,36 +701,35 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
710
701
  case 0:
711
702
  this.logMethodStart('refresh');
712
703
  // TODO: 接入真实刷新逻辑(资源重拉取、流程重建)后替换当前实现
713
- console.log('[ScanOrder] refresh 调用');
714
- _context10.prev = 2;
704
+ _context10.prev = 1;
715
705
  this.store.status = 'initializing';
716
- _context10.next = 6;
706
+ _context10.next = 5;
717
707
  return this.loadRuntimeConfigs();
718
- case 6:
719
- _context10.next = 8;
708
+ case 5:
709
+ _context10.next = 7;
720
710
  return this.refreshItemRuleQuantityLimits();
721
- case 8:
711
+ case 7:
722
712
  this.store.status = 'ready';
723
- _context10.next = 11;
713
+ _context10.next = 10;
724
714
  return this.core.effects.emit(ScanOrderHooks.onRefresh, {
725
715
  status: this.store.status
726
716
  });
727
- case 11:
717
+ case 10:
728
718
  this.logMethodSuccess('refresh', {
729
719
  status: this.store.status
730
720
  });
731
- _context10.next = 18;
721
+ _context10.next = 17;
732
722
  break;
733
- case 14:
734
- _context10.prev = 14;
735
- _context10.t0 = _context10["catch"](2);
723
+ case 13:
724
+ _context10.prev = 13;
725
+ _context10.t0 = _context10["catch"](1);
736
726
  this.logMethodError('refresh', _context10.t0);
737
727
  throw _context10.t0;
738
- case 18:
728
+ case 17:
739
729
  case "end":
740
730
  return _context10.stop();
741
731
  }
742
- }, _callee10, this, [[2, 14]]);
732
+ }, _callee10, this, [[1, 13]]);
743
733
  }));
744
734
  function refresh() {
745
735
  return _refresh.apply(this, arguments);
@@ -76,8 +76,6 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
76
76
  this.options = options;
77
77
  this.store = _objectSpread(_objectSpread({}, this.store), options.store || {});
78
78
  this.hooks = (_options$otherParams = options.otherParams) === null || _options$otherParams === void 0 || (_options$otherParams = _options$otherParams.rules) === null || _options$otherParams === void 0 ? void 0 : _options$otherParams.hooks;
79
- console.log('[ShopDiscount] 初始化完成');
80
-
81
79
  // 获取依赖的插件
82
80
  this.initializePlugins();
83
81
 
@@ -86,7 +84,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
86
84
 
87
85
  // 注册事件监听
88
86
  this.registerEventListeners();
89
- case 8:
87
+ case 7:
90
88
  case "end":
91
89
  return _context.stop();
92
90
  }
@@ -113,8 +111,6 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
113
111
  _context2.next = 7;
114
112
  return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
115
113
  case 7:
116
- console.log('[ShopDiscount] 已销毁');
117
- case 8:
118
114
  case "end":
119
115
  return _context2.stop();
120
116
  }
@@ -137,8 +133,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
137
133
  this.store.customer = null;
138
134
  (_this$store$discount2 = this.store.discount) === null || _this$store$discount2 === void 0 || _this$store$discount2.clear();
139
135
  (_this$store$rules2 = this.store.rules) === null || _this$store$rules2 === void 0 || _this$store$rules2.clear();
140
- console.log('[ShopDiscount] clear');
141
- case 5:
136
+ case 4:
142
137
  case "end":
143
138
  return _context3.stop();
144
139
  }
@@ -198,6 +198,11 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
198
198
  getOrderProducts(): ScanOrderOrderProduct[];
199
199
  getSummary(): Promise<import("./types").ScanOrderSummary>;
200
200
  submitOrder<T = any>(): Promise<T>;
201
+ /**
202
+ * 0 元订单免费领取(非定金场景)
203
+ * 与 appointment getFreeProduct 同接口:POST /pay/order/free-pay/:id
204
+ */
205
+ submitFreeOrder(id: string | number): Promise<any>;
201
206
  addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
202
207
  updateProductInOrder(params: UpdateProductInOrderParams): Promise<ScanOrderOrderProduct[]>;
203
208
  removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;