@pisell/private-materials 3.3.21 → 3.3.23

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 (214) 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/render/default/view.js +4 -4
  7. package/build/lowcode/view.js +4 -4
  8. package/es/businessModel/SalesModel/index.d.ts +1 -0
  9. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  10. package/es/components/appointmentBooking/components/Cart/Item/index.js +19 -7
  11. package/es/components/appointmentBooking/components/ConfirmInformation/index.d.ts +4 -0
  12. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +2 -1
  13. package/es/components/appointmentBooking/components/Content/index.d.ts +4 -0
  14. package/es/components/appointmentBooking/components/Content/index.js +0 -1
  15. package/es/components/appointmentBooking/components/Date/index.d.ts +4 -0
  16. package/es/components/appointmentBooking/components/Date/index.js +1 -5
  17. package/es/components/appointmentBooking/components/Date/state.d.ts +63 -0
  18. package/es/components/appointmentBooking/components/Form/index.d.ts +4 -0
  19. package/es/components/appointmentBooking/components/Form/index.js +4 -3
  20. package/es/components/appointmentBooking/components/Guest/index.d.ts +4 -0
  21. package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
  22. package/es/components/appointmentBooking/components/Resource/index.d.ts +7 -0
  23. package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
  24. package/es/components/appointmentBooking/components/Services/index.js +21 -11
  25. package/es/components/appointmentBooking/components/TimeSlicing/index.d.ts +4 -0
  26. package/es/components/appointmentBooking/context.d.ts +35 -0
  27. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  28. package/es/components/appointmentBooking/hooks.d.ts +106 -0
  29. package/es/components/appointmentBooking/hooks.js +12 -18
  30. package/es/components/appointmentBooking/index.d.ts +1 -0
  31. package/es/components/appointmentBooking/index.js +3 -5
  32. package/es/components/appointmentBooking/locales.d.ts +354 -0
  33. package/es/components/appointmentBooking/utils.d.ts +114 -0
  34. package/es/components/appointmentBooking/utils.js +15 -15
  35. package/es/components/booking/addons/model.d.ts +1 -10
  36. package/es/components/booking/addons/model.js +5 -5
  37. package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
  38. package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
  39. package/es/components/booking/components/browserSelect/index.js +1 -1
  40. package/es/components/booking/components/voucher/index.js +4 -2
  41. package/es/components/booking/deposit/index.d.ts +3 -0
  42. package/es/components/booking/forms/model.d.ts +1 -10
  43. package/es/components/booking/forms/model.js +5 -5
  44. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  45. package/es/components/booking/forms/single/index.d.ts +0 -1
  46. package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
  47. package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  48. package/es/components/booking/info/model.d.ts +1 -10
  49. package/es/components/booking/info/service/addService/index.js +14 -16
  50. package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  51. package/es/components/booking/info/service/like/index.js +1 -1
  52. package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
  53. package/es/components/booking/info/service2/utils.d.ts +1 -1
  54. package/es/components/booking/info/service2/utils.js +1 -0
  55. package/es/components/booking/info2/service/addService/index.js +30 -17
  56. package/es/components/booking/materiels/startTime/index.js +1 -1
  57. package/es/components/booking/model.d.ts +1 -9
  58. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  59. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  60. package/es/components/booking/notes/model.d.ts +1 -10
  61. package/es/components/booking/notes/model.js +5 -5
  62. package/es/components/booking/payments/model.d.ts +1 -10
  63. package/es/components/booking/payments/model.js +5 -5
  64. package/es/components/eftposPay/amount.d.ts +2 -1
  65. package/es/components/eftposPay/app.d.ts +1 -0
  66. package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
  67. package/es/components/eftposPay/device.d.ts +2 -1
  68. package/es/components/eftposPay/hooks.d.ts +2 -2
  69. package/es/components/eftposPay/payo/config.d.ts +13 -0
  70. package/es/components/eftposPay/payo/hooks.d.ts +10 -0
  71. package/es/components/eftposPay/store/index.d.ts +6 -6
  72. package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  73. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  74. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  75. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  76. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  77. package/es/components/eventBooking/index.d.ts +1 -0
  78. package/es/components/listComponent/index.js +5 -5
  79. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  80. package/es/components/pay/toC/model.d.ts +1 -9
  81. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  82. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  83. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  84. package/es/components/productExtension/card/index.js +3 -3
  85. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  86. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  87. package/es/components/productExtension/fields/Forms/index.js +12 -12
  88. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  89. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  90. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  91. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  92. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  93. package/es/components/productExtension/index.d.ts +1 -0
  94. package/es/components/productExtension/server.js +2 -2
  95. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  96. package/es/components/schedules/calendar/index.js +4 -4
  97. package/es/components/schedules/calendar/serve.js +2 -2
  98. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  99. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  100. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  101. package/es/components/schedules/components/ResourceList/index.js +1 -1
  102. package/es/components/schedules/components/Search/index.js +5 -5
  103. package/es/components/schedules/model.d.ts +1 -9
  104. package/es/components/schedules/model.js +5 -5
  105. package/es/components/schedules/openHours/index.js +1 -1
  106. package/es/components/schedules/openHours/serve.js +2 -2
  107. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  108. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  109. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  110. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  111. package/es/components/schedules/products/serve.js +2 -2
  112. package/es/components/schedules/products/utils.js +5 -5
  113. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  114. package/es/components/schedules/resources/detail/index.js +10 -10
  115. package/es/components/schedules/resources/list/index.js +2 -2
  116. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  117. package/es/components/schedules/resources/serve.js +2 -2
  118. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  119. package/es/components/schedules/utils.js +4 -4
  120. package/es/components/selectModal/index.js +2 -2
  121. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  122. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  123. package/es/components/ticketBooking/components/timeBar/index.js +1 -0
  124. package/es/components/ticketBooking/index.d.ts +1 -0
  125. package/es/components/wallet/Detail/model.d.ts +1 -13
  126. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  127. package/es/components/wallet/PointCard/model.d.ts +1 -13
  128. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  129. package/es/components/wallet/Voucher/model.d.ts +1 -13
  130. package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
  131. package/es/components/wallet/model.d.ts +1 -9
  132. package/es/hooks/useComponents.js +1 -1
  133. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  134. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  135. package/lib/components/appointmentBooking/components/Cart/Item/index.js +12 -9
  136. package/lib/components/appointmentBooking/components/ConfirmInformation/index.d.ts +4 -0
  137. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +7 -1
  138. package/lib/components/appointmentBooking/components/Content/index.d.ts +4 -0
  139. package/lib/components/appointmentBooking/components/Content/index.js +1 -1
  140. package/lib/components/appointmentBooking/components/Date/index.d.ts +4 -0
  141. package/lib/components/appointmentBooking/components/Date/index.js +1 -1
  142. package/lib/components/appointmentBooking/components/Date/state.d.ts +63 -0
  143. package/lib/components/appointmentBooking/components/Form/index.d.ts +4 -0
  144. package/lib/components/appointmentBooking/components/Form/index.js +3 -2
  145. package/lib/components/appointmentBooking/components/Guest/index.d.ts +4 -0
  146. package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
  147. package/lib/components/appointmentBooking/components/Resource/index.d.ts +7 -0
  148. package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
  149. package/lib/components/appointmentBooking/components/Services/index.js +8 -1
  150. package/lib/components/appointmentBooking/components/TimeSlicing/index.d.ts +4 -0
  151. package/lib/components/appointmentBooking/context.d.ts +35 -0
  152. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  153. package/lib/components/appointmentBooking/hooks.d.ts +106 -0
  154. package/lib/components/appointmentBooking/hooks.js +2 -6
  155. package/lib/components/appointmentBooking/index.d.ts +1 -0
  156. package/lib/components/appointmentBooking/index.js +2 -2
  157. package/lib/components/appointmentBooking/locales.d.ts +354 -0
  158. package/lib/components/appointmentBooking/utils.d.ts +114 -0
  159. package/lib/components/appointmentBooking/utils.js +14 -23
  160. package/lib/components/booking/addons/model.d.ts +1 -10
  161. package/lib/components/booking/components/voucher/index.js +4 -2
  162. package/lib/components/booking/deposit/index.d.ts +3 -0
  163. package/lib/components/booking/forms/model.d.ts +1 -10
  164. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  165. package/lib/components/booking/forms/single/index.d.ts +0 -1
  166. package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
  167. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  168. package/lib/components/booking/info/model.d.ts +1 -10
  169. package/lib/components/booking/info/service/addService/index.js +14 -14
  170. package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  171. package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
  172. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  173. package/lib/components/booking/info/service2/utils.js +1 -0
  174. package/lib/components/booking/info2/service/addService/index.js +27 -15
  175. package/lib/components/booking/model.d.ts +1 -9
  176. package/lib/components/booking/notes/model.d.ts +1 -10
  177. package/lib/components/booking/payments/model.d.ts +1 -10
  178. package/lib/components/eftposPay/amount.d.ts +2 -1
  179. package/lib/components/eftposPay/app.d.ts +1 -0
  180. package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
  181. package/lib/components/eftposPay/device.d.ts +2 -1
  182. package/lib/components/eftposPay/hooks.d.ts +2 -2
  183. package/lib/components/eftposPay/payo/config.d.ts +13 -0
  184. package/lib/components/eftposPay/payo/hooks.d.ts +10 -0
  185. package/lib/components/eftposPay/store/index.d.ts +6 -6
  186. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  187. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  188. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  189. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  190. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  191. package/lib/components/eventBooking/index.d.ts +1 -0
  192. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  193. package/lib/components/pay/toC/model.d.ts +1 -9
  194. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  195. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  196. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  197. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  198. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  199. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  200. package/lib/components/productExtension/index.d.ts +1 -0
  201. package/lib/components/schedules/model.d.ts +1 -9
  202. package/lib/components/schedules/utils.js +1 -1
  203. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  204. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  205. package/lib/components/ticketBooking/components/timeBar/index.js +1 -0
  206. package/lib/components/ticketBooking/index.d.ts +1 -0
  207. package/lib/components/wallet/Detail/model.d.ts +1 -13
  208. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  209. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  210. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  211. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  212. package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
  213. package/lib/components/wallet/model.d.ts +1 -9
  214. package/package.json +3 -3
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const SalesModel: ({ children, hooks, config }: any) => JSX.Element;
2
3
  export * from './Sales';
3
4
  export default SalesModel;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const CartItem: ({ onNext }: any) => JSX.Element;
3
4
  export default CartItem;
@@ -13,16 +13,15 @@ import ShoppingCart from "../../../../shoppingCart";
13
13
  import ContinueButton from "../ContinueButton";
14
14
  import { useAppointmentBooking } from "../../../hooks";
15
15
  import { useAppointmentBookingContext } from "../../../context";
16
- import { useAppointmentBookingAccount, useAppointmentBookingResource, useAppointmentBookingSetting, useAppointmentBookingLogin } from "../../../hooks";
16
+ import { useAppointmentBookingAccount, useAppointmentBookingResource, useAppointmentBookingSetting, useAppointmentBookingLogin, contextUtils } from "../../../hooks";
17
17
  import { formatHolder, formatCarts, formatCurrentUser, openForm } from "../../../utils";
18
18
  import VoucherCard from "../../Voucher";
19
19
  import Total from "./Total";
20
20
  import Deposit from "../../Deposit";
21
- import useEngineContext from "../../../../../hooks/useEngineContext";
22
21
  import { handleAddHolder } from "../utils";
23
22
  import "./index.less";
24
23
  var CartItem = function CartItem(_ref) {
25
- var _context$appHelper, _businessUtils$getApp, _currentStep$step, _currentStep$step2;
24
+ var _businessUtils$getApp, _currentStep$step, _currentStep$step2;
26
25
  var onNext = _ref.onNext;
27
26
  var appointmentBooking = useAppointmentBooking();
28
27
  var _useAppointmentBookin = useAppointmentBookingContext(),
@@ -45,12 +44,22 @@ var CartItem = function CartItem(_ref) {
45
44
  bookingSubject = _useAppointmentBookin4.bookingSubject;
46
45
  var _useAppointmentBookin5 = useAppointmentBookingLogin(),
47
46
  isLogin = _useAppointmentBookin5.isLogin;
48
- var context = useEngineContext();
49
- var utils = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils;
47
+ var utils = contextUtils();
50
48
  var businessUtils = utils.businessUtils;
51
- var currentUser = formatCurrentUser();
52
49
  var deposit = summary.deposit;
53
50
 
51
+ /**
52
+ * @title: 当前客户
53
+ * @description:
54
+ * @param {*} useMemo
55
+ * @return {*}
56
+ * @Author: WangHan
57
+ * @Date: 2025-05-14 14:59
58
+ */
59
+ var currentUser = useMemo(function () {
60
+ return formatCurrentUser(utils) || {};
61
+ }, []);
62
+
54
63
  /**
55
64
  * @title: 格式化购物车ids
56
65
  * @description:
@@ -188,13 +197,16 @@ var CartItem = function CartItem(_ref) {
188
197
  });
189
198
  }
190
199
  };
200
+ var products = useMemo(function () {
201
+ return formatCarts(carts, resources, utils, accountLists);
202
+ }, [carts, resources, accountLists]);
191
203
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
192
204
  className: "appointment-cart-item-wrap ".concat(isMobile() ? 'appointment-cart-mobile-item-wrap' : '')
193
205
  }, /*#__PURE__*/React.createElement("div", {
194
206
  className: "content"
195
207
  }, /*#__PURE__*/React.createElement(ShoppingCart, {
196
208
  productParams: {
197
- products: formatCarts(carts, resources, accountLists),
209
+ products: products,
198
210
  hideAddBtn: false,
199
211
  holders: holders,
200
212
  disabledEdit: isLastStep,
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const ConfirmInformation: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
4
+ export default ConfirmInformation;
@@ -155,7 +155,8 @@ var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
155
155
  }, /*#__PURE__*/React.createElement("div", {
156
156
  className: "image"
157
157
  }, /*#__PURE__*/React.createElement("img", {
158
- src: "".concat(config === null || config === void 0 ? void 0 : config.awsStatic, "/checkout_confirm.png")
158
+ src: "".concat(config === null || config === void 0 ? void 0 : config.awsStatic, "/checkout_confirm.png"),
159
+ loading: "lazy"
159
160
  })), /*#__PURE__*/React.createElement("span", {
160
161
  className: "tips"
161
162
  }, locales.getText('pisell2.appointment.tips')), /*#__PURE__*/React.createElement("span", {
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ declare const Layout: () => JSX.Element;
4
+ export default Layout;
@@ -40,7 +40,6 @@ var Layout = function Layout() {
40
40
  policyParams = _useAppointmentBookin.policyParams,
41
41
  closePolicy = _useAppointmentBookin.closePolicy;
42
42
  var _useAppointmentBookin2 = useAppointmentBookingSetting(),
43
- getLoadAllSchedule = _useAppointmentBookin2.getLoadAllSchedule,
44
43
  isDateSelectedFirst = _useAppointmentBookin2.isDateSelectedFirst,
45
44
  isFormSubject = _useAppointmentBookin2.isFormSubject;
46
45
  var _useAppointmentBookin3 = useAppointmentBookingLogin(),
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const Date: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
4
+ export default Date;
@@ -52,7 +52,6 @@ var Date = /*#__PURE__*/forwardRef(function (props, ref) {
52
52
  var _useAppointmentBookin2 = useAppointmentBookingSetting(),
53
53
  isDateSelectedFirst = _useAppointmentBookin2.isDateSelectedFirst,
54
54
  customPageId = _useAppointmentBookin2.customPageId,
55
- getLoadAllSchedule = _useAppointmentBookin2.getLoadAllSchedule,
56
55
  channel = _useAppointmentBookin2.channel;
57
56
  var _useAppointmentBookin3 = useAppointmentBookingStep(),
58
57
  nextStep = _useAppointmentBookin3.nextStep;
@@ -282,10 +281,7 @@ var Date = /*#__PURE__*/forwardRef(function (props, ref) {
282
281
  });
283
282
  }
284
283
  return day;
285
- }); // 先选日期,加载schedule数据
286
- // if (isDateSelectedFirst) {
287
- // getLoadAllSchedule();
288
- // }
284
+ });
289
285
  setLoading(false);
290
286
  setDateMonthList(updatedDates);
291
287
  _context4.next = 23;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @title: 获取包括今天的后七天日期
3
+ * @description:
4
+ * @param {*}
5
+ * @return {*}
6
+ * @Author: 严文强
7
+ * @Date: 2024-02-01 11:00
8
+ */
9
+ export declare const getNextSevenDaysList: (defaultDay: string) => string[];
10
+ /**
11
+ * @title: 将年月日信息只展示为天
12
+ * @description: 如果为今天 则返回ToDay
13
+ * @param {*}
14
+ * @return {*}
15
+ * @Author: 严文强
16
+ * @Date: 2024-02-01 11:00
17
+ */
18
+ export declare const ShowDayOnly: (date: string) => string;
19
+ /**
20
+ * @title: 日历星期多语言
21
+ * @description:
22
+ * @param {*}
23
+ * @return {*}
24
+ * @Author: 严文强
25
+ * @Date: 2024-02-01 18:42
26
+ */
27
+ export declare const weekListText: string[];
28
+ /**
29
+ * @title: 不同状态颜色值
30
+ * @description:
31
+ * @param {*}
32
+ * @return {*}
33
+ * @Author: xiangxiang.shao
34
+ * @Date: 2024-02-19 11:35
35
+ */
36
+ export declare const statusColor: {
37
+ call_to_book: string;
38
+ lots_of_space: string;
39
+ filling_up_fast: string;
40
+ sold_out: string;
41
+ };
42
+ /**
43
+ * @title: 根据预约量数据判断当前状态
44
+ * @description:
45
+ * @param {*}
46
+ * @return {*}
47
+ * @Author: xiangxiang.shao
48
+ * @Date: 2024-02-19 11:35
49
+ */
50
+ export declare const getStatus: (dateLimit: any, currentDate: string, cutTime: any) => {
51
+ status: string;
52
+ disabled: boolean;
53
+ };
54
+ /**
55
+ * @title: 根据当前日期以设定判断当前是否是call_to_book状态
56
+ * @description:
57
+ * @param {*}
58
+ * @return {*}
59
+ * @Author: xiangxiang.shao
60
+ * @Date: 2024-02-21 10:10
61
+ */
62
+ export declare const getCallToBookStatus: (currentDate: string, dateLimitData: any, cutTime: any) => boolean;
63
+ export declare const localeTypes: any;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const Form: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
4
+ export default Form;
@@ -14,7 +14,7 @@ import React, { useMemo, useRef, useState, useImperativeHandle, forwardRef, useE
14
14
  import useComponents from "../../../../hooks/useComponents";
15
15
  import { formatForms, formatCarts, updateLists, updateBookingFormStorage } from "../../utils";
16
16
  import { useAppointmentBookingContext } from "../../context";
17
- import { useAppointmentBookingResource, useAppointmentBookingSetting, useAppointmentBookingStep } from "../../hooks";
17
+ import { useAppointmentBookingResource, useAppointmentBookingSetting, useAppointmentBookingStep, contextUtils } from "../../hooks";
18
18
  import PolicyModal from "../../deposit/components/PolicyModal";
19
19
  import "./index.less";
20
20
  var Form = /*#__PURE__*/forwardRef(function (props, ref) {
@@ -54,6 +54,7 @@ var Form = /*#__PURE__*/forwardRef(function (props, ref) {
54
54
  getOtherData = _useAppointmentBookin3.getOtherData;
55
55
  var _useAppointmentBookin4 = useAppointmentBookingStep(),
56
56
  nextStep = _useAppointmentBookin4.nextStep;
57
+ var utils = contextUtils();
57
58
  useImperativeHandle(ref, function () {
58
59
  return {
59
60
  next: function next() {
@@ -80,11 +81,11 @@ var Form = /*#__PURE__*/forwardRef(function (props, ref) {
80
81
  var _resource = getResourceList();
81
82
  return (_resource === null || _resource === void 0 ? void 0 : _resource.resources) || [];
82
83
  }, []);
83
- var newCarts = formatCarts(carts, resources);
84
84
  var forms = useMemo(function () {
85
+ var newCarts = formatCarts(carts, resources, utils);
85
86
  if (!(newCarts !== null && newCarts !== void 0 && newCarts.length) || !(resources !== null && resources !== void 0 && resources.length)) return [];
86
87
  return formatForms(newCarts) || [];
87
- }, [newCarts, resources]);
88
+ }, [carts, resources]);
88
89
  useEffect(function () {
89
90
  var _forms$currentFormInd;
90
91
  if (!(forms !== null && forms !== void 0 && forms.length)) return;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const Guest: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
4
+ export default Guest;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Header: () => JSX.Element;
3
4
  export default Header;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface ResourceProps {
4
+ onChange?: (val: any) => void;
5
+ }
6
+ declare const Resource: React.ForwardRefExoticComponent<ResourceProps & React.RefAttributes<any>>;
7
+ export default Resource;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const Services: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
4
+ export default Services;
@@ -84,17 +84,27 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
84
84
  },
85
85
  callback: function () {
86
86
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
87
- var product, session, startDate, endDate, _data$origin, resources, activeStatus, index, description;
87
+ var session, product, startDate, endDate, _data$origin, resources, activeStatus, index, description;
88
88
  return _regeneratorRuntime().wrap(function _callee$(_context) {
89
89
  while (1) switch (_context.prev = _context.next) {
90
90
  case 0:
91
+ if (!(data !== null && data !== void 0 && data.isCancel)) {
92
+ _context.next = 3;
93
+ break;
94
+ }
95
+ if (type === 'session') {
96
+ appointmentBooking.closeProductDetail();
97
+ appointmentBooking.getAvailableDate();
98
+ }
99
+ return _context.abrupt("return");
100
+ case 3:
101
+ session = data === null || data === void 0 ? void 0 : data.session;
91
102
  product = _objectSpread(_objectSpread({}, data), {}, {
92
103
  options: (data === null || data === void 0 ? void 0 : data.option) || []
93
104
  });
94
105
  delete product.option;
95
- session = data === null || data === void 0 ? void 0 : data.session;
96
106
  if (!session) {
97
- _context.next = 11;
107
+ _context.next = 14;
98
108
  break;
99
109
  }
100
110
  startDate = dayjs(session === null || session === void 0 ? void 0 : session.start_at).format('YYYY-MM-DD');
@@ -111,28 +121,28 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
111
121
  startDate: startDate,
112
122
  endDate: endDate
113
123
  });
114
- _context.next = 19;
124
+ _context.next = 22;
115
125
  break;
116
- case 11:
126
+ case 14:
117
127
  resources = (data === null || data === void 0 || (_data$origin = data.origin) === null || _data$origin === void 0 || (_data$origin = _data$origin.product_resource) === null || _data$origin === void 0 ? void 0 : _data$origin.resources) || [];
118
128
  activeStatus = resources.find(function (item) {
119
129
  return item.status === 1;
120
130
  });
121
131
  if (activeStatus) {
122
- _context.next = 15;
132
+ _context.next = 18;
123
133
  break;
124
134
  }
125
135
  return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
126
- case 15:
136
+ case 18:
127
137
  appointmentBooking.storeProduct(product);
128
138
  // duration 类型的商品,要获取一下资源
129
139
  if (!(type === 'duration')) {
130
- _context.next = 19;
140
+ _context.next = 22;
131
141
  break;
132
142
  }
133
- _context.next = 19;
143
+ _context.next = 22;
134
144
  return appointmentBooking.getAvailableDate();
135
- case 19:
145
+ case 22:
136
146
  // 先选择日期流程
137
147
  if (isDateSelectedFirst) {
138
148
  index = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2; //先选择日期流程:如果商品类型是duration的商品,则需要增加选择时间步骤
@@ -151,7 +161,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
151
161
  removeStep('select-time');
152
162
  }
153
163
  }
154
- case 20:
164
+ case 23:
155
165
  case "end":
156
166
  return _context.stop();
157
167
  }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const TimeSlicing: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
4
+ export default TimeSlicing;
@@ -0,0 +1,35 @@
1
+ import { ReactNode } from 'react';
2
+ import { TasksManager } from '../../utils/tasks';
3
+ interface AppointmentBookingContextType {
4
+ appointmentBooking: any;
5
+ times: any[];
6
+ resources: any[];
7
+ setTimes: (times: any[]) => void;
8
+ setResources: (lists: any[]) => void;
9
+ carts: any[];
10
+ summary: any;
11
+ setCarts: (val: any[]) => void;
12
+ setSummary: (val: any) => void;
13
+ currentStep: any;
14
+ setCurrentStep: (val: any) => void;
15
+ appHelper?: any;
16
+ symbolic?: any;
17
+ resourceOtherParams?: any;
18
+ setResourceOtherParams: (val: any) => void;
19
+ selectedTime: any;
20
+ setSelectedTime: (val: any) => void;
21
+ isAgreeDepositPolicy: boolean;
22
+ setIsAgreeDepositPolicy: (val: boolean) => void;
23
+ isLastStep: boolean;
24
+ tasksManager: TasksManager;
25
+ policyParams: any;
26
+ setPolicyParams: (val: any) => void;
27
+ openPolicy: (content: any, callback?: any) => void;
28
+ closePolicy: (val?: boolean) => void;
29
+ [key: string]: any;
30
+ }
31
+ export declare const AppointmentBookingProvider: ({ children, }: {
32
+ children: ReactNode;
33
+ }) => JSX.Element;
34
+ export declare const useAppointmentBookingContext: () => AppointmentBookingContextType | undefined;
35
+ export {};
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const DepositModal: (props: any) => JSX.Element;
3
+ export default DepositModal;
@@ -0,0 +1,106 @@
1
+ export declare const useAppointmentBooking: () => any;
2
+ export declare const useShopDiscount: () => any;
3
+ export declare const contextUtils: () => any;
4
+ /**
5
+ * @title: 监听步骤发生变化
6
+ * @description:
7
+ * @return {*}
8
+ * @Author: WangHan
9
+ * @Date: 2025-04-15 11:11
10
+ */
11
+ export declare const useAppointmentBookingStep: () => {
12
+ getStepIndex: (type: string, skipNumber?: number) => any;
13
+ stepList: any;
14
+ removeStep: (key: string) => any;
15
+ addStep: (props: any, stepKey?: string) => any;
16
+ updateStep: (key: string, step: any) => void;
17
+ nextStep: () => void;
18
+ };
19
+ /**
20
+ * @title: 获取商品数据
21
+ * @description:
22
+ * @return {*}
23
+ * @Author: WangHan
24
+ * @Date: 2025-04-15 11:12
25
+ */
26
+ export declare const useAppointmentBookingProduct: () => {
27
+ checkProductType: (productId: number) => Promise<any>;
28
+ getProducts: () => Promise<any>;
29
+ };
30
+ /**
31
+ * @title: 更新购物车数据
32
+ * @description:
33
+ * @return {*}
34
+ * @Author: WangHan
35
+ * @Date: 2025-04-15 11:12
36
+ */
37
+ export declare const useAppointmentBookingCart: () => void;
38
+ /**
39
+ * @title: 获取登录状态
40
+ * @description:
41
+ * @return {*}
42
+ * @Author: WangHan
43
+ * @Date: 2025-04-15 11:14
44
+ */
45
+ export declare const useAppointmentBookingLogin: () => {
46
+ isLogin: boolean;
47
+ openLoginModal: (params: {
48
+ callback: any;
49
+ }) => void;
50
+ };
51
+ /**
52
+ * @title: 获取账户
53
+ * @description:
54
+ * @return {*}
55
+ * @Author: WangHan
56
+ * @Date: 2025-04-15 11:15
57
+ */
58
+ export declare const useAppointmentBookingAccount: () => {
59
+ accountLists: any;
60
+ getHolders: () => Promise<any>;
61
+ form_id: any;
62
+ addAccount: (val: any, type?: string) => Promise<any>;
63
+ checkAccount: (type: any) => any;
64
+ };
65
+ /**
66
+ * @title: 获取资源数据
67
+ * @description:
68
+ * @return {*}
69
+ * @Author: WangHan
70
+ * @Date: 2025-04-15 11:29
71
+ */
72
+ export declare const useAppointmentBookingResource: () => {
73
+ getResourceTimeSlot: (index?: number) => Promise<void>;
74
+ getResourceList: () => {
75
+ resources: any;
76
+ resourceCodes: any;
77
+ };
78
+ autoSelectAllProductResources: (index?: number) => Promise<any>;
79
+ };
80
+ /**
81
+ * @title: 是否跳过资源选择步骤
82
+ * @description:
83
+ * @return {*}
84
+ * @Author: WangHan
85
+ * @Date: 2025-04-21 11:47
86
+ */
87
+ export declare const useIsSkipResourceStep: () => {
88
+ checkSkipResourceStep: (isSkipUpdateFormStep?: boolean) => Promise<boolean>;
89
+ };
90
+ /**
91
+ * @title: 获取预约配置
92
+ * @description:
93
+ * @return {*}
94
+ * @Author: WangHan
95
+ * @Date: 2025-04-24 18:15
96
+ */
97
+ export declare const useAppointmentBookingSetting: () => {
98
+ isDateSelectedFirst: boolean;
99
+ isFormSubject: boolean;
100
+ customPageId: any;
101
+ channel: any;
102
+ bookingSubject: any;
103
+ setOtherData: (key: string, val: any) => any;
104
+ getOtherData: (key: string) => any;
105
+ formName: any;
106
+ };
@@ -372,7 +372,6 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
372
372
  var _ref12 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o2 = appointmentBooking.otherParams) === null || _appointmentBooking$o2 === void 0 ? void 0 : _appointmentBooking$o2.productModuleParams) || {},
373
373
  bookingSubject = _ref12.bookingSubject;
374
374
  var form_id = bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id;
375
- var customer = getCustomer();
376
375
 
377
376
  // 获取账户列表数据
378
377
  var getAccountLists = /*#__PURE__*/function () {
@@ -423,17 +422,18 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
423
422
  var getHolders = /*#__PURE__*/function () {
424
423
  var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
425
424
  var _utils$getStore$getSt;
426
- var shop_id, params, data, newData;
425
+ var shop_id, customer, params, data, newData;
427
426
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
428
427
  while (1) switch (_context8.prev = _context8.next) {
429
428
  case 0:
430
429
  shop_id = (_utils$getStore$getSt = utils.getStore().getState()) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.global) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.shop) === null || _utils$getStore$getSt === void 0 ? void 0 : _utils$getStore$getSt.id;
430
+ customer = getCustomer(utils);
431
431
  if (!(!shop_id || !form_id || !(customer !== null && customer !== void 0 && customer.id))) {
432
- _context8.next = 3;
432
+ _context8.next = 4;
433
433
  break;
434
434
  }
435
435
  return _context8.abrupt("return", []);
436
- case 3:
436
+ case 4:
437
437
  params = {
438
438
  url: '/form/data/v1',
439
439
  query: {
@@ -442,9 +442,9 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
442
442
  shop_id: shop_id
443
443
  }
444
444
  };
445
- _context8.next = 6;
445
+ _context8.next = 7;
446
446
  return appointmentBooking.fetchHolderAccountsAsync(params);
447
- case 6:
447
+ case 7:
448
448
  data = _context8.sent;
449
449
  newData = data === null || data === void 0 ? void 0 : data.map(function (item) {
450
450
  return {
@@ -453,7 +453,7 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
453
453
  };
454
454
  });
455
455
  return _context8.abrupt("return", newData || []);
456
- case 9:
456
+ case 10:
457
457
  case "end":
458
458
  return _context8.stop();
459
459
  }
@@ -467,19 +467,20 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
467
467
  // 添加账户
468
468
  var addAccount = /*#__PURE__*/function () {
469
469
  var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(val, type) {
470
- var result;
470
+ var customer, result;
471
471
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
472
472
  while (1) switch (_context9.prev = _context9.next) {
473
473
  case 0:
474
- _context9.next = 2;
474
+ customer = getCustomer(utils);
475
+ _context9.next = 3;
475
476
  return appointmentBooking.addAccount(val, {
476
477
  type: type,
477
478
  customerId: customer === null || customer === void 0 ? void 0 : customer.id
478
479
  });
479
- case 2:
480
+ case 3:
480
481
  result = _context9.sent;
481
482
  return _context9.abrupt("return", result);
482
- case 4:
483
+ case 5:
483
484
  case "end":
484
485
  return _context9.stop();
485
486
  }
@@ -731,12 +732,6 @@ export var useAppointmentBookingSetting = function useAppointmentBookingSetting(
731
732
  customPageId = _ref21.customPageId,
732
733
  channel = _ref21.channel;
733
734
 
734
- // 加载日历接口
735
- var getLoadAllSchedule = function getLoadAllSchedule() {
736
- var res = appointmentBooking.loadAllSchedule();
737
- console.log(res, 'loadAllSchedule');
738
- };
739
-
740
735
  // 设置缓存
741
736
  var setOtherData = function setOtherData(key, val) {
742
737
  return appointmentBooking.setOtherData(key, val);
@@ -756,7 +751,6 @@ export var useAppointmentBookingSetting = function useAppointmentBookingSetting(
756
751
  isFormSubject: (bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.type) === 'form',
757
752
  customPageId: customPageId,
758
753
  channel: channel,
759
- getLoadAllSchedule: getLoadAllSchedule,
760
754
  bookingSubject: bookingSubject,
761
755
  setOtherData: setOtherData,
762
756
  getOtherData: getOtherData,
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const AppointmentBooking: () => JSX.Element;
3
4
  export default AppointmentBooking;
@@ -4,18 +4,15 @@ import useEngineContext from "../../hooks/useEngineContext";
4
4
  import { AppointmentBookingProvider } from "./context";
5
5
  import Content from "./components/Content";
6
6
  import localeTexts from "./locales";
7
- import { useAppointmentBooking } from "./hooks";
7
+ import { useAppointmentBooking, contextUtils } from "./hooks";
8
8
  import { formatCurrentUser } from "./utils";
9
9
  import "./index.less";
10
10
  var AppointmentBooking = function AppointmentBooking() {
11
11
  var _context$engine;
12
12
  var context = useEngineContext();
13
13
  locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
14
+ var utils = contextUtils();
14
15
  var appointmentBooking = useAppointmentBooking();
15
-
16
- // 初始化项目的时候,用于预加载 schedule 数据
17
- appointmentBooking.loadAllSchedule();
18
- var currentUser = formatCurrentUser();
19
16
  useEffect(function () {
20
17
  var _appointmentBooking$o;
21
18
  var _ref = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.productModuleParams) || {},
@@ -25,6 +22,7 @@ var AppointmentBooking = function AppointmentBooking() {
25
22
  if ((bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.type) === 'form') return;
26
23
  appointmentBooking.getAccounts().then(function (data) {
27
24
  if (!data.length) {
25
+ var currentUser = formatCurrentUser(utils);
28
26
  appointmentBooking.addAccounts([currentUser]);
29
27
  }
30
28
  });