@pisell/private-materials 3.3.33 → 3.3.34

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 (209) 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 +13 -13
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +6 -6
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +25 -4
  12. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  14. package/es/components/appointmentBooking/components/Cart/Item/index.js +25 -45
  15. package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  16. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  17. package/es/components/appointmentBooking/components/Content/index.js +36 -53
  18. package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  19. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  20. package/es/components/appointmentBooking/components/Form/index.js +161 -61
  21. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  22. package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
  23. package/es/components/appointmentBooking/components/Header/index.js +50 -64
  24. package/es/components/appointmentBooking/components/Resource/index.js +102 -119
  25. package/es/components/appointmentBooking/components/TimeSlicing/index.js +12 -5
  26. package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  27. package/es/components/appointmentBooking/context.js +3 -43
  28. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
  29. package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
  30. package/es/components/appointmentBooking/hooks.d.ts +3 -2
  31. package/es/components/appointmentBooking/hooks.js +209 -293
  32. package/es/components/appointmentBooking/index.d.ts +1 -0
  33. package/es/components/appointmentBooking/utils.d.ts +2 -88
  34. package/es/components/appointmentBooking/utils.js +63 -325
  35. package/es/components/booking/addons/model.js +5 -5
  36. package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
  37. package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
  38. package/es/components/booking/components/browserSelect/index.js +1 -1
  39. package/es/components/booking/components/footer/index.d.ts +1 -0
  40. package/es/components/booking/components/voucher/index.d.ts +0 -1
  41. package/es/components/booking/deposit/index.d.ts +1 -0
  42. package/es/components/booking/forms/model.js +5 -5
  43. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  44. package/es/components/booking/hooks/useClearCart.d.ts +0 -1
  45. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  46. package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  47. package/es/components/booking/info/index.d.ts +1 -0
  48. package/es/components/booking/info/service/Lists.d.ts +1 -0
  49. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  50. package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  51. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  52. package/es/components/booking/info/service/like/index.js +1 -1
  53. package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
  54. package/es/components/booking/info/utils.js +1 -1
  55. package/es/components/booking/info2/service/addService/index.d.ts +1 -0
  56. package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  57. package/es/components/booking/materiels/startTime/index.js +1 -1
  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.js +5 -5
  61. package/es/components/booking/payments/model.js +5 -5
  62. package/es/components/eftposPay/amount.d.ts +1 -1
  63. package/es/components/eftposPay/device.d.ts +1 -1
  64. package/es/components/eftposPay/hooks.d.ts +1 -1
  65. package/es/components/eftposPay/store/index.d.ts +3 -3
  66. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  67. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  68. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  69. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  70. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  71. package/es/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
  72. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  73. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  74. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.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/Schedule.d.ts +1 -0
  80. package/es/components/eventBooking/index.d.ts +1 -0
  81. package/es/components/listComponent/index.js +5 -5
  82. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  83. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  84. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  85. package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
  86. package/es/components/productExtension/card/index.js +3 -3
  87. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  88. package/es/components/productExtension/fields/Forms/index.js +12 -12
  89. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  90. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  91. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  92. package/es/components/productExtension/server.js +2 -2
  93. package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
  94. package/es/components/productSelect/components/productGroup/index.d.ts +0 -1
  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.js +5 -5
  104. package/es/components/schedules/openHours/index.js +1 -1
  105. package/es/components/schedules/openHours/serve.js +2 -2
  106. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  107. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  108. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  109. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  110. package/es/components/schedules/products/serve.js +2 -2
  111. package/es/components/schedules/products/utils.js +5 -5
  112. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  113. package/es/components/schedules/resources/detail/index.js +10 -10
  114. package/es/components/schedules/resources/list/index.js +2 -2
  115. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  116. package/es/components/schedules/resources/serve.js +2 -2
  117. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  118. package/es/components/schedules/utils.d.ts +1 -1
  119. package/es/components/schedules/utils.js +4 -4
  120. package/es/components/selectModal/index.js +2 -2
  121. package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
  122. package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  123. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  124. package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  125. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  126. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  127. package/es/hooks/useComponents.js +1 -1
  128. package/es/utils/index.d.ts +1 -1
  129. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +5 -0
  130. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  131. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  132. package/lib/components/appointmentBooking/components/Cart/Item/index.js +9 -33
  133. package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  134. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  135. package/lib/components/appointmentBooking/components/Content/index.js +21 -35
  136. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  137. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  138. package/lib/components/appointmentBooking/components/Form/index.js +98 -54
  139. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  140. package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
  141. package/lib/components/appointmentBooking/components/Header/index.js +20 -39
  142. package/lib/components/appointmentBooking/components/Resource/index.js +59 -41
  143. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +7 -1
  144. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  145. package/lib/components/appointmentBooking/context.js +4 -48
  146. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
  147. package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
  148. package/lib/components/appointmentBooking/hooks.d.ts +3 -2
  149. package/lib/components/appointmentBooking/hooks.js +57 -143
  150. package/lib/components/appointmentBooking/index.d.ts +1 -0
  151. package/lib/components/appointmentBooking/utils.d.ts +2 -88
  152. package/lib/components/appointmentBooking/utils.js +51 -191
  153. package/lib/components/booking/components/footer/index.d.ts +1 -0
  154. package/lib/components/booking/components/voucher/index.d.ts +0 -1
  155. package/lib/components/booking/deposit/index.d.ts +1 -0
  156. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  157. package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
  158. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  159. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  160. package/lib/components/booking/info/index.d.ts +1 -0
  161. package/lib/components/booking/info/service/Lists.d.ts +1 -0
  162. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  163. package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  164. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  165. package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
  166. package/lib/components/booking/info/utils.js +1 -1
  167. package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
  168. package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  169. package/lib/components/eftposPay/amount.d.ts +1 -1
  170. package/lib/components/eftposPay/device.d.ts +1 -1
  171. package/lib/components/eftposPay/hooks.d.ts +1 -1
  172. package/lib/components/eftposPay/store/index.d.ts +3 -3
  173. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  174. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  175. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  176. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  177. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  178. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
  179. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  180. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  181. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  182. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  183. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  184. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  185. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
  186. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  187. package/lib/components/eventBooking/index.d.ts +1 -0
  188. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  189. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  190. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  191. package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
  192. package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
  193. package/lib/components/productSelect/components/productGroup/index.d.ts +0 -1
  194. package/lib/components/schedules/utils.d.ts +1 -1
  195. package/lib/components/schedules/utils.js +1 -1
  196. package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
  197. package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  198. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  199. package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  200. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  201. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  202. package/lib/utils/index.d.ts +1 -1
  203. package/package.json +4 -4
  204. package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +0 -4
  205. package/es/components/eventBooking/components/Provider/SelectProduct/index.js +0 -77
  206. package/es/components/eventBooking/components/Provider/SelectProduct/index.less +0 -131
  207. package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +0 -4
  208. package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +0 -69
  209. package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +0 -131
@@ -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/Resource/utils");
51
+ var import_utils3 = require("./components/Cart/utils");
52
52
  var useAppointmentBooking = () => {
53
53
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
54
54
  return pisellOS.getModule("appointmentBooking");
@@ -66,13 +66,8 @@ var contextUtils = () => {
66
66
  var useAppointmentBookingStep = () => {
67
67
  var _a, _b, _c;
68
68
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
69
- const { appointmentBooking, setCurrentStep, carts, openPolicy, setCarts, setLoading, currentSelectedResourcesRef, currentStepParams, setIsErrorHolder } = (0, import_context.useAppointmentBookingContext)();
69
+ const { appointmentBooking, setCurrentStep, policyIdsRef, openPolicy } = (0, import_context.useAppointmentBookingContext)();
70
70
  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) || [];
71
- const { isLogin, openLoginModal } = useAppointmentBookingLogin();
72
- const { isFormSubject } = useAppointmentBookingSetting();
73
- const { accountLists, getHolders, checkAccount } = useAppointmentBookingAccount();
74
- const { getResourceList } = useAppointmentBookingResource();
75
- const utils = contextUtils();
76
71
  const getCurrentAndLastStep = () => {
77
72
  const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
78
73
  setCurrentStep(currentStep);
@@ -119,113 +114,34 @@ var useAppointmentBookingStep = () => {
119
114
  });
120
115
  };
121
116
  const nextStep = () => {
122
- var _a2, _b2, _c2, _d, _e, _f, _g, _h;
123
- let stepList2 = (currentStepParams == null ? void 0 : currentStepParams.stepLists) || [];
124
- const currentKey = currentStepParams == null ? void 0 : currentStepParams.key;
125
- if (currentKey == null ? void 0 : currentKey.startsWith("select-resource")) {
126
- const { hasError, updatedCartList } = (0, import_utils2.checkAndMarkCartRenderError)((currentSelectedResourcesRef == null ? void 0 : currentSelectedResourcesRef.current) || [], appointmentBooking, utils);
127
- if (hasError) {
128
- (0, import_utils3.scrollToFirstErrorCard)();
117
+ var _a2, _b2, _c2, _d;
118
+ const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
119
+ 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) || [];
120
+ if ((currentStep == null ? void 0 : currentStep.index) + 2 === (stepList2 == null ? void 0 : stepList2.length)) {
121
+ if ((_d = policyIdsRef == null ? void 0 : policyIdsRef.current) == null ? void 0 : _d.length) {
122
+ let idx = 0;
123
+ const showNextPolicy = () => {
124
+ if (idx < policyIdsRef.current.length) {
125
+ openPolicy({ id: policyIdsRef.current[idx] }, () => {
126
+ idx++;
127
+ showNextPolicy();
128
+ });
129
+ } else {
130
+ appointmentBooking.next();
131
+ }
132
+ };
133
+ showNextPolicy();
129
134
  return;
130
135
  }
131
- (_a2 = currentSelectedResourcesRef == null ? void 0 : currentSelectedResourcesRef.current) == null ? void 0 : _a2.forEach((cart) => {
132
- var _a3, _b3;
133
- const selectedResource2 = cart == null ? void 0 : cart.currentSelectedResource;
134
- const resourceItem = (selectedResource2 == null ? void 0 : selectedResource2.resourceItem) || {};
135
- const formId = (_a3 = selectedResource2 == null ? void 0 : selectedResource2.renderItem) == null ? void 0 : _a3.resource_form_id;
136
- const policyId = (_b3 = selectedResource2 == null ? void 0 : selectedResource2.renderItem) == null ? void 0 : _b3.policy_id;
137
- 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}`;
138
- if (formId) {
139
- const description = import_utils.locales.getText("pisell2.appointment.fill-form");
140
- const beforeKey = (0, import_utils2.getFormInsertBeforeKey)(currentKey, stepList2);
141
- appointmentBooking.addStep({ key: formKey, description }, beforeKey);
142
- } else {
143
- appointmentBooking.removeStep(formKey);
144
- }
145
- });
146
- const selectedResource = (_c2 = (_b2 = currentSelectedResourcesRef == null ? void 0 : currentSelectedResourcesRef.current) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.currentSelectedResource;
147
- if (selectedResource) {
148
- const originRenderLists = ((_d = selectedResource == null ? void 0 : selectedResource.resourceItem) == null ? void 0 : _d.originRenderLists) || [];
149
- const currentResourceIndex = originRenderLists == null ? void 0 : originRenderLists.findIndex((item) => {
150
- var _a3;
151
- return item.id === ((_a3 = selectedResource == null ? void 0 : selectedResource.renderItem) == null ? void 0 : _a3.form_id);
152
- });
153
- const nextResource = originRenderLists == null ? void 0 : originRenderLists[currentResourceIndex + 1];
154
- const resourceKey = `select-resource_@${nextResource == null ? void 0 : nextResource.form_id}-${nextResource == null ? void 0 : nextResource.code}`;
155
- if (nextResource) {
156
- const beforeKey = (_e = stepList2[stepList2.length - 2]) == null ? void 0 : _e.key;
157
- appointmentBooking.addStep({ key: resourceKey, description: "" }, beforeKey);
158
- } else {
159
- appointmentBooking.removeStep(resourceKey);
160
- }
161
- }
162
- }
163
- const nextStep2 = stepList2[(currentStepParams == null ? void 0 : currentStepParams.index) + 1];
164
- if (((_f = nextStep2 == null ? void 0 : nextStep2.key) == null ? void 0 : _f.startsWith("select-resource_")) || (nextStep2 == null ? void 0 : nextStep2.key) === "confirm-information") {
165
- const selectedResource = (_h = (_g = currentSelectedResourcesRef.current) == null ? void 0 : _g[0]) == null ? void 0 : _h.currentSelectedResource;
166
- const renderItem = (selectedResource == null ? void 0 : selectedResource.renderItem) || {};
167
- const checkHolder = () => {
168
- setLoading(false);
169
- const { hasError, updatedCartList } = (0, import_utils2.checkAndGoNext)(isFormSubject, checkAccount, carts);
170
- if (hasError) {
171
- setIsErrorHolder(hasError);
172
- setCarts(updatedCartList);
173
- return;
174
- }
175
- if (!!(renderItem == null ? void 0 : renderItem.policy_id)) {
176
- openPolicy({ id: renderItem == null ? void 0 : renderItem.policy_id }, () => {
177
- return appointmentBooking.next();
178
- });
179
- } else {
180
- return appointmentBooking.next();
181
- }
182
- };
183
- const checkLogin = () => {
184
- if (!isLogin) {
185
- return openLoginModal({
186
- callback: (status) => {
187
- var _a3;
188
- if (status === "success") {
189
- if (!isFormSubject) {
190
- const user = JSON.parse(((_a3 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a3.get("customer")) || "{}");
191
- const currentUser = (0, import_utils2.formatCustomer)(user);
192
- const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
193
- appointmentBooking.setLoginAccount(meAccount == null ? void 0 : meAccount.id, currentUser);
194
- } else {
195
- getHolders();
196
- }
197
- checkHolder();
198
- }
199
- }
200
- });
201
- } else {
202
- return checkHolder();
203
- }
204
- };
205
- if ((nextStep2 == null ? void 0 : nextStep2.key) !== "confirm-information") {
206
- if (!(renderItem == null ? void 0 : renderItem.policy_id)) {
207
- return appointmentBooking.next();
208
- }
209
- return openPolicy({ id: renderItem == null ? void 0 : renderItem.policy_id }, () => {
210
- const cartItem = carts == null ? void 0 : carts[0];
211
- appointmentBooking.updateCart({
212
- _id: cartItem == null ? void 0 : cartItem._id,
213
- ...cartItem
214
- });
215
- appointmentBooking.next();
216
- });
217
- } else {
218
- return checkLogin();
219
- }
220
136
  }
221
137
  appointmentBooking.next();
222
138
  };
223
139
  return { getStepIndex, stepList, removeStep, addStep, updateStep, nextStep };
224
140
  };
225
141
  var useAppointmentBookingProduct = () => {
226
- const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
142
+ const { appointmentBooking, carts } = (0, import_context.useAppointmentBookingContext)();
227
143
  const { productModuleParams } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
228
- const { bookingProcess } = productModuleParams || {};
144
+ const { bookingProcess, bookingSubject } = productModuleParams || {};
229
145
  const getProducts = async () => {
230
146
  var _a;
231
147
  if (bookingProcess === "date_first") {
@@ -254,29 +170,14 @@ var useAppointmentBookingCart = () => {
254
170
  var _a;
255
171
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
256
172
  const utils = contextUtils();
257
- const { appointmentBooking, isErrorHolder, setCarts, setSummary, setIsAgreeDepositPolicy } = (0, import_context.useAppointmentBookingContext)();
173
+ const { appointmentBooking, setCarts, setSummary, setIsAgreeDepositPolicy } = (0, import_context.useAppointmentBookingContext)();
258
174
  const { bookingSubject } = ((_a = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a.productModuleParams) || {};
259
175
  const getCartAndSummary = async () => {
260
- var _a2;
261
- const locale = ((_a2 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a2.get("umi_locale")) || "en-US";
262
- const symbol = (utils == null ? void 0 : utils.getSymbolic()) || "$";
263
176
  const carts = await appointmentBooking.getCart();
264
- const accountLists = await appointmentBooking.getAccounts();
265
177
  const newCarts = carts == null ? void 0 : carts.map((item) => {
266
- var _a3;
267
178
  return {
268
179
  ...item,
269
- addHolderButtonText: utils == null ? void 0 : utils.translation(bookingSubject == null ? void 0 : bookingSubject.form_name),
270
- format: ["HH:mm", "HH:mm"],
271
- show_time: true,
272
- duration_type: ((_a3 = item == null ? void 0 : item.duration) == null ? void 0 : _a3.type) || "minutes",
273
- locale,
274
- symbol,
275
- holders: (0, import_utils2.formatHolder)(accountLists),
276
- allowClearHolder: true,
277
- allowClearResource: true,
278
- isErrorHolder: isErrorHolder || false,
279
- isMultipleResource: true
180
+ addHolderButtonText: utils == null ? void 0 : utils.translation(bookingSubject == null ? void 0 : bookingSubject.form_name)
280
181
  };
281
182
  });
282
183
  setCarts(newCarts || []);
@@ -369,7 +270,7 @@ var useAppointmentBookingAccount = () => {
369
270
  return { accountLists, getHolders, form_id, addAccount, checkAccount };
370
271
  };
371
272
  var useAppointmentBookingResource = () => {
372
- const { appointmentBooking, setResources, setTimes } = (0, import_context.useAppointmentBookingContext)();
273
+ const { appointmentBooking, setResources, setTimes, setResourceOtherParams, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
373
274
  const { resourceSort } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
374
275
  const getResourceList = () => {
375
276
  var _a;
@@ -391,40 +292,53 @@ var useAppointmentBookingResource = () => {
391
292
  const data = await appointmentBooking.getTimeSlotByAllResources(code);
392
293
  setTimes(data || []);
393
294
  };
394
- return { getResourceTimeSlot, getResourceList };
295
+ const autoSelectAllProductResources = async (index) => {
296
+ const { resourceCodes } = getResourceList();
297
+ const code = resourceCodes == null ? void 0 : resourceCodes[index || 0];
298
+ const data = await appointmentBooking.getTimeSlotByAllResources(code);
299
+ let res = await appointmentBooking.autoSelectAllProductResources(code);
300
+ setResourceOtherParams({
301
+ ...resourceOtherParams,
302
+ ...res,
303
+ resourceCodes
304
+ });
305
+ return res;
306
+ };
307
+ return { getResourceTimeSlot, getResourceList, autoSelectAllProductResources };
395
308
  };
396
309
  var useIsSkipResourceStep = () => {
397
- const { currentStepParams } = (0, import_context.useAppointmentBookingContext)();
398
- const { getResourceList } = useAppointmentBookingResource();
310
+ var _a, _b, _c;
311
+ const { currentStep, setCarts, setPolicyIds } = (0, import_context.useAppointmentBookingContext)();
312
+ const { getResourceList, autoSelectAllProductResources } = useAppointmentBookingResource();
399
313
  const { isFormSubject } = useAppointmentBookingSetting();
400
314
  const appointmentBooking = useAppointmentBooking();
315
+ 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) || [];
316
+ const { isLogin, openLoginModal } = useAppointmentBookingLogin();
317
+ const { getHolders, checkAccount } = useAppointmentBookingAccount();
401
318
  const { nextStep } = useAppointmentBookingStep();
402
- const checkSkipResourceStep = async () => {
319
+ const utils = contextUtils();
320
+ const checkSkipResourceStep = async (isSkipUpdateFormStep) => {
321
+ var _a2, _b2, _c2, _d, _e;
403
322
  try {
404
- const { resources } = getResourceList();
405
323
  const accountLists = await appointmentBooking.getAccounts();
406
- const { isSystem, isSkip, form_code } = (0, import_utils2.currentAppointmentBoard)(currentStepParams.key, resources, appointmentBooking);
407
- if (isSystem) {
408
- nextStep();
409
- return true;
410
- }
324
+ const carts = await appointmentBooking.getCart();
411
325
  if ((accountLists == null ? void 0 : accountLists.length) === 1 || isFormSubject) {
412
- const renderLists = (0, import_utils2.currentRenderLists)(resources, form_code);
413
- let _isSkip = false;
414
- if ((renderLists == null ? void 0 : renderLists.length) === 1) {
415
- _isSkip = isSkip || false;
416
- } else {
417
- _isSkip = false;
418
- }
419
- if (_isSkip) {
420
- nextStep();
326
+ const res = await autoSelectAllProductResources();
327
+ const { resources } = getResourceList();
328
+ 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) {
329
+ if (!isSkipUpdateFormStep) {
330
+ const resultCarts = (0, import_utils2.formatCartsResources)(carts, resources, setPolicyIds);
331
+ (0, import_utils2.checkHasFormStep)({ 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 });
332
+ }
421
333
  return true;
334
+ } else {
335
+ return false;
422
336
  }
423
- return _isSkip;
424
337
  } else {
425
338
  return false;
426
339
  }
427
340
  } catch (error) {
341
+ console.log(error, "checkSkipResourceStep33");
428
342
  return false;
429
343
  }
430
344
  };
@@ -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;
@@ -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 | string, newData: any) => any;
104
+ export declare const updateBookingFormStorage: (bookingForm: any, id: number, newData: any) => any;
105
105
  export declare const Toast: (text: string) => void;
106
106
  /**
107
107
  * @title: 添加或移除表单步骤
@@ -111,90 +111,4 @@ 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: ({ 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, resourceItem: 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
- /**
148
- * @title: 查表表单步骤插入到哪个步骤的后面的key
149
- * @description:
150
- * @param {string} currentKey
151
- * @param {any} stepList
152
- * @return {*}
153
- * @Author: WangHan
154
- * @Date: 2025-05-24 19:05
155
- */
156
- export declare const getFormInsertBeforeKey: (currentKey: string, stepList: any[]) => any;
157
- /**
158
- * @title: 监测holder数据
159
- * @description:
160
- * @param {any} isFormSubject
161
- * @param {any} checkAccount
162
- * @param {any} carts
163
- * @return {*}
164
- * @Author: WangHan
165
- * @Date: 2025-05-24 22:46
166
- */
167
- export declare const checkAndGoNext: (isFormSubject: any, checkAccount: any, carts: any[]) => {
168
- hasError: boolean;
169
- updatedCartList: any[];
170
- };
171
- export declare const currentAppointmentBoard: (currentKey: string, resources: any[], appointmentBooking: any) => {
172
- isRequired: boolean;
173
- isSystem: boolean;
174
- isSkip: boolean;
175
- form_id: number;
176
- form_code: any;
177
- cart_id: string;
178
- resource_form_id: string;
179
- policy_id: string;
180
- } | {
181
- isRequired?: undefined;
182
- isSystem?: undefined;
183
- isSkip?: undefined;
184
- form_id?: undefined;
185
- form_code?: undefined;
186
- cart_id?: undefined;
187
- resource_form_id?: undefined;
188
- policy_id?: undefined;
189
- };
190
- export declare const currentRenderLists: (resources: any[], code: any) => any;
191
- /**
192
- * @title: 更新购物车
193
- * @description:
194
- * @param {any} carts
195
- * @param {any} value
196
- * @return {*}
197
- * @Author: WangHan
198
- * @Date: 2025-05-25 23:17
199
- */
200
- export declare const updateCartResources: (item: any, value: any) => any;
114
+ export declare const checkHasFormStep: ({ nextStep, isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId, currentStep, stepList, appointmentBooking, locales, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }: any) => true | undefined;