@pisell/private-materials 6.1.3 → 6.1.5

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 (24) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +2 -2
  6. package/build/lowcode/view.js +2 -2
  7. package/es/components/booking/info2/index.js +1 -0
  8. package/es/components/booking/info2/service/editService/index.js +28 -12
  9. package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
  10. package/es/components/ticketBooking/components/timeBar/index.js +78 -71
  11. package/es/components/ticketBooking/index.js +2 -2
  12. package/lib/components/booking/info2/service/editService/index.js +20 -7
  13. package/lib/components/ticketBooking/components/ticketBooking/index.js +25 -25
  14. package/lib/components/ticketBooking/components/timeBar/index.js +95 -88
  15. package/lib/components/ticketBooking/index.js +2 -2
  16. package/package.json +3 -3
  17. package/es/components/booking/components/drawer/index.d.ts +0 -19
  18. package/es/components/booking/info2/service/addService/utils.d.ts +0 -98
  19. package/es/components/booking/info2/service/editService/Resources/index.d.ts +0 -4
  20. package/es/components/booking/materiels/duration/index.d.ts +0 -13
  21. package/lib/components/booking/components/drawer/index.d.ts +0 -19
  22. package/lib/components/booking/info2/service/addService/utils.d.ts +0 -98
  23. package/lib/components/booking/info2/service/editService/Resources/index.d.ts +0 -4
  24. package/lib/components/booking/materiels/duration/index.d.ts +0 -13
@@ -79,6 +79,7 @@ var Info = Provider(function (props) {
79
79
  }, []);
80
80
  useMemo(function () {
81
81
  var _context$appHelper, _context$appHelper$ge, _context$appHelper2, _context$appHelper2$i, _context$appHelper3;
82
+ // TODO: 优化 内部每次设置state会触发两次渲染
82
83
  var isFranchisee = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.businessUtils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getAppByModal) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper, 'franchisee');
83
84
  modal.dispatch({
84
85
  type: 'setState',
@@ -38,7 +38,7 @@ import { getErrorList } from "../../utilsByBooking";
38
38
  import { formatResources, getDurationProps, getFlexibleOption, getTimeObj, setDefaultCapacitys } from "../addService/utils";
39
39
  var submitLock = false;
40
40
  var Info = function Info(_, ref) {
41
- var _state$service3, _state$bookingConfig2, _state$bookingConfig3, _state$service$cacheI4, _state$service$cacheI5, _state$service5, _window$BaseMaterials, _state$service7, _state$service$cacheI10, _state$bookingConfig5, _state$service$cacheI11, _state$service$cacheI12, _state$service8, _state$service$resour2, _state$service$cacheI13, _state$service$cacheI14;
41
+ var _state$service4, _state$bookingConfig2, _state$bookingConfig3, _state$service$cacheI4, _state$service$cacheI5, _state$service6, _window$BaseMaterials, _state$service8, _state$service$cacheI10, _state$bookingConfig5, _state$service$cacheI11, _state$service$cacheI12, _state$service9, _state$service$resour2, _state$service$cacheI13, _state$service$cacheI14;
42
42
  var _Form$useForm = Form.useForm(),
43
43
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
44
44
  form = _Form$useForm2[0];
@@ -64,9 +64,12 @@ var Info = function Info(_, ref) {
64
64
  };
65
65
  }, []);
66
66
  var isNormalProduct = useMemo(function () {
67
- var _state$service, _state$service2;
68
- return (state === null || state === void 0 || (_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.cacheItem) && isNormalProductByDurationSchedule(state === null || state === void 0 || (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.cacheItem);
69
- }, [state === null || state === void 0 || (_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.cacheItem]);
67
+ var _state$service, _state$service2, _state$service3;
68
+ if (!(state !== null && state !== void 0 && (_state$service = state.service) !== null && _state$service !== void 0 && _state$service.cacheItem)) {
69
+ return true;
70
+ }
71
+ return (state === null || state === void 0 || (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.cacheItem) && isNormalProductByDurationSchedule(state === null || state === void 0 || (_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.cacheItem);
72
+ }, [state === null || state === void 0 || (_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : _state$service4.cacheItem]);
70
73
 
71
74
  // 当前商品信息+ 表单信息
72
75
  var getCurrentCacheItem = useMemoizedFn(function (_cacheItem) {
@@ -443,9 +446,9 @@ var Info = function Info(_, ref) {
443
446
  getDiscount();
444
447
  }, [useTotal, (_state$service$cacheI5 = state.service.cacheItem) === null || _state$service$cacheI5 === void 0 || (_state$service$cacheI5 = _state$service$cacheI5._extend) === null || _state$service$cacheI5 === void 0 ? void 0 : _state$service$cacheI5.origin_total]);
445
448
  var bundles = useMemo(function () {
446
- var _state$service4;
447
- return ((_state$service4 = state.service) === null || _state$service4 === void 0 || (_state$service4 = _state$service4.cacheItem) === null || _state$service4 === void 0 || (_state$service4 = _state$service4._extend) === null || _state$service4 === void 0 || (_state$service4 = _state$service4.other) === null || _state$service4 === void 0 ? void 0 : _state$service4.bundle) || [];
448
- }, [(_state$service5 = state.service) === null || _state$service5 === void 0 || (_state$service5 = _state$service5.cacheItem) === null || _state$service5 === void 0 || (_state$service5 = _state$service5._extend) === null || _state$service5 === void 0 || (_state$service5 = _state$service5.other) === null || _state$service5 === void 0 ? void 0 : _state$service5.bundle]);
449
+ var _state$service5;
450
+ return ((_state$service5 = state.service) === null || _state$service5 === void 0 || (_state$service5 = _state$service5.cacheItem) === null || _state$service5 === void 0 || (_state$service5 = _state$service5._extend) === null || _state$service5 === void 0 || (_state$service5 = _state$service5.other) === null || _state$service5 === void 0 ? void 0 : _state$service5.bundle) || [];
451
+ }, [(_state$service6 = state.service) === null || _state$service6 === void 0 || (_state$service6 = _state$service6.cacheItem) === null || _state$service6 === void 0 || (_state$service6 = _state$service6._extend) === null || _state$service6 === void 0 || (_state$service6 = _state$service6.other) === null || _state$service6 === void 0 ? void 0 : _state$service6.bundle]);
449
452
 
450
453
  /**
451
454
  * @title: 编辑商品
@@ -596,7 +599,7 @@ var Info = function Info(_, ref) {
596
599
  var SelectTime = (_window$BaseMaterials = window.BaseMaterials) === null || _window$BaseMaterials === void 0 ? void 0 : _window$BaseMaterials.SelectTime;
597
600
  console.log(isShowTimeAndResource, 'isShowTimeAndResource');
598
601
  var productName = useMemo(function () {
599
- var _state$service6;
602
+ var _state$service7;
600
603
  return /*#__PURE__*/React.createElement(Col, {
601
604
  span: 24
602
605
  }, /*#__PURE__*/React.createElement(Form.Item, {
@@ -607,7 +610,7 @@ var Info = function Info(_, ref) {
607
610
  className: "current-service-info-name-wrap"
608
611
  }, /*#__PURE__*/React.createElement("div", {
609
612
  className: "current-service-info-name"
610
- }, ((_state$service6 = state.service) === null || _state$service6 === void 0 || (_state$service6 = _state$service6.cacheItem) === null || _state$service6 === void 0 || (_state$service6 = _state$service6._extend) === null || _state$service6 === void 0 ? void 0 : _state$service6.product_name) || '-'), /*#__PURE__*/React.createElement(Button, {
613
+ }, ((_state$service7 = state.service) === null || _state$service7 === void 0 || (_state$service7 = _state$service7.cacheItem) === null || _state$service7 === void 0 || (_state$service7 = _state$service7._extend) === null || _state$service7 === void 0 ? void 0 : _state$service7.product_name) || '-'), /*#__PURE__*/React.createElement(Button, {
611
614
  onClick: handleEdit
612
615
  }, locales.getText('pisell2.text.edit')), !state.isBookingCreatePage && /*#__PURE__*/React.createElement(Button, {
613
616
  onClick: handleChange
@@ -620,7 +623,7 @@ var Info = function Info(_, ref) {
620
623
  return renderBundles(item, state.amountSymbol);
621
624
  }
622
625
  }))));
623
- }, [(_state$service7 = state.service) === null || _state$service7 === void 0 || (_state$service7 = _state$service7.cacheItem) === null || _state$service7 === void 0 || (_state$service7 = _state$service7._extend) === null || _state$service7 === void 0 ? void 0 : _state$service7.product_name, bundles, state.amountSymbol, state.isBookingCreatePage]);
626
+ }, [(_state$service8 = state.service) === null || _state$service8 === void 0 || (_state$service8 = _state$service8.cacheItem) === null || _state$service8 === void 0 || (_state$service8 = _state$service8._extend) === null || _state$service8 === void 0 ? void 0 : _state$service8.product_name, bundles, state.amountSymbol, state.isBookingCreatePage]);
624
627
  var price = useMemo(function () {
625
628
  var _state$service$cacheI6, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9;
626
629
  return /*#__PURE__*/React.createElement(Col, {
@@ -718,7 +721,7 @@ var Info = function Info(_, ref) {
718
721
  cacheItem: state.service.cacheItem
719
722
  }));
720
723
  // 只监听Capacity 内部使用的 state.locale state.isTerminal, state.service?.cacheItem?._data?.capacitys
721
- }, [state.locale, state.isTerminal, (_state$service8 = state.service) === null || _state$service8 === void 0 || (_state$service8 = _state$service8.cacheItem) === null || _state$service8 === void 0 || (_state$service8 = _state$service8._data) === null || _state$service8 === void 0 ? void 0 : _state$service8.capacitys]);
724
+ }, [state.locale, state.isTerminal, (_state$service9 = state.service) === null || _state$service9 === void 0 || (_state$service9 = _state$service9.cacheItem) === null || _state$service9 === void 0 || (_state$service9 = _state$service9._data) === null || _state$service9 === void 0 ? void 0 : _state$service9.capacitys]);
722
725
  var hiddenQuantity = useMemo(function () {
723
726
  return /*#__PURE__*/React.createElement(Form.Item, {
724
727
  hidden: true,
@@ -770,6 +773,19 @@ var Info = function Info(_, ref) {
770
773
  }, [(_state$service$resour2 = state.service.resourcesOrigin) === null || _state$service$resour2 === void 0 ? void 0 : _state$service$resour2.length]);
771
774
  console.log('render edit');
772
775
  console.log(state.service.editModal && !((_state$service$cacheI13 = state.service.cacheItem) !== null && _state$service$cacheI13 !== void 0 && _state$service$cacheI13.autoClose), performance.now() - window.pp1, '打开商品1');
776
+ var _useState3 = useState(false),
777
+ _useState4 = _slicedToArray(_useState3, 2),
778
+ val = _useState4[0],
779
+ setVal = _useState4[1];
780
+ useEffect(function () {
781
+ if (isShowTimeAndResource) {
782
+ setTimeout(function () {
783
+ setVal(true);
784
+ }, 200);
785
+ } else {
786
+ setVal(false);
787
+ }
788
+ }, [isShowTimeAndResource]);
773
789
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer, {
774
790
  titleNoWrap: true
775
791
  //通过zIndex的方式控制 添加商品 和 编辑服务弹窗的上下层级
@@ -801,6 +817,6 @@ var Info = function Info(_, ref) {
801
817
  width: '100%'
802
818
  },
803
819
  gutter: [16, 0]
804
- }, productName, price, reason, isShowTimeAndResource && /*#__PURE__*/React.createElement(React.Fragment, null, startTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity)), footer)));
820
+ }, productName, price, reason, val && isShowTimeAndResource && /*#__PURE__*/React.createElement(React.Fragment, null, startTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity)), footer)));
805
821
  };
806
822
  export default /*#__PURE__*/forwardRef(Info);
@@ -164,7 +164,7 @@ export var _formatBookingDetail = function _formatBookingDetail(data, modalState
164
164
  });
165
165
  };
166
166
  var TicketBooking = function TicketBooking() {
167
- var _engineContext$appHel2;
167
+ var _engineContext$appHel2, _state$modalState2;
168
168
  var _useStore = useStore(),
169
169
  _useStore2 = _slicedToArray(_useStore, 2),
170
170
  state = _useStore2[0],
@@ -372,7 +372,7 @@ var TicketBooking = function TicketBooking() {
372
372
  fees: fees
373
373
  }
374
374
  });
375
- }, [state.modalState]);
375
+ }, [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]);
376
376
 
377
377
  /**
378
378
  * 设置弹窗内的状态
@@ -4,45 +4,49 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React from 'react';
7
+ import React, { useMemo } from 'react';
8
8
  import { LeftOutlined, RightOutlined } from '@ant-design/icons';
9
9
  import { DatePicker, SelectTime } from '@pisell/materials';
10
+ import { useMemoizedFn } from "ahooks";
10
11
  import { Button } from 'antd';
11
12
  import classNames from 'classnames';
12
13
  import { locales } from '@pisell/utils';
13
14
  import "./index.less";
14
15
  var TimeBar = function TimeBar(props) {
15
- var _state$modalState4, _state$modalState5;
16
+ var _state$modalState7;
16
17
  var state = props.globalState,
17
18
  setGlobalState = props.setGlobalState,
18
19
  locale = props.locale;
19
- var _onClickNext = function _onClickNext() {
20
+ var _onClickNext = useMemoizedFn(function () {
20
21
  var _state$modalState, _props$onDateChange, _props$setIntervalTim;
21
22
  var currentTime = (_state$modalState = state.modalState) === null || _state$modalState === void 0 || (_state$modalState = _state$modalState.date) === null || _state$modalState === void 0 ? void 0 : _state$modalState.value;
22
23
  var newTime = currentTime['add'](1, 'day');
23
24
  (_props$onDateChange = props.onDateChange) === null || _props$onDateChange === void 0 || _props$onDateChange.call(props, newTime, newTime.format('YYYY-MM-DD HH:mm:ss'));
24
25
  (_props$setIntervalTim = props.setIntervalTime) === null || _props$setIntervalTim === void 0 || _props$setIntervalTim.call(props, false);
25
- };
26
- var _onClickPre = function _onClickPre() {
26
+ });
27
+ var _onClickPre = useMemoizedFn(function () {
27
28
  var _state$modalState2, _props$onDateChange2, _props$setIntervalTim2;
28
29
  var currentTime = (_state$modalState2 = state.modalState) === null || _state$modalState2 === void 0 || (_state$modalState2 = _state$modalState2.date) === null || _state$modalState2 === void 0 ? void 0 : _state$modalState2.value;
29
30
  var newTime = currentTime['subtract'](1, 'day');
30
31
  (_props$onDateChange2 = props.onDateChange) === null || _props$onDateChange2 === void 0 || _props$onDateChange2.call(props, newTime, newTime.format('YYYY-MM-DD HH:mm:ss'));
31
32
  (_props$setIntervalTim2 = props.setIntervalTime) === null || _props$setIntervalTim2 === void 0 || _props$setIntervalTim2.call(props, false);
32
- };
33
- var _onClickToday = function _onClickToday() {
34
- var _props$setIntervalTim3;
35
- (_props$setIntervalTim3 = props.setIntervalTime) === null || _props$setIntervalTim3 === void 0 || _props$setIntervalTim3.call(props, true);
36
- };
37
- var _onClickNow = function _onClickNow() {
33
+ });
34
+ var _onClickToday = useMemoizedFn(function () {
35
+ var _state$modalState3, _props$onDateChange3, _props$setIntervalTim3;
36
+ var currentTime = (_state$modalState3 = state.modalState) === null || _state$modalState3 === void 0 || (_state$modalState3 = _state$modalState3.date) === null || _state$modalState3 === void 0 ? void 0 : _state$modalState3.value;
37
+ var newTime = currentTime['subtract'](1, 'day');
38
+ (_props$onDateChange3 = props.onDateChange) === null || _props$onDateChange3 === void 0 || _props$onDateChange3.call(props, newTime, newTime.format('YYYY-MM-DD HH:mm:ss'));
39
+ (_props$setIntervalTim3 = props.setIntervalTime) === null || _props$setIntervalTim3 === void 0 || _props$setIntervalTim3.call(props, false);
40
+ });
41
+ var _onClickNow = useMemoizedFn(function () {
38
42
  var _props$setIntervalTim4;
39
43
  (_props$setIntervalTim4 = props.setIntervalTime) === null || _props$setIntervalTim4 === void 0 || _props$setIntervalTim4.call(props, true);
40
- };
44
+ });
41
45
 
42
46
  // 时间选择变更事件
43
- var _onDateTimeChange = function _onDateTimeChange(timeString) {
44
- var _state$modalState3, _props$onDateTimeChan, _props$setIntervalTim5;
45
- var currentTime = (_state$modalState3 = state.modalState) === null || _state$modalState3 === void 0 || (_state$modalState3 = _state$modalState3.date) === null || _state$modalState3 === void 0 ? void 0 : _state$modalState3.value;
47
+ var _onDateTimeChange = useMemoizedFn(function (timeString) {
48
+ var _state$modalState4, _props$onDateTimeChan, _props$setIntervalTim5;
49
+ var currentTime = (_state$modalState4 = state.modalState) === null || _state$modalState4 === void 0 || (_state$modalState4 = _state$modalState4.date) === null || _state$modalState4 === void 0 ? void 0 : _state$modalState4.value;
46
50
  var _timeString$split$map = timeString.split(':').map(Number),
47
51
  _timeString$split$map2 = _slicedToArray(_timeString$split$map, 2),
48
52
  hours = _timeString$split$map2[0],
@@ -53,63 +57,66 @@ var TimeBar = function TimeBar(props) {
53
57
  isTimeChange: true
54
58
  });
55
59
  (_props$setIntervalTim5 = props.setIntervalTime) === null || _props$setIntervalTim5 === void 0 || _props$setIntervalTim5.call(props, false);
56
- };
57
- return /*#__PURE__*/React.createElement("div", {
58
- className: "pisell-ticket-booking-time-bar"
59
- }, /*#__PURE__*/React.createElement(Button, {
60
- icon: /*#__PURE__*/React.createElement(LeftOutlined, null),
61
- onClick: _onClickPre,
62
- size: "large"
63
- }), /*#__PURE__*/React.createElement(Button, {
64
- onClick: _onClickToday,
65
- size: "large",
66
- style: state.intervalSetTime ? {
67
- background: '#000',
68
- color: '#fff'
69
- } : undefined
70
- }, locales.getText('pisell2.ticket-booking.today')), /*#__PURE__*/React.createElement("div", {
71
- className: classNames({
72
- 'booking-page-date-picker-select': state.isDateChange
73
- }),
74
- style: {
75
- width: 200,
76
- flexShrink: 0
77
- }
78
- }, /*#__PURE__*/React.createElement(DatePicker, {
79
- inputReadOnly: true,
80
- value: state === null || state === void 0 || (_state$modalState4 = state.modalState) === null || _state$modalState4 === void 0 || (_state$modalState4 = _state$modalState4.date) === null || _state$modalState4 === void 0 ? void 0 : _state$modalState4.value,
81
- format: locale === 'en' ? 'dddd, DD MMM YYYY' : 'YYYY年MM月DD日',
82
- onChange: props === null || props === void 0 ? void 0 : props.onDateChange,
83
- size: "large",
84
- style: {
85
- width: '100%'
86
- }
87
- })), /*#__PURE__*/React.createElement(Button, {
88
- icon: /*#__PURE__*/React.createElement(RightOutlined, null),
89
- onClick: _onClickNext,
90
- size: "large"
91
- }), /*#__PURE__*/React.createElement("div", {
92
- className: classNames({
93
- 'booking-page-date-picker-select': state.isTimeChange
94
- })
95
- }, /*#__PURE__*/React.createElement(SelectTime, {
96
- value: state === null || state === void 0 || (_state$modalState5 = state.modalState) === null || _state$modalState5 === void 0 || (_state$modalState5 = _state$modalState5.date) === null || _state$modalState5 === void 0 ? void 0 : _state$modalState5.value.format('HH:mm'),
97
- onChange: _onDateTimeChange,
98
- popoverProps: {
60
+ });
61
+ return useMemo(function () {
62
+ var _state$modalState5, _state$modalState6;
63
+ return /*#__PURE__*/React.createElement("div", {
64
+ className: "pisell-ticket-booking-time-bar"
65
+ }, /*#__PURE__*/React.createElement(Button, {
66
+ icon: /*#__PURE__*/React.createElement(LeftOutlined, null),
67
+ onClick: _onClickPre,
68
+ size: "large"
69
+ }), /*#__PURE__*/React.createElement(Button, {
70
+ onClick: _onClickToday,
71
+ size: "large",
72
+ style: state.intervalSetTime ? {
73
+ background: '#000',
74
+ color: '#fff'
75
+ } : undefined
76
+ }, locales.getText('pisell2.ticket-booking.today')), /*#__PURE__*/React.createElement("div", {
77
+ className: classNames({
78
+ 'booking-page-date-picker-select': state.isDateChange
79
+ }),
80
+ style: {
81
+ width: 200,
82
+ flexShrink: 0
83
+ }
84
+ }, /*#__PURE__*/React.createElement(DatePicker, {
85
+ inputReadOnly: true,
86
+ value: state === null || state === void 0 || (_state$modalState5 = state.modalState) === null || _state$modalState5 === void 0 || (_state$modalState5 = _state$modalState5.date) === null || _state$modalState5 === void 0 ? void 0 : _state$modalState5.value,
87
+ format: locale === 'en' ? 'dddd, DD MMM YYYY' : 'YYYY年MM月DD日',
88
+ onChange: props === null || props === void 0 ? void 0 : props.onDateChange,
89
+ size: "large",
99
90
  style: {
100
- zoom: 0.8
91
+ width: '100%'
101
92
  }
102
- },
103
- timePickerProps: {},
104
- timeProps: {},
105
- slice: 5
106
- })), /*#__PURE__*/React.createElement(Button, {
107
- onClick: _onClickNow,
108
- size: "large",
109
- style: state.intervalSetTime ? {
110
- background: '#000',
111
- color: '#fff'
112
- } : undefined
113
- }, locales.getText('pisell2.ticket-booking.now')));
93
+ })), /*#__PURE__*/React.createElement(Button, {
94
+ icon: /*#__PURE__*/React.createElement(RightOutlined, null),
95
+ onClick: _onClickNext,
96
+ size: "large"
97
+ }), /*#__PURE__*/React.createElement("div", {
98
+ className: classNames({
99
+ 'booking-page-date-picker-select': state.isTimeChange
100
+ })
101
+ }, /*#__PURE__*/React.createElement(SelectTime, {
102
+ value: state === null || state === void 0 || (_state$modalState6 = state.modalState) === null || _state$modalState6 === void 0 || (_state$modalState6 = _state$modalState6.date) === null || _state$modalState6 === void 0 ? void 0 : _state$modalState6.value.format('HH:mm'),
103
+ onChange: _onDateTimeChange,
104
+ popoverProps: {
105
+ style: {
106
+ zoom: 0.8
107
+ }
108
+ },
109
+ timePickerProps: {},
110
+ timeProps: {},
111
+ slice: 5
112
+ })), /*#__PURE__*/React.createElement(Button, {
113
+ onClick: _onClickNow,
114
+ size: "large",
115
+ style: state.intervalSetTime ? {
116
+ background: '#000',
117
+ color: '#fff'
118
+ } : undefined
119
+ }, locales.getText('pisell2.ticket-booking.now')));
120
+ }, [(_state$modalState7 = state.modalState) === null || _state$modalState7 === void 0 || (_state$modalState7 = _state$modalState7.date) === null || _state$modalState7 === void 0 ? void 0 : _state$modalState7.value, state.intervalSetTime, state.isTimeChange, state.isDateChange, locale]);
114
121
  };
115
122
  export default TimeBar;
@@ -132,12 +132,12 @@ var initialState = {
132
132
  productExtensionType: ['appointment_ticket', 'session_ticket', 'product_appointment', 'service_product', 'session_product', 'normal', 'product_appointment']
133
133
  };
134
134
  export default (function (props) {
135
- var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3;
135
+ var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4;
136
136
  var productExtensionType = props.productExtensionType,
137
137
  bookingConfigParams = props.bookingConfigParams;
138
138
  var storeRef = useRef(null);
139
139
  var context = useEngineContext();
140
- locales.init(localeTexts, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.getApp()) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.locales) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getLocale) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.call(_context$appHelper$ut)) || ((_context$appHelper$ut3 = context.appHelper.utils) === null || _context$appHelper$ut3 === void 0 || (_context$appHelper$ut3 = _context$appHelper$ut3.storage) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.get('umi_locale')) || 'en');
140
+ locales.init(localeTexts, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getApp) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.locales) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut3 = _context$appHelper$ut2.getLocale) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.call(_context$appHelper$ut2)) || ((_context$appHelper$ut4 = context.appHelper.utils) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut4 = _context$appHelper$ut4.storage) === null || _context$appHelper$ut4 === void 0 ? void 0 : _context$appHelper$ut4.get('umi_locale')) || 'en');
141
141
  useLayoutEffect(function () {
142
142
  request.setRequest(context.appHelper.utils.request);
143
143
  }, []);
@@ -73,8 +73,11 @@ var Info = (_, ref) => {
73
73
  };
74
74
  }, []);
75
75
  const isNormalProduct = (0, import_react.useMemo)(() => {
76
- var _a2, _b2;
77
- return ((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.cacheItem) && (0, import_utils4.isNormalProductByDurationSchedule)((_b2 = state == null ? void 0 : state.service) == null ? void 0 : _b2.cacheItem);
76
+ var _a2, _b2, _c2;
77
+ if (!((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.cacheItem)) {
78
+ return true;
79
+ }
80
+ return ((_b2 = state == null ? void 0 : state.service) == null ? void 0 : _b2.cacheItem) && (0, import_utils4.isNormalProductByDurationSchedule)((_c2 = state == null ? void 0 : state.service) == null ? void 0 : _c2.cacheItem);
78
81
  }, [(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.cacheItem]);
79
82
  const getCurrentCacheItem = (0, import_ahooks.useMemoizedFn)((_cacheItem) => {
80
83
  let values = form.getFieldsValue();
@@ -93,13 +96,13 @@ var Info = (_, ref) => {
93
96
  const durationProps = (0, import_react.useMemo)(() => {
94
97
  var _a2, _b2, _c2;
95
98
  let _cacheItem = getCurrentCacheItem();
96
- const val = (0, import_utils7.getDurationProps)({
99
+ const val2 = (0, import_utils7.getDurationProps)({
97
100
  cacheItem: _cacheItem,
98
101
  useStartTime,
99
102
  // currentResource,
100
103
  slice: (_c2 = (_b2 = (_a2 = state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.service_time
101
104
  });
102
- return val;
105
+ return val2;
103
106
  }, [
104
107
  // currentResource,
105
108
  state.service.cacheItem,
@@ -114,14 +117,14 @@ var Info = (_, ref) => {
114
117
  return op;
115
118
  }, [durationProps, import_utils.locales.locale]);
116
119
  const timeObj = (0, import_react.useMemo)(() => {
117
- const val = (0, import_utils7.getTimeObj)({
120
+ const val2 = (0, import_utils7.getTimeObj)({
118
121
  durationProps,
119
122
  useStartTime,
120
123
  currentResource,
121
124
  state,
122
125
  useDuration
123
126
  });
124
- return val;
127
+ return val2;
125
128
  }, [
126
129
  durationProps,
127
130
  useStartTime,
@@ -641,6 +644,16 @@ var Info = (_, ref) => {
641
644
  performance.now() - window.pp1,
642
645
  "打开商品1"
643
646
  );
647
+ const [val, setVal] = (0, import_react.useState)(false);
648
+ (0, import_react.useEffect)(() => {
649
+ if (isShowTimeAndResource) {
650
+ setTimeout(() => {
651
+ setVal(true);
652
+ }, 200);
653
+ } else {
654
+ setVal(false);
655
+ }
656
+ }, [isShowTimeAndResource]);
644
657
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
645
658
  import_drawer.default,
646
659
  {
@@ -662,7 +675,7 @@ var Info = (_, ref) => {
662
675
  });
663
676
  }
664
677
  },
665
- /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { layout: "vertical", form, onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, productName, price, reason, isShowTimeAndResource && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, startTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity)), footer)
678
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { layout: "vertical", form, onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, productName, price, reason, val && isShowTimeAndResource && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, startTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity)), footer)
666
679
  ));
667
680
  };
668
681
  var editService_default = (0, import_react.forwardRef)(Info);
@@ -188,7 +188,7 @@ var _formatBookingDetail = (data, modalState) => {
188
188
  };
189
189
  };
190
190
  var TicketBooking = () => {
191
- var _a;
191
+ var _a, _b, _c;
192
192
  const [state, setState] = (0, import_miniRedux.useStore)();
193
193
  const engineContext = (0, import_useEngineContext.default)();
194
194
  const { props: engineProps } = engineContext.engine;
@@ -210,7 +210,7 @@ var TicketBooking = () => {
210
210
  const _timerRef = (0, import_react.useRef)();
211
211
  const _callbackFnRef = (0, import_react.useRef)();
212
212
  (0, import_react.useEffect)(() => {
213
- var _a2, _b, _c, _d, _e, _f;
213
+ var _a2, _b2, _c2, _d, _e, _f;
214
214
  _persistentRef.current = storage.get(`drawer-booking`) === "true" ? true : isTerminal();
215
215
  if (lowcodeRef) {
216
216
  lowcodeRef.onReady(void 0);
@@ -235,7 +235,7 @@ var TicketBooking = () => {
235
235
  });
236
236
  setState(
237
237
  {
238
- amountSymbol: (getData == null ? void 0 : getData("shop_symbol")) || ((_d = (_c = (_b = store == null ? void 0 : store.getState) == null ? void 0 : _b.call(store)) == null ? void 0 : _c.global) == null ? void 0 : _d.symbol) || "$"
238
+ amountSymbol: (getData == null ? void 0 : getData("shop_symbol")) || ((_d = (_c2 = (_b2 = store == null ? void 0 : store.getState) == null ? void 0 : _b2.call(store)) == null ? void 0 : _c2.global) == null ? void 0 : _d.symbol) || "$"
239
239
  },
240
240
  () => {
241
241
  _initStateRef.current = JSON.parse(JSON.stringify(state));
@@ -291,10 +291,10 @@ var TicketBooking = () => {
291
291
  });
292
292
  };
293
293
  (0, import_react.useEffect)(() => {
294
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
295
- const cartItems = (_b = (_a2 = state == null ? void 0 : state.modalState) == null ? void 0 : _a2.service) == null ? void 0 : _b.value;
294
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j;
295
+ const cartItems = (_b2 = (_a2 = state == null ? void 0 : state.modalState) == null ? void 0 : _a2.service) == null ? void 0 : _b2.value;
296
296
  if (!Array.isArray(cartItems) || cartItems.length === 0) {
297
- (_d = (_c = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c.postMessageToApp) == null ? void 0 : _d.call(_c, {
297
+ (_d = (_c2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c2.postMessageToApp) == null ? void 0 : _d.call(_c2, {
298
298
  module: "cds",
299
299
  key: "cartUpdate",
300
300
  data: {
@@ -395,15 +395,15 @@ var TicketBooking = () => {
395
395
  fees
396
396
  }
397
397
  });
398
- }, [state.modalState]);
398
+ }, [(_c = (_b = state == null ? void 0 : state.modalState) == null ? void 0 : _b.service) == null ? void 0 : _c.value]);
399
399
  const _setModalState = (props) => {
400
- var _a2, _b;
400
+ var _a2, _b2;
401
401
  console.log("同步state到外层", props);
402
402
  let newVal = { ...props };
403
403
  if (newVal.service) {
404
404
  newVal.service.value = ((_a2 = newVal == null ? void 0 : newVal.service) == null ? void 0 : _a2.value) || [];
405
405
  }
406
- console.log((_b = newVal == null ? void 0 : newVal.service) == null ? void 0 : _b.value, "newVal.service.value");
406
+ console.log((_b2 = newVal == null ? void 0 : newVal.service) == null ? void 0 : _b2.value, "newVal.service.value");
407
407
  setState({
408
408
  modalState: {
409
409
  ...state.modalState,
@@ -430,10 +430,10 @@ var TicketBooking = () => {
430
430
  }
431
431
  });
432
432
  setTimeout(() => {
433
- var _a2, _b, _c, _d, _e;
434
- if ((_b = (_a2 = state.modalState.service) == null ? void 0 : _a2.value) == null ? void 0 : _b.length) {
435
- let _list = (_e = (_c = state.bookingFunctions) == null ? void 0 : _c.updateServiceDate) == null ? void 0 : _e.call(
436
- _c,
433
+ var _a2, _b2, _c2, _d, _e;
434
+ if ((_b2 = (_a2 = state.modalState.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) {
435
+ let _list = (_e = (_c2 = state.bookingFunctions) == null ? void 0 : _c2.updateServiceDate) == null ? void 0 : _e.call(
436
+ _c2,
437
437
  (_d = state.modalState.service) == null ? void 0 : _d.value,
438
438
  date,
439
439
  false
@@ -449,8 +449,8 @@ var TicketBooking = () => {
449
449
  }, 100);
450
450
  };
451
451
  const _setShopOpeningHours = () => {
452
- var _a2, _b, _c, _d, _e, _f;
453
- let time = ((_a2 = getData == null ? void 0 : getData("operating_day_boundary")) == null ? void 0 : _a2.time) || ((_f = (_e = (_d = (_c = (_b = store == null ? void 0 : store.getState) == null ? void 0 : _b.call(store)) == null ? void 0 : _c.global) == null ? void 0 : _d.shopDetail) == null ? void 0 : _e.operating_day_boundary) == null ? void 0 : _f.time);
452
+ var _a2, _b2, _c2, _d, _e, _f;
453
+ let time = ((_a2 = getData == null ? void 0 : getData("operating_day_boundary")) == null ? void 0 : _a2.time) || ((_f = (_e = (_d = (_c2 = (_b2 = store == null ? void 0 : store.getState) == null ? void 0 : _b2.call(store)) == null ? void 0 : _c2.global) == null ? void 0 : _d.shopDetail) == null ? void 0 : _e.operating_day_boundary) == null ? void 0 : _f.time);
454
454
  if (time) {
455
455
  localStorage.setItem("shopOpeningHours", time);
456
456
  }
@@ -467,12 +467,12 @@ var TicketBooking = () => {
467
467
  });
468
468
  };
469
469
  const _getBoardConfig = async () => {
470
- var _a2, _b, _c;
470
+ var _a2, _b2, _c2;
471
471
  const { bookingConfigParams } = state;
472
472
  const data = await (0, import_serve.getBookingConfig)({
473
473
  ...bookingConfigParams
474
474
  });
475
- if ((_c = (_b = (_a2 = data == null ? void 0 : data.config) == null ? void 0 : _a2.information_tab) == null ? void 0 : _b.appointment_card) == null ? void 0 : _c.quick_time) {
475
+ if ((_c2 = (_b2 = (_a2 = data == null ? void 0 : data.config) == null ? void 0 : _a2.information_tab) == null ? void 0 : _b2.appointment_card) == null ? void 0 : _c2.quick_time) {
476
476
  _getAddTimeProducts();
477
477
  }
478
478
  setState({
@@ -566,7 +566,7 @@ var TicketBooking = () => {
566
566
  }
567
567
  };
568
568
  const _initBookingData = (type, data) => {
569
- var _a2, _b, _c, _d, _e, _f, _g;
569
+ var _a2, _b2, _c2, _d, _e, _f, _g;
570
570
  let initState = _getInitState({
571
571
  bookingDetail: null,
572
572
  bookingConfig: state.bookingConfig,
@@ -588,14 +588,14 @@ var TicketBooking = () => {
588
588
  if (type === "create") {
589
589
  if ((_a2 = data == null ? void 0 : data.serviceParams) == null ? void 0 : _a2.start_date) {
590
590
  initState.modalState.date.value = (0, import_dayjs.default)(
591
- (_b = data == null ? void 0 : data.serviceParams) == null ? void 0 : _b.start_date
591
+ (_b2 = data == null ? void 0 : data.serviceParams) == null ? void 0 : _b2.start_date
592
592
  );
593
593
  sessionStorage.setItem(
594
594
  "pisell2.booking.serviceParams",
595
595
  JSON.stringify(data)
596
596
  );
597
597
  } else {
598
- let timezone = (_f = (_e = (_d = (_c = store == null ? void 0 : store.getState) == null ? void 0 : _c.call(store)) == null ? void 0 : _d.global) == null ? void 0 : _e.globalConfig) == null ? void 0 : _f.timezone;
598
+ let timezone = (_f = (_e = (_d = (_c2 = store == null ? void 0 : store.getState) == null ? void 0 : _c2.call(store)) == null ? void 0 : _d.global) == null ? void 0 : _e.globalConfig) == null ? void 0 : _f.timezone;
599
599
  initState.modalState.date.value = import_dayjs.default.tz(/* @__PURE__ */ new Date(), timezone);
600
600
  sessionStorage.removeItem("pisell2.booking.serviceParams");
601
601
  }
@@ -613,9 +613,9 @@ var TicketBooking = () => {
613
613
  });
614
614
  };
615
615
  const _rebook = () => {
616
- var _a2, _b, _c;
616
+ var _a2, _b2, _c2;
617
617
  let date = (0, import_utils2.getNextTimeSlice)(
618
- ((_c = (_b = (_a2 = state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.service_time.value) || 10
618
+ ((_c2 = (_b2 = (_a2 = state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.service_time.value) || 10
619
619
  );
620
620
  setState({
621
621
  rebookState: {
@@ -703,7 +703,7 @@ var TicketBooking = () => {
703
703
  );
704
704
  };
705
705
  const _scanBookingDetailResult = async (detail) => {
706
- var _a2, _b, _c;
706
+ var _a2, _b2, _c2;
707
707
  (_a2 = Toast == null ? void 0 : Toast.loading) == null ? void 0 : _a2.call(Toast, import_utils.locales.getText("pisell2.ticket-booking.loading"), 6e4);
708
708
  let result = {};
709
709
  try {
@@ -711,7 +711,7 @@ var TicketBooking = () => {
711
711
  } catch (err) {
712
712
  }
713
713
  if (!(result == null ? void 0 : result.value)) {
714
- (_b = import_antd.message) == null ? void 0 : _b.error(
714
+ (_b2 = import_antd.message) == null ? void 0 : _b2.error(
715
715
  import_utils.locales.getText("pisell2.ticket-booking.appointment-not-found")
716
716
  );
717
717
  Toast == null ? void 0 : Toast.hide();
@@ -720,7 +720,7 @@ var TicketBooking = () => {
720
720
  const objDetail = await (0, import_serve.getOrderInfoByCode)({ code: result.value });
721
721
  Toast == null ? void 0 : Toast.hide();
722
722
  if (!(objDetail == null ? void 0 : objDetail.order_id) || (objDetail == null ? void 0 : objDetail.event_id) === 0) {
723
- (_c = import_antd.message) == null ? void 0 : _c.error(
723
+ (_c2 = import_antd.message) == null ? void 0 : _c2.error(
724
724
  import_utils.locales.getText("pisell2.ticket-booking.appointment-not-found")
725
725
  );
726
726
  return;