@pisell/private-materials 3.3.42 → 3.3.44

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 (222) 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.css +1 -1
  6. package/build/lowcode/render/default/view.js +5 -5
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +5 -5
  9. package/es/businessModel/SalesModel/index.d.ts +0 -1
  10. package/es/components/Sales/Summary/utils.d.ts +1 -1
  11. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -25
  12. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Cart/Item/index.js +31 -16
  14. package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  15. package/es/components/appointmentBooking/components/Content/index.js +39 -20
  16. package/es/components/appointmentBooking/components/Date/index.js +2 -13
  17. package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  18. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  19. package/es/components/appointmentBooking/components/Form/index.js +76 -167
  20. package/es/components/appointmentBooking/components/Form/utils.d.ts +8 -0
  21. package/es/components/appointmentBooking/components/Form/utils.js +36 -0
  22. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  23. package/es/components/appointmentBooking/components/Header/index.js +78 -46
  24. package/es/components/appointmentBooking/components/Resource/index.js +92 -115
  25. package/es/components/appointmentBooking/components/Services/index.js +19 -4
  26. package/es/components/appointmentBooking/components/TimeSlicing/index.js +20 -27
  27. package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  28. package/es/components/appointmentBooking/context.js +50 -3
  29. package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
  30. package/es/components/appointmentBooking/hooks.d.ts +1 -2
  31. package/es/components/appointmentBooking/hooks.js +377 -269
  32. package/es/components/appointmentBooking/utils.d.ts +91 -2
  33. package/es/components/appointmentBooking/utils.js +350 -61
  34. package/es/components/booking/components/footer/index.d.ts +0 -1
  35. package/es/components/booking/components/voucher/index.d.ts +0 -1
  36. package/es/components/booking/components/voucher/index.js +2 -1
  37. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  38. package/es/components/booking/hooks/useClearCart.d.ts +0 -1
  39. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  40. package/es/components/booking/info/index.d.ts +0 -1
  41. package/es/components/booking/info/service/Lists.d.ts +0 -1
  42. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  43. package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
  44. package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
  45. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  46. package/es/components/booking/info/service2/utils.d.ts +1 -1
  47. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  48. package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  49. package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
  50. package/es/components/booking/utils.d.ts +2 -2
  51. package/es/components/eftposPay/amount.d.ts +1 -1
  52. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  53. package/es/components/eftposPay/component/fail/index.d.ts +1 -0
  54. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  55. package/es/components/eftposPay/device.d.ts +1 -1
  56. package/es/components/eftposPay/hooks.d.ts +1 -1
  57. package/es/components/eftposPay/index.d.ts +1 -0
  58. package/es/components/eftposPay/pay.d.ts +1 -0
  59. package/es/components/eftposPay/store/index.d.ts +2 -2
  60. package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
  61. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  62. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  63. package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
  64. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  65. package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  66. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  67. package/es/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
  68. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  69. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  70. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  71. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  72. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  73. package/es/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
  74. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  75. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  76. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  77. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  78. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
  79. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  80. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  81. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  82. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
  83. package/es/components/eventBooking/index.d.ts +0 -1
  84. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  85. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  86. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  87. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  88. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  89. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  90. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
  91. package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
  92. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  93. package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  94. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  95. package/es/components/productExtension/index.d.ts +0 -1
  96. package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
  97. package/es/components/productSelect/components/productGroup/index.d.ts +11 -7
  98. package/es/components/productSelect/components/productGroup/index.js +32 -19
  99. package/es/components/productSelect/components/productGroup/index.less +17 -3
  100. package/es/components/productSelect/index.d.ts +3 -2
  101. package/es/components/productSelect/index.js +20 -6
  102. package/es/components/productSelect/index.less +7 -0
  103. package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
  104. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  105. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  106. package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  107. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  108. package/es/components/shoppingCart/index.d.ts +0 -1
  109. package/es/components/ticketBooking/components/addServiceVariant/addService.js +11 -3
  110. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  111. package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  112. package/es/components/ticketBooking/index.d.ts +0 -1
  113. package/es/components/wallet/hooks/useWalletCard.d.ts +0 -1
  114. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  115. package/lib/businessModel/SalesModel/index.d.ts +0 -1
  116. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  117. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +0 -5
  118. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  119. package/lib/components/appointmentBooking/components/Cart/Item/index.js +35 -16
  120. package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  121. package/lib/components/appointmentBooking/components/Content/index.js +37 -21
  122. package/lib/components/appointmentBooking/components/Date/index.js +0 -6
  123. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  124. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  125. package/lib/components/appointmentBooking/components/Form/index.js +56 -108
  126. package/lib/components/appointmentBooking/components/Form/utils.d.ts +8 -0
  127. package/lib/components/appointmentBooking/components/Form/utils.js +49 -0
  128. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  129. package/lib/components/appointmentBooking/components/Header/index.js +49 -19
  130. package/lib/components/appointmentBooking/components/Resource/index.js +51 -69
  131. package/lib/components/appointmentBooking/components/Services/index.js +16 -3
  132. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +1 -7
  133. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  134. package/lib/components/appointmentBooking/context.js +52 -4
  135. package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
  136. package/lib/components/appointmentBooking/hooks.d.ts +1 -2
  137. package/lib/components/appointmentBooking/hooks.js +153 -57
  138. package/lib/components/appointmentBooking/utils.d.ts +91 -2
  139. package/lib/components/appointmentBooking/utils.js +210 -50
  140. package/lib/components/booking/components/footer/index.d.ts +0 -1
  141. package/lib/components/booking/components/voucher/index.d.ts +0 -1
  142. package/lib/components/booking/components/voucher/index.js +2 -1
  143. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  144. package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
  145. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  146. package/lib/components/booking/info/index.d.ts +0 -1
  147. package/lib/components/booking/info/service/Lists.d.ts +0 -1
  148. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  149. package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
  150. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
  151. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  152. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  153. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  154. package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  155. package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
  156. package/lib/components/booking/utils.d.ts +2 -2
  157. package/lib/components/eftposPay/amount.d.ts +1 -1
  158. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  159. package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
  160. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  161. package/lib/components/eftposPay/device.d.ts +1 -1
  162. package/lib/components/eftposPay/hooks.d.ts +1 -1
  163. package/lib/components/eftposPay/index.d.ts +1 -0
  164. package/lib/components/eftposPay/pay.d.ts +1 -0
  165. package/lib/components/eftposPay/store/index.d.ts +2 -2
  166. package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
  167. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  168. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  169. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
  170. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  171. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  172. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  173. package/lib/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
  174. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  175. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  176. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  177. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  178. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  179. package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
  180. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  181. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  182. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  183. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  184. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
  185. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  186. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  187. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  188. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
  189. package/lib/components/eventBooking/index.d.ts +0 -1
  190. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  191. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  192. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  193. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  194. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  195. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  196. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
  197. package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
  198. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  199. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  200. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  201. package/lib/components/productExtension/index.d.ts +0 -1
  202. package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
  203. package/lib/components/productSelect/components/productGroup/index.d.ts +11 -7
  204. package/lib/components/productSelect/components/productGroup/index.js +12 -10
  205. package/lib/components/productSelect/components/productGroup/index.less +17 -3
  206. package/lib/components/productSelect/index.d.ts +3 -2
  207. package/lib/components/productSelect/index.js +17 -3
  208. package/lib/components/productSelect/index.less +7 -0
  209. package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
  210. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  211. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  212. package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  213. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  214. package/lib/components/shoppingCart/index.d.ts +0 -1
  215. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +9 -1
  216. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  217. package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  218. package/lib/components/ticketBooking/index.d.ts +0 -1
  219. package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -1
  220. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  221. package/lowcode/product-select/meta.ts +18 -34
  222. package/package.json +2 -2
@@ -48,7 +48,7 @@ var import_useEngineContext = require("../../hooks/useEngineContext");
48
48
  var import_useEngineContext2 = __toESM(require("../../hooks/useEngineContext"));
49
49
  var import_utils2 = require("./utils");
50
50
  var import_context = require("./context");
51
- var import_utils3 = require("./components/Cart/utils");
51
+ var import_utils3 = require("./components/Resource/utils");
52
52
  var useAppointmentBooking = () => {
53
53
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
54
54
  return pisellOS.getModule("appointmentBooking");
@@ -66,9 +66,13 @@ var contextUtils = () => {
66
66
  var useAppointmentBookingStep = () => {
67
67
  var _a, _b, _c;
68
68
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
69
- const { appointmentBooking, setCurrentStep, policyIdsRef, openPolicy } = (0, import_context.useAppointmentBookingContext)();
69
+ const { appointmentBooking, setCurrentStep, carts, openPolicy, setLoading, setCurrentSelectedResources, currentStepParams, setIsErrorHolder } = (0, import_context.useAppointmentBookingContext)();
70
70
  const { isRetailTemplate } = useAppointmentBookingSetting();
71
71
  const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
72
+ const { isLogin, openLoginModal } = useAppointmentBookingLogin();
73
+ const { isFormSubject } = useAppointmentBookingSetting();
74
+ const { getHolders, checkAccount } = useAppointmentBookingAccount();
75
+ const utils = contextUtils();
72
76
  const getCurrentAndLastStep = () => {
73
77
  const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
74
78
  setCurrentStep(currentStep);
@@ -115,28 +119,120 @@ var useAppointmentBookingStep = () => {
115
119
  });
116
120
  };
117
121
  const nextStep = () => {
118
- var _a2, _b2, _c2, _d;
119
- if (isRetailTemplate) {
120
- return appointmentBooking.next();
122
+ var _a2, _b2, _c2, _d, _e;
123
+ let stepList2 = appointmentBooking.getStepList() || [];
124
+ const currentKey = currentStepParams == null ? void 0 : currentStepParams.key;
125
+ let nextStep2 = stepList2[(currentStepParams == null ? void 0 : currentStepParams.index) + 1];
126
+ const currentSelectedResources = appointmentBooking.getOtherData(
127
+ "current_selected_resources"
128
+ );
129
+ if ((nextStep2 == null ? void 0 : nextStep2.key) === "select-resource") {
130
+ const result = appointmentBooking.checkResourceListForDate();
131
+ if (!result) {
132
+ return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.date"));
133
+ }
121
134
  }
122
- const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
123
- const stepList2 = ((_c2 = (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.step) == null ? void 0 : _b2.store) == null ? void 0 : _c2.stepList) || [];
124
- if ((currentStep == null ? void 0 : currentStep.index) + 2 >= (stepList2 == null ? void 0 : stepList2.length)) {
125
- if ((_d = policyIdsRef == null ? void 0 : policyIdsRef.current) == null ? void 0 : _d.length) {
126
- let idx = 0;
127
- const showNextPolicy = () => {
128
- if (idx < policyIdsRef.current.length) {
129
- openPolicy({ id: policyIdsRef.current[idx] }, () => {
130
- idx++;
131
- showNextPolicy();
132
- });
133
- } else {
134
- appointmentBooking.next();
135
- }
136
- };
137
- showNextPolicy();
135
+ if (currentKey == null ? void 0 : currentKey.startsWith("select-resource")) {
136
+ const { hasError, updatedCartList } = (0, import_utils2.checkAndMarkCartRenderError)(currentSelectedResources, appointmentBooking, utils);
137
+ if (hasError) {
138
+ setCurrentSelectedResources(updatedCartList);
139
+ (0, import_utils3.scrollToFirstErrorCard)();
138
140
  return;
139
141
  }
142
+ currentSelectedResources == null ? void 0 : currentSelectedResources.forEach((cart) => {
143
+ var _a3, _b3;
144
+ const selectedResource2 = cart == null ? void 0 : cart.currentSelectedResource;
145
+ const resourceItem = (selectedResource2 == null ? void 0 : selectedResource2.resourceItem) || {};
146
+ const formId = (_a3 = selectedResource2 == null ? void 0 : selectedResource2.renderItem) == null ? void 0 : _a3.resource_form_id;
147
+ const policyId = (_b3 = selectedResource2 == null ? void 0 : selectedResource2.renderItem) == null ? void 0 : _b3.policy_id;
148
+ const formKey = `fill-form_@${resourceItem == null ? void 0 : resourceItem.form_id}-${resourceItem == null ? void 0 : resourceItem.code}-${cart == null ? void 0 : cart._id}-${formId}-${policyId}`;
149
+ if (formId) {
150
+ const description = import_utils.locales.getText("pisell2.appointment.fill-form");
151
+ const beforeKey = (0, import_utils2.getFormInsertBeforeKey)(currentKey, stepList2);
152
+ appointmentBooking.addStep({ key: formKey, description }, beforeKey);
153
+ } else {
154
+ appointmentBooking.removeStep(formKey);
155
+ }
156
+ });
157
+ stepList2 = appointmentBooking.getStepList();
158
+ const selectedResource = (_a2 = currentSelectedResources == null ? void 0 : currentSelectedResources[0]) == null ? void 0 : _a2.currentSelectedResource;
159
+ if (selectedResource) {
160
+ const originRenderLists = ((_b2 = selectedResource == null ? void 0 : selectedResource.resourceItem) == null ? void 0 : _b2.originRenderLists) || [];
161
+ const currentResourceIndex = originRenderLists == null ? void 0 : originRenderLists.findIndex((item) => {
162
+ var _a3;
163
+ return item.id === ((_a3 = selectedResource == null ? void 0 : selectedResource.renderItem) == null ? void 0 : _a3.form_id);
164
+ });
165
+ const nextResource = originRenderLists == null ? void 0 : originRenderLists[currentResourceIndex + 1];
166
+ const resourceKey = `select-resource_@${nextResource == null ? void 0 : nextResource.form_id}-${nextResource == null ? void 0 : nextResource.code}`;
167
+ if (nextResource) {
168
+ const beforeKey = (_c2 = stepList2[stepList2.length - 2]) == null ? void 0 : _c2.key;
169
+ appointmentBooking.addStep({ key: resourceKey, description: "" }, beforeKey);
170
+ } else {
171
+ appointmentBooking.removeStep(resourceKey);
172
+ }
173
+ }
174
+ }
175
+ stepList2 = appointmentBooking.getStepList();
176
+ nextStep2 = stepList2[(currentStepParams == null ? void 0 : currentStepParams.index) + 1];
177
+ if (((_d = nextStep2 == null ? void 0 : nextStep2.key) == null ? void 0 : _d.startsWith("select-resource_")) || (nextStep2 == null ? void 0 : nextStep2.key) === "confirm-information") {
178
+ const selectedResource = ((_e = currentSelectedResources == null ? void 0 : currentSelectedResources[0]) == null ? void 0 : _e.currentSelectedResource) || {};
179
+ const renderItem = (selectedResource == null ? void 0 : selectedResource.renderItem) || {};
180
+ const checkHolder = () => {
181
+ setLoading(false);
182
+ if (isRetailTemplate) {
183
+ return appointmentBooking.next();
184
+ }
185
+ const { hasError } = (0, import_utils2.checkAndGoNext)(isFormSubject, checkAccount, carts);
186
+ setIsErrorHolder(hasError);
187
+ if (hasError) {
188
+ return;
189
+ }
190
+ if (!!(renderItem == null ? void 0 : renderItem.policy_id)) {
191
+ openPolicy({ id: renderItem == null ? void 0 : renderItem.policy_id }, () => {
192
+ return appointmentBooking.next();
193
+ });
194
+ } else {
195
+ return appointmentBooking.next();
196
+ }
197
+ };
198
+ const checkLogin = async () => {
199
+ if (!isLogin) {
200
+ const accountLists = await appointmentBooking.getAccounts();
201
+ return openLoginModal({
202
+ callback: (status) => {
203
+ var _a3;
204
+ if (status === "success") {
205
+ if (!isFormSubject) {
206
+ const user = JSON.parse(((_a3 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a3.get("customer")) || "{}");
207
+ const currentUser = (0, import_utils2.formatCustomer)(user);
208
+ const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
209
+ appointmentBooking.setLoginAccount(meAccount == null ? void 0 : meAccount.id, currentUser);
210
+ } else {
211
+ getHolders();
212
+ }
213
+ checkHolder();
214
+ }
215
+ }
216
+ });
217
+ } else {
218
+ return checkHolder();
219
+ }
220
+ };
221
+ if ((nextStep2 == null ? void 0 : nextStep2.key) !== "confirm-information") {
222
+ if (!(renderItem == null ? void 0 : renderItem.policy_id)) {
223
+ return appointmentBooking.next();
224
+ }
225
+ return openPolicy({ id: renderItem == null ? void 0 : renderItem.policy_id }, () => {
226
+ const cartItem = carts == null ? void 0 : carts[0];
227
+ appointmentBooking.updateCart({
228
+ _id: cartItem == null ? void 0 : cartItem._id,
229
+ ...cartItem
230
+ });
231
+ appointmentBooking.next();
232
+ });
233
+ } else {
234
+ return checkLogin();
235
+ }
140
236
  }
141
237
  appointmentBooking.next();
142
238
  };
@@ -177,11 +273,25 @@ var useAppointmentBookingCart = () => {
177
273
  const { appointmentBooking, setCarts, setSummary, setIsAgreeDepositPolicy } = (0, import_context.useAppointmentBookingContext)();
178
274
  const { bookingSubject } = ((_a = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a.productModuleParams) || {};
179
275
  const getCartAndSummary = async () => {
276
+ var _a2;
277
+ const locale = ((_a2 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a2.get("umi_locale")) || "en-US";
278
+ const symbol = (utils == null ? void 0 : utils.getSymbolic()) || "$";
180
279
  const carts = await appointmentBooking.getCart();
280
+ const accountLists = await appointmentBooking.getAccounts();
181
281
  const newCarts = carts == null ? void 0 : carts.map((item) => {
282
+ var _a3;
182
283
  return {
183
284
  ...item,
184
- addHolderButtonText: utils == null ? void 0 : utils.translation(bookingSubject == null ? void 0 : bookingSubject.form_name)
285
+ addHolderButtonText: utils == null ? void 0 : utils.translation(bookingSubject == null ? void 0 : bookingSubject.form_name),
286
+ format: ["HH:mm", "HH:mm"],
287
+ show_time: true,
288
+ duration_type: ((_a3 = item == null ? void 0 : item.duration) == null ? void 0 : _a3.type) || "minutes",
289
+ locale,
290
+ symbol,
291
+ holders: (0, import_utils2.formatHolder)(accountLists),
292
+ allowClearHolder: true,
293
+ allowClearResource: true,
294
+ isMultipleResource: true
185
295
  };
186
296
  });
187
297
  setCarts(newCarts || []);
@@ -235,7 +345,6 @@ var useAppointmentBookingAccount = () => {
235
345
  "appointmentBooking_accountList:changed",
236
346
  async (res) => {
237
347
  if (res.path === "accounts") {
238
- console.log("appointmentBooking_accountList:changed", res);
239
348
  getAccountLists();
240
349
  }
241
350
  }
@@ -274,7 +383,7 @@ var useAppointmentBookingAccount = () => {
274
383
  return { accountLists, getHolders, form_id, addAccount, checkAccount };
275
384
  };
276
385
  var useAppointmentBookingResource = () => {
277
- const { appointmentBooking, setResources, setTimes, setResourceOtherParams, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
386
+ const { appointmentBooking, setResources, setTimes } = (0, import_context.useAppointmentBookingContext)();
278
387
  const { resourceSort } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
279
388
  const getResourceList = () => {
280
389
  var _a;
@@ -296,53 +405,40 @@ var useAppointmentBookingResource = () => {
296
405
  const data = await appointmentBooking.getTimeSlotByAllResources(code);
297
406
  setTimes(data || []);
298
407
  };
299
- const autoSelectAllProductResources = async (index) => {
300
- const { resourceCodes } = getResourceList();
301
- const code = resourceCodes == null ? void 0 : resourceCodes[index || 0];
302
- const data = await appointmentBooking.getTimeSlotByAllResources(code);
303
- let res = await appointmentBooking.autoSelectAllProductResources(code);
304
- setResourceOtherParams({
305
- ...resourceOtherParams,
306
- ...res,
307
- resourceCodes
308
- });
309
- return res;
310
- };
311
- return { getResourceTimeSlot, getResourceList, autoSelectAllProductResources };
408
+ return { getResourceTimeSlot, getResourceList };
312
409
  };
313
410
  var useIsSkipResourceStep = () => {
314
- var _a, _b, _c;
315
- const { currentStep, setCarts, setPolicyIds, setIsErrorHolder } = (0, import_context.useAppointmentBookingContext)();
316
- const { getResourceList, autoSelectAllProductResources } = useAppointmentBookingResource();
411
+ const { currentStepParams } = (0, import_context.useAppointmentBookingContext)();
412
+ const { getResourceList } = useAppointmentBookingResource();
317
413
  const { isFormSubject } = useAppointmentBookingSetting();
318
414
  const appointmentBooking = useAppointmentBooking();
319
- const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
320
- const { isLogin, openLoginModal } = useAppointmentBookingLogin();
321
- const { getHolders, checkAccount } = useAppointmentBookingAccount();
322
415
  const { nextStep } = useAppointmentBookingStep();
323
- const utils = contextUtils();
324
- const checkSkipResourceStep = async (isSkipUpdateFormStep) => {
325
- var _a2, _b2, _c2, _d, _e;
416
+ const checkSkipResourceStep = async () => {
326
417
  try {
418
+ const { resources } = getResourceList();
327
419
  const accountLists = await appointmentBooking.getAccounts();
328
- const carts = await appointmentBooking.getCart();
420
+ const { isSystem, isSkip, form_code } = (0, import_utils2.currentAppointmentBoard)(currentStepParams.key, resources, appointmentBooking);
421
+ if (isSystem) {
422
+ nextStep();
423
+ return true;
424
+ }
329
425
  if ((accountLists == null ? void 0 : accountLists.length) === 1 || isFormSubject) {
330
- const res = await autoSelectAllProductResources();
331
- const { resources } = getResourceList();
332
- if (!((_a2 = res == null ? void 0 : res.errorList) == null ? void 0 : _a2.length) && ((_e = (_d = (_c2 = (_b2 = resources == null ? void 0 : resources[0]) == null ? void 0 : _b2.resources) == null ? void 0 : _c2[0]) == null ? void 0 : _d.renderList) == null ? void 0 : _e.length) === 1) {
333
- if (!isSkipUpdateFormStep) {
334
- const resultCarts = (0, import_utils2.formatCartsResources)(carts, resources, setPolicyIds);
335
- (0, import_utils2.checkHasFormStep)({ setIsErrorHolder, nextStep, isSkip: true, openLoginModal, utils, accountLists, getHolders, checkHolder: import_utils3.checkHolder, setCarts, checkAccount, carts, isFormSubject, hasResourceFormId: (resultCarts == null ? void 0 : resultCarts.length) > 0, currentStep, stepList, appointmentBooking, locales: import_utils.locales, isLogin });
336
- }
337
- return true;
426
+ const renderLists = (0, import_utils2.currentRenderLists)(resources, form_code);
427
+ let _isSkip = false;
428
+ if ((renderLists == null ? void 0 : renderLists.length) === 1) {
429
+ _isSkip = isSkip || false;
338
430
  } else {
339
- return false;
431
+ _isSkip = false;
432
+ }
433
+ if (_isSkip) {
434
+ nextStep();
435
+ return true;
340
436
  }
437
+ return _isSkip;
341
438
  } else {
342
439
  return false;
343
440
  }
344
441
  } catch (error) {
345
- console.log(error, "checkSkipResourceStep33");
346
442
  return false;
347
443
  }
348
444
  };
@@ -101,7 +101,7 @@ export declare function updateLists<T extends Record<string, any>>(list: T[], ke
101
101
  * @Author: WangHan
102
102
  * @Date: 2025-04-27 17:27
103
103
  */
104
- export declare const updateBookingFormStorage: (bookingForm: any, id: number, newData: any) => any;
104
+ export declare const updateBookingFormStorage: (bookingForm: any, id: number | string, newData: any) => any;
105
105
  export declare const Toast: (text: string) => void;
106
106
  /**
107
107
  * @title: 添加或移除表单步骤
@@ -111,4 +111,93 @@ export declare const Toast: (text: string) => void;
111
111
  * @Author: WangHan
112
112
  * @Date: 2025-05-06 21:51
113
113
  */
114
- export declare const checkHasFormStep: ({ setIsErrorHolder, nextStep, isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId, currentStep, stepList, appointmentBooking, locales, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }: any) => true | undefined;
114
+ export declare const checkHasFormStep: ({ setIsErrorHolder, nextStep, isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId, currentStep, stepList, appointmentBooking, locales, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }: any) => void;
115
+ export declare const getCartCurrentResourceData: (cart: any, currentKey: any, resources: any[]) => any;
116
+ /**
117
+ * @title: 获取购物车资源列表
118
+ * @description:
119
+ * @return {*}
120
+ * @Author: WangHan
121
+ * @Date: 2025-05-25 13:56
122
+ */
123
+ export declare const getMultiResources: (cart: any, currentSelectedResource: any, currentKey: string) => any[];
124
+ export declare const getCurrentBoard: (appointmentBooking: any, code: string) => any;
125
+ /**
126
+ * @title:
127
+ * @description: 根据资源code获取资源标题
128
+ * @param {any} appointmentBooking
129
+ * @param {string} code
130
+ * @return {*}
131
+ * @Author: WangHan
132
+ * @Date: 2025-05-24 18:51
133
+ */
134
+ export declare const getResourceTitle: (appointmentBooking: any, code: string, utils: any, originResource: any) => string;
135
+ /**
136
+ * @title: 监测购物车中是否有没有选择资源的
137
+ * @description:
138
+ * @param {any} carts
139
+ * @return {*}
140
+ * @Author: WangHan
141
+ * @Date: 2025-05-24 18:47
142
+ */
143
+ export declare const checkAndMarkCartRenderError: (carts: any, appointmentBooking?: any, utils?: any) => {
144
+ hasError: boolean;
145
+ updatedCartList: any;
146
+ } | {
147
+ hasError?: undefined;
148
+ updatedCartList?: undefined;
149
+ };
150
+ /**
151
+ * @title: 查表表单步骤插入到哪个步骤的后面的key
152
+ * @description:
153
+ * @param {string} currentKey
154
+ * @param {any} stepList
155
+ * @return {*}
156
+ * @Author: WangHan
157
+ * @Date: 2025-05-24 19:05
158
+ */
159
+ export declare const getFormInsertBeforeKey: (currentKey: string, stepList: any[]) => any;
160
+ /**
161
+ * @title: 监测holder数据
162
+ * @description:
163
+ * @param {any} isFormSubject
164
+ * @param {any} checkAccount
165
+ * @param {any} carts
166
+ * @return {*}
167
+ * @Author: WangHan
168
+ * @Date: 2025-05-24 22:46
169
+ */
170
+ export declare const checkAndGoNext: (isFormSubject: any, checkAccount: any, carts: any[]) => {
171
+ hasError: boolean;
172
+ updatedCartList: any[];
173
+ };
174
+ export declare const currentAppointmentBoard: (currentKey: string, resources: any[], appointmentBooking: any) => {
175
+ isRequired: boolean;
176
+ isSystem: boolean;
177
+ isSkip: boolean;
178
+ form_id: number;
179
+ form_code: any;
180
+ cart_id: string;
181
+ resource_form_id: string;
182
+ policy_id: string;
183
+ } | {
184
+ isRequired?: undefined;
185
+ isSystem?: undefined;
186
+ isSkip?: undefined;
187
+ form_id?: undefined;
188
+ form_code?: undefined;
189
+ cart_id?: undefined;
190
+ resource_form_id?: undefined;
191
+ policy_id?: undefined;
192
+ };
193
+ export declare const currentRenderLists: (resources: any[], code: any) => any;
194
+ /**
195
+ * @title: 更新购物车
196
+ * @description:
197
+ * @param {any} carts
198
+ * @param {any} value
199
+ * @return {*}
200
+ * @Author: WangHan
201
+ * @Date: 2025-05-25 23:17
202
+ */
203
+ export declare const updateCartResources: (item: any, value?: any, currentSelectedResources?: any) => any;