@pisell/private-materials 3.4.66 → 3.4.67

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 (261) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +6 -6
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/Sales/Cart/index.js +20 -3
  12. package/es/components/Sales/Cart/utils.d.ts +5 -0
  13. package/es/components/Sales/Cart/utils.js +16 -0
  14. package/es/components/Sales/Summary/utils.js +5 -4
  15. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  16. package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  17. package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  18. package/es/components/appointmentBooking/components/Header/index.js +12 -12
  19. package/es/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +2 -0
  20. package/es/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.js +82 -0
  21. package/es/components/appointmentBooking/components/TimeSlicing/index.js +46 -5
  22. package/es/components/appointmentBooking/components/Voucher/index.js +5 -2
  23. package/es/components/appointmentBooking/hooks.d.ts +1 -1
  24. package/es/components/appointmentBooking/hooks.js +6 -13
  25. package/es/components/appointmentBooking/locales.d.ts +3 -0
  26. package/es/components/appointmentBooking/locales.js +3 -0
  27. package/es/components/appointmentBooking/utils.d.ts +23 -0
  28. package/es/components/appointmentBooking/utils.js +159 -0
  29. package/es/components/booking/addons/model.d.ts +10 -1
  30. package/es/components/booking/components/TabProduct/index.d.ts +1 -0
  31. package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  32. package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
  33. package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
  34. package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
  35. package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
  36. package/es/components/booking/components/voucher/index.js +5 -2
  37. package/es/components/booking/forms/footer.d.ts +1 -0
  38. package/es/components/booking/forms/model.d.ts +10 -1
  39. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  40. package/es/components/booking/forms/table/index.d.ts +1 -0
  41. package/es/components/booking/hooks/useClearCart.d.ts +1 -0
  42. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  43. package/es/components/booking/info/date/index.d.ts +1 -0
  44. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  45. package/es/components/booking/info/model.d.ts +10 -1
  46. package/es/components/booking/info/notes/index.d.ts +1 -0
  47. package/es/components/booking/info/service/actions/index.d.ts +1 -0
  48. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  49. package/es/components/booking/info2/service/actions/index.d.ts +1 -0
  50. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  51. package/es/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
  52. package/es/components/booking/locales.d.ts +3 -0
  53. package/es/components/booking/locales.js +3 -0
  54. package/es/components/booking/materiels/duration/index.d.ts +1 -0
  55. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  56. package/es/components/booking/materiels/startTime/index.d.ts +1 -0
  57. package/es/components/booking/model.d.ts +9 -1
  58. package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
  59. package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
  60. package/es/components/booking/notes/model.d.ts +10 -1
  61. package/es/components/booking/payments/model.d.ts +10 -1
  62. package/es/components/booking/utils.d.ts +2 -2
  63. package/es/components/eftposPay/amount.d.ts +2 -1
  64. package/es/components/eftposPay/device.d.ts +1 -1
  65. package/es/components/eftposPay/hooks.d.ts +1 -1
  66. package/es/components/eftposPay/payo/config.d.ts +1 -0
  67. package/es/components/eftposPay/store/index.d.ts +1 -1
  68. package/es/components/eftposPay/tip.d.ts +1 -0
  69. package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
  70. package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
  71. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -1
  72. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  73. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  74. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  75. package/es/components/eventBooking/components/Voucher/components/Voucher.d.ts +20 -0
  76. package/es/components/eventBooking/components/Voucher/components/Voucher.js +99 -0
  77. package/es/components/eventBooking/components/Voucher/components/index.less +124 -0
  78. package/es/components/eventBooking/components/Voucher/components/locales.d.ts +39 -0
  79. package/es/components/eventBooking/components/Voucher/components/locales.js +38 -0
  80. package/es/components/eventBooking/components/Voucher/hooks.d.ts +7 -0
  81. package/es/components/eventBooking/components/Voucher/hooks.js +212 -0
  82. package/es/components/eventBooking/components/Voucher/index.d.ts +2 -0
  83. package/es/components/eventBooking/components/Voucher/index.js +266 -0
  84. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  85. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  86. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
  87. package/es/components/login/index.d.ts +1 -0
  88. package/es/components/pay/toC/PaymentMethods/StripePay/index.js +1 -1
  89. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  90. package/es/components/pay/toC/model.d.ts +9 -1
  91. package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
  92. package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
  93. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  94. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  95. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
  96. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
  97. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  98. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  99. package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
  100. package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
  101. package/es/components/schedules/calendar/index.d.ts +1 -0
  102. package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
  103. package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
  104. package/es/components/schedules/model.d.ts +9 -1
  105. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
  106. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  107. package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
  108. package/es/components/schedules/products/list/index.d.ts +1 -0
  109. package/es/components/schedules/resources/list/index.d.ts +1 -0
  110. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  111. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  112. package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  113. package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  114. package/es/components/shoppingCart/index.d.ts +1 -0
  115. package/es/components/systemSettings/registry/components/docs/images/image-1.png +0 -0
  116. package/es/components/systemSettings/registry/components/docs/images/image-2.png +0 -0
  117. package/es/components/systemSettings/registry/components/docs/images/image-3.png +0 -0
  118. package/es/components/systemSettings/registry/components/docs/images/image-4.png +0 -0
  119. package/es/components/systemSettings/registry/components/docs/images/image-5.png +0 -0
  120. package/es/components/systemSettings/registry/components/docs/images/image-6.png +0 -0
  121. package/es/components/systemSettings/registry/components/docs/images/image-7.png +0 -0
  122. package/es/components/systemSettings/registry/components/docs/images/image-8.png +0 -0
  123. package/es/components/systemSettings/registry/components/docs/images/image.png +0 -0
  124. package/es/hooks/usePaymentLogger.d.ts +1 -0
  125. package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
  126. package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
  127. package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
  128. package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
  129. package/es/plus/saasRegister/components/Header.d.ts +1 -0
  130. package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
  131. package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
  132. package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
  133. package/es/plus/skuOptionsSelection/components/VariantCard/index.d.ts +1 -0
  134. package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  135. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  136. package/lib/components/Sales/Cart/index.js +25 -7
  137. package/lib/components/Sales/Cart/utils.d.ts +5 -0
  138. package/lib/components/Sales/Cart/utils.js +13 -1
  139. package/lib/components/Sales/Summary/utils.js +2 -4
  140. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  141. package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  142. package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  143. package/lib/components/appointmentBooking/components/Header/index.js +3 -8
  144. package/lib/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +2 -0
  145. package/lib/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.js +89 -0
  146. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +27 -7
  147. package/lib/components/appointmentBooking/components/Voucher/index.js +4 -1
  148. package/lib/components/appointmentBooking/hooks.d.ts +1 -1
  149. package/lib/components/appointmentBooking/hooks.js +6 -11
  150. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  151. package/lib/components/appointmentBooking/locales.js +3 -0
  152. package/lib/components/appointmentBooking/utils.d.ts +23 -0
  153. package/lib/components/appointmentBooking/utils.js +103 -0
  154. package/lib/components/booking/addons/model.d.ts +10 -1
  155. package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
  156. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  157. package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
  158. package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
  159. package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
  160. package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
  161. package/lib/components/booking/components/voucher/index.js +4 -1
  162. package/lib/components/booking/forms/footer.d.ts +1 -0
  163. package/lib/components/booking/forms/model.d.ts +10 -1
  164. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  165. package/lib/components/booking/forms/table/index.d.ts +1 -0
  166. package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
  167. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  168. package/lib/components/booking/info/date/index.d.ts +1 -0
  169. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  170. package/lib/components/booking/info/model.d.ts +10 -1
  171. package/lib/components/booking/info/notes/index.d.ts +1 -0
  172. package/lib/components/booking/info/service/actions/index.d.ts +1 -0
  173. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  174. package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
  175. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  176. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
  177. package/lib/components/booking/locales.d.ts +3 -0
  178. package/lib/components/booking/locales.js +3 -0
  179. package/lib/components/booking/materiels/duration/index.d.ts +1 -0
  180. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  181. package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
  182. package/lib/components/booking/model.d.ts +9 -1
  183. package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
  184. package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
  185. package/lib/components/booking/notes/model.d.ts +10 -1
  186. package/lib/components/booking/payments/model.d.ts +10 -1
  187. package/lib/components/booking/utils.d.ts +2 -2
  188. package/lib/components/eftposPay/amount.d.ts +2 -1
  189. package/lib/components/eftposPay/device.d.ts +1 -1
  190. package/lib/components/eftposPay/hooks.d.ts +1 -1
  191. package/lib/components/eftposPay/payo/config.d.ts +1 -0
  192. package/lib/components/eftposPay/store/index.d.ts +1 -1
  193. package/lib/components/eftposPay/tip.d.ts +1 -0
  194. package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
  195. package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
  196. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -1
  197. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  198. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  199. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  200. package/lib/components/eventBooking/components/Voucher/components/Voucher.d.ts +20 -0
  201. package/lib/components/eventBooking/components/Voucher/components/Voucher.js +116 -0
  202. package/lib/components/eventBooking/components/Voucher/components/index.less +124 -0
  203. package/lib/components/eventBooking/components/Voucher/components/locales.d.ts +39 -0
  204. package/lib/components/eventBooking/components/Voucher/components/locales.js +59 -0
  205. package/lib/components/eventBooking/components/Voucher/hooks.d.ts +7 -0
  206. package/lib/components/eventBooking/components/Voucher/hooks.js +176 -0
  207. package/lib/components/eventBooking/components/Voucher/index.d.ts +2 -0
  208. package/lib/components/eventBooking/components/Voucher/index.js +197 -0
  209. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  210. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  211. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
  212. package/lib/components/login/index.d.ts +1 -0
  213. package/lib/components/pay/toC/PaymentMethods/StripePay/index.js +1 -1
  214. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  215. package/lib/components/pay/toC/model.d.ts +9 -1
  216. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
  217. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
  218. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  219. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  220. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
  221. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
  222. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  223. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  224. package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
  225. package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
  226. package/lib/components/schedules/calendar/index.d.ts +1 -0
  227. package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
  228. package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
  229. package/lib/components/schedules/model.d.ts +9 -1
  230. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
  231. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  232. package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
  233. package/lib/components/schedules/products/list/index.d.ts +1 -0
  234. package/lib/components/schedules/resources/list/index.d.ts +1 -0
  235. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  236. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  237. package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  238. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  239. package/lib/components/shoppingCart/index.d.ts +1 -0
  240. package/lib/components/systemSettings/registry/components/docs/images/image-1.png +0 -0
  241. package/lib/components/systemSettings/registry/components/docs/images/image-2.png +0 -0
  242. package/lib/components/systemSettings/registry/components/docs/images/image-3.png +0 -0
  243. package/lib/components/systemSettings/registry/components/docs/images/image-4.png +0 -0
  244. package/lib/components/systemSettings/registry/components/docs/images/image-5.png +0 -0
  245. package/lib/components/systemSettings/registry/components/docs/images/image-6.png +0 -0
  246. package/lib/components/systemSettings/registry/components/docs/images/image-7.png +0 -0
  247. package/lib/components/systemSettings/registry/components/docs/images/image-8.png +0 -0
  248. package/lib/components/systemSettings/registry/components/docs/images/image.png +0 -0
  249. package/lib/hooks/usePaymentLogger.d.ts +1 -0
  250. package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
  251. package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
  252. package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
  253. package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
  254. package/lib/plus/saasRegister/components/Header.d.ts +1 -0
  255. package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
  256. package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
  257. package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
  258. package/lib/plus/skuOptionsSelection/components/VariantCard/index.d.ts +1 -0
  259. package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  260. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  261. package/package.json +2 -2
@@ -225,7 +225,7 @@ var CartProvider = ({ children }) => {
225
225
  });
226
226
  };
227
227
  const createCartItemData = () => {
228
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
228
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
229
229
  const _cartData = getCurrentData().cartData;
230
230
  if (_cartData.currentCartItem) {
231
231
  const {
@@ -241,16 +241,24 @@ var CartProvider = ({ children }) => {
241
241
  const endDateInfo = (_g = (_f = eventItem == null ? void 0 : eventItem.eventDetail) == null ? void 0 : _f.selectDate) == null ? void 0 : _g.endDateInfo;
242
242
  const endTime = (_j = (_i = (_h = endDateInfo == null ? void 0 : endDateInfo.times) == null ? void 0 : _h.slice(-1)) == null ? void 0 : _i[0]) == null ? void 0 : _j.end_at;
243
243
  const num = 1;
244
- const { totalPrice, originTotal, is_charge_tax } = (0, import_utils3.handleProductInfo)(
244
+ const { price, totalPrice, originTotal, is_charge_tax } = (0, import_utils3.handleProductInfo)(
245
245
  eventDetail,
246
246
  num
247
247
  );
248
+ const transformProduct = (_temp) => {
249
+ var _a2;
250
+ if (!((_a2 = _temp == null ? void 0 : _temp.variant) == null ? void 0 : _a2.length)) {
251
+ return { ..._temp || {}, variant: [] };
252
+ }
253
+ return _temp;
254
+ };
248
255
  const newCartItem = {
249
256
  _id,
250
257
  id: eventItem.id,
251
258
  name: eventItem.title,
252
- price: totalPrice,
259
+ price,
253
260
  // eventBooking中售价和总价保持一致,因为数量为1
261
+ origin_price: price,
254
262
  total: totalPrice,
255
263
  // 排除原始价格为0的场景
256
264
  origin_total: isNaN(originTotal) || originTotal === 0 ? void 0 : originTotal,
@@ -271,6 +279,10 @@ var CartProvider = ({ children }) => {
271
279
  end_time: endTime ? (0, import_dayjs.default)(endTime || "").format("HH:mm") : "",
272
280
  custom_day_count: ((_m = (_l = (_k = eventItem == null ? void 0 : eventItem.eventDetail) == null ? void 0 : _k.selectDate) == null ? void 0 : _l.dates) == null ? void 0 : _m.length) || 0,
273
281
  is_charge_tax,
282
+ selectedBundle: (_n = eventDetail == null ? void 0 : eventDetail.productDetail) == null ? void 0 : _n.bundle,
283
+ selectedOptions: (_o = eventDetail == null ? void 0 : eventDetail.productDetail) == null ? void 0 : _o.options,
284
+ isNormalProduct: true,
285
+ // 是否是普通商品,eventBooking中接入的都是普通商品
274
286
  _originData: {
275
287
  ..._cartData.currentCartItem._originData,
276
288
  product: {
@@ -293,16 +305,22 @@ var CartProvider = ({ children }) => {
293
305
  event_unique_identifier: _id
294
306
  // 传递给接口用于商品可用性检测的比对
295
307
  },
296
- _productDetail: eventDetail.productDetail
308
+ _productDetail: eventDetail.productDetail,
309
+ _productOrigin: transformProduct(
310
+ ((_p = eventDetail == null ? void 0 : eventDetail.productDetail) == null ? void 0 : _p.origin) || bookingOptionData
311
+ ),
312
+ _productInit: transformProduct(
313
+ ((_q = eventDetail == null ? void 0 : eventDetail.productDetail) == null ? void 0 : _q.origin) || bookingOptionData
314
+ )
297
315
  };
298
316
  newCartItem.deposit = (0, import_utils3.handleProductDeposit)(newCartItem, eventDetail, num);
299
317
  const originData = (0, import_utils3.handleCartItemOrigin)(newCartItem, eventDetail);
300
318
  newCartItem._originData = originData;
301
319
  if (holderItem == null ? void 0 : holderItem._originData) {
302
320
  newCartItem._originData.holder = {
303
- customer_id: (_n = getUserInfo()) == null ? void 0 : _n.id,
304
- form_id: (_o = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _o.form_id,
305
- form_record: ((_p = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _p.form_record_id) ? [(_q = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _q.form_record_id] : null
321
+ customer_id: (_r = getUserInfo()) == null ? void 0 : _r.id,
322
+ form_id: (_s = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _s.form_id,
323
+ form_record: ((_t = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _t.form_record_id) ? [(_u = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _u.form_record_id] : null
306
324
  };
307
325
  }
308
326
  return newCartItem;
@@ -1,10 +1,15 @@
1
1
  import Decimal from 'decimal.js';
2
2
  import { ICalculatePriceParams } from './types';
3
3
  export declare const handleProductInfo: (eventDetail: any, num: number) => {
4
+ price: number;
4
5
  totalPrice: number;
5
6
  originTotal: any;
6
7
  is_charge_tax: any;
7
8
  };
9
+ /**
10
+ * 获取商品价格
11
+ */
12
+ export declare const getPrice: (params: ICalculatePriceParams) => number;
8
13
  /**
9
14
  * 获取商品总价
10
15
  * @description 当前总价计算基于商品数量为1
@@ -33,6 +33,7 @@ __export(utils_exports, {
33
33
  formatBundleToOrigin: () => formatBundleToOrigin,
34
34
  formatOptionsToOrigin: () => formatOptionsToOrigin,
35
35
  getOriginTotalPrice: () => getOriginTotalPrice,
36
+ getPrice: () => getPrice,
36
37
  getProductDeposit: () => getProductDeposit,
37
38
  getTotalPrice: () => getTotalPrice,
38
39
  handleCartItemOrigin: () => handleCartItemOrigin,
@@ -45,6 +46,7 @@ var handleProductInfo = (eventDetail, num) => {
45
46
  var _a;
46
47
  const { productDetail, bookingOptionItem } = eventDetail;
47
48
  const normalProduct = bookingOptionItem == null ? void 0 : bookingOptionItem._originData;
49
+ let price = Number((normalProduct == null ? void 0 : normalProduct.price) || 0);
48
50
  let totalPrice = Number((normalProduct == null ? void 0 : normalProduct.price) || "");
49
51
  let originTotal = Number((normalProduct == null ? void 0 : normalProduct.original_price) || "");
50
52
  let is_charge_tax = normalProduct == null ? void 0 : normalProduct.is_charge_tax;
@@ -58,10 +60,19 @@ var handleProductInfo = (eventDetail, num) => {
58
60
  is_charge_tax = variant == null ? void 0 : variant.is_charge_tax;
59
61
  }
60
62
  const params = { product: origin, variant, bundle, options, num };
63
+ price = getPrice(params);
61
64
  totalPrice = getTotalPrice(params);
62
65
  originTotal = getOriginTotalPrice(params);
63
66
  }
64
- return { totalPrice, originTotal, is_charge_tax };
67
+ return { price, totalPrice, originTotal, is_charge_tax };
68
+ };
69
+ var getPrice = (params) => {
70
+ const { product, variant } = params;
71
+ let price = Number(product.price);
72
+ if (variant) {
73
+ price = Number(variant == null ? void 0 : variant.price);
74
+ }
75
+ return price;
65
76
  };
66
77
  var getTotalPrice = (params) => {
67
78
  const { product, bundle, options, variant } = params;
@@ -270,6 +281,7 @@ var calculateProductDeposit = (params) => {
270
281
  formatBundleToOrigin,
271
282
  formatOptionsToOrigin,
272
283
  getOriginTotalPrice,
284
+ getPrice,
273
285
  getProductDeposit,
274
286
  getTotalPrice,
275
287
  handleCartItemOrigin,
@@ -41,9 +41,7 @@ var calculateSubtotal = (items) => {
41
41
  return "0.00";
42
42
  }
43
43
  const subtotal = items.reduce((sum, item) => {
44
- const price = new import_decimal.default(item.price || 0);
45
- const quantity = new import_decimal.default(item.quantity || 1);
46
- return sum.plus(price.times(quantity));
44
+ return sum.plus(item.total || 0);
47
45
  }, new import_decimal.default(0));
48
46
  return subtotal.toFixed(2);
49
47
  };
@@ -54,7 +52,7 @@ var calculateTaxFee = (shopInfo, items) => {
54
52
  const { is_price_include_tax, tax_rate } = shopInfo || {};
55
53
  console.log("shopInfo>>>", is_price_include_tax, tax_rate);
56
54
  const totalTaxFee = items.reduce((sum, item) => {
57
- const price = new import_decimal.default(item.price || 0);
55
+ const price = new import_decimal.default(item.total || 0);
58
56
  const taxRate = new import_decimal.default(tax_rate || 0).div(100);
59
57
  const productTaxRate = price.times(taxRate).times((item == null ? void 0 : item.is_charge_tax) || 0).div(taxRate.times(is_price_include_tax || 0).plus(1));
60
58
  return sum.plus(productTaxRate);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Total: ({ className, isFooter }: any) => JSX.Element;
3
4
  export default Total;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Cart: ({ open, onCancel, onNext }: any) => JSX.Element;
3
4
  export default Cart;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Footer: ({ onNext, isOpen }: any) => JSX.Element;
3
4
  export default Footer;
@@ -114,20 +114,15 @@ var Header = () => {
114
114
  isSkip: false
115
115
  });
116
116
  }
117
- if ((prevStepData == null ? void 0 : prevStepData.key) === "select-service") {
117
+ const isServiceStep = (prevStepData == null ? void 0 : prevStepData.key) === "select-service";
118
+ const isResourceStep = (prevStepData == null ? void 0 : prevStepData.key) === "select-resource";
119
+ if (isServiceStep || isResourceStep) {
118
120
  stepList.forEach((item) => {
119
121
  if (item.key.startsWith("select-resource_") || item.key.startsWith("fill-form_")) {
120
122
  removeStep(item.key);
121
123
  }
122
124
  });
123
125
  }
124
- if ((prevStepData == null ? void 0 : prevStepData.key) === "select-resource") {
125
- stepList.forEach((item) => {
126
- if (item.key.startsWith("fill-form_")) {
127
- removeStep(item.key);
128
- }
129
- });
130
- }
131
126
  };
132
127
  const handleClose = () => {
133
128
  var _a2, _b;
@@ -0,0 +1,2 @@
1
+ declare const SelectDate: (props: any) => JSX.Element | null;
2
+ export default SelectDate;
@@ -0,0 +1,89 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.tsx
30
+ var SelectDateOS_exports = {};
31
+ __export(SelectDateOS_exports, {
32
+ default: () => SelectDateOS_default
33
+ });
34
+ module.exports = __toCommonJS(SelectDateOS_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_hooks = require("../../../hooks");
37
+ var import_context = require("../../../context");
38
+ var import_useComponents = __toESM(require("../../../../../hooks/useComponents"));
39
+ var import_utils = require("../../../utils");
40
+ var import_hooks2 = require("../../../hooks");
41
+ var import_utils2 = require("../../../utils");
42
+ var SelectDate = (props) => {
43
+ const { onDateChange, times, currentDate } = props;
44
+ const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
45
+ const { currentSelectedResources, setTimes } = (0, import_context.useAppointmentBookingContext)();
46
+ const utils = (0, import_hooks2.contextUtils)();
47
+ const [SelectDateOS] = (0, import_useComponents.default)({
48
+ components: ["SelectDateOS"]
49
+ });
50
+ const resourceCode = (0, import_react.useMemo)(() => {
51
+ const { resourceSort } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
52
+ const resources = appointmentBooking.getResourcesList();
53
+ const { resourceCodes } = (0, import_utils.processResourceList)(resources, resourceSort);
54
+ return (resourceCodes == null ? void 0 : resourceCodes[0]) || "";
55
+ }, []);
56
+ const currentResourceName = (0, import_react.useMemo)(() => {
57
+ var _a;
58
+ const currentResource = (_a = currentSelectedResources == null ? void 0 : currentSelectedResources[0]) == null ? void 0 : _a.currentSelectedResource;
59
+ const resourceItem = (currentResource == null ? void 0 : currentResource.resourceItem) || {};
60
+ const name = (0, import_utils.getResourceTitle)(
61
+ appointmentBooking,
62
+ resourceItem == null ? void 0 : resourceItem.code,
63
+ utils,
64
+ resourceItem
65
+ );
66
+ return name;
67
+ }, [currentSelectedResources]);
68
+ const onStepChange = () => {
69
+ (0, import_utils2.clearDataByStepKey)("select-service", appointmentBooking, setTimes);
70
+ const stepLists = appointmentBooking.getStepList();
71
+ const serviceIndex = stepLists.findIndex(
72
+ (item) => (item == null ? void 0 : item.key) === "select-service"
73
+ );
74
+ appointmentBooking.gotoStep(serviceIndex);
75
+ };
76
+ return SelectDateOS ? /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
77
+ SelectDateOS,
78
+ {
79
+ isTimeSlicing: true,
80
+ currentDate,
81
+ resourceCode,
82
+ resourceName: currentResourceName,
83
+ onDateChange,
84
+ onStepChange,
85
+ times
86
+ }
87
+ )) : null;
88
+ };
89
+ var SelectDateOS_default = SelectDate;
@@ -39,6 +39,7 @@ var import_context = require("../../context");
39
39
  var import_utils2 = require("../Resource/utils");
40
40
  var import_hooks = require("../../hooks");
41
41
  var import_utils3 = require("../../utils");
42
+ var import_SelectDateOS = __toESM(require("./components/SelectDateOS"));
42
43
  var import_index = require("./index.less");
43
44
  var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
44
45
  const [selectedResource, setSelectedResource] = (0, import_react.useState)("");
@@ -51,6 +52,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
51
52
  } = (0, import_context.useAppointmentBookingContext)();
52
53
  const { getResourceTimeSlot, getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
53
54
  const { nextStep } = (0, import_hooks.useAppointmentBookingStep)();
55
+ const [currentDate, setCurrentDate] = (0, import_react.useState)(void 0);
54
56
  (0, import_react.useImperativeHandle)(ref, () => ({
55
57
  next: () => {
56
58
  const isUnSelectedTimes = appointmentBooking.checkCartItems("date");
@@ -85,7 +87,30 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
85
87
  setSelectedResource(e == null ? void 0 : e.start_time);
86
88
  getAutoSelect(e);
87
89
  };
88
- return (times == null ? void 0 : times.length) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-time-slicing-wrap" }, times.map((item, index) => {
90
+ (0, import_react.useEffect)(() => {
91
+ const getCurrentDate = async () => {
92
+ var _a;
93
+ const res = await appointmentBooking.getDateRange();
94
+ const date = (_a = res == null ? void 0 : res[0]) == null ? void 0 : _a.date;
95
+ setCurrentDate(date);
96
+ };
97
+ getCurrentDate();
98
+ }, []);
99
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
100
+ import_SelectDateOS.default,
101
+ {
102
+ onDateChange: (currentData) => {
103
+ if ((times == null ? void 0 : times.length) > 0) {
104
+ appointmentBooking.deleteCartItemInfo("time");
105
+ }
106
+ setCurrentDate(currentData == null ? void 0 : currentData.date);
107
+ appointmentBooking.setDateRange([currentData]);
108
+ getResourceTimeSlot();
109
+ },
110
+ times,
111
+ currentDate
112
+ }
113
+ ), (times == null ? void 0 : times.length) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-time-slicing-wrap" }, times.map((item, index) => {
89
114
  return /* @__PURE__ */ import_react.default.createElement(
90
115
  "div",
91
116
  {
@@ -96,11 +121,6 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
96
121
  /* @__PURE__ */ import_react.default.createElement("span", null, item == null ? void 0 : item.start_time),
97
122
  /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-chevron-right", className: `icon` })
98
123
  );
99
- })) : /* @__PURE__ */ import_react.default.createElement(
100
- import_materials.PisellEmpty,
101
- {
102
- description: import_utils.locales.getText("pisell2.appointment.unselect.time")
103
- }
104
- );
124
+ })) : null);
105
125
  });
106
126
  var TimeSlicing_default = TimeSlicing;
@@ -170,8 +170,11 @@ var VoucherCard = (props) => {
170
170
  batchUpdateCart(val.productList);
171
171
  setCode("");
172
172
  } else {
173
+ const content = {
174
+ time_limit: import_utils.locales.getText("pisell2.text.goodpass.code-invalid-expired")
175
+ };
173
176
  (0, import_materials.PisellToast)({
174
- content: val.type === "server" ? import_utils.locales.getText("pisell2.text.goodpass.code-invalid") : import_utils.locales.getText("pisell2.text.goodpass.code-invalid-cart")
177
+ content: val.type === "server" ? import_utils.locales.getText("pisell2.text.goodpass.code-invalid") : content[val == null ? void 0 : val.unavailableReason] || import_utils.locales.getText("pisell2.text.goodpass.code-invalid-cart")
175
178
  });
176
179
  }
177
180
  };
@@ -72,7 +72,7 @@ export declare const useAppointmentBookingAccount: () => {
72
72
  export declare const useAppointmentBookingResource: () => {
73
73
  getResourceTimeSlot: (index?: number) => Promise<void>;
74
74
  getResourceList: () => {
75
- resources: any;
75
+ resources: any[];
76
76
  resourceCodes: any;
77
77
  };
78
78
  };
@@ -489,18 +489,13 @@ var useAppointmentBookingResource = () => {
489
489
  const { appointmentBooking, setResources, setTimes } = (0, import_context.useAppointmentBookingContext)();
490
490
  const { resourceSort } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
491
491
  const getResourceList = () => {
492
- var _a;
493
492
  let resources = appointmentBooking.getResourcesList();
494
- resources = resources.map((item) => {
495
- return {
496
- ...item,
497
- resources: (0, import_utils2.sortResources)((item == null ? void 0 : item.resources) || [], resourceSort)
498
- };
499
- });
500
- const _resources = ((_a = resources == null ? void 0 : resources[0]) == null ? void 0 : _a.resources) || [];
501
- const resourceCodes = _resources.map((item) => item.code);
502
- setResources(resources || []);
503
- return { resources, resourceCodes };
493
+ const { resources: processedResources, resourceCodes } = (0, import_utils2.processResourceList)(
494
+ resources,
495
+ resourceSort
496
+ );
497
+ setResources(processedResources || []);
498
+ return { resources: processedResources, resourceCodes };
504
499
  };
505
500
  const getResourceTimeSlot = async (index) => {
506
501
  const { resourceCodes } = getResourceList();
@@ -115,6 +115,7 @@ declare const _default: {
115
115
  'pisell2.text.goodpass.enter-code': string;
116
116
  'pisell2.text.goodpass.code-invalid': string;
117
117
  'pisell2.text.goodpass.code-invalid-cart': string;
118
+ 'pisell2.text.goodpass.code-invalid-expired': string;
118
119
  'pisell2.text.goodpass.login': string;
119
120
  'pisell2.text.goodpass.login-tip': string;
120
121
  'pisell2.text.contact-info.title': string;
@@ -235,6 +236,7 @@ declare const _default: {
235
236
  'pisell2.text.goodpass.enter-code': string;
236
237
  'pisell2.text.goodpass.code-invalid': string;
237
238
  'pisell2.text.goodpass.code-invalid-cart': string;
239
+ 'pisell2.text.goodpass.code-invalid-expired': string;
238
240
  'pisell2.text.goodpass.login': string;
239
241
  'pisell2.text.goodpass.login-tip': string;
240
242
  'pisell2.text.contact-info.title': string;
@@ -355,6 +357,7 @@ declare const _default: {
355
357
  'pisell2.text.goodpass.enter-code': string;
356
358
  'pisell2.text.goodpass.code-invalid': string;
357
359
  'pisell2.text.goodpass.code-invalid-cart': string;
360
+ 'pisell2.text.goodpass.code-invalid-expired': string;
358
361
  'pisell2.text.goodpass.login': string;
359
362
  'pisell2.text.goodpass.login-tip': string;
360
363
  'pisell2.text.contact-info.title': string;
@@ -139,6 +139,7 @@ var locales_default = {
139
139
  "pisell2.text.goodpass.enter-code": "Enter Code",
140
140
  "pisell2.text.goodpass.code-invalid": "Current code is invalid",
141
141
  "pisell2.text.goodpass.code-invalid-cart": "No eligible items in the cart",
142
+ "pisell2.text.goodpass.code-invalid-expired": "Current coupon is not valid in use",
142
143
  "pisell2.text.goodpass.login": "Login",
143
144
  "pisell2.text.goodpass.login-tip": " for member benefit Or use account credit",
144
145
  "pisell2.text.contact-info.title": "Contact info"
@@ -259,6 +260,7 @@ var locales_default = {
259
260
  "pisell2.text.goodpass.enter-code": "请输入券码",
260
261
  "pisell2.text.goodpass.code-invalid": "当前券码不可用",
261
262
  "pisell2.text.goodpass.code-invalid-cart": "当前购物车中无可用商品",
263
+ "pisell2.text.goodpass.code-invalid-expired": "当前优惠券不在使用期限内",
262
264
  "pisell2.text.goodpass.login": "登录",
263
265
  "pisell2.text.goodpass.login-tip": "以获取会员福利或使用账户积分",
264
266
  "pisell2.text.contact-info.title": "联系信息"
@@ -379,6 +381,7 @@ var locales_default = {
379
381
  "pisell2.text.goodpass.enter-code": "請輸入券碼",
380
382
  "pisell2.text.goodpass.code-invalid": "當前券碼不可用",
381
383
  "pisell2.text.goodpass.code-invalid-cart": "當前購物車中無可用商品",
384
+ "pisell2.text.goodpass.code-invalid-expired": "當前優惠券不在使用期限內",
382
385
  "pisell2.text.goodpass.login": "登錄",
383
386
  "pisell2.text.goodpass.login-tip": "以獲取會員福利或使用賬戶積分",
384
387
  "pisell2.text.contact-info.title": "聯繫信息"
@@ -39,6 +39,19 @@ export declare const formatCarts: (data: any[], resources: any[], utils: any, ac
39
39
  * @Date: 2025-04-14 11:16
40
40
  */
41
41
  export declare const sortResources: (resources: any[], resourceSort: any[]) => any[] | undefined;
42
+ /**
43
+ * @title: 处理资源列表并提取资源代码
44
+ * @description: 对资源列表进行排序,并提取 resourceCodes
45
+ * @param {any[]} resources - 原始资源列表
46
+ * @param {any[]} resourceSort - 资源排序配置
47
+ * @return {*} 返回处理后的资源列表和资源代码数组
48
+ * @Author: WangHan
49
+ * @Date: 2025-11-21 15:33
50
+ */
51
+ export declare const processResourceList: (resources: any[], resourceSort: any[]) => {
52
+ resources: any[];
53
+ resourceCodes: any;
54
+ };
42
55
  export declare const getMeAccount: (val: any[]) => any;
43
56
  export declare const getCustomer: (utils: any) => any;
44
57
  export declare const formatCustomer: (val: any) => {
@@ -201,3 +214,13 @@ export declare const currentRenderLists: (resources: any[], code: any) => any;
201
214
  * @Date: 2025-05-25 23:17
202
215
  */
203
216
  export declare const updateCartResources: (item: any, value?: any, currentSelectedResources?: any) => any;
217
+ /**
218
+ * @title: 根据步骤key清空数据
219
+ * @param {string} key - 当前步骤的key
220
+ * @param {any} appointmentBooking - 预约预订实例
221
+ * @param {(times: any[]) => void} setTimes - 设置时间列表的回调函数
222
+ * @return {string[]} 返回需要清空的数据类型数组
223
+ * @Author: WangHan
224
+ * @Date: 2025-11-21 15:40
225
+ */
226
+ export declare const clearDataByStepKey: (key: string, appointmentBooking: any, setTimes?: ((times: any[]) => void) | undefined) => string[] | undefined;
@@ -23,6 +23,7 @@ __export(utils_exports, {
23
23
  checkAndGoNext: () => checkAndGoNext,
24
24
  checkAndMarkCartRenderError: () => checkAndMarkCartRenderError,
25
25
  checkHasFormStep: () => checkHasFormStep,
26
+ clearDataByStepKey: () => clearDataByStepKey,
26
27
  currentAppointmentBoard: () => currentAppointmentBoard,
27
28
  currentRenderLists: () => currentRenderLists,
28
29
  formatCarts: () => formatCarts,
@@ -42,6 +43,7 @@ __export(utils_exports, {
42
43
  getResourceTitle: () => getResourceTitle,
43
44
  hasResourceFormId: () => hasResourceFormId,
44
45
  openForm: () => openForm,
46
+ processResourceList: () => processResourceList,
45
47
  sortResources: () => sortResources,
46
48
  updateBookingFormStorage: () => updateBookingFormStorage,
47
49
  updateCartResources: () => updateCartResources,
@@ -165,6 +167,18 @@ var sortResources = (resources, resourceSort) => {
165
167
  console.log(error, "wh2222");
166
168
  }
167
169
  };
170
+ var processResourceList = (resources, resourceSort) => {
171
+ var _a;
172
+ const processedResources = resources.map((item) => {
173
+ return {
174
+ ...item,
175
+ resources: sortResources((item == null ? void 0 : item.resources) || [], resourceSort)
176
+ };
177
+ });
178
+ const _resources = ((_a = processedResources == null ? void 0 : processedResources[0]) == null ? void 0 : _a.resources) || [];
179
+ const resourceCodes = _resources.map((item) => item.code);
180
+ return { resources: processedResources, resourceCodes };
181
+ };
168
182
  var getMeAccount = (val) => {
169
183
  return val == null ? void 0 : val.find((d) => !(d == null ? void 0 : d.isGuest));
170
184
  };
@@ -487,12 +501,100 @@ var updateCartResources = (item, value, currentSelectedResources) => {
487
501
  }
488
502
  return newResource || [];
489
503
  };
504
+ var STEP_CLEAR_CONFIG = {
505
+ "select-time": ["time"],
506
+ "fill-form": ["time", "form"],
507
+ "select-resource": ["time", "form", "resource"],
508
+ "select-date": ["time", "form", "resource", "date"],
509
+ "select-service": ["time", "form", "resource", "date"]
510
+ };
511
+ var getMatchedStepKey = (key) => {
512
+ if (STEP_CLEAR_CONFIG[key]) {
513
+ return key;
514
+ }
515
+ const matchedKey = Object.keys(STEP_CLEAR_CONFIG).find(
516
+ (stepKey) => key.startsWith(stepKey)
517
+ );
518
+ return matchedKey || null;
519
+ };
520
+ var createClearActions = (appointmentBooking, setTimes) => {
521
+ return {
522
+ time: () => {
523
+ appointmentBooking.deleteCartItemInfo("time");
524
+ setTimes == null ? void 0 : setTimes([]);
525
+ },
526
+ resource: () => {
527
+ appointmentBooking.deleteCartItemInfo("resource");
528
+ },
529
+ form: () => {
530
+ appointmentBooking.deleteCartItemInfo("relationForms");
531
+ appointmentBooking.removeStep("fill-form");
532
+ },
533
+ date: () => {
534
+ var _a;
535
+ const { bookingProcess } = ((_a = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a.productModuleParams) || {};
536
+ if (bookingProcess !== "date_first") {
537
+ appointmentBooking.clearDateRange();
538
+ }
539
+ }
540
+ };
541
+ };
542
+ var clearServiceRelatedSteps = (appointmentBooking) => {
543
+ const stepList = (appointmentBooking == null ? void 0 : appointmentBooking.getStepList()) || [];
544
+ const stepKeysToRemove = ["select-resource_", "fill-form_"];
545
+ stepList.forEach((item) => {
546
+ if (item == null ? void 0 : item.isSkip) {
547
+ appointmentBooking.updateStep(item.key, {
548
+ key: item.key,
549
+ isSkip: false
550
+ });
551
+ }
552
+ const shouldRemove = stepKeysToRemove.some(
553
+ (prefix) => {
554
+ var _a;
555
+ return (_a = item.key) == null ? void 0 : _a.startsWith(prefix);
556
+ }
557
+ );
558
+ if (shouldRemove) {
559
+ appointmentBooking.removeStep(item.key);
560
+ }
561
+ });
562
+ };
563
+ var executeClearActions = (dataTypes, clearActions) => {
564
+ const uniqueTypes = Array.from(new Set(dataTypes));
565
+ uniqueTypes.forEach((type) => {
566
+ const action = clearActions[type];
567
+ if (action) {
568
+ action();
569
+ }
570
+ });
571
+ };
572
+ var clearDataByStepKey = (key, appointmentBooking, setTimes) => {
573
+ if (!key || !appointmentBooking) {
574
+ return;
575
+ }
576
+ if (key === "select-service") {
577
+ clearServiceRelatedSteps(appointmentBooking);
578
+ }
579
+ const stepKey = getMatchedStepKey(key);
580
+ if (!stepKey) {
581
+ return;
582
+ }
583
+ const clearDataTypes = STEP_CLEAR_CONFIG[stepKey] || [];
584
+ if (clearDataTypes.length === 0) {
585
+ return clearDataTypes;
586
+ }
587
+ const clearActions = createClearActions(appointmentBooking, setTimes);
588
+ executeClearActions(clearDataTypes, clearActions);
589
+ return clearDataTypes;
590
+ };
490
591
  // Annotate the CommonJS export names for ESM import in node:
491
592
  0 && (module.exports = {
492
593
  Toast,
493
594
  checkAndGoNext,
494
595
  checkAndMarkCartRenderError,
495
596
  checkHasFormStep,
597
+ clearDataByStepKey,
496
598
  currentAppointmentBoard,
497
599
  currentRenderLists,
498
600
  formatCarts,
@@ -512,6 +614,7 @@ var updateCartResources = (item, value, currentSelectedResources) => {
512
614
  getResourceTitle,
513
615
  hasResourceFormId,
514
616
  openForm,
617
+ processResourceList,
515
618
  sortResources,
516
619
  updateBookingFormStorage,
517
620
  updateCartResources,
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  interface TabProductProps {
3
4
  list: any[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ProductItem: ({ item, onClick, amountSymbol, style, className, }: any) => JSX.Element;
3
4
  export default ProductItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare const SelectProductItem: ({ item, onClick, onChangeQuantity, amountSymbol, style, className, disabled, }: any) => JSX.Element;
3
4
  export default SelectProductItem;