@pisell/private-materials 6.6.59 → 6.6.60

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 (49) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.js +9 -9
  8. package/build/lowcode/view.js +9 -9
  9. package/es/components/booking/components/footer/amount.js +4 -3
  10. package/es/components/booking/components/footer/utils.js +10 -3
  11. package/es/components/booking/components/voucher/index.js +1 -1
  12. package/es/components/booking/dashboard/index.d.ts +0 -5
  13. package/es/components/booking/dashboard/index.js +6 -9
  14. package/es/components/booking/info/service2/Group/utils.js +1 -30
  15. package/es/components/booking/info2/service/editService/index.js +49 -6
  16. package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
  17. package/es/components/booking/info2/service/editService/utils.js +16 -0
  18. package/es/components/booking/payments/index.js +1 -1
  19. package/es/components/checkout/hooks/useWalletPass.js +15 -23
  20. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
  21. package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -2
  22. package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +2 -5
  23. package/es/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -2
  24. package/es/components/ticketBooking/components/bookingDataPanel/index.js +2 -5
  25. package/es/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +1 -2
  26. package/es/components/ticketBooking/components/ticketBooking/index.js +37 -156
  27. package/es/components/ticketBooking/index.js +1 -7
  28. package/es/pro/Login2.0/components/phoneValidation.js +58 -65
  29. package/lib/components/booking/components/footer/amount.js +3 -3
  30. package/lib/components/booking/components/footer/utils.js +12 -5
  31. package/lib/components/booking/components/voucher/index.js +1 -1
  32. package/lib/components/booking/dashboard/index.d.ts +0 -5
  33. package/lib/components/booking/dashboard/index.js +5 -6
  34. package/lib/components/booking/info/service2/Group/utils.js +3 -42
  35. package/lib/components/booking/info2/service/editService/index.js +39 -5
  36. package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
  37. package/lib/components/booking/info2/service/editService/utils.js +16 -0
  38. package/lib/components/booking/payments/index.js +1 -1
  39. package/lib/components/checkout/hooks/useWalletPass.js +16 -23
  40. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
  41. package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -2
  42. package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +2 -3
  43. package/lib/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -2
  44. package/lib/components/ticketBooking/components/bookingDataPanel/index.js +3 -10
  45. package/lib/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +1 -10
  46. package/lib/components/ticketBooking/components/ticketBooking/index.js +14 -114
  47. package/lib/components/ticketBooking/index.js +1 -11
  48. package/lib/pro/Login2.0/components/phoneValidation.js +2 -4
  49. package/package.json +4 -4
@@ -52,28 +52,6 @@ import { useDebounceFn } from 'ahooks';
52
52
  import { useOsKey } from "../../context";
53
53
  import { useIsActive } from "../../context/IsActiveContext";
54
54
  import { useShopDiscountModule } from "../../hooks/pisellos/useShopDiscountModule";
55
- // ============= 内存监控埋点(不影响业务逻辑) =============
56
- var MEM_STATS_KEY = '__pisellTicketBookingMemStats';
57
- var getMemStats = function getMemStats() {
58
- var g = globalThis;
59
- if (!g[MEM_STATS_KEY]) {
60
- g[MEM_STATS_KEY] = {
61
- mountedAt: Date.now(),
62
- storeCreateCount: 0,
63
- intervalDateSetCount: 0,
64
- intervalDateTickCount: 0,
65
- postCartUpdateCount: 0,
66
- postCartUpdateBytes: 0,
67
- lastHeartbeatHeapMB: 0,
68
- crossedThresholdsMB: []
69
- };
70
- }
71
- return g[MEM_STATS_KEY];
72
- };
73
- // 水位越线阈值(MB),由低到高,单页面周期内每个阈值只触发一次
74
- var HEAP_CROSS_THRESHOLDS_MB = [800, 1200, 1500, 2000, 2500];
75
- // ========================================================
76
-
77
55
  export var _formatBookingDetail = function _formatBookingDetail(data, modalState) {
78
56
  var _bookings$list, _bookings$list2;
79
57
  var customer_id = data.customer_id,
@@ -271,9 +249,6 @@ var TicketBooking = function TicketBooking(props) {
271
249
  var Toast = useToast();
272
250
  var _persistentRef = useRef(false);
273
251
  var _initStateRef = useRef({});
274
- // 内存监控埋点:镜像最新 state,供心跳定时器读取,避免闭包钉在初次 render
275
- var _memStateRef = useRef(null);
276
- _memStateRef.current = state;
277
252
  var _listTimerRef = useRef();
278
253
  var _timerRef = useRef();
279
254
  var _callbackFnRef = useRef();
@@ -491,96 +466,6 @@ var TicketBooking = function TicketBooking(props) {
491
466
  };
492
467
  }, []);
493
468
 
494
- // ============= 内存监控心跳:每 5 分钟上报一次;水位跨越阈值即时上报 =============
495
- useEffect(function () {
496
- var stats = getMemStats();
497
- // 新页面周期开始,重置 mountedAt 和 crossedThresholds(仅当此单例首次用于本组件)
498
- if (!stats.mountedAt || Date.now() - stats.mountedAt > 24 * 60 * 60 * 1000) {
499
- stats.mountedAt = Date.now();
500
- stats.crossedThresholdsMB = [];
501
- }
502
- var buildPayload = function buildPayload(extra) {
503
- var _store$getState$globa, _store$getState4, _s$modalState$service, _s$modalState, _s$list$bookingList$l, _s$list, _s$bookingId;
504
- var s = _memStateRef.current || {};
505
- var perfMem = performance.memory || {};
506
- var shopId = (_store$getState$globa = store === null || store === void 0 || (_store$getState4 = store.getState) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.call(store)) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.global) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.globalConfig) === null || _store$getState4 === void 0 ? void 0 : _store$getState4.id) !== null && _store$getState$globa !== void 0 ? _store$getState$globa : '';
507
- var jsHeapUsedMB = perfMem.usedJSHeapSize ? +(perfMem.usedJSHeapSize / 1024 / 1024).toFixed(2) : -1;
508
- var jsHeapTotalMB = perfMem.totalJSHeapSize ? +(perfMem.totalJSHeapSize / 1024 / 1024).toFixed(2) : -1;
509
- var jsHeapLimitMB = perfMem.jsHeapSizeLimit ? +(perfMem.jsHeapSizeLimit / 1024 / 1024).toFixed(2) : -1;
510
- var payload = {
511
- page_alive_sec: Math.round((Date.now() - stats.mountedAt) / 1000),
512
- shop_id: shopId,
513
- url: typeof location !== 'undefined' ? location.href.slice(0, 200) : '',
514
- js_heap_used_mb: jsHeapUsedMB,
515
- js_heap_total_mb: jsHeapTotalMB,
516
- js_heap_limit_mb: jsHeapLimitMB,
517
- dom_nodes_count: typeof document !== 'undefined' ? document.getElementsByTagName('*').length : -1,
518
- cart_items_count: (_s$modalState$service = s === null || s === void 0 || (_s$modalState = s.modalState) === null || _s$modalState === void 0 || (_s$modalState = _s$modalState.service) === null || _s$modalState === void 0 || (_s$modalState = _s$modalState.value) === null || _s$modalState === void 0 ? void 0 : _s$modalState.length) !== null && _s$modalState$service !== void 0 ? _s$modalState$service : 0,
519
- booking_list_count: (_s$list$bookingList$l = s === null || s === void 0 || (_s$list = s.list) === null || _s$list === void 0 || (_s$list = _s$list.bookingList) === null || _s$list === void 0 ? void 0 : _s$list.length) !== null && _s$list$bookingList$l !== void 0 ? _s$list$bookingList$l : 0,
520
- modal_open: !!(s !== null && s !== void 0 && s.open),
521
- booking_id: (_s$bookingId = s === null || s === void 0 ? void 0 : s.bookingId) !== null && _s$bookingId !== void 0 ? _s$bookingId : 0,
522
- board_config_loaded: !!(s !== null && s !== void 0 && s.bookingConfig),
523
- store_create_count: stats.storeCreateCount,
524
- interval_date_set_count: stats.intervalDateSetCount,
525
- interval_date_tick_count: stats.intervalDateTickCount,
526
- post_cart_update_count: stats.postCartUpdateCount,
527
- post_cart_update_mb: +(stats.postCartUpdateBytes / 1024 / 1024).toFixed(2),
528
- ua: typeof navigator !== 'undefined' ? navigator.userAgent.slice(0, 120) : ''
529
- };
530
- if (extra) Object.assign(payload, extra);
531
- return payload;
532
- };
533
- var doSend = function doSend(title, extra) {
534
- try {
535
- var payload = buildPayload(extra);
536
- sendWarningLog({
537
- title: title,
538
- content: Object.entries(payload).map(function (_ref) {
539
- var _ref2 = _slicedToArray(_ref, 2),
540
- key = _ref2[0],
541
- value = _ref2[1];
542
- return {
543
- key: key,
544
- value: String(value !== null && value !== void 0 ? value : '')
545
- };
546
- })
547
- });
548
- } catch (e) {}
549
- };
550
-
551
- // 心跳:立即发一次(记录进入时基线),然后每 5 分钟发一次
552
- doSend('TicketBookingMemHeartbeat', {
553
- reason: 'mounted'
554
- });
555
- var heartbeatTimer = setInterval(function () {
556
- var perfMem = performance.memory || {};
557
- var heapMB = perfMem.usedJSHeapSize ? perfMem.usedJSHeapSize / 1024 / 1024 : -1;
558
- stats.lastHeartbeatHeapMB = heapMB;
559
- doSend('TicketBookingMemHeartbeat', {
560
- reason: 'heartbeat'
561
- });
562
-
563
- // 水位越线检测:本轮心跳时发现某阈值被跨越且之前未上报过
564
- if (heapMB > 0) {
565
- for (var _i = 0, _HEAP_CROSS_THRESHOLD = HEAP_CROSS_THRESHOLDS_MB; _i < _HEAP_CROSS_THRESHOLD.length; _i++) {
566
- var th = _HEAP_CROSS_THRESHOLD[_i];
567
- if (heapMB >= th && !stats.crossedThresholdsMB.includes(th)) {
568
- stats.crossedThresholdsMB.push(th);
569
- doSend('TicketBookingMemHeapCross', {
570
- reason: 'heap_cross',
571
- threshold_mb: th,
572
- current_heap_mb: +heapMB.toFixed(2)
573
- });
574
- }
575
- }
576
- }
577
- }, 5 * 60 * 1000);
578
- return function () {
579
- clearInterval(heartbeatTimer);
580
- };
581
- }, []);
582
- // ================================================================================
583
-
584
469
  // 日期选择变更事件
585
470
  var _onDateChange = function _onDateChange(date, dateString) {
586
471
  _setIntervalTime(false);
@@ -594,10 +479,6 @@ var TicketBooking = function TicketBooking(props) {
594
479
  var _setIntervalTime = function _setIntervalTime(isInterval) {
595
480
  clearInterval(_timerRef.current);
596
481
  if (isInterval) {
597
- try {
598
- var _s = getMemStats();
599
- _s.intervalDateSetCount = (_s.intervalDateSetCount || 0) + 1;
600
- } catch (e) {}
601
482
  setState({
602
483
  isTimeChange: false,
603
484
  isDateChange: false
@@ -607,10 +488,6 @@ var TicketBooking = function TicketBooking(props) {
607
488
  }
608
489
  _setDataChange(dayjs());
609
490
  _timerRef.current = setInterval(function () {
610
- try {
611
- var _s2 = getMemStats();
612
- _s2.intervalDateTickCount = (_s2.intervalDateTickCount || 0) + 1;
613
- } catch (e) {}
614
491
  _setDataChange(dayjs());
615
492
  }, 1000 * 60);
616
493
  }
@@ -684,6 +561,7 @@ var TicketBooking = function TicketBooking(props) {
684
561
  } catch (error) {
685
562
  console.error(error);
686
563
  }
564
+ console.log('formatedProducts', total, formatedProducts);
687
565
  var fees = [];
688
566
  var products = [];
689
567
  var _iterator3 = _createForOfIteratorHelper(formatedProducts),
@@ -747,41 +625,42 @@ var TicketBooking = function TicketBooking(props) {
747
625
  message: (_locales$getText2 = locales.getText('pisell2.product.card.cart-items')) === null || _locales$getText2 === void 0 ? void 0 : _locales$getText2(products.length)
748
626
  });
749
627
  }
750
- interaction === null || interaction === void 0 || (_interaction$utils4 = interaction.utils) === null || _interaction$utils4 === void 0 || (_interaction$utils4$p = _interaction$utils4.postMessageToApp) === null || _interaction$utils4$p === void 0 || _interaction$utils4$p.call(_interaction$utils4, {
628
+ console.log('start post message, config:', {
751
629
  module: 'cds',
752
630
  key: 'cartUpdate',
753
631
  data: {
754
632
  currency_symbol: getSymbolic(),
755
- total: total.expectAmount,
633
+ total: total.productAmount,
756
634
  // 小计
757
635
  products: products,
758
636
  fees: fees
759
637
  }
760
638
  });
761
- // 内存监控埋点:统计 cartUpdate 消息的累计次数和字节数
762
- try {
763
- var _s = getMemStats();
764
- _s.postCartUpdateCount = (_s.postCartUpdateCount || 0) + 1;
765
- var _payload = {
639
+ interaction === null || interaction === void 0 || (_interaction$utils4 = interaction.utils) === null || _interaction$utils4 === void 0 || (_interaction$utils4$p = _interaction$utils4.postMessageToApp) === null || _interaction$utils4$p === void 0 || _interaction$utils4$p.call(_interaction$utils4, {
640
+ module: 'cds',
641
+ key: 'cartUpdate',
642
+ data: {
766
643
  currency_symbol: getSymbolic(),
767
644
  total: total.expectAmount,
645
+ // 小计
768
646
  products: products,
769
647
  fees: fees
770
- };
771
- _s.postCartUpdateBytes = (_s.postCartUpdateBytes || 0) + JSON.stringify(_payload).length;
772
- } catch (e) {}
648
+ }
649
+ });
773
650
  }, [state === null || state === void 0 || (_state$modalState2 = state.modalState) === null || _state$modalState2 === void 0 || (_state$modalState2 = _state$modalState2.service) === null || _state$modalState2 === void 0 ? void 0 : _state$modalState2.value]);
774
651
 
775
652
  /**
776
653
  * 设置弹窗内的状态
777
654
  */
778
655
  var _setModalState = function _setModalState(props) {
656
+ var _newVal$service2;
779
657
  console.log('同步state到外层', props);
780
658
  var newVal = _objectSpread({}, props);
781
659
  if (newVal.service) {
782
660
  var _newVal$service;
783
661
  newVal.service.value = (newVal === null || newVal === void 0 || (_newVal$service = newVal.service) === null || _newVal$service === void 0 ? void 0 : _newVal$service.value) || [];
784
662
  }
663
+ console.log(newVal === null || newVal === void 0 || (_newVal$service2 = newVal.service) === null || _newVal$service2 === void 0 ? void 0 : _newVal$service2.value, 'newVal.service.value');
785
664
  setState({
786
665
  modalState: _objectSpread(_objectSpread({}, state.modalState), newVal)
787
666
  });
@@ -817,14 +696,14 @@ var TicketBooking = function TicketBooking(props) {
817
696
  }, 100);
818
697
  };
819
698
  var _setShopOpeningHours = function _setShopOpeningHours() {
820
- var _getData, _store$getState5;
821
- var time = (getData === null || getData === void 0 || (_getData = getData('operating_day_boundary')) === null || _getData === void 0 ? void 0 : _getData.time) || (store === null || store === void 0 || (_store$getState5 = store.getState) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.call(store)) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.global) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.shopDetail) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.operating_day_boundary) === null || _store$getState5 === void 0 ? void 0 : _store$getState5.time);
699
+ var _getData, _store$getState4;
700
+ var time = (getData === null || getData === void 0 || (_getData = getData('operating_day_boundary')) === null || _getData === void 0 ? void 0 : _getData.time) || (store === null || store === void 0 || (_store$getState4 = store.getState) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.call(store)) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.global) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.shopDetail) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.operating_day_boundary) === null || _store$getState4 === void 0 ? void 0 : _store$getState4.time);
822
701
  if (time) {
823
702
  localStorage.setItem('shopOpeningHours', time);
824
703
  }
825
704
  };
826
705
  var _getAddTimeProducts = /*#__PURE__*/function () {
827
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
706
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
828
707
  var data;
829
708
  return _regeneratorRuntime().wrap(function _callee$(_context) {
830
709
  while (1) switch (_context.prev = _context.next) {
@@ -847,7 +726,7 @@ var TicketBooking = function TicketBooking(props) {
847
726
  }, _callee);
848
727
  }));
849
728
  return function _getAddTimeProducts() {
850
- return _ref3.apply(this, arguments);
729
+ return _ref.apply(this, arguments);
851
730
  };
852
731
  }();
853
732
 
@@ -855,7 +734,7 @@ var TicketBooking = function TicketBooking(props) {
855
734
  * 获取board配置
856
735
  */
857
736
  var _getBoardConfig = /*#__PURE__*/function () {
858
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
737
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
859
738
  var bookingConfigParams, isHasCache, cachedBoardConfig, _cachedBoardConfig$co, data;
860
739
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
861
740
  while (1) switch (_context2.prev = _context2.next) {
@@ -909,7 +788,7 @@ var TicketBooking = function TicketBooking(props) {
909
788
  }, _callee2, null, [[3, 11]]);
910
789
  }));
911
790
  return function _getBoardConfig() {
912
- return _ref4.apply(this, arguments);
791
+ return _ref2.apply(this, arguments);
913
792
  };
914
793
  }();
915
794
  var _addVisibilityListener = function _addVisibilityListener(callback) {
@@ -1035,9 +914,9 @@ var TicketBooking = function TicketBooking(props) {
1035
914
  // 储存参数, 添加服务商品时使用
1036
915
  sessionStorage.setItem('pisell2.booking.serviceParams', JSON.stringify(data));
1037
916
  } else {
1038
- var _store$getState6;
917
+ var _store$getState5;
1039
918
  // 当前时区的时间
1040
- var timezone = store === null || store === void 0 || (_store$getState6 = store.getState) === null || _store$getState6 === void 0 || (_store$getState6 = _store$getState6.call(store)) === null || _store$getState6 === void 0 || (_store$getState6 = _store$getState6.global) === null || _store$getState6 === void 0 || (_store$getState6 = _store$getState6.globalConfig) === null || _store$getState6 === void 0 ? void 0 : _store$getState6.timezone;
919
+ var timezone = store === null || store === void 0 || (_store$getState5 = store.getState) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.call(store)) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.global) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.globalConfig) === null || _store$getState5 === void 0 ? void 0 : _store$getState5.timezone;
1041
920
  initState.modalState.date.value = dayjs.tz(new Date(), timezone);
1042
921
  // 兜底, 没有传递则清空下
1043
922
  sessionStorage.removeItem('pisell2.booking.serviceParams');
@@ -1047,6 +926,7 @@ var TicketBooking = function TicketBooking(props) {
1047
926
  }
1048
927
  if (data !== null && data !== void 0 && data.eventBookingServiceParams) {}
1049
928
  }
929
+ console.log(initState, 'initState');
1050
930
  setState(_objectSpread(_objectSpread({}, initState), {}, _defineProperty(_defineProperty({}, state.renderType === 'eventBooking' ? 'eventOpen' : 'open', true), "bookingId", state.bookingId)));
1051
931
  };
1052
932
  var _rebook = useMemoizedFn(function () {
@@ -1065,7 +945,7 @@ var TicketBooking = function TicketBooking(props) {
1065
945
  *
1066
946
  */
1067
947
  var _getBookingDetail = /*#__PURE__*/function () {
1068
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(bookingId) {
948
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(bookingId) {
1069
949
  var renderType, openRebook, getDetail, data;
1070
950
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1071
951
  while (1) switch (_context3.prev = _context3.next) {
@@ -1087,6 +967,7 @@ var TicketBooking = function TicketBooking(props) {
1087
967
  })
1088
968
  });
1089
969
  }
970
+ console.log('getBookingDetail', data);
1090
971
 
1091
972
  // 格式化储存
1092
973
  _initBookingData('edit', data);
@@ -1095,14 +976,14 @@ var TicketBooking = function TicketBooking(props) {
1095
976
  _rebook();
1096
977
  });
1097
978
  }
1098
- case 9:
979
+ case 10:
1099
980
  case "end":
1100
981
  return _context3.stop();
1101
982
  }
1102
983
  }, _callee3);
1103
984
  }));
1104
985
  return function _getBookingDetail(_x) {
1105
- return _ref5.apply(this, arguments);
986
+ return _ref3.apply(this, arguments);
1106
987
  };
1107
988
  }();
1108
989
  /**
@@ -1110,16 +991,16 @@ var TicketBooking = function TicketBooking(props) {
1110
991
  *
1111
992
  */
1112
993
  var _openModal = function _openModal(props) {
1113
- var _ref6 = props || {},
1114
- bookingId = _ref6.bookingId,
1115
- serviceParams = _ref6.serviceParams,
1116
- params = _ref6.params,
1117
- eventBookingServiceParams = _ref6.eventBookingServiceParams,
1118
- _ref6$renderType = _ref6.renderType,
1119
- renderType = _ref6$renderType === void 0 ? 'booking' : _ref6$renderType,
1120
- openRebook = _ref6.openRebook,
1121
- _ref6$isParallelResou = _ref6.isParallelResourcesBooking,
1122
- isParallelResourcesBooking = _ref6$isParallelResou === void 0 ? true : _ref6$isParallelResou;
994
+ var _ref4 = props || {},
995
+ bookingId = _ref4.bookingId,
996
+ serviceParams = _ref4.serviceParams,
997
+ params = _ref4.params,
998
+ eventBookingServiceParams = _ref4.eventBookingServiceParams,
999
+ _ref4$renderType = _ref4.renderType,
1000
+ renderType = _ref4$renderType === void 0 ? 'booking' : _ref4$renderType,
1001
+ openRebook = _ref4.openRebook,
1002
+ _ref4$isParallelResou = _ref4.isParallelResourcesBooking,
1003
+ isParallelResourcesBooking = _ref4$isParallelResou === void 0 ? true : _ref4$isParallelResou;
1123
1004
  setState({
1124
1005
  isShowInfo: false
1125
1006
  });
@@ -1156,7 +1037,7 @@ var TicketBooking = function TicketBooking(props) {
1156
1037
  });
1157
1038
  };
1158
1039
  var _scanBookingDetailResult = /*#__PURE__*/function () {
1159
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(detail) {
1040
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(detail) {
1160
1041
  var _Toast$loading, _result;
1161
1042
  var result, objDetail;
1162
1043
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
@@ -1210,7 +1091,7 @@ var TicketBooking = function TicketBooking(props) {
1210
1091
  }, _callee4);
1211
1092
  }));
1212
1093
  return function _scanBookingDetailResult(_x2) {
1213
- return _ref7.apply(this, arguments);
1094
+ return _ref5.apply(this, arguments);
1214
1095
  };
1215
1096
  }();
1216
1097
  /**
@@ -206,18 +206,12 @@ export default (function (props) {
206
206
  request.setRequest(context.appHelper.utils.request);
207
207
  }, []);
208
208
  useMemo(function () {
209
- try {
210
- var g = globalThis;
211
- if (g.__pisellTicketBookingMemStats) {
212
- g.__pisellTicketBookingMemStats.storeCreateCount = (g.__pisellTicketBookingMemStats.storeCreateCount || 0) + 1;
213
- }
214
- } catch (e) {}
215
209
  var store = createStore(_objectSpread(_objectSpread({}, cloneDeep(initialState)), {}, {
216
210
  bookingConfigParams: bookingConfigParams,
217
211
  productExtensionType: productExtensionType
218
212
  }));
219
213
  storeRef.current = store;
220
- }, [JSON.stringify(bookingConfigParams), JSON.stringify(productExtensionType)]);
214
+ }, [bookingConfigParams, productExtensionType]);
221
215
  useMemo(function () {
222
216
  if (BookingTicket) {
223
217
  var _businessUtils$getApp;
@@ -12,7 +12,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
12
12
  */
13
13
  export var validatePhoneNumber = /*#__PURE__*/function () {
14
14
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, getText) {
15
- var phone, countryCode, match, usCanadaReg, auReg;
15
+ var phone, countryCode, match;
16
16
  return _regeneratorRuntime().wrap(function _callee$(_context) {
17
17
  while (1) switch (_context.prev = _context.next) {
18
18
  case 0:
@@ -55,7 +55,7 @@ export var validatePhoneNumber = /*#__PURE__*/function () {
55
55
  throw new Error(getText('pisell-phone-validation-required'));
56
56
  case 16:
57
57
  _context.t0 = countryCode;
58
- _context.next = _context.t0 === '86' ? 19 : _context.t0 === '852' ? 22 : _context.t0 === '853' ? 25 : _context.t0 === '886' ? 28 : _context.t0 === '1' ? 31 : _context.t0 === '44' ? 35 : _context.t0 === '61' ? 38 : _context.t0 === '81' ? 42 : _context.t0 === '82' ? 45 : _context.t0 === '65' ? 48 : _context.t0 === '60' ? 51 : _context.t0 === '66' ? 54 : _context.t0 === '84' ? 57 : _context.t0 === '63' ? 60 : _context.t0 === '62' ? 63 : _context.t0 === '91' ? 66 : 69;
58
+ _context.next = _context.t0 === '86' ? 19 : _context.t0 === '852' ? 22 : _context.t0 === '853' ? 25 : _context.t0 === '886' ? 28 : _context.t0 === '1' ? 31 : _context.t0 === '44' ? 34 : _context.t0 === '61' ? 37 : _context.t0 === '81' ? 40 : _context.t0 === '82' ? 43 : _context.t0 === '65' ? 46 : _context.t0 === '60' ? 49 : _context.t0 === '66' ? 52 : _context.t0 === '84' ? 55 : _context.t0 === '63' ? 58 : _context.t0 === '62' ? 61 : _context.t0 === '91' ? 64 : 67;
59
59
  break;
60
60
  case 19:
61
61
  if (/^1[3-9]\d{9}$/.test(phone)) {
@@ -64,7 +64,7 @@ export var validatePhoneNumber = /*#__PURE__*/function () {
64
64
  }
65
65
  throw new Error(getText('pisell-phone-validation-china'));
66
66
  case 21:
67
- return _context.abrupt("break", 72);
67
+ return _context.abrupt("break", 70);
68
68
  case 22:
69
69
  if (/^[5-9]\d{7}$/.test(phone)) {
70
70
  _context.next = 24;
@@ -72,7 +72,7 @@ export var validatePhoneNumber = /*#__PURE__*/function () {
72
72
  }
73
73
  throw new Error(getText('pisell-phone-validation-hongkong'));
74
74
  case 24:
75
- return _context.abrupt("break", 72);
75
+ return _context.abrupt("break", 70);
76
76
  case 25:
77
77
  if (/^6\d{7}$/.test(phone)) {
78
78
  _context.next = 27;
@@ -80,7 +80,7 @@ export var validatePhoneNumber = /*#__PURE__*/function () {
80
80
  }
81
81
  throw new Error(getText('pisell-phone-validation-macau'));
82
82
  case 27:
83
- return _context.abrupt("break", 72);
83
+ return _context.abrupt("break", 70);
84
84
  case 28:
85
85
  if (/^9\d{8}$/.test(phone)) {
86
86
  _context.next = 30;
@@ -88,119 +88,112 @@ export var validatePhoneNumber = /*#__PURE__*/function () {
88
88
  }
89
89
  throw new Error(getText('pisell-phone-validation-taiwan'));
90
90
  case 30:
91
- return _context.abrupt("break", 72);
91
+ return _context.abrupt("break", 70);
92
92
  case 31:
93
- // 美国/加拿大
94
- // NANP 标准 10 位格式:3位区号[2-9] + 3位局号[2-9] + 4位
95
- usCanadaReg = /^[2-9]\d{2}[2-9]\d{6}$/;
96
- if (usCanadaReg.test(phone)) {
97
- _context.next = 34;
93
+ if (/^\d{10}$/.test(phone)) {
94
+ _context.next = 33;
98
95
  break;
99
96
  }
100
97
  throw new Error(getText('pisell-phone-validation-us-canada'));
98
+ case 33:
99
+ return _context.abrupt("break", 70);
101
100
  case 34:
102
- return _context.abrupt("break", 72);
103
- case 35:
104
101
  if (/^7\d{9}$/.test(phone)) {
105
- _context.next = 37;
102
+ _context.next = 36;
106
103
  break;
107
104
  }
108
105
  throw new Error(getText('pisell-phone-validation-uk'));
106
+ case 36:
107
+ return _context.abrupt("break", 70);
109
108
  case 37:
110
- return _context.abrupt("break", 72);
111
- case 38:
112
- // 澳大利亚
113
- // const reg = /^(\+?0)?4\d{8}$/;
114
- // 固话前缀 02/03/07/08, 手机前缀 04/05, 首位 0 可选
115
- auReg = /^0?[2-578]\d{8}$/;
116
- if (auReg.test(phone)) {
117
- _context.next = 41;
109
+ if (/^(\+?0)?4\d{8}$/.test(phone)) {
110
+ _context.next = 39;
118
111
  break;
119
112
  }
120
113
  throw new Error(getText('pisell-phone-validation-australia'));
121
- case 41:
122
- return _context.abrupt("break", 72);
123
- case 42:
114
+ case 39:
115
+ return _context.abrupt("break", 70);
116
+ case 40:
124
117
  if (/^[789]0\d{8}$/.test(phone)) {
125
- _context.next = 44;
118
+ _context.next = 42;
126
119
  break;
127
120
  }
128
121
  throw new Error(getText('pisell-phone-validation-japan'));
129
- case 44:
130
- return _context.abrupt("break", 72);
131
- case 45:
122
+ case 42:
123
+ return _context.abrupt("break", 70);
124
+ case 43:
132
125
  if (/^1[0-9]\d{7,8}$/.test(phone)) {
133
- _context.next = 47;
126
+ _context.next = 45;
134
127
  break;
135
128
  }
136
129
  throw new Error(getText('pisell-phone-validation-korea'));
137
- case 47:
138
- return _context.abrupt("break", 72);
139
- case 48:
130
+ case 45:
131
+ return _context.abrupt("break", 70);
132
+ case 46:
140
133
  if (/^[89]\d{7}$/.test(phone)) {
141
- _context.next = 50;
134
+ _context.next = 48;
142
135
  break;
143
136
  }
144
137
  throw new Error(getText('pisell-phone-validation-singapore'));
145
- case 50:
146
- return _context.abrupt("break", 72);
147
- case 51:
138
+ case 48:
139
+ return _context.abrupt("break", 70);
140
+ case 49:
148
141
  if (/^1[0-9]\d{7,8}$/.test(phone)) {
149
- _context.next = 53;
142
+ _context.next = 51;
150
143
  break;
151
144
  }
152
145
  throw new Error(getText('pisell-phone-validation-malaysia'));
153
- case 53:
154
- return _context.abrupt("break", 72);
155
- case 54:
146
+ case 51:
147
+ return _context.abrupt("break", 70);
148
+ case 52:
156
149
  if (/^[689]\d{8}$/.test(phone)) {
157
- _context.next = 56;
150
+ _context.next = 54;
158
151
  break;
159
152
  }
160
153
  throw new Error(getText('pisell-phone-validation-thailand'));
161
- case 56:
162
- return _context.abrupt("break", 72);
163
- case 57:
154
+ case 54:
155
+ return _context.abrupt("break", 70);
156
+ case 55:
164
157
  if (/^[3579]\d{8}$/.test(phone)) {
165
- _context.next = 59;
158
+ _context.next = 57;
166
159
  break;
167
160
  }
168
161
  throw new Error(getText('pisell-phone-validation-vietnam'));
169
- case 59:
170
- return _context.abrupt("break", 72);
171
- case 60:
162
+ case 57:
163
+ return _context.abrupt("break", 70);
164
+ case 58:
172
165
  if (/^9\d{9}$/.test(phone)) {
173
- _context.next = 62;
166
+ _context.next = 60;
174
167
  break;
175
168
  }
176
169
  throw new Error(getText('pisell-phone-validation-philippines'));
177
- case 62:
178
- return _context.abrupt("break", 72);
179
- case 63:
170
+ case 60:
171
+ return _context.abrupt("break", 70);
172
+ case 61:
180
173
  if (/^8\d{8,11}$/.test(phone)) {
181
- _context.next = 65;
174
+ _context.next = 63;
182
175
  break;
183
176
  }
184
177
  throw new Error(getText('pisell-phone-validation-indonesia'));
185
- case 65:
186
- return _context.abrupt("break", 72);
187
- case 66:
178
+ case 63:
179
+ return _context.abrupt("break", 70);
180
+ case 64:
188
181
  if (/^[6-9]\d{9}$/.test(phone)) {
189
- _context.next = 68;
182
+ _context.next = 66;
190
183
  break;
191
184
  }
192
185
  throw new Error(getText('pisell-phone-validation-india'));
193
- case 68:
194
- return _context.abrupt("break", 72);
195
- case 69:
186
+ case 66:
187
+ return _context.abrupt("break", 70);
188
+ case 67:
196
189
  if (/^\d{6,15}$/.test(phone)) {
197
- _context.next = 71;
190
+ _context.next = 69;
198
191
  break;
199
192
  }
200
193
  throw new Error(getText('pisell-phone-validation-invalid'));
201
- case 71:
202
- return _context.abrupt("break", 72);
203
- case 72:
194
+ case 69:
195
+ return _context.abrupt("break", 70);
196
+ case 70:
204
197
  case "end":
205
198
  return _context.stop();
206
199
  }
@@ -323,7 +323,7 @@ var processItemsTax = (items, state, options) => {
323
323
  }
324
324
  }
325
325
  }
326
- return { originTax: expectedOriginTax, tax: expectedTax };
326
+ return { originTax: expectedOriginTax, tax: expectedTax, taxDecimal: preciseTax };
327
327
  };
328
328
  var clearTaxFee = (state) => {
329
329
  var _a, _b;
@@ -376,7 +376,7 @@ var getTax = (state, options) => {
376
376
  computed
377
377
  });
378
378
  totalOriginTax = totalOriginTax.plus(serviceResult.originTax);
379
- totalTax = totalTax.plus(serviceResult.tax);
379
+ totalTax = totalTax.plus(serviceResult.taxDecimal);
380
380
  }
381
381
  if ((_c = state == null ? void 0 : state.addons) == null ? void 0 : _c.value) {
382
382
  const addonsResult = processItemsTax(state.addons.value, state, {
@@ -385,7 +385,7 @@ var getTax = (state, options) => {
385
385
  computed
386
386
  });
387
387
  totalOriginTax = totalOriginTax.plus(addonsResult.originTax);
388
- totalTax = totalTax.plus(addonsResult.tax);
388
+ totalTax = totalTax.plus(addonsResult.taxDecimal);
389
389
  }
390
390
  }
391
391
  return {