@pisell/pisellos 2.1.169 → 2.1.170

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.
@@ -214,6 +214,42 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
214
214
  }
215
215
  return addVenueBookingLog;
216
216
  }()
217
+ /**
218
+ * 临时线上排查日志:
219
+ * - 仅对指定页面 cacheId 开启,避免影响其他页面
220
+ * - 不 await,且吞掉日志上报异常,保证日志系统不会阻断登录/商品加载主流程
221
+ */
222
+ }, {
223
+ key: "logPricingDiagnostics",
224
+ value: function logPricingDiagnostics(title) {
225
+ var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
226
+ if (!this.isPricingDiagnosticsEnabled()) return;
227
+ void this.addVenueBookingLog({
228
+ level: 'info',
229
+ title: title,
230
+ payload: payload
231
+ }).catch(function (error) {
232
+ console.warn('[VenueBooking] pricing diagnostic log failed', error);
233
+ });
234
+ }
235
+ }, {
236
+ key: "isPricingDiagnosticsEnabled",
237
+ value: function isPricingDiagnosticsEnabled() {
238
+ return String(this.cacheId || '') === VenueBookingImpl.PRICING_DEBUG_CACHE_ID;
239
+ }
240
+ }, {
241
+ key: "getAvailableWalletIdsForDiagnostics",
242
+ value: function getAvailableWalletIdsForDiagnostics() {
243
+ try {
244
+ var _this$store$order, _this$store$order$get;
245
+ return (_this$store$order = this.store.order) === null || _this$store$order === void 0 || (_this$store$order$get = _this$store$order.getAvailableWalletIds) === null || _this$store$order$get === void 0 ? void 0 : _this$store$order$get.call(_this$store$order);
246
+ } catch (error) {
247
+ return {
248
+ readFailed: true,
249
+ error: this.serializeError(error)
250
+ };
251
+ }
252
+ }
217
253
  }, {
218
254
  key: "logMethodStart",
219
255
  value: function logMethodStart(method) {
@@ -338,17 +374,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
338
374
  while (1) switch (_context3.prev = _context3.next) {
339
375
  case 0:
340
376
  customerId = _this2.resolveCustomerIdFromLoginPayload(payload);
377
+ _this2.logPricingDiagnostics('[VenueBooking] customer login event received', {
378
+ customerId: customerId,
379
+ hasLoadAllProductsInFlight: !!_this2.loadAllProductsInFlight,
380
+ productsLoaded: _this2.productsLoaded,
381
+ smartPricingProductCatalogCount: _this2.smartPricingProductCatalog.length
382
+ });
341
383
  if (customerId) {
342
- _context3.next = 3;
384
+ _context3.next = 5;
343
385
  break;
344
386
  }
387
+ _this2.logPricingDiagnostics('[VenueBooking] customer login event skipped customerId not found in login payload');
345
388
  return _context3.abrupt("return");
346
- case 3:
347
- _context3.next = 5;
389
+ case 5:
390
+ _context3.next = 7;
348
391
  return _this2.refreshOrderMarketingAfterLogin({
349
392
  customerId: customerId
350
393
  });
351
- case 5:
394
+ case 7:
352
395
  case "end":
353
396
  return _context3.stop();
354
397
  }
@@ -378,22 +421,35 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
378
421
  }
379
422
  throw new Error('order 模块未初始化');
380
423
  case 2:
424
+ this.logPricingDiagnostics('[VenueBooking] refreshOrderMarketingAfterLogin entered', {
425
+ customerId: params.customerId,
426
+ hasCustomerLoginRefreshInFlight: !!this.customerLoginRefreshInFlight,
427
+ customerLoginRefreshIdInFlight: this.customerLoginRefreshIdInFlight,
428
+ hasLoadAllProductsInFlight: !!this.loadAllProductsInFlight,
429
+ productsLoaded: this.productsLoaded,
430
+ smartPricingProductCatalogCount: this.smartPricingProductCatalog.length,
431
+ note: 'This login refresh recalculates the loaded catalog and does not call loadAllProducts'
432
+ });
381
433
  if (!this.customerLoginRefreshInFlight) {
382
- _context5.next = 9;
434
+ _context5.next = 11;
383
435
  break;
384
436
  }
385
437
  if (!(this.customerLoginRefreshIdInFlight === params.customerId)) {
386
- _context5.next = 7;
438
+ _context5.next = 9;
387
439
  break;
388
440
  }
389
- _context5.next = 6;
441
+ this.logPricingDiagnostics('[VenueBooking] customer login refresh reused', {
442
+ customerId: params.customerId,
443
+ reason: 'same customer refresh is already in flight'
444
+ });
445
+ _context5.next = 8;
390
446
  return this.customerLoginRefreshInFlight;
391
- case 6:
447
+ case 8:
392
448
  return _context5.abrupt("return");
393
- case 7:
394
- _context5.next = 9;
395
- return this.customerLoginRefreshInFlight;
396
449
  case 9:
450
+ _context5.next = 11;
451
+ return this.customerLoginRefreshInFlight;
452
+ case 11:
397
453
  this.customerLoginRefreshIdInFlight = params.customerId;
398
454
  refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
399
455
  var _this3$core, _this3$core$emit;
@@ -436,28 +492,28 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
436
492
  }, _callee4);
437
493
  }))();
438
494
  this.customerLoginRefreshInFlight = refreshTask;
439
- _context5.prev = 12;
440
- _context5.next = 15;
495
+ _context5.prev = 14;
496
+ _context5.next = 17;
441
497
  return refreshTask;
442
- case 15:
443
- _context5.next = 20;
444
- break;
445
498
  case 17:
446
- _context5.prev = 17;
447
- _context5.t0 = _context5["catch"](12);
499
+ _context5.next = 22;
500
+ break;
501
+ case 19:
502
+ _context5.prev = 19;
503
+ _context5.t0 = _context5["catch"](14);
448
504
  throw _context5.t0;
449
- case 20:
450
- _context5.prev = 20;
505
+ case 22:
506
+ _context5.prev = 22;
451
507
  if (this.customerLoginRefreshInFlight === refreshTask) {
452
508
  this.customerLoginRefreshInFlight = null;
453
509
  this.customerLoginRefreshIdInFlight = null;
454
510
  }
455
- return _context5.finish(20);
456
- case 23:
511
+ return _context5.finish(22);
512
+ case 25:
457
513
  case "end":
458
514
  return _context5.stop();
459
515
  }
460
- }, _callee5, this, [[12, 17, 20, 23]]);
516
+ }, _callee5, this, [[14, 19, 22, 25]]);
461
517
  }));
462
518
  function refreshOrderMarketingAfterLogin(_x4) {
463
519
  return _refreshOrderMarketingAfterLogin.apply(this, arguments);
@@ -484,8 +540,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
484
540
  scheduleModule,
485
541
  quotationModule,
486
542
  openDataModule,
487
- _this$store$order,
488
543
  _this$store$order2,
544
+ _this$store$order3,
489
545
  _args6 = arguments;
490
546
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
491
547
  while (1) switch (_context6.prev = _context6.next) {
@@ -504,6 +560,12 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
504
560
  this.store.slotConfig = _objectSpread({}, this.baseSlotConfig);
505
561
  this.otherParams = options.otherParams || {};
506
562
  this.cacheId = (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.cacheId;
563
+ this.logPricingDiagnostics('[VenueBooking] initialize product loading state', {
564
+ hasLoadAllProductsInFlight: !!this.loadAllProductsInFlight,
565
+ productsLoaded: this.productsLoaded,
566
+ smartPricingProductCatalogCount: this.smartPricingProductCatalog.length,
567
+ note: 'initialize currently does not reset the product loading state'
568
+ });
507
569
  this.itemRuleRuntimeConfig = ((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.venueBookingItemRule) || ((_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.itemRule) || {};
508
570
  this.itemRuleConfigs = [];
509
571
  this.itemRuleConfigsPromise = null;
@@ -516,19 +578,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
516
578
  this.window = core.getPlugin('window');
517
579
  this.request = core.getPlugin('request');
518
580
  if (this.window) {
519
- _context6.next = 25;
581
+ _context6.next = 26;
520
582
  break;
521
583
  }
522
584
  this.logMethodError('initialize', 'window plugin missing');
523
585
  throw new Error('venueBooking解决方案需要 window 插件支持');
524
- case 25:
586
+ case 26:
525
587
  if (this.request) {
526
- _context6.next = 28;
588
+ _context6.next = 29;
527
589
  break;
528
590
  }
529
591
  this.logMethodError('initialize', 'request plugin missing');
530
592
  throw new Error('venueBooking解决方案需要 request 插件支持');
531
- case 28:
593
+ case 29:
532
594
  // 注册基础模块(order, salesSummary, products, logger)
533
595
  baseModules = ['scanOrderLogger', 'products', 'order', 'salesSummary'];
534
596
  baseModules.forEach(function (step) {
@@ -625,41 +687,41 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
625
687
  }
626
688
  this.registerCustomerLoginListeners();
627
689
  console.log('[VenueBooking] 初始化开始');
628
- _context6.prev = 51;
629
- _context6.next = 54;
630
- return (_this$store$order = this.store.order) === null || _this$store$order === void 0 ? void 0 : _this$store$order.recalculateSummary({
690
+ _context6.prev = 52;
691
+ _context6.next = 55;
692
+ return (_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 ? void 0 : _this$store$order2.recalculateSummary({
631
693
  createIfMissing: false
632
694
  });
633
- case 54:
634
- (_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || _this$store$order2.persistTempOrder();
635
- _context6.next = 57;
695
+ case 55:
696
+ (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || _this$store$order3.persistTempOrder();
697
+ _context6.next = 58;
636
698
  return this.loadRuntimeConfigs();
637
- case 57:
699
+ case 58:
638
700
  if (!this.store.schedule) {
639
- _context6.next = 60;
701
+ _context6.next = 61;
640
702
  break;
641
703
  }
642
- _context6.next = 60;
704
+ _context6.next = 61;
643
705
  return this.store.schedule.loadAllSchedule();
644
- case 60:
645
- _context6.next = 62;
706
+ case 61:
707
+ _context6.next = 63;
646
708
  return this.refreshItemRuleQuantityLimits();
647
- case 62:
709
+ case 63:
648
710
  this.store.status = 'ready';
649
711
  console.log('[VenueBooking] 初始化完成');
650
- _context6.next = 66;
712
+ _context6.next = 67;
651
713
  return this.core.effects.emit(VenueBookingHooks.onInited, {
652
714
  status: this.store.status
653
715
  });
654
- case 66:
716
+ case 67:
655
717
  this.logMethodSuccess('initialize', {
656
718
  status: this.store.status
657
719
  });
658
- _context6.next = 76;
720
+ _context6.next = 77;
659
721
  break;
660
- case 69:
661
- _context6.prev = 69;
662
- _context6.t0 = _context6["catch"](51);
722
+ case 70:
723
+ _context6.prev = 70;
724
+ _context6.t0 = _context6["catch"](52);
663
725
  this.store.status = 'error';
664
726
  this.store.error = _context6.t0 instanceof Error ? _context6.t0.message : '初始化失败';
665
727
  console.error('[VenueBooking] 初始化失败', _context6.t0);
@@ -667,11 +729,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
667
729
  status: this.store.status
668
730
  });
669
731
  throw _context6.t0;
670
- case 76:
732
+ case 77:
671
733
  case "end":
672
734
  return _context6.stop();
673
735
  }
674
- }, _callee6, this, [[51, 69]]);
736
+ }, _callee6, this, [[52, 70]]);
675
737
  }));
676
738
  function initialize(_x5) {
677
739
  return _initialize.apply(this, arguments);
@@ -836,8 +898,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
836
898
  }, {
837
899
  key: "resolveAvailableWalletIdsForSmartPricing",
838
900
  value: function resolveAvailableWalletIdsForSmartPricing() {
839
- var _this$store$order3, _this$store$order3$ge, _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
840
- var orderWalletIds = (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getAvailableWalletIds) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3);
901
+ var _this$store$order4, _this$store$order4$ge, _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
902
+ var orderWalletIds = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 || (_this$store$order4$ge = _this$store$order4.getAvailableWalletIds) === null || _this$store$order4$ge === void 0 ? void 0 : _this$store$order4$ge.call(_this$store$order4);
841
903
  var fallbackWalletIds = ((_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.available_wallet_ids) || ((_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.availableWalletIds) || ((_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 || (_this$otherParams8 = _this$otherParams8.strategy_context) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.available_wallet_ids) || ((_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 || (_this$otherParams9 = _this$otherParams9.strategy_context) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.availableWalletIds);
842
904
  var source = Array.isArray(orderWalletIds) && orderWalletIds.length ? orderWalletIds : fallbackWalletIds;
843
905
  if (!Array.isArray(source)) return [];
@@ -863,9 +925,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
863
925
  }, {
864
926
  key: "buildSmartPricingContext",
865
927
  value: function buildSmartPricingContext(customerId) {
866
- var _this$core3, _this$otherParams10, _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14, _this$otherParams15, _this$otherParams16;
928
+ var _this$core3,
929
+ _this$otherParams10,
930
+ _this$otherParams11,
931
+ _this$otherParams12,
932
+ _this$otherParams13,
933
+ _this$otherParams14,
934
+ _this$otherParams15,
935
+ _this$otherParams16,
936
+ _this5 = this;
867
937
  var evaluator = (_this$core3 = this.core) === null || _this$core3 === void 0 || (_this$core3 = _this$core3.context) === null || _this$core3 === void 0 ? void 0 : _this$core3.dataVariantEvaluator;
868
- return {
938
+ return _objectSpread({
869
939
  evaluator: evaluator,
870
940
  scheduleList: this.getScheduleListForSmartPricing(),
871
941
  menuList: ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.menuList) || ((_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 || (_this$otherParams11 = _this$otherParams11.openData) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.menuList) || [],
@@ -875,7 +945,12 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
875
945
  businessCode: (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.businessCode,
876
946
  orderType: ((_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.orderType) || ((_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.type),
877
947
  strategy_context: (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.strategy_context
878
- };
948
+ }, this.isPricingDiagnosticsEnabled() ? {
949
+ debugLog: function debugLog(title) {
950
+ var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
951
+ return _this5.logPricingDiagnostics(title, payload);
952
+ }
953
+ } : {});
879
954
  }
880
955
 
881
956
  /** venue + addon 全量商品,供智能定价评估 */
@@ -924,21 +999,41 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
924
999
  key: "loadAllProducts",
925
1000
  value: function () {
926
1001
  var _loadAllProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
927
- var _this5 = this;
1002
+ var _this6 = this;
928
1003
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
929
1004
  while (1) switch (_context10.prev = _context10.next) {
930
1005
  case 0:
1006
+ this.logPricingDiagnostics('[VenueBooking] loadAllProducts called', {
1007
+ hasLoadAllProductsInFlight: !!this.loadAllProductsInFlight,
1008
+ productsLoaded: this.productsLoaded,
1009
+ smartPricingCustomerId: this.smartPricingCustomerId,
1010
+ smartPricingProductCatalogCount: this.smartPricingProductCatalog.length,
1011
+ venueProducts: !this.store.venueProducts,
1012
+ addonProducts: !this.store.addonProducts
1013
+ });
931
1014
  if (!this.loadAllProductsInFlight) {
932
- _context10.next = 2;
1015
+ _context10.next = 4;
933
1016
  break;
934
1017
  }
1018
+ this.logPricingDiagnostics('[VenueBooking] loadAllProducts request skipped', {
1019
+ reason: 'reusing existing loadAllProductsInFlight promise',
1020
+ productsLoaded: this.productsLoaded
1021
+ });
935
1022
  return _context10.abrupt("return", this.loadAllProductsInFlight);
936
- case 2:
1023
+ case 4:
1024
+ this.logPricingDiagnostics('[VenueBooking] loadAllProducts request starting', {
1025
+ productsLoaded: this.productsLoaded,
1026
+ smartPricingCustomerId: this.smartPricingCustomerId
1027
+ });
937
1028
  this.loadAllProductsInFlight = this._doLoadAllProducts().finally(function () {
938
- _this5.loadAllProductsInFlight = null;
1029
+ _this6.logPricingDiagnostics('[VenueBooking] loadAllProducts request settled', {
1030
+ productsLoaded: _this6.productsLoaded,
1031
+ smartPricingProductCatalogCount: _this6.smartPricingProductCatalog.length
1032
+ });
1033
+ _this6.loadAllProductsInFlight = null;
939
1034
  });
940
1035
  return _context10.abrupt("return", this.loadAllProductsInFlight);
941
- case 4:
1036
+ case 7:
942
1037
  case "end":
943
1038
  return _context10.stop();
944
1039
  }
@@ -953,7 +1048,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
953
1048
  key: "_doLoadAllProducts",
954
1049
  value: function () {
955
1050
  var _doLoadAllProducts2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
956
- var _this$otherParams17, _this$store$venueProd, associatedMenus, menuListIds, allProducts, rawList, list, venueList, addonList, venueStore;
1051
+ var _this$otherParams17, _this$store$venueProd, associatedMenus, menuListIds, allProducts, rawList, list, smartPricingContext, venueList, addonList, venueStore;
957
1052
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
958
1053
  while (1) switch (_context11.prev = _context11.next) {
959
1054
  case 0:
@@ -998,7 +1093,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
998
1093
  rawList = Array.isArray(allProducts) ? allProducts : [];
999
1094
  list = rawList;
1000
1095
  this.smartPricingProductCatalog = rawList.slice();
1001
- list = formatProductsWithDataVariant(list, this.buildSmartPricingContext(), dayjs().format('YYYY-MM-DD HH:mm:ss'));
1096
+ smartPricingContext = this.buildSmartPricingContext();
1097
+ list = formatProductsWithDataVariant(list, smartPricingContext, dayjs().format('YYYY-MM-DD HH:mm:ss'));
1098
+
1099
+ // 增加日志排查智能定价
1100
+ if (this.isPricingDiagnosticsEnabled()) {
1101
+ this.logPricingDiagnostics('[VenueBooking] loadAllProducts smart pricing context', {
1102
+ smartPricingContext: smartPricingContext,
1103
+ rawList: rawList,
1104
+ list: list,
1105
+ otherParams: this.otherParams,
1106
+ availableWalletIds: this.getAvailableWalletIdsForDiagnostics()
1107
+ });
1108
+ }
1002
1109
  this.clearSlotPriceMapCache();
1003
1110
  venueList = list.filter(function (p) {
1004
1111
  return p.duration != null;
@@ -1025,16 +1132,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1025
1132
  venueProducts: venueList,
1026
1133
  addonProducts: addonList
1027
1134
  });
1028
- case 32:
1029
- _context11.prev = 32;
1135
+ case 34:
1136
+ _context11.prev = 34;
1030
1137
  _context11.t0 = _context11["catch"](1);
1031
1138
  this.logMethodError('loadAllProducts', _context11.t0);
1032
1139
  throw _context11.t0;
1033
- case 36:
1140
+ case 38:
1034
1141
  case "end":
1035
1142
  return _context11.stop();
1036
1143
  }
1037
- }, _callee11, this, [[1, 32]]);
1144
+ }, _callee11, this, [[1, 34]]);
1038
1145
  }));
1039
1146
  function _doLoadAllProducts() {
1040
1147
  return _doLoadAllProducts2.apply(this, arguments);
@@ -1049,12 +1156,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1049
1156
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1050
1157
  while (1) switch (_context12.prev = _context12.next) {
1051
1158
  case 0:
1052
- _context12.next = 2;
1159
+ this.logPricingDiagnostics('[VenueBooking] loadVenueProducts called', {
1160
+ hasLoadAllProductsInFlight: !!this.loadAllProductsInFlight,
1161
+ productsLoaded: this.productsLoaded
1162
+ });
1163
+ _context12.next = 3;
1053
1164
  return this.loadAllProducts();
1054
- case 2:
1165
+ case 3:
1055
1166
  result = _context12.sent;
1056
1167
  return _context12.abrupt("return", result.venueProducts);
1057
- case 4:
1168
+ case 5:
1058
1169
  case "end":
1059
1170
  return _context12.stop();
1060
1171
  }
@@ -1346,7 +1457,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1346
1457
  }, {
1347
1458
  key: "getDateRangeSummary",
1348
1459
  value: function getDateRangeSummary(params) {
1349
- var _this6 = this;
1460
+ var _this7 = this;
1350
1461
  return buildDateRangeSummary({
1351
1462
  startDate: params.startDate,
1352
1463
  endDate: params.endDate,
@@ -1354,10 +1465,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1354
1465
  rawResources: this.store.rawResourceData,
1355
1466
  resourceProductMap: this.resourceProductMap,
1356
1467
  resolveConfig: function resolveConfig(date) {
1357
- return _this6.resolveSlotConfigForDate(date);
1468
+ return _this7.resolveSlotConfigForDate(date);
1358
1469
  },
1359
1470
  buildSlotPriceMap: function buildSlotPriceMap(date, config, productIds) {
1360
- return _this6.buildSlotPriceMapForDate(date, config, productIds);
1471
+ return _this7.buildSlotPriceMapForDate(date, config, productIds);
1361
1472
  }
1362
1473
  });
1363
1474
  }
@@ -1474,8 +1585,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1474
1585
  }, {
1475
1586
  key: "getSelectedSlotsForResource",
1476
1587
  value: function getSelectedSlotsForResource(resourceId, productId) {
1477
- var _this$store$order4;
1478
- var tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 ? void 0 : _this$store$order4.getTempOrder();
1588
+ var _this$store$order5;
1589
+ var tempOrder = (_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 ? void 0 : _this$store$order5.getTempOrder();
1479
1590
  if (!tempOrder) return [];
1480
1591
  var venueProducts = tempOrder.products.filter(function (p) {
1481
1592
  var _p$metadata, _p$metadata2;
@@ -1540,7 +1651,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1540
1651
  }, {
1541
1652
  key: "isSlotDisabledBySelection",
1542
1653
  value: function isSlotDisabledBySelection(params) {
1543
- var _this7 = this;
1654
+ var _this8 = this;
1544
1655
  var resourceId = params.resourceId,
1545
1656
  productId = params.productId,
1546
1657
  startTime = params.startTime;
@@ -1562,7 +1673,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1562
1673
 
1563
1674
  // 组合资源字段缓存
1564
1675
  var getCombinedChildIds = function getCombinedChildIds(resId) {
1565
- var raw = _this7.store.rawResourceData.find(function (r) {
1676
+ var raw = _this8.store.rawResourceData.find(function (r) {
1566
1677
  return String(r.resourceId) === String(resId);
1567
1678
  });
1568
1679
  var combined = raw === null || raw === void 0 ? void 0 : raw.combined_resource;
@@ -1636,9 +1747,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1636
1747
  }, {
1637
1748
  key: "getAllSelectedSlots",
1638
1749
  value: function getAllSelectedSlots() {
1639
- var _this$store$order5;
1750
+ var _this$store$order6;
1640
1751
  var result = new Map();
1641
- var tempOrder = (_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 ? void 0 : _this$store$order5.getTempOrder();
1752
+ var tempOrder = (_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 ? void 0 : _this$store$order6.getTempOrder();
1642
1753
  if (!tempOrder) return result;
1643
1754
  var venueProducts = tempOrder.products.filter(function (p) {
1644
1755
  var _p$metadata3;
@@ -1881,7 +1992,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1881
1992
  }, {
1882
1993
  key: "getCombinedChildRawResources",
1883
1994
  value: function getCombinedChildRawResources(rawResource) {
1884
- var _this8 = this;
1995
+ var _this9 = this;
1885
1996
  if (!rawResource) return undefined;
1886
1997
  var combined = rawResource.combined_resource;
1887
1998
  if (!combined || combined.status !== 1 || !Array.isArray(combined.resource_ids) || !combined.resource_ids.length) {
@@ -1893,7 +2004,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1893
2004
  try {
1894
2005
  var _loop3 = function _loop3() {
1895
2006
  var id = _step11.value;
1896
- var child = _this8.store.rawResourceData.find(function (r) {
2007
+ var child = _this9.store.rawResourceData.find(function (r) {
1897
2008
  return String(r.resourceId) === String(id);
1898
2009
  });
1899
2010
  if (child) children.push(child);
@@ -1971,8 +2082,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1971
2082
  }, {
1972
2083
  key: "getTempOrder",
1973
2084
  value: function getTempOrder() {
1974
- var _this$store$order6;
1975
- var result = ((_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 ? void 0 : _this$store$order6.getTempOrder()) || null;
2085
+ var _this$store$order7;
2086
+ var result = ((_this$store$order7 = this.store.order) === null || _this$store$order7 === void 0 ? void 0 : _this$store$order7.getTempOrder()) || null;
1976
2087
  return result;
1977
2088
  }
1978
2089
  }, {
@@ -2034,7 +2145,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2034
2145
  key: "recalculateOrderPricesFromSmartPricing",
2035
2146
  value: function recalculateOrderPricesFromSmartPricing() {
2036
2147
  var _tempOrder$products,
2037
- _this9 = this;
2148
+ _this10 = this;
2038
2149
  if (!this.store.order) return;
2039
2150
  var tempOrder = this.store.order.getTempOrder();
2040
2151
  if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$products = tempOrder.products) !== null && _tempOrder$products !== void 0 && _tempOrder$products.length)) return;
@@ -2048,13 +2159,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2048
2159
  var _product$metadata2;
2049
2160
  var product = _step12.value;
2050
2161
  if ((_product$metadata2 = product.metadata) !== null && _product$metadata2 !== void 0 && _product$metadata2.venue_booking) {
2051
- var mappings = _this9.resourceProductMap.get(product.metadata.resource_id);
2162
+ var mappings = _this10.resourceProductMap.get(product.metadata.resource_id);
2052
2163
  if (!mappings || !mappings.length) return 0; // continue
2053
2164
  var mapping = mappings.find(function (m) {
2054
2165
  return Number(m.productId) === Number(product.product_id);
2055
2166
  }) || mappings[0];
2056
2167
  if (!mapping) return 0; // continue
2057
- var slots = expandMergedSlotToIndividual(product, _this9.store.slotConfig.slotDurationMinutes);
2168
+ var slots = expandMergedSlotToIndividual(product, _this10.store.slotConfig.slotDurationMinutes);
2058
2169
  var uniqueDates = _toConsumableArray(new Set(slots.map(function (slot) {
2059
2170
  return dayjs(slot.startTime).format('YYYY-MM-DD');
2060
2171
  })));
@@ -2064,7 +2175,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2064
2175
  try {
2065
2176
  for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
2066
2177
  var slotDate = _step13.value;
2067
- slotPriceMaps.set(slotDate, _this9.buildSlotPriceMapForDate(slotDate, _this9.store.slotConfig, [mapping.productId]));
2178
+ slotPriceMaps.set(slotDate, _this10.buildSlotPriceMapForDate(slotDate, _this10.store.slotConfig, [mapping.productId]));
2068
2179
  }
2069
2180
  } catch (err) {
2070
2181
  _iterator13.e(err);
@@ -2086,7 +2197,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2086
2197
  });
2087
2198
  var merged = mergeConsecutiveSlots(updatedSlots);
2088
2199
  if (merged.length === 1) {
2089
- _this9.resetProductPriceForSmartPricing({
2200
+ _this10.resetProductPriceForSmartPricing({
2090
2201
  product: product,
2091
2202
  price: merged[0].totalPrice,
2092
2203
  priceBreakdown: buildPriceBreakdown({
@@ -2103,7 +2214,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2103
2214
  datetime: now,
2104
2215
  fallbackPrice: product.selling_price
2105
2216
  });
2106
- _this9.resetProductPriceForSmartPricing({
2217
+ _this10.resetProductPriceForSmartPricing({
2107
2218
  product: product,
2108
2219
  price: smartPrice
2109
2220
  });
@@ -2209,7 +2320,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2209
2320
  key: "setDiscountSelected",
2210
2321
  value: (function () {
2211
2322
  var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(params) {
2212
- var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator14, _step14, d, afterApplyTarget, finalSummary, finalProduct, finalTarget;
2323
+ var _tempOrder$holder, _this$store$order$get2, _this$store$order$get3, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator14, _step14, d, afterApplyTarget, finalSummary, finalProduct, finalTarget;
2213
2324
  return _regeneratorRuntime().wrap(function _callee21$(_context21) {
2214
2325
  while (1) switch (_context21.prev = _context21.next) {
2215
2326
  case 0:
@@ -2302,8 +2413,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2302
2413
  });
2303
2414
  case 25:
2304
2415
  this.store.order.persistTempOrder();
2305
- finalSummary = ((_this$store$order$get = this.store.order.getTempOrder()) === null || _this$store$order$get === void 0 ? void 0 : _this$store$order$get.summary) || null;
2306
- finalProduct = ((_this$store$order$get2 = this.store.order.getTempOrder()) === null || _this$store$order$get2 === void 0 || (_this$store$order$get2 = _this$store$order$get2.products) === null || _this$store$order$get2 === void 0 ? void 0 : _this$store$order$get2[0]) || null;
2416
+ finalSummary = ((_this$store$order$get2 = this.store.order.getTempOrder()) === null || _this$store$order$get2 === void 0 ? void 0 : _this$store$order$get2.summary) || null;
2417
+ finalProduct = ((_this$store$order$get3 = this.store.order.getTempOrder()) === null || _this$store$order$get3 === void 0 || (_this$store$order$get3 = _this$store$order$get3.products) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3[0]) || null;
2307
2418
  this.logMethodSuccess('setDiscountSelected', params);
2308
2419
  finalTarget = this.store.order.getDiscountList().find(function (d) {
2309
2420
  return d.id === params.discountId;
@@ -2679,7 +2790,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2679
2790
  key: "removeProductFromOrder",
2680
2791
  value: function () {
2681
2792
  var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(identity) {
2682
- var _this$store$order$get3, _this$store$order7, _this$store$order$ens, _this$store$order8, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator16, _step16, _product$metadata5, _product$metadata6, product, beforeBookingCount, _this$store$order$per, _this$store$order9;
2793
+ var _this$store$order$get4, _this$store$order8, _this$store$order$ens, _this$store$order9, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator16, _step16, _product$metadata5, _product$metadata6, product, beforeBookingCount, _this$store$order$per, _this$store$order10;
2683
2794
  return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2684
2795
  while (1) switch (_context28.prev = _context28.next) {
2685
2796
  case 0:
@@ -2694,7 +2805,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2694
2805
  }
2695
2806
  throw new Error('order 模块未初始化');
2696
2807
  case 4:
2697
- tempOrder = ((_this$store$order$get3 = (_this$store$order7 = this.store.order).getTempOrder) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.call(_this$store$order7)) || ((_this$store$order$ens = (_this$store$order8 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order8));
2808
+ tempOrder = ((_this$store$order$get4 = (_this$store$order8 = this.store.order).getTempOrder) === null || _this$store$order$get4 === void 0 ? void 0 : _this$store$order$get4.call(_this$store$order8)) || ((_this$store$order$ens = (_this$store$order9 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order9));
2698
2809
  _context28.next = 7;
2699
2810
  return this.store.order.removeProductFromOrder(identity);
2700
2811
  case 7:
@@ -2751,7 +2862,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2751
2862
  return true;
2752
2863
  });
2753
2864
  if ((((_tempOrder$bookings3 = tempOrder.bookings) === null || _tempOrder$bookings3 === void 0 ? void 0 : _tempOrder$bookings3.length) || 0) !== beforeBookingCount) {
2754
- (_this$store$order$per = (_this$store$order9 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order9);
2865
+ (_this$store$order$per = (_this$store$order10 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order10);
2755
2866
  }
2756
2867
  case 33:
2757
2868
  _context28.next = 35;
@@ -2789,17 +2900,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2789
2900
  while (1) switch (_context29.prev = _context29.next) {
2790
2901
  case 0:
2791
2902
  if (!this.productsLoaded) {
2792
- _context29.next = 2;
2903
+ _context29.next = 3;
2793
2904
  break;
2794
2905
  }
2906
+ this.logPricingDiagnostics('[VenueBooking] getProductList loadAllProducts skipped', {
2907
+ reason: 'productsLoaded is true',
2908
+ addonProductCount: this.getAddonProductsList().length,
2909
+ smartPricingProductCatalogCount: this.smartPricingProductCatalog.length
2910
+ });
2795
2911
  return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
2796
- case 2:
2797
- _context29.next = 4;
2912
+ case 3:
2913
+ _context29.next = 5;
2798
2914
  return this.loadAllProducts();
2799
- case 4:
2915
+ case 5:
2800
2916
  result = _context29.sent;
2801
2917
  return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
2802
- case 6:
2918
+ case 7:
2803
2919
  case "end":
2804
2920
  return _context29.stop();
2805
2921
  }
@@ -3042,7 +3158,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3042
3158
  key: "ensureItemRuleConfigsLoaded",
3043
3159
  value: function () {
3044
3160
  var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
3045
- var _this10 = this;
3161
+ var _this11 = this;
3046
3162
  return _regeneratorRuntime().wrap(function _callee35$(_context35) {
3047
3163
  while (1) switch (_context35.prev = _context35.next) {
3048
3164
  case 0:
@@ -3063,19 +3179,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3063
3179
  return _regeneratorRuntime().wrap(function _callee34$(_context34) {
3064
3180
  while (1) switch (_context34.prev = _context34.next) {
3065
3181
  case 0:
3066
- runtimeConfig = _this10.getItemRuleRuntimeConfig();
3182
+ runtimeConfig = _this11.getItemRuleRuntimeConfig();
3067
3183
  staticConfigs = normalizeItemRuleStrategies(runtimeConfig.strategyConfigs);
3068
3184
  if (!(staticConfigs.length > 0)) {
3069
3185
  _context34.next = 6;
3070
3186
  break;
3071
3187
  }
3072
- _this10.itemRuleConfigs = staticConfigs;
3073
- _this10.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
3074
- return _context34.abrupt("return", _this10.itemRuleConfigs);
3188
+ _this11.itemRuleConfigs = staticConfigs;
3189
+ _this11.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
3190
+ return _context34.abrupt("return", _this11.itemRuleConfigs);
3075
3191
  case 6:
3076
- _this10.itemRuleConfigs = [];
3077
- _this10.itemRuleEvaluator.setStrategyConfigs([]);
3078
- return _context34.abrupt("return", _this10.itemRuleConfigs);
3192
+ _this11.itemRuleConfigs = [];
3193
+ _this11.itemRuleEvaluator.setStrategyConfigs([]);
3194
+ return _context34.abrupt("return", _this11.itemRuleConfigs);
3079
3195
  case 9:
3080
3196
  case "end":
3081
3197
  return _context34.stop();
@@ -3647,6 +3763,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3647
3763
  }]);
3648
3764
  return VenueBookingImpl;
3649
3765
  }(BaseModule);
3766
+ _defineProperty(VenueBookingImpl, "PRICING_DEBUG_CACHE_ID", '031596279011848516');
3650
3767
  _defineProperty(VenueBookingImpl, "OPEN_DATA_CACHE_TTL", 5 * 60 * 1000);
3651
3768
  _defineProperty(VenueBookingImpl, "PISELL1_LOGIN_SUCCESS", 'pisell1.login.success');
3652
3769
  _defineProperty(VenueBookingImpl, "UI_STATE_KEY_PREFIX", 'pisell.venueBooking.uiState:');