@pisell/private-materials 3.2.22 → 3.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) 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 +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/appointmentBooking/assets/guests.svg +1 -0
  12. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +83 -104
  13. package/es/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
  14. package/es/components/appointmentBooking/components/Cart/Item/index.js +32 -18
  15. package/es/components/appointmentBooking/components/Cart/Item/index.less +7 -4
  16. package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
  17. package/es/components/appointmentBooking/components/Content/index.js +11 -11
  18. package/es/components/appointmentBooking/components/Date/index.d.ts +0 -1
  19. package/es/components/appointmentBooking/components/Date/index.js +49 -32
  20. package/es/components/appointmentBooking/components/Date/index.less +5 -0
  21. package/es/components/appointmentBooking/components/Guest/index.js +8 -21
  22. package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
  23. package/es/components/appointmentBooking/components/Header/index.js +44 -7
  24. package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
  25. package/es/components/appointmentBooking/components/Resource/index.js +28 -20
  26. package/es/components/appointmentBooking/components/Resource/index.less +5 -0
  27. package/es/components/appointmentBooking/components/Services/index.js +20 -9
  28. package/es/components/appointmentBooking/components/TimeSlicing/index.js +47 -32
  29. package/es/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
  30. package/es/components/appointmentBooking/components/Voucher/index.js +28 -18
  31. package/es/components/appointmentBooking/context.d.ts +2 -0
  32. package/es/components/appointmentBooking/context.js +7 -1
  33. package/es/components/appointmentBooking/hooks.d.ts +45 -9
  34. package/es/components/appointmentBooking/hooks.js +158 -121
  35. package/es/components/appointmentBooking/index.d.ts +0 -1
  36. package/es/components/appointmentBooking/index.js +12 -7
  37. package/es/components/appointmentBooking/locales.d.ts +30 -0
  38. package/es/components/appointmentBooking/locales.js +30 -0
  39. package/es/components/appointmentBooking/utils.d.ts +19 -0
  40. package/es/components/appointmentBooking/utils.js +68 -1
  41. package/es/components/booking/components/footer/utils.js +15 -15
  42. package/es/components/booking/components/voucher/index.d.ts +1 -1
  43. package/es/components/booking/components/voucher/index.js +28 -27
  44. package/es/components/booking/deposit/index.d.ts +0 -1
  45. package/es/components/booking/forms/single/index.d.ts +0 -1
  46. package/es/components/booking/hooks/useClearCart.d.ts +1 -0
  47. package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  48. package/es/components/booking/hooks/useIsBooking4Shop.js +10 -0
  49. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  50. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  51. package/es/components/booking/info/header/index.d.ts +0 -1
  52. package/es/components/booking/info/index.d.ts +0 -1
  53. package/es/components/booking/info/service/addService/index.d.ts +0 -1
  54. package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  55. package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  56. package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
  57. package/es/components/booking/info/service2/utils.d.ts +1 -1
  58. package/es/components/booking/info2/service/addService/index.d.ts +0 -1
  59. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  60. package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  61. package/es/components/booking/materiels/contacts/index.d.ts +0 -1
  62. package/es/components/booking/utils.d.ts +2 -2
  63. package/es/components/eftpos/form/index.d.ts +0 -1
  64. package/es/components/eftpos/hooks.d.ts +0 -1
  65. package/es/components/eftpos/index.d.ts +0 -1
  66. package/es/components/eftpos/pos.d.ts +0 -1
  67. package/es/components/eftpos/surcharge/index.d.ts +0 -1
  68. package/es/components/eftposPay/amount.d.ts +1 -1
  69. package/es/components/eftposPay/app.d.ts +0 -1
  70. package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  71. package/es/components/eftposPay/component/fail/index.d.ts +0 -1
  72. package/es/components/eftposPay/component/fail/network.d.ts +0 -1
  73. package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
  74. package/es/components/eftposPay/component/manual/index.d.ts +0 -1
  75. package/es/components/eftposPay/component/signature/index.d.ts +0 -1
  76. package/es/components/eftposPay/device.d.ts +1 -1
  77. package/es/components/eftposPay/hooks.d.ts +1 -1
  78. package/es/components/eftposPay/index.d.ts +0 -1
  79. package/es/components/eftposPay/pay.d.ts +0 -1
  80. package/es/components/eftposPay/store/index.d.ts +3 -3
  81. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  82. package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  83. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  84. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  85. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  86. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  87. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  88. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  89. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  90. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  91. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
  92. package/es/components/eventBooking/index.d.ts +0 -1
  93. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
  94. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  95. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  96. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  97. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  98. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  99. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  100. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  101. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  102. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  103. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  104. package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
  105. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
  106. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
  107. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
  108. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  109. package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
  110. package/es/components/schedules/products/index.d.ts +0 -1
  111. package/es/components/schedules/resources/index.d.ts +0 -1
  112. package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
  113. package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
  114. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
  115. package/es/components/schedules/schedules/index.d.ts +0 -1
  116. package/es/components/shoppingCart/components/Cart/Product.js +3 -0
  117. package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
  118. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  119. package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  120. package/es/components/shoppingCart/hooks/useClearCart.js +4 -3
  121. package/es/components/shoppingCart/type.d.ts +1 -0
  122. package/es/components/taxSelect/index.d.ts +0 -1
  123. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  124. package/lib/components/appointmentBooking/assets/guests.svg +1 -0
  125. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +37 -27
  126. package/lib/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
  127. package/lib/components/appointmentBooking/components/Cart/Item/index.js +23 -11
  128. package/lib/components/appointmentBooking/components/Cart/Item/index.less +7 -4
  129. package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
  130. package/lib/components/appointmentBooking/components/Content/index.js +3 -5
  131. package/lib/components/appointmentBooking/components/Date/index.d.ts +0 -1
  132. package/lib/components/appointmentBooking/components/Date/index.js +53 -47
  133. package/lib/components/appointmentBooking/components/Date/index.less +5 -0
  134. package/lib/components/appointmentBooking/components/Guest/index.js +6 -5
  135. package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
  136. package/lib/components/appointmentBooking/components/Header/index.js +25 -3
  137. package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
  138. package/lib/components/appointmentBooking/components/Resource/index.js +16 -17
  139. package/lib/components/appointmentBooking/components/Resource/index.less +5 -0
  140. package/lib/components/appointmentBooking/components/Services/index.js +21 -2
  141. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +23 -21
  142. package/lib/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
  143. package/lib/components/appointmentBooking/components/Voucher/index.js +28 -16
  144. package/lib/components/appointmentBooking/context.d.ts +2 -0
  145. package/lib/components/appointmentBooking/context.js +4 -1
  146. package/lib/components/appointmentBooking/hooks.d.ts +45 -9
  147. package/lib/components/appointmentBooking/hooks.js +28 -41
  148. package/lib/components/appointmentBooking/index.d.ts +0 -1
  149. package/lib/components/appointmentBooking/index.js +11 -7
  150. package/lib/components/appointmentBooking/locales.d.ts +30 -0
  151. package/lib/components/appointmentBooking/locales.js +30 -0
  152. package/lib/components/appointmentBooking/utils.d.ts +19 -0
  153. package/lib/components/appointmentBooking/utils.js +39 -1
  154. package/lib/components/booking/components/footer/utils.js +1 -15
  155. package/lib/components/booking/components/voucher/index.d.ts +1 -1
  156. package/lib/components/booking/components/voucher/index.js +28 -17
  157. package/lib/components/booking/deposit/index.d.ts +0 -1
  158. package/lib/components/booking/forms/single/index.d.ts +0 -1
  159. package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
  160. package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  161. package/lib/components/booking/hooks/useIsBooking4Shop.js +51 -0
  162. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  163. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  164. package/lib/components/booking/info/header/index.d.ts +0 -1
  165. package/lib/components/booking/info/index.d.ts +0 -1
  166. package/lib/components/booking/info/service/addService/index.d.ts +0 -1
  167. package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  168. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  169. package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
  170. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  171. package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
  172. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  173. package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  174. package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
  175. package/lib/components/booking/utils.d.ts +2 -2
  176. package/lib/components/eftpos/form/index.d.ts +0 -1
  177. package/lib/components/eftpos/hooks.d.ts +0 -1
  178. package/lib/components/eftpos/index.d.ts +0 -1
  179. package/lib/components/eftpos/pos.d.ts +0 -1
  180. package/lib/components/eftpos/surcharge/index.d.ts +0 -1
  181. package/lib/components/eftposPay/amount.d.ts +1 -1
  182. package/lib/components/eftposPay/app.d.ts +0 -1
  183. package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  184. package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
  185. package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
  186. package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
  187. package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
  188. package/lib/components/eftposPay/component/signature/index.d.ts +0 -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/index.d.ts +0 -1
  192. package/lib/components/eftposPay/pay.d.ts +0 -1
  193. package/lib/components/eftposPay/store/index.d.ts +3 -3
  194. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  195. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  196. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  197. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  198. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  199. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  200. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  201. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  202. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  203. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  204. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
  205. package/lib/components/eventBooking/index.d.ts +0 -1
  206. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
  207. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  208. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  209. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  210. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  211. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  212. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  213. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  214. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  215. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  216. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  217. package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
  218. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
  219. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
  220. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
  221. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  222. package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
  223. package/lib/components/schedules/products/index.d.ts +0 -1
  224. package/lib/components/schedules/resources/index.d.ts +0 -1
  225. package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
  226. package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
  227. package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
  228. package/lib/components/schedules/schedules/index.d.ts +0 -1
  229. package/lib/components/shoppingCart/components/Cart/Product.js +1 -0
  230. package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
  231. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  232. package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  233. package/lib/components/shoppingCart/hooks/useClearCart.js +3 -2
  234. package/lib/components/shoppingCart/type.d.ts +1 -0
  235. package/lib/components/taxSelect/index.d.ts +0 -1
  236. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  237. package/package.json +4 -4
@@ -13,11 +13,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
14
14
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
15
15
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
16
+ import { useState, useEffect } from 'react';
16
17
  import { usePisellOS } from "../../hooks/useEngineContext";
17
18
  import useEngineContext from "../../hooks/useEngineContext";
18
- import { getUniqueId } from "@pisell/utils";
19
19
  import { sortResources } from "./utils";
20
- import { useState, useEffect } from 'react';
21
20
  import { useAppointmentBookingContext } from "./context";
22
21
  export var useAppointmentBooking = function useAppointmentBooking() {
23
22
  var pisellOS = usePisellOS();
@@ -27,6 +26,14 @@ export var useShopDiscount = function useShopDiscount() {
27
26
  var pisellOS = usePisellOS();
28
27
  return pisellOS.getModule('shopDiscount');
29
28
  };
29
+
30
+ /**
31
+ * @title: 监听步骤发生变化
32
+ * @description:
33
+ * @return {*}
34
+ * @Author: WangHan
35
+ * @Date: 2025-04-15 11:11
36
+ */
30
37
  export var useAppointmentBookingStep = function useAppointmentBookingStep() {
31
38
  var _appointmentBooking$s;
32
39
  var pisellOS = usePisellOS();
@@ -34,12 +41,7 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
34
41
  appointmentBooking = _useAppointmentBookin.appointmentBooking,
35
42
  setCurrentStep = _useAppointmentBookin.setCurrentStep,
36
43
  setIsLastStep = _useAppointmentBookin.setIsLastStep;
37
- // const appointmentBooking = useAppointmentBooking();
38
44
  var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
39
-
40
- // const [currentStep, setCurrentStep] = useState<any>(appointmentBooking.getCurrentStep());
41
- // const [isLastStep, setIsLastStep] = useState<any>(false)
42
-
43
45
  useEffect(function () {
44
46
  pisellOS.effects.on('appointmentBooking_step:changed', /*#__PURE__*/function () {
45
47
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
@@ -64,75 +66,102 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
64
66
  }());
65
67
  }, []);
66
68
  };
69
+
70
+ /**
71
+ * @title: 获取商品数据
72
+ * @description:
73
+ * @return {*}
74
+ * @Author: WangHan
75
+ * @Date: 2025-04-15 11:12
76
+ */
67
77
  export var useAppointmentBookingProduct = function useAppointmentBookingProduct() {
68
78
  var _useAppointmentBookin2 = useAppointmentBookingContext(),
69
79
  appointmentBooking = _useAppointmentBookin2.appointmentBooking,
70
80
  setProducts = _useAppointmentBookin2.setProducts;
71
- // const [products, setProducts] = useState<any>([]);
72
81
  var productModuleParams = appointmentBooking.otherParams.productModuleParams;
73
82
  useEffect(function () {
74
83
  appointmentBooking.loadProducts(productModuleParams).then(function (res) {
75
- console.log(res, 'loadProductsloadProducts');
76
84
  setProducts(res || []);
77
85
  });
78
86
  }, []);
79
87
  };
88
+
89
+ /**
90
+ * @title: 更新购物车数据
91
+ * @description:
92
+ * @return {*}
93
+ * @Author: WangHan
94
+ * @Date: 2025-04-15 11:12
95
+ */
80
96
  export var useAppointmentBookingCart = function useAppointmentBookingCart() {
81
- var _appointmentBooking$s2;
82
97
  var pisellOS = usePisellOS();
83
98
  var _useAppointmentBookin3 = useAppointmentBookingContext(),
84
99
  appointmentBooking = _useAppointmentBookin3.appointmentBooking,
85
100
  setCarts = _useAppointmentBookin3.setCarts,
86
101
  setSummary = _useAppointmentBookin3.setSummary;
87
- var cart = appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.cart) === null || _appointmentBooking$s2 === void 0 ? void 0 : _appointmentBooking$s2.store;
102
+ var getCartAndSummary = /*#__PURE__*/function () {
103
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
104
+ var carts, summary;
105
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
106
+ while (1) switch (_context2.prev = _context2.next) {
107
+ case 0:
108
+ _context2.next = 2;
109
+ return appointmentBooking.getCart();
110
+ case 2:
111
+ carts = _context2.sent;
112
+ setCarts(carts || []);
113
+ _context2.next = 6;
114
+ return appointmentBooking.getSummary();
115
+ case 6:
116
+ summary = _context2.sent;
117
+ setSummary(summary || {});
118
+ console.log(carts, summary, 'appointmentBooking_cart:changed');
119
+ case 9:
120
+ case "end":
121
+ return _context2.stop();
122
+ }
123
+ }, _callee2);
124
+ }));
125
+ return function getCartAndSummary() {
126
+ return _ref2.apply(this, arguments);
127
+ };
128
+ }();
88
129
  useEffect(function () {
89
- var _appointmentBooking$g;
90
- pisellOS.effects.on('appointmentBooking_cart:changed', /*#__PURE__*/function () {
91
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(res) {
92
- var carts, summary;
93
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
94
- while (1) switch (_context2.prev = _context2.next) {
95
- case 0:
96
- _context2.next = 2;
97
- return appointmentBooking.getCart();
98
- case 2:
99
- carts = _context2.sent;
100
- setCarts(carts || []);
101
- _context2.next = 6;
102
- return appointmentBooking.getSummary();
103
- case 6:
104
- summary = _context2.sent;
105
- setSummary(summary || {});
106
- console.log(carts, summary, 'appointmentBooking_cart:changed');
107
- case 9:
108
- case "end":
109
- return _context2.stop();
110
- }
111
- }, _callee2);
112
- }));
113
- return function (_x2) {
114
- return _ref2.apply(this, arguments);
115
- };
116
- }());
117
- appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$g = appointmentBooking.getCart) === null || _appointmentBooking$g === void 0 || _appointmentBooking$g.call(appointmentBooking).then(function (data) {
118
- setCarts(data || []);
119
- });
130
+ getCartAndSummary();
131
+ pisellOS.effects.on('appointmentBooking_cart:changed', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
132
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
133
+ while (1) switch (_context3.prev = _context3.next) {
134
+ case 0:
135
+ getCartAndSummary();
136
+ case 1:
137
+ case "end":
138
+ return _context3.stop();
139
+ }
140
+ }, _callee3);
141
+ })));
120
142
  }, []);
121
- return {
122
- cart: cart
123
- };
124
143
  };
144
+
145
+ /**
146
+ * @title: 获取登录状态
147
+ * @description:
148
+ * @return {*}
149
+ * @Author: WangHan
150
+ * @Date: 2025-04-15 11:14
151
+ */
125
152
  export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
126
153
  var _utils$token, _utils$token$get;
127
154
  var context = useEngineContext();
128
155
  var utils = context.appHelper.utils || {};
129
156
  var isLogin = !!(utils !== null && utils !== void 0 && (_utils$token = utils.token) !== null && _utils$token !== void 0 && (_utils$token$get = _utils$token.get) !== null && _utils$token$get !== void 0 && _utils$token$get.call(_utils$token));
130
157
  var openLoginModal = function openLoginModal(params) {
131
- var _ref3 = params || {},
132
- callback = _ref3.callback;
158
+ var _ref4 = params || {},
159
+ callback = _ref4.callback;
133
160
  utils.action({
134
161
  type: 'pisell1.login',
135
- data: {},
162
+ data: {
163
+ type: 'plugin'
164
+ },
136
165
  callback: callback
137
166
  });
138
167
  };
@@ -141,55 +170,77 @@ export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
141
170
  openLoginModal: openLoginModal
142
171
  };
143
172
  };
173
+
174
+ /**
175
+ * @title: 获取账户
176
+ * @description:
177
+ * @return {*}
178
+ * @Author: WangHan
179
+ * @Date: 2025-04-15 11:15
180
+ */
144
181
  export var useAppointmentBookingAccount = function useAppointmentBookingAccount() {
145
- var _utils$getStore$getSt, _userInfo, _userInfo2, _userInfo3, _currentUserName, _userInfo4, _userInfo5;
146
182
  var pisellOS = usePisellOS();
147
- var context = useEngineContext();
148
- var utils = context.appHelper.utils || {};
149
183
  var appointmentBooking = useAppointmentBooking();
150
184
  var _useState = useState([]),
151
185
  _useState2 = _slicedToArray(_useState, 2),
152
186
  accountLists = _useState2[0],
153
187
  setAccountLists = _useState2[1];
154
- var userInfo = (_utils$getStore$getSt = utils.getStore().getState()) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.global) === null || _utils$getStore$getSt === void 0 ? void 0 : _utils$getStore$getSt.userInfo;
155
- var localUserInfo = JSON.parse(utils.storage.get('customer') || '{}');
156
- userInfo = (_userInfo = userInfo) !== null && _userInfo !== void 0 && _userInfo.id ? userInfo : localUserInfo;
157
- var currentUserName = "".concat((_userInfo2 = userInfo) === null || _userInfo2 === void 0 ? void 0 : _userInfo2.first_name, " ").concat((_userInfo3 = userInfo) === null || _userInfo3 === void 0 ? void 0 : _userInfo3.last_name);
158
- currentUserName = ((_currentUserName = currentUserName) === null || _currentUserName === void 0 ? void 0 : _currentUserName.trim()) || ((_userInfo4 = userInfo) === null || _userInfo4 === void 0 ? void 0 : _userInfo4.nickname) || 'Me';
159
- var currentUser = {
160
- id: ((_userInfo5 = userInfo) === null || _userInfo5 === void 0 ? void 0 : _userInfo5.id) || getUniqueId(),
161
- username: currentUserName
162
- };
188
+ var getAccountLists = /*#__PURE__*/function () {
189
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
190
+ var _appointmentBooking$s2;
191
+ var data;
192
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
193
+ while (1) switch (_context4.prev = _context4.next) {
194
+ case 0:
195
+ _context4.next = 2;
196
+ return appointmentBooking.getAccounts();
197
+ case 2:
198
+ data = _context4.sent;
199
+ setAccountLists(data || []);
200
+ console.log('currentUser4455777', appointmentBooking, (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.accountList) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.store) === null || _appointmentBooking$s2 === void 0 ? void 0 : _appointmentBooking$s2.accountList, data);
201
+ case 5:
202
+ case "end":
203
+ return _context4.stop();
204
+ }
205
+ }, _callee4);
206
+ }));
207
+ return function getAccountLists() {
208
+ return _ref5.apply(this, arguments);
209
+ };
210
+ }();
163
211
  useEffect(function () {
164
212
  pisellOS.effects.on('appointmentBooking_accountList:changed', /*#__PURE__*/function () {
165
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(res) {
166
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
167
- while (1) switch (_context3.prev = _context3.next) {
213
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(res) {
214
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
215
+ while (1) switch (_context5.prev = _context5.next) {
168
216
  case 0:
169
217
  if (res.path === 'accounts') {
170
- appointmentBooking.getAccounts().then(function (data) {
171
- setAccountLists(data || []);
172
- });
218
+ getAccountLists();
173
219
  }
174
220
  case 1:
175
221
  case "end":
176
- return _context3.stop();
222
+ return _context5.stop();
177
223
  }
178
- }, _callee3);
224
+ }, _callee5);
179
225
  }));
180
- return function (_x3) {
181
- return _ref4.apply(this, arguments);
226
+ return function (_x2) {
227
+ return _ref6.apply(this, arguments);
182
228
  };
183
229
  }());
184
- appointmentBooking.getAccounts().then(function (data) {
185
- setAccountLists(data || []);
186
- });
230
+ getAccountLists();
187
231
  }, []);
188
232
  return {
189
- currentUser: currentUser,
190
233
  accountLists: accountLists
191
234
  };
192
235
  };
236
+
237
+ /**
238
+ * @title: 获取资源数据
239
+ * @description:
240
+ * @return {*}
241
+ * @Author: WangHan
242
+ * @Date: 2025-04-15 11:29
243
+ */
193
244
  export var useAppointmentBookingResource = function useAppointmentBookingResource() {
194
245
  var _useAppointmentBookin4 = useAppointmentBookingContext(),
195
246
  appointmentBooking = _useAppointmentBookin4.appointmentBooking,
@@ -197,80 +248,66 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
197
248
  setTimes = _useAppointmentBookin4.setTimes,
198
249
  setResourceOtherParams = _useAppointmentBookin4.setResourceOtherParams,
199
250
  resourceOtherParams = _useAppointmentBookin4.resourceOtherParams;
200
- var _ref5 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
201
- resourceSort = _ref5.resourceSort;
202
- console.log(appointmentBooking, 'appointmentBooking22');
251
+ var _ref7 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
252
+ resourceSort = _ref7.resourceSort;
203
253
 
204
254
  // 设置时间切片
205
255
  var getResourceTimeSlot = /*#__PURE__*/function () {
206
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
256
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
207
257
  var data;
208
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
209
- while (1) switch (_context4.prev = _context4.next) {
258
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
259
+ while (1) switch (_context6.prev = _context6.next) {
210
260
  case 0:
211
- _context4.next = 2;
212
- return appointmentBooking.getResourceTimeSlot(params);
261
+ _context6.next = 2;
262
+ return appointmentBooking.getTimeSlotByAllResources(params);
213
263
  case 2:
214
- data = _context4.sent;
264
+ data = _context6.sent;
215
265
  setTimes(data || []);
216
266
  case 4:
217
267
  case "end":
218
- return _context4.stop();
268
+ return _context6.stop();
219
269
  }
220
- }, _callee4);
270
+ }, _callee6);
221
271
  }));
222
- return function getResourceTimeSlot(_x4) {
223
- return _ref6.apply(this, arguments);
272
+ return function getResourceTimeSlot(_x3) {
273
+ return _ref8.apply(this, arguments);
224
274
  };
225
275
  }();
226
276
 
227
277
  // 设置资源列表
228
- var getResourceList = /*#__PURE__*/function () {
229
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
230
- var resources;
231
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
232
- while (1) switch (_context5.prev = _context5.next) {
233
- case 0:
234
- resources = appointmentBooking.getResourcesList();
235
- resources = resources.map(function (item) {
236
- return _objectSpread(_objectSpread({}, item), {}, {
237
- resources: sortResources((item === null || item === void 0 ? void 0 : item.resources) || [], resourceSort)
238
- });
239
- });
240
- setResources(resources || []);
241
- return _context5.abrupt("return", resources);
242
- case 4:
243
- case "end":
244
- return _context5.stop();
245
- }
246
- }, _callee5);
247
- }));
248
- return function getResourceList() {
249
- return _ref7.apply(this, arguments);
250
- };
251
- }();
278
+ var getResourceList = function getResourceList() {
279
+ var resources = appointmentBooking.getResourcesList();
280
+ resources = resources.map(function (item) {
281
+ return _objectSpread(_objectSpread({}, item), {}, {
282
+ resources: sortResources((item === null || item === void 0 ? void 0 : item.resources) || [], resourceSort)
283
+ });
284
+ });
285
+ setResources(resources || []);
286
+ console.log(resources, 'resourcesresources');
287
+ return resources;
288
+ };
252
289
 
253
290
  // 获取自动分配
254
291
  var autoSelectAllProductResources = /*#__PURE__*/function () {
255
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(code) {
292
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(code) {
256
293
  var res;
257
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
258
- while (1) switch (_context6.prev = _context6.next) {
294
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
295
+ while (1) switch (_context7.prev = _context7.next) {
259
296
  case 0:
260
- _context6.next = 2;
297
+ _context7.next = 2;
261
298
  return appointmentBooking.autoSelectAllProductResources(code);
262
299
  case 2:
263
- res = _context6.sent;
264
- console.log(res, 'autoSelectAllProductResources');
300
+ res = _context7.sent;
265
301
  setResourceOtherParams(_objectSpread(_objectSpread({}, resourceOtherParams), res));
302
+ return _context7.abrupt("return", res);
266
303
  case 5:
267
304
  case "end":
268
- return _context6.stop();
305
+ return _context7.stop();
269
306
  }
270
- }, _callee6);
307
+ }, _callee7);
271
308
  }));
272
- return function autoSelectAllProductResources(_x5) {
273
- return _ref8.apply(this, arguments);
309
+ return function autoSelectAllProductResources(_x4) {
310
+ return _ref9.apply(this, arguments);
274
311
  };
275
312
  }();
276
313
  return {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const AppointmentBooking: () => JSX.Element;
4
3
  export default AppointmentBooking;
@@ -1,22 +1,27 @@
1
1
  import React, { useEffect } from 'react';
2
- import Content from "./components/Content";
3
2
  import { isMobile, locales } from '@pisell/utils';
4
3
  import useEngineContext from "../../hooks/useEngineContext";
5
- import "./index.less";
6
- import localeTexts from "./locales";
7
4
  import { AppointmentBookingProvider } from "./context";
5
+ import Content from "./components/Content";
6
+ import localeTexts from "./locales";
8
7
  import { useAppointmentBooking, useAppointmentBookingAccount } from "./hooks";
8
+ import "./index.less";
9
9
  var AppointmentBooking = function AppointmentBooking() {
10
10
  var _utils$storage;
11
11
  var context = useEngineContext();
12
- var appointmentBooking = useAppointmentBooking();
13
- var appointmentBookingAccount = useAppointmentBookingAccount();
14
12
  var utils = context.appHelper.utils || {};
15
13
  locales.init(localeTexts, (utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('umi_locale')) || 'en');
14
+ var appointmentBooking = useAppointmentBooking();
15
+ var _useAppointmentBookin = useAppointmentBookingAccount(),
16
+ accountLists = _useAppointmentBookin.accountLists;
17
+ console.log(appointmentBooking, 'wh97886786currentUser4455777');
16
18
  useEffect(function () {
17
- var currentUser = appointmentBookingAccount.currentUser;
18
- appointmentBooking.addAccount([currentUser]);
19
+ var res = appointmentBooking.getAccounts();
20
+ console.log(res, 'wh98867');
19
21
  }, []);
22
+ useEffect(function () {
23
+ console.log(accountLists, 'wh98867555');
24
+ }, [accountLists]);
20
25
  return /*#__PURE__*/React.createElement("div", {
21
26
  className: "parallel-booking-wrap ".concat(isMobile() ? 'parallel-booking-mobile-wrap' : '')
22
27
  }, /*#__PURE__*/React.createElement(AppointmentBookingProvider, null, /*#__PURE__*/React.createElement(Content, null)));
@@ -70,11 +70,21 @@ declare const _default: {
70
70
  'pisell2.event.capacity.limit.reached.title': string;
71
71
  'pisell2.event.capacity.limit.reached.tip': string;
72
72
  'pisell2.appointment.booking.empty.service': string;
73
+ 'pisell2.appointment.booking.empty.time': string;
73
74
  'pisell2.appointment.service.title': (val: number) => string;
74
75
  'pisell2.appointment.add.guest': string;
75
76
  'pisell2.appointment.edit.service': string;
76
77
  'pisell2.appointment.remove.guest': string;
77
78
  'pisell2.appointment.no.available.service': string;
79
+ 'pisell2.appointment.max.guest': string;
80
+ 'pisell2.appointment.no.available.time': string;
81
+ 'pisell2.appointment.monday': string;
82
+ 'pisell2.appointment.tuesday': string;
83
+ 'pisell2.appointment.wednesday': string;
84
+ 'pisell2.appointment.thursday': string;
85
+ 'pisell2.appointment.friday': string;
86
+ 'pisell2.appointment.saturday': string;
87
+ 'pisell2.appointment.sunday': string;
78
88
  'pisell2.text.apply': string;
79
89
  'pisell2.text.goodpass': string;
80
90
  'pisell2.text.goodpass.product-vouchers': string;
@@ -156,11 +166,21 @@ declare const _default: {
156
166
  'pisell2.event.capacity.limit.reached.title': string;
157
167
  'pisell2.event.capacity.limit.reached.tip': string;
158
168
  'pisell2.appointment.booking.empty.service': string;
169
+ 'pisell2.appointment.booking.empty.time': string;
159
170
  'pisell2.appointment.service.title': (val: number) => string;
160
171
  'pisell2.appointment.add.guest': string;
161
172
  'pisell2.appointment.edit.service': string;
162
173
  'pisell2.appointment.remove.guest': string;
163
174
  'pisell2.appointment.no.available.service': string;
175
+ 'pisell2.appointment.max.guest': string;
176
+ 'pisell2.appointment.no.available.time': string;
177
+ 'pisell2.appointment.monday': string;
178
+ 'pisell2.appointment.tuesday': string;
179
+ 'pisell2.appointment.wednesday': string;
180
+ 'pisell2.appointment.thursday': string;
181
+ 'pisell2.appointment.friday': string;
182
+ 'pisell2.appointment.saturday': string;
183
+ 'pisell2.appointment.sunday': string;
164
184
  'pisell2.text.apply': string;
165
185
  'pisell2.text.goodpass': string;
166
186
  'pisell2.text.goodpass.product-vouchers': string;
@@ -242,11 +262,21 @@ declare const _default: {
242
262
  'pisell2.event.capacity.limit.reached.title': string;
243
263
  'pisell2.event.capacity.limit.reached.tip': string;
244
264
  'pisell2.appointment.booking.empty.service': string;
265
+ 'pisell2.appointment.booking.empty.time': string;
245
266
  'pisell2.appointment.service.title': (val: number) => string;
246
267
  'pisell2.appointment.add.guest': string;
247
268
  'pisell2.appointment.edit.service': string;
248
269
  'pisell2.appointment.remove.guest': string;
249
270
  'pisell2.appointment.no.available.service': string;
271
+ 'pisell2.appointment.max.guest': string;
272
+ 'pisell2.appointment.no.available.time': string;
273
+ 'pisell2.appointment.monday': string;
274
+ 'pisell2.appointment.tuesday': string;
275
+ 'pisell2.appointment.wednesday': string;
276
+ 'pisell2.appointment.thursday': string;
277
+ 'pisell2.appointment.friday': string;
278
+ 'pisell2.appointment.saturday': string;
279
+ 'pisell2.appointment.sunday': string;
250
280
  'pisell2.text.apply': string;
251
281
  'pisell2.text.goodpass': string;
252
282
  'pisell2.text.goodpass.product-vouchers': string;
@@ -82,6 +82,7 @@ export default {
82
82
  'pisell2.event.capacity.limit.reached.title': 'Capacity limit reached',
83
83
  'pisell2.event.capacity.limit.reached.tip': 'One or more events in your cart are no longer available due to full capacity. Please remove unavailable events from your cart to complete checkout.',
84
84
  'pisell2.appointment.booking.empty.service': 'No service',
85
+ 'pisell2.appointment.booking.empty.time': 'No time',
85
86
  'pisell2.appointment.service.title': function pisell2AppointmentServiceTitle(val) {
86
87
  return "".concat(val, " ").concat(val > 1 ? 'services' : 'service');
87
88
  },
@@ -89,6 +90,15 @@ export default {
89
90
  'pisell2.appointment.edit.service': "Edit services",
90
91
  'pisell2.appointment.remove.guest': "Remove guest",
91
92
  'pisell2.appointment.no.available.service': "No available times for this service. Please choose another.",
93
+ 'pisell2.appointment.max.guest': "Book a group appointment for up to 6 guests",
94
+ 'pisell2.appointment.no.available.time': "No availability Try booking different time",
95
+ 'pisell2.appointment.monday': 'Mon',
96
+ 'pisell2.appointment.tuesday': 'Tue',
97
+ 'pisell2.appointment.wednesday': 'Wed',
98
+ 'pisell2.appointment.thursday': 'Thu',
99
+ 'pisell2.appointment.friday': 'Fri',
100
+ 'pisell2.appointment.saturday': 'Sat',
101
+ 'pisell2.appointment.sunday': 'Sun',
92
102
  'pisell2.text.apply': 'Apply',
93
103
  'pisell2.text.goodpass': "GoodPass",
94
104
  'pisell2.text.goodpass.product-vouchers': "Product Vouchers",
@@ -182,6 +192,7 @@ export default {
182
192
  'pisell2.event.capacity.limit.reached.title': '活动名额已满',
183
193
  'pisell2.event.capacity.limit.reached.tip': '购物车中有一个或多个活动已达预约上限,请将已满额的活动从购物车中移除后再完成结算。',
184
194
  'pisell2.appointment.booking.empty.service': '暂无服务',
195
+ 'pisell2.appointment.booking.empty.time': '暂无时间',
185
196
  'pisell2.appointment.service.title': function pisell2AppointmentServiceTitle(val) {
186
197
  return "".concat(val, "\u4E2A\u670D\u52A1");
187
198
  },
@@ -189,6 +200,15 @@ export default {
189
200
  'pisell2.appointment.edit.service': "编辑服务",
190
201
  'pisell2.appointment.remove.guest': "移除预约人",
191
202
  'pisell2.appointment.no.available.service': "此服务无可用时间,请选择其他服务。",
203
+ 'pisell2.appointment.max.guest': "最多为6人预约",
204
+ 'pisell2.appointment.no.available.time': "无可用 请选择其他时间",
205
+ 'pisell2.appointment.monday': '周一',
206
+ 'pisell2.appointment.tuesday': '周二',
207
+ 'pisell2.appointment.wednesday': '周三',
208
+ 'pisell2.appointment.thursday': '周四',
209
+ 'pisell2.appointment.friday': '周五',
210
+ 'pisell2.appointment.saturday': '周六',
211
+ 'pisell2.appointment.sunday': '周日',
192
212
  'pisell2.text.apply': '应用',
193
213
  'pisell2.text.goodpass': "商品券",
194
214
  'pisell2.text.goodpass.product-vouchers': "商品兑换券",
@@ -282,6 +302,7 @@ export default {
282
302
  'pisell2.event.capacity.limit.reached.title': '活動名額已滿',
283
303
  'pisell2.event.capacity.limit.reached.tip': '購物車中有一個或多個活動已達預約上限,請將已滿額的活動從購物車中移除後再完成結算。',
284
304
  'pisell2.appointment.booking.empty.service': '暫無服務',
305
+ 'pisell2.appointment.booking.empty.time': '暫無時間',
285
306
  'pisell2.appointment.service.title': function pisell2AppointmentServiceTitle(val) {
286
307
  return "".concat(val, "\u4E2A\u670D\u52D9");
287
308
  },
@@ -289,6 +310,15 @@ export default {
289
310
  'pisell2.appointment.edit.service': "編輯服務",
290
311
  'pisell2.appointment.remove.guest': "移除預約人",
291
312
  'pisell2.appointment.no.available.service': "此服务无可用时间,请选择其他服务。",
313
+ 'pisell2.appointment.max.guest': "最多为6人预约",
314
+ 'pisell2.appointment.no.available.time': "無可用 請選擇其他時間",
315
+ 'pisell2.appointment.monday': '周壹',
316
+ 'pisell2.appointment.tuesday': '周二',
317
+ 'pisell2.appointment.wednesday': '周三',
318
+ 'pisell2.appointment.thursday': '周四',
319
+ 'pisell2.appointment.friday': '周五',
320
+ 'pisell2.appointment.saturday': '周六',
321
+ 'pisell2.appointment.sunday': '周日',
292
322
  'pisell2.text.apply': '應用',
293
323
  'pisell2.text.goodpass': "商品券",
294
324
  'pisell2.text.goodpass.product-vouchers': "商品兌換券",
@@ -56,3 +56,22 @@ export declare const formatCarts: (data: any[], resources: any[]) => any[];
56
56
  * @Date: 2025-04-14 11:16
57
57
  */
58
58
  export declare const sortResources: (resources: any[], resourceSort: any[]) => any[] | undefined;
59
+ export declare const getMeAccount: (val: any[]) => any;
60
+ export declare const formatCustomer: (val: any) => {
61
+ id: any;
62
+ username: string;
63
+ };
64
+ export declare const formatCurrentUser: () => {
65
+ id: any;
66
+ username: string;
67
+ };
68
+ /**
69
+ * @title: 检查是否有空的账户
70
+ * @description:
71
+ * @param {any} carts
72
+ * @param {any} accounts
73
+ * @return {*}
74
+ * @Author: WangHan
75
+ * @Date: 2025-04-15 17:05
76
+ */
77
+ export declare const isEmptyGuest: (carts: any[], accounts: any[]) => boolean;