@pisell/private-materials 3.2.17 → 3.2.18

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 (144) 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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.js +19 -10
  12. package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/Total.js +10 -20
  13. package/es/components/appointmentBooking/components/Cart/Item/index.js +73 -0
  14. package/es/components/appointmentBooking/components/Content/index.js +29 -15
  15. package/es/components/appointmentBooking/components/Date/index.js +77 -12
  16. package/es/components/appointmentBooking/components/Date/index.less +1 -0
  17. package/es/components/appointmentBooking/components/Footer/index.js +3 -3
  18. package/es/components/appointmentBooking/components/Guest/index.d.ts +3 -0
  19. package/es/components/appointmentBooking/components/{Provider/Information → Guest}/index.js +50 -59
  20. package/es/components/appointmentBooking/components/Header/index.js +6 -4
  21. package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
  22. package/es/components/appointmentBooking/components/Resource/index.js +62 -29
  23. package/es/components/appointmentBooking/components/Resource/index.less +6 -0
  24. package/es/components/appointmentBooking/components/Services/index.js +25 -135
  25. package/es/components/appointmentBooking/components/TimeSlicing/index.d.ts +1 -1
  26. package/es/components/appointmentBooking/components/TimeSlicing/index.js +44 -755
  27. package/es/components/appointmentBooking/context.d.ts +23 -0
  28. package/es/components/appointmentBooking/context.js +71 -0
  29. package/es/components/appointmentBooking/hooks.d.ts +6 -8
  30. package/es/components/appointmentBooking/hooks.js +119 -62
  31. package/es/components/appointmentBooking/index.js +2 -3
  32. package/es/components/appointmentBooking/locales.d.ts +12 -0
  33. package/es/components/appointmentBooking/locales.js +21 -3
  34. package/es/components/appointmentBooking/utils.d.ts +12 -0
  35. package/es/components/appointmentBooking/utils.js +70 -0
  36. package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.js +18 -16
  37. package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/Total.js +7 -11
  38. package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/index.js +22 -21
  39. package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/index.js +1 -1
  40. package/lib/components/appointmentBooking/components/Content/index.js +26 -14
  41. package/lib/components/appointmentBooking/components/Date/index.js +53 -16
  42. package/lib/components/appointmentBooking/components/Date/index.less +1 -0
  43. package/lib/components/appointmentBooking/components/Footer/index.js +3 -3
  44. package/lib/components/appointmentBooking/components/Guest/index.d.ts +3 -0
  45. package/lib/components/appointmentBooking/components/{Provider/Information → Guest}/index.js +43 -52
  46. package/lib/components/appointmentBooking/components/Header/index.js +2 -3
  47. package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
  48. package/lib/components/appointmentBooking/components/Resource/index.js +55 -41
  49. package/lib/components/appointmentBooking/components/Resource/index.less +6 -0
  50. package/lib/components/appointmentBooking/components/Services/index.js +15 -155
  51. package/lib/components/appointmentBooking/components/TimeSlicing/index.d.ts +1 -1
  52. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +17 -941
  53. package/lib/components/appointmentBooking/context.d.ts +23 -0
  54. package/lib/components/appointmentBooking/context.js +85 -0
  55. package/lib/components/appointmentBooking/hooks.d.ts +6 -8
  56. package/lib/components/appointmentBooking/hooks.js +44 -20
  57. package/lib/components/appointmentBooking/index.js +2 -5
  58. package/lib/components/appointmentBooking/locales.d.ts +12 -0
  59. package/lib/components/appointmentBooking/locales.js +15 -3
  60. package/lib/components/appointmentBooking/utils.d.ts +12 -0
  61. package/lib/components/appointmentBooking/utils.js +62 -2
  62. package/package.json +2 -2
  63. package/es/components/appointmentBooking/components/Information/index.d.ts +0 -3
  64. package/es/components/appointmentBooking/components/Information/index.js +0 -178
  65. package/es/components/appointmentBooking/components/Provider/Cart/Item/index.js +0 -68
  66. package/es/components/appointmentBooking/components/Provider/Content/index.d.ts +0 -3
  67. package/es/components/appointmentBooking/components/Provider/Content/index.js +0 -64
  68. package/es/components/appointmentBooking/components/Provider/Content/index.less +0 -31
  69. package/es/components/appointmentBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -3
  70. package/es/components/appointmentBooking/components/Provider/EmptyHolderModal/index.js +0 -34
  71. package/es/components/appointmentBooking/components/Provider/EmptyHolderModal/index.less +0 -17
  72. package/es/components/appointmentBooking/components/Provider/Event/index.d.ts +0 -3
  73. package/es/components/appointmentBooking/components/Provider/Event/index.js +0 -93
  74. package/es/components/appointmentBooking/components/Provider/Event/index.less +0 -20
  75. package/es/components/appointmentBooking/components/Provider/Information/index.d.ts +0 -3
  76. package/es/components/appointmentBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -3
  77. package/es/components/appointmentBooking/components/Provider/InformationOptionsModal/index.js +0 -34
  78. package/es/components/appointmentBooking/components/Provider/InformationOptionsModal/index.less +0 -27
  79. package/es/components/appointmentBooking/components/Provider/OrderProductModal/index.d.ts +0 -3
  80. package/es/components/appointmentBooking/components/Provider/OrderProductModal/index.js +0 -27
  81. package/es/components/appointmentBooking/components/Provider/OrderProductModal/index.less +0 -32
  82. package/es/components/appointmentBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -2
  83. package/es/components/appointmentBooking/components/Provider/RemoveOptionConfirmModal.js +0 -31
  84. package/es/components/appointmentBooking/components/Provider/Resource/index.d.ts +0 -3
  85. package/es/components/appointmentBooking/components/Provider/Resource/index.js +0 -79
  86. package/es/components/appointmentBooking/components/Provider/Resource/index.less +0 -46
  87. package/es/components/appointmentBooking/components/Provider/SelectHolderModal.d.ts +0 -2
  88. package/es/components/appointmentBooking/components/Provider/SelectHolderModal.js +0 -90
  89. package/es/components/appointmentBooking/components/Provider/SelectProduct/index.d.ts +0 -4
  90. package/es/components/appointmentBooking/components/Provider/SelectProduct/index.js +0 -77
  91. package/es/components/appointmentBooking/components/Provider/SelectProduct/index.less +0 -131
  92. package/es/components/booking/info/service2/utils.d.ts +0 -240
  93. package/es/components/eventBooking/components/Provider/Information/index.d.ts +0 -3
  94. package/lib/components/appointmentBooking/components/Information/index.d.ts +0 -3
  95. package/lib/components/appointmentBooking/components/Information/index.js +0 -151
  96. package/lib/components/appointmentBooking/components/Information/index.less +0 -92
  97. package/lib/components/appointmentBooking/components/Provider/Cart/Item/index.d.ts +0 -3
  98. package/lib/components/appointmentBooking/components/Provider/Content/index.d.ts +0 -3
  99. package/lib/components/appointmentBooking/components/Provider/Content/index.js +0 -90
  100. package/lib/components/appointmentBooking/components/Provider/Content/index.less +0 -31
  101. package/lib/components/appointmentBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -3
  102. package/lib/components/appointmentBooking/components/Provider/EmptyHolderModal/index.js +0 -60
  103. package/lib/components/appointmentBooking/components/Provider/EmptyHolderModal/index.less +0 -17
  104. package/lib/components/appointmentBooking/components/Provider/Event/index.d.ts +0 -3
  105. package/lib/components/appointmentBooking/components/Provider/Event/index.js +0 -100
  106. package/lib/components/appointmentBooking/components/Provider/Event/index.less +0 -20
  107. package/lib/components/appointmentBooking/components/Provider/Information/index.d.ts +0 -3
  108. package/lib/components/appointmentBooking/components/Provider/Information/index.less +0 -92
  109. package/lib/components/appointmentBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -3
  110. package/lib/components/appointmentBooking/components/Provider/InformationOptionsModal/index.js +0 -67
  111. package/lib/components/appointmentBooking/components/Provider/InformationOptionsModal/index.less +0 -27
  112. package/lib/components/appointmentBooking/components/Provider/OrderProductModal/index.d.ts +0 -3
  113. package/lib/components/appointmentBooking/components/Provider/OrderProductModal/index.js +0 -57
  114. package/lib/components/appointmentBooking/components/Provider/OrderProductModal/index.less +0 -32
  115. package/lib/components/appointmentBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -2
  116. package/lib/components/appointmentBooking/components/Provider/RemoveOptionConfirmModal.js +0 -62
  117. package/lib/components/appointmentBooking/components/Provider/Resource/index.d.ts +0 -3
  118. package/lib/components/appointmentBooking/components/Provider/Resource/index.js +0 -90
  119. package/lib/components/appointmentBooking/components/Provider/Resource/index.less +0 -46
  120. package/lib/components/appointmentBooking/components/Provider/SelectHolderModal.d.ts +0 -2
  121. package/lib/components/appointmentBooking/components/Provider/SelectHolderModal.js +0 -97
  122. package/lib/components/appointmentBooking/components/Provider/SelectProduct/index.d.ts +0 -4
  123. package/lib/components/appointmentBooking/components/Provider/SelectProduct/index.js +0 -69
  124. package/lib/components/appointmentBooking/components/Provider/SelectProduct/index.less +0 -131
  125. package/lib/components/booking/info/service2/utils.d.ts +0 -240
  126. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -3
  127. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +0 -3
  128. /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.d.ts +0 -0
  129. /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.less +0 -0
  130. /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/Total.d.ts +0 -0
  131. /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/index.d.ts +0 -0
  132. /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/index.less +0 -0
  133. /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/index.d.ts +0 -0
  134. /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/index.js +0 -0
  135. /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/index.less +0 -0
  136. /package/es/components/appointmentBooking/components/{Information → Guest}/index.less +0 -0
  137. /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.d.ts +0 -0
  138. /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.less +0 -0
  139. /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/Total.d.ts +0 -0
  140. /package/{es/components/eventBooking/components/Provider → lib/components/appointmentBooking/components}/Cart/Item/index.d.ts +0 -0
  141. /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/index.less +0 -0
  142. /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/index.d.ts +0 -0
  143. /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/index.less +0 -0
  144. /package/{es/components/appointmentBooking/components/Provider/Information → lib/components/appointmentBooking/components/Guest}/index.less +0 -0
@@ -19,12 +19,14 @@ import { Button, PisellToast } from '@pisell/materials';
19
19
  // useSales,
20
20
  // useCustomer,
21
21
  // } from '../../../../../Sales';
22
- import { formatValues } from "../../../../../Sales/Checkout/utils";
23
- import useEngineContext from "../../../../../../hooks/useEngineContext";
24
- import { useAppointmentBooking, useAppointmentBookingStep, useAppointmentBookingLogin } from "../../../../hooks";
22
+ import { formatValues } from "../../../../Sales/Checkout/utils";
23
+ // import OrderProductModal from '../../OrderProductModal/index';
24
+ // import EmptyHolderModal from '../../EmptyHolderModal';
25
+ import useEngineContext from "../../../../../hooks/useEngineContext";
26
+ import { useAppointmentBooking, useAppointmentBookingLogin } from "../../../hooks";
27
+ import { useAppointmentBookingContext } from "../../../context";
25
28
  import "./index.less";
26
29
  var ContinueButton = function ContinueButton() {
27
- var _cartData$cartItems;
28
30
  var context = useEngineContext();
29
31
  // const { data } = useSales();
30
32
  // const { onHolderOpen } = useHolder();
@@ -43,9 +45,12 @@ var ContinueButton = function ContinueButton() {
43
45
  var _useAppointmentBookin = useAppointmentBookingLogin(),
44
46
  isLogin = _useAppointmentBookin.isLogin,
45
47
  openLoginModal = _useAppointmentBookin.openLoginModal;
46
- var _useAppointmentBookin2 = useAppointmentBookingStep(),
48
+ // const { currentStep, isLastStep } = useAppointmentBookingStep();
49
+ var _useAppointmentBookin2 = useAppointmentBookingContext(),
47
50
  currentStep = _useAppointmentBookin2.currentStep,
48
- isLastStep = _useAppointmentBookin2.isLastStep;
51
+ isLastStep = _useAppointmentBookin2.isLastStep,
52
+ products = _useAppointmentBookin2.products;
53
+ // const { products } = useAppointmentBookingCart();
49
54
 
50
55
  // 下单之前是否检测失败
51
56
  var _useState = useState(false),
@@ -175,8 +180,12 @@ var ContinueButton = function ContinueButton() {
175
180
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
176
181
  while (1) switch (_context3.prev = _context3.next) {
177
182
  case 0:
183
+ if (!isLastStep) {
184
+ _context3.next = 3;
185
+ break;
186
+ }
178
187
  if (isLogin) {
179
- _context3.next = 2;
188
+ _context3.next = 3;
180
189
  break;
181
190
  }
182
191
  return _context3.abrupt("return", openLoginModal({
@@ -187,10 +196,10 @@ var ContinueButton = function ContinueButton() {
187
196
  }
188
197
  }
189
198
  }));
190
- case 2:
199
+ case 3:
191
200
  handleNextStep();
192
201
  // handleHolder();
193
- case 3:
202
+ case 4:
194
203
  case "end":
195
204
  return _context3.stop();
196
205
  }
@@ -230,7 +239,7 @@ var ContinueButton = function ContinueButton() {
230
239
  return (createBooking === null || createBooking === void 0 ? void 0 : createBooking.loading) || (checkBeforeBooking === null || checkBeforeBooking === void 0 ? void 0 : checkBeforeBooking.loading);
231
240
  }, [isLastStep, createBooking === null || createBooking === void 0 ? void 0 : createBooking.loading, checkBeforeBooking === null || checkBeforeBooking === void 0 ? void 0 : checkBeforeBooking.loading]);
232
241
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
233
- disabled: !(cartData !== null && cartData !== void 0 && (_cartData$cartItems = cartData.cartItems) !== null && _cartData$cartItems !== void 0 && _cartData$cartItems.length),
242
+ disabled: !(products !== null && products !== void 0 && products.length),
234
243
  size: "large",
235
244
  type: "primary",
236
245
  onClick: function onClick() {
@@ -5,31 +5,21 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
5
5
  import React from 'react';
6
6
  import { locales } from '@pisell/utils';
7
7
  import { PisellText } from '@pisell/materials';
8
- // import { useCart, useHolder, useSummary, useStep } from '../../../../../Sales';
9
- import useEngineContext from "../../../../../../hooks/useEngineContext";
10
- import { useAppointmentBooking } from "../../../../hooks";
8
+ import useEngineContext from "../../../../../hooks/useEngineContext";
11
9
  import "./index.less";
12
10
  import classNames from 'classnames';
11
+ import { useAppointmentBookingContext } from "../../../context";
13
12
  var Total = function Total(_ref) {
14
- var _context$appHelper, _context$appHelper2, _context$appHelper2$g;
13
+ var _context$appHelper, _context$appHelper$ge;
15
14
  var className = _ref.className,
16
15
  isFooter = _ref.isFooter;
17
- // const { taxTitle, totalTaxFee, isPriceIncludeTax, total } = useSummary();
18
16
  var context = useEngineContext();
19
- var appointmentBooking = useAppointmentBooking();
20
- // console.log(
21
- // taxTitle,
22
- // isPriceIncludeTax,
23
- // totalTaxFee,
24
- // total,
25
- // context?.appHelper?.utils?.getSymbolic?.(),
26
- // 'wh97978'
27
- // );
28
- var taxTitle = 'GST';
29
- var totalTaxFee = 0;
30
- var isPriceIncludeTax = true;
31
- var total = 0;
32
- console.log(context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils, 'wh978976');
17
+ var _useAppointmentBookin = useAppointmentBookingContext(),
18
+ summary = _useAppointmentBookin.summary;
19
+ var taxTitle = summary.taxTitle,
20
+ totalTaxFee = summary.totalTaxFee,
21
+ isPriceIncludeTax = summary.isPriceIncludeTax,
22
+ total = summary.total;
33
23
  return /*#__PURE__*/React.createElement("div", {
34
24
  className: "event-total-wrap ".concat(className)
35
25
  }, !isPriceIncludeTax && Number(totalTaxFee) > 0 ? /*#__PURE__*/React.createElement("div", {
@@ -47,7 +37,7 @@ var Total = function Total(_ref) {
47
37
  className: "event-amount"
48
38
  }) : null), isPriceIncludeTax && Number(totalTaxFee) > 0 ? /*#__PURE__*/React.createElement("span", {
49
39
  className: "gst"
50
- }, locales.getText('pisell2.event.total.gst')("".concat(isFooter ? "".concat(taxTitle, ": ") : taxTitle), "".concat(context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.utils) === null || _context$appHelper2 === void 0 || (_context$appHelper2$g = _context$appHelper2.getSymbolic) === null || _context$appHelper2$g === void 0 ? void 0 : _context$appHelper2$g.call(_context$appHelper2)).concat(totalTaxFee))) : null), !isFooter ? /*#__PURE__*/React.createElement(PisellText.Amount, {
40
+ }, locales.getText('pisell2.event.total.gst')("".concat(isFooter ? "".concat(taxTitle, ": ") : taxTitle), "".concat(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$ge = _context$appHelper.getSymbolic) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper)).concat(totalTaxFee))) : null), !isFooter ? /*#__PURE__*/React.createElement(PisellText.Amount, {
51
41
  value: total,
52
42
  showCurrencySymbol: true,
53
43
  className: "event-amount"
@@ -0,0 +1,73 @@
1
+ import React, { useMemo } from 'react';
2
+ import { isMobile, locales } from '@pisell/utils';
3
+ import ShoppingCart from "../../../../shoppingCart";
4
+ // import SelectHolderModal from '../../../../';
5
+ import ContinueButton from "../ContinueButton";
6
+ import { useAppointmentBookingAccount, useAppointmentBooking } from "../../../hooks";
7
+ import { useAppointmentBookingContext } from "../../../context";
8
+ import Total from "./Total";
9
+ import { formatHolder } from "../../../utils";
10
+ import "./index.less";
11
+ var CartItem = function CartItem() {
12
+ var appointmentBooking = useAppointmentBooking();
13
+ var appointmentBookingAccount = useAppointmentBookingAccount();
14
+ var _useAppointmentBookin = useAppointmentBookingContext(),
15
+ carts = _useAppointmentBookin.carts,
16
+ summary = _useAppointmentBookin.summary,
17
+ isLastStep = _useAppointmentBookin.isLastStep;
18
+ var accountLists = appointmentBookingAccount.accountLists;
19
+ console.log(summary, carts, 'accountLists');
20
+ var holderIds = useMemo(function () {
21
+ return accountLists.map(function (item) {
22
+ return item.id;
23
+ });
24
+ }, [accountLists]);
25
+ var holders = useMemo(function () {
26
+ return formatHolder(accountLists);
27
+ }, [accountLists]);
28
+ var handleClickCard = function handleClickCard(e, type, key) {
29
+ console.log(e, type, key, 'wh9988767');
30
+
31
+ // 更改备注
32
+ if (type === 'note') {
33
+ return appointmentBooking.updateCart(e === null || e === void 0 ? void 0 : e._id, {
34
+ products: e
35
+ });
36
+ }
37
+
38
+ // 删除购物车下某个商品
39
+ if (type === 'delete') {
40
+ // return appointmentBooking.updateCart(e?._id, { products: e });
41
+ }
42
+
43
+ // 删除购物车
44
+ if (type === 'delete_holders') {
45
+ return appointmentBooking.removeAccount(key);
46
+ }
47
+ };
48
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
49
+ className: "cart-item-wrap ".concat(isMobile() ? 'cart-mobile-item-wrap' : '')
50
+ }, /*#__PURE__*/React.createElement("div", {
51
+ className: "content"
52
+ }, /*#__PURE__*/React.createElement(ShoppingCart, {
53
+ productParams: {
54
+ products: carts,
55
+ hideAddBtn: false,
56
+ holders: holders,
57
+ disabledEdit: isLastStep
58
+ },
59
+ collapseParams: {
60
+ activeKey: holderIds,
61
+ ghost: true
62
+ },
63
+ platform: "h5",
64
+ emptyText: locales.getText('pisell2.event.empty.service'),
65
+ isOpenGroup: !!(holderIds !== null && holderIds !== void 0 && holderIds.length),
66
+ onChange: function onChange(e, type, key) {
67
+ return handleClickCard(e, type, key);
68
+ }
69
+ })), /*#__PURE__*/React.createElement("div", {
70
+ className: "event-footer"
71
+ }, /*#__PURE__*/React.createElement(Total, null), /*#__PURE__*/React.createElement(ContinueButton, null))));
72
+ };
73
+ export default CartItem;
@@ -5,34 +5,45 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
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
7
  import React, { useMemo, useEffect, useState } from 'react';
8
- // import { useStep } from '../../../../Sales';
9
8
  import { isMobile } from '@pisell/utils';
10
- import CartItem from "../Provider/Cart/Item";
9
+ import CartItem from "../Cart/Item";
10
+ import Header from "../Header";
11
+ import Footer from "../Footer";
11
12
  import Services from "../Services";
12
13
  import Date from "../Date";
13
14
  import Resource from "../Resource";
14
15
  import TimeSlicing from "../TimeSlicing";
16
+ import Guest from "../Guest";
17
+ import { useAppointmentBookingStep, useAppointmentBookingCart } from "../../hooks";
18
+ import { useAppointmentBookingContext } from "../../context";
15
19
  import "./index.less";
16
20
  var Layout = function Layout() {
17
- // const { currentStepData, isFirstStep } = useStep();
18
- var _useState = useState({
19
- key: 'select-service'
20
- }),
21
+ var _currentStep$step2, _currentStep$step4, _currentStep$step5;
22
+ var appointmentBookingStep = useAppointmentBookingStep();
23
+ var appointmentBookingCart = useAppointmentBookingCart();
24
+ var _useAppointmentBookin = useAppointmentBookingContext(),
25
+ currentStep = _useAppointmentBookin.currentStep;
26
+ var _useState = useState({}),
21
27
  _useState2 = _slicedToArray(_useState, 2),
22
- currentStepData = _useState2[0],
23
- setCurrentStepData = _useState2[1];
28
+ params = _useState2[0],
29
+ setParams = _useState2[1];
24
30
  useEffect(function () {
31
+ var _currentStep$step;
32
+ console.log(currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key, 'whcurrentStep?.step?.key');
25
33
  window.scrollTo({
26
34
  top: 0,
27
35
  behavior: 'smooth'
28
36
  });
29
- }, [currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key]);
37
+ }, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key]);
30
38
  var Com = useMemo(function () {
31
- var key = currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key;
39
+ var _currentStep$step3;
40
+ var key = currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key;
32
41
  if (!key) return null;
33
42
  var components = {
34
43
  // 选择服务
35
44
  'select-service': Services,
45
+ // 添加客户
46
+ 'select-guest': Guest,
36
47
  // 选择时间
37
48
  'select-date': Date,
38
49
  // 选择资源
@@ -41,8 +52,11 @@ var Layout = function Layout() {
41
52
  'select-time': TimeSlicing
42
53
  };
43
54
  var Com = components[key];
44
- return /*#__PURE__*/React.createElement(Com, null);
45
- }, [currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key]);
55
+ return /*#__PURE__*/React.createElement(Com, {
56
+ onChange: setParams,
57
+ params: params
58
+ });
59
+ }, [currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key]);
46
60
 
47
61
  /**
48
62
  * @title: 动态计算中间内容区域的高度
@@ -66,13 +80,13 @@ var Layout = function Layout() {
66
80
  content.style.overflowY = 'auto';
67
81
  }
68
82
  }
69
- }, [currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key]);
70
- return /*#__PURE__*/React.createElement("div", {
83
+ }, [currentStep === null || currentStep === void 0 || (_currentStep$step5 = currentStep.step) === null || _currentStep$step5 === void 0 ? void 0 : _currentStep$step5.key]);
84
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement("div", {
71
85
  className: "parallel-content-wrap ".concat(isMobile() ? 'parallel-content-mobile-wrap' : '')
72
86
  }, /*#__PURE__*/React.createElement("div", {
73
87
  className: "parallel-content-left"
74
88
  }, Com), !isMobile() ? /*#__PURE__*/React.createElement("div", {
75
89
  className: "parallel-content-right"
76
- }, /*#__PURE__*/React.createElement(CartItem, null)) : null);
90
+ }, /*#__PURE__*/React.createElement(CartItem, null)) : null), isMobile() ? /*#__PURE__*/React.createElement(Footer, null) : null);
77
91
  };
78
92
  export default Layout;
@@ -1,23 +1,30 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
10
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
11
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
12
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
13
  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; }
9
14
  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; } }
10
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import { useState, useEffect } from 'react';
16
+ import React, { useState, useEffect } from 'react';
17
+ import { Skeleton } from 'antd';
12
18
  import Dayjs from 'dayjs';
13
19
  import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
14
20
  Dayjs.extend(isSameOrBefore);
15
21
  import { weekListText } from "./state";
16
22
  import classNames from 'classnames';
17
23
  import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons';
24
+ import { useAppointmentBookingContext } from "../../context";
18
25
  import "./index.less";
19
26
  var CalendarDate = function CalendarDate(props) {
20
- var _useState = useState(''),
27
+ var _useState = useState(),
21
28
  _useState2 = _slicedToArray(_useState, 2),
22
29
  currentDate = _useState2[0],
23
30
  setCurrentDate = _useState2[1];
@@ -33,6 +40,8 @@ var CalendarDate = function CalendarDate(props) {
33
40
  _useState6 = _slicedToArray(_useState5, 2),
34
41
  currentMonth = _useState6[0],
35
42
  setCurrentMonth = _useState6[1];
43
+ var _useAppointmentBookin = useAppointmentBookingContext(),
44
+ appointmentBooking = _useAppointmentBookin.appointmentBooking;
36
45
 
37
46
  // 计算开始渲染的列
38
47
  var startingColumn = 0 % 7; // 0 表示星期日
@@ -87,6 +96,61 @@ var CalendarDate = function CalendarDate(props) {
87
96
  var lastDate = Dayjs(newCurrentMonth).subtract(1, 'month');
88
97
  return lastDate.isBefore(Dayjs(), 'month');
89
98
  };
99
+ var getDates = /*#__PURE__*/function () {
100
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(date) {
101
+ var startDate, endDate, params, data, firstAvailableDate, baseMonthData, updatedDates;
102
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
103
+ while (1) switch (_context.prev = _context.next) {
104
+ case 0:
105
+ startDate = Dayjs(date).startOf('month').format('YYYY-MM-DD');
106
+ endDate = Dayjs(date).endOf('month').format('YYYY-MM-DD');
107
+ params = {
108
+ startDate: startDate,
109
+ endDate: endDate
110
+ };
111
+ _context.next = 5;
112
+ return appointmentBooking.getAvailableDate(params);
113
+ case 5:
114
+ data = _context.sent;
115
+ console.log(data, params, date, date.format('YYYY-MM') === Dayjs().format('YYYY-MM'), 'wh78968');
116
+
117
+ // 当前月则默认选中当前第一个可用的
118
+
119
+ if (date.format('YYYY-MM') === Dayjs().format('YYYY-MM')) {
120
+ firstAvailableDate = data.find(function (d) {
121
+ return d.status === 'available';
122
+ });
123
+ setCurrentDate(firstAvailableDate === null || firstAvailableDate === void 0 ? void 0 : firstAvailableDate.date);
124
+ appointmentBooking.setDateRange([firstAvailableDate]);
125
+ }
126
+
127
+ // 创建基础日历数据
128
+ baseMonthData = getMonthData(date.format('YYYY-MM')); // 使用后台数据更新可用日期的状态
129
+ updatedDates = baseMonthData.map(function (day) {
130
+ var matchedDay = data.find(function (d) {
131
+ return d.date === day.date;
132
+ });
133
+ if (matchedDay) {
134
+ return _objectSpread(_objectSpread(_objectSpread({}, day), matchedDay), {}, {
135
+ disabled: matchedDay.status === 'unavailable'
136
+ });
137
+ }
138
+ return day;
139
+ });
140
+ setDateMonthList(updatedDates);
141
+ case 11:
142
+ case "end":
143
+ return _context.stop();
144
+ }
145
+ }, _callee);
146
+ }));
147
+ return function getDates(_x) {
148
+ return _ref.apply(this, arguments);
149
+ };
150
+ }();
151
+ useEffect(function () {
152
+ getDates(currentMonth);
153
+ }, [currentMonth]);
90
154
 
91
155
  /**
92
156
  * @title: 切换上个月
@@ -100,7 +164,6 @@ var CalendarDate = function CalendarDate(props) {
100
164
  var currentLastText = currentMonth.format('YYYY-MM');
101
165
  var newLastMonth = Dayjs(currentLastText).subtract(1, 'month');
102
166
  setCurrentMonth(newLastMonth);
103
- setDateMonthList(getMonthData(newLastMonth.format('YYYY-MM')));
104
167
  };
105
168
 
106
169
  /**
@@ -115,16 +178,16 @@ var CalendarDate = function CalendarDate(props) {
115
178
  var currentMonthText = currentMonth.format('YYYY-MM');
116
179
  var newNextMonth = Dayjs(currentMonthText).add(1, 'month');
117
180
  setCurrentMonth(newNextMonth);
118
- setDateMonthList(getMonthData(newNextMonth.format('YYYY-MM')));
119
181
  };
120
- useEffect(function () {
121
- var date = '2025-04-25';
122
- var daysText = Dayjs(date).format('YYYY-MM');
123
- setDateMonthList(getMonthData(daysText));
124
- }, []);
125
182
  return /*#__PURE__*/React.createElement("div", {
126
183
  className: 'calendar-date-box'
127
- }, /*#__PURE__*/React.createElement("div", {
184
+ }, !dateMonthList.length ? /*#__PURE__*/React.createElement(Skeleton, {
185
+ loading: true,
186
+ active: true,
187
+ style: {
188
+ paddingTop: '16px'
189
+ }
190
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
128
191
  className: 'calendar-header'
129
192
  }, /*#__PURE__*/React.createElement("div", {
130
193
  className: classNames('calendar-last-month', _defineProperty({}, 'last-month-disabled', lastMonthDisable())),
@@ -155,14 +218,16 @@ var CalendarDate = function CalendarDate(props) {
155
218
  key: index,
156
219
  className: classNames('calendar-days-items', _defineProperty(_defineProperty(_defineProperty({}, 'disabledDate', day === null || day === void 0 ? void 0 : day.disabled), 'selectDate', currentDate === date), 'other-month-days', !isCurrentMonth)),
157
220
  onClick: function onClick() {
221
+ if (day !== null && day !== void 0 && day.disabled) return;
158
222
  console.log(day, 'wh987976');
159
- !(day !== null && day !== void 0 && day.disabled) && setCurrentDate(date);
223
+ setCurrentDate(date);
224
+ appointmentBooking.setDateRange([day]);
160
225
  }
161
226
  }, isCurrentMonth && /*#__PURE__*/React.createElement("div", {
162
227
  className: classNames('day-text', {
163
228
  // ['day-line']: !disabled,
164
229
  })
165
230
  }, Dayjs(day.date).format('D')));
166
- }))));
231
+ })))));
167
232
  };
168
233
  export default CalendarDate;
@@ -3,6 +3,7 @@
3
3
  flex-direction: column;
4
4
  gap: 32px;
5
5
  user-select: none;
6
+ margin-top: 16px;
6
7
 
7
8
  .calendar-header {
8
9
  display: flex;
@@ -7,11 +7,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React from 'react';
8
8
  import { SectionFooters, Button, Badge, Image } from '@pisell/materials';
9
9
  import { useState } from 'react';
10
- import ContinueButton from "../Provider/Cart/ContinueButton";
10
+ import ContinueButton from "../Cart/ContinueButton";
11
11
  import shoppingCartSvg from "../../assets/shopping-cart.svg";
12
12
  import { useAppointmentBooking, useAppointmentBookingCart } from "../../hooks";
13
- import Cart from "../Provider/Cart";
14
- import Total from "../Provider/Cart/Item/Total";
13
+ import Cart from "../Cart";
14
+ import Total from "../Cart/Item/Total";
15
15
  import "./index.less";
16
16
  var Footer = function Footer() {
17
17
  var _cartData$cartItems;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const Guest: () => JSX.Element;
3
+ export default Guest;