@pisell/private-materials 3.3.42 → 3.3.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +5 -5
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +5 -5
  9. package/es/businessModel/SalesModel/index.d.ts +0 -1
  10. package/es/components/Sales/Summary/utils.d.ts +1 -1
  11. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -25
  12. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Cart/Item/index.js +31 -16
  14. package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  15. package/es/components/appointmentBooking/components/Content/index.js +39 -20
  16. package/es/components/appointmentBooking/components/Date/index.js +2 -13
  17. package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  18. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  19. package/es/components/appointmentBooking/components/Form/index.js +76 -167
  20. package/es/components/appointmentBooking/components/Form/utils.d.ts +8 -0
  21. package/es/components/appointmentBooking/components/Form/utils.js +36 -0
  22. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  23. package/es/components/appointmentBooking/components/Header/index.js +78 -46
  24. package/es/components/appointmentBooking/components/Resource/index.js +92 -115
  25. package/es/components/appointmentBooking/components/Services/index.js +19 -4
  26. package/es/components/appointmentBooking/components/TimeSlicing/index.js +20 -27
  27. package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  28. package/es/components/appointmentBooking/context.js +50 -3
  29. package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
  30. package/es/components/appointmentBooking/hooks.d.ts +1 -2
  31. package/es/components/appointmentBooking/hooks.js +377 -269
  32. package/es/components/appointmentBooking/utils.d.ts +91 -2
  33. package/es/components/appointmentBooking/utils.js +350 -61
  34. package/es/components/booking/components/footer/index.d.ts +0 -1
  35. package/es/components/booking/components/voucher/index.d.ts +0 -1
  36. package/es/components/booking/components/voucher/index.js +2 -1
  37. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  38. package/es/components/booking/hooks/useClearCart.d.ts +0 -1
  39. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  40. package/es/components/booking/info/index.d.ts +0 -1
  41. package/es/components/booking/info/service/Lists.d.ts +0 -1
  42. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  43. package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
  44. package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
  45. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  46. package/es/components/booking/info/service2/utils.d.ts +1 -1
  47. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  48. package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  49. package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
  50. package/es/components/booking/utils.d.ts +2 -2
  51. package/es/components/eftposPay/amount.d.ts +1 -1
  52. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  53. package/es/components/eftposPay/component/fail/index.d.ts +1 -0
  54. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  55. package/es/components/eftposPay/device.d.ts +1 -1
  56. package/es/components/eftposPay/hooks.d.ts +1 -1
  57. package/es/components/eftposPay/index.d.ts +1 -0
  58. package/es/components/eftposPay/pay.d.ts +1 -0
  59. package/es/components/eftposPay/store/index.d.ts +2 -2
  60. package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
  61. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  62. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  63. package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
  64. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  65. package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  66. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  67. package/es/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
  68. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  69. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  70. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  71. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  72. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  73. package/es/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
  74. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  75. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  76. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  77. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  78. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
  79. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  80. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  81. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  82. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
  83. package/es/components/eventBooking/index.d.ts +0 -1
  84. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  85. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  86. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  87. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  88. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  89. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  90. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
  91. package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
  92. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  93. package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  94. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  95. package/es/components/productExtension/index.d.ts +0 -1
  96. package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
  97. package/es/components/productSelect/components/productGroup/index.d.ts +11 -7
  98. package/es/components/productSelect/components/productGroup/index.js +32 -19
  99. package/es/components/productSelect/components/productGroup/index.less +17 -3
  100. package/es/components/productSelect/index.d.ts +3 -2
  101. package/es/components/productSelect/index.js +20 -6
  102. package/es/components/productSelect/index.less +7 -0
  103. package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
  104. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  105. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  106. package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  107. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  108. package/es/components/shoppingCart/index.d.ts +0 -1
  109. package/es/components/ticketBooking/components/addServiceVariant/addService.js +11 -3
  110. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  111. package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  112. package/es/components/ticketBooking/index.d.ts +0 -1
  113. package/es/components/wallet/hooks/useWalletCard.d.ts +0 -1
  114. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  115. package/lib/businessModel/SalesModel/index.d.ts +0 -1
  116. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  117. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +0 -5
  118. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  119. package/lib/components/appointmentBooking/components/Cart/Item/index.js +35 -16
  120. package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  121. package/lib/components/appointmentBooking/components/Content/index.js +37 -21
  122. package/lib/components/appointmentBooking/components/Date/index.js +0 -6
  123. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  124. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  125. package/lib/components/appointmentBooking/components/Form/index.js +56 -108
  126. package/lib/components/appointmentBooking/components/Form/utils.d.ts +8 -0
  127. package/lib/components/appointmentBooking/components/Form/utils.js +49 -0
  128. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  129. package/lib/components/appointmentBooking/components/Header/index.js +49 -19
  130. package/lib/components/appointmentBooking/components/Resource/index.js +51 -69
  131. package/lib/components/appointmentBooking/components/Services/index.js +16 -3
  132. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +1 -7
  133. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  134. package/lib/components/appointmentBooking/context.js +52 -4
  135. package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
  136. package/lib/components/appointmentBooking/hooks.d.ts +1 -2
  137. package/lib/components/appointmentBooking/hooks.js +153 -57
  138. package/lib/components/appointmentBooking/utils.d.ts +91 -2
  139. package/lib/components/appointmentBooking/utils.js +210 -50
  140. package/lib/components/booking/components/footer/index.d.ts +0 -1
  141. package/lib/components/booking/components/voucher/index.d.ts +0 -1
  142. package/lib/components/booking/components/voucher/index.js +2 -1
  143. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  144. package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
  145. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  146. package/lib/components/booking/info/index.d.ts +0 -1
  147. package/lib/components/booking/info/service/Lists.d.ts +0 -1
  148. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  149. package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
  150. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
  151. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  152. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  153. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  154. package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  155. package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
  156. package/lib/components/booking/utils.d.ts +2 -2
  157. package/lib/components/eftposPay/amount.d.ts +1 -1
  158. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  159. package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
  160. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  161. package/lib/components/eftposPay/device.d.ts +1 -1
  162. package/lib/components/eftposPay/hooks.d.ts +1 -1
  163. package/lib/components/eftposPay/index.d.ts +1 -0
  164. package/lib/components/eftposPay/pay.d.ts +1 -0
  165. package/lib/components/eftposPay/store/index.d.ts +2 -2
  166. package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
  167. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  168. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  169. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
  170. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  171. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  172. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  173. package/lib/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
  174. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  175. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  176. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  177. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  178. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  179. package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
  180. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  181. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  182. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  183. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  184. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
  185. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  186. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  187. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  188. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
  189. package/lib/components/eventBooking/index.d.ts +0 -1
  190. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  191. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  192. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  193. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  194. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  195. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  196. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
  197. package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
  198. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  199. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  200. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  201. package/lib/components/productExtension/index.d.ts +0 -1
  202. package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
  203. package/lib/components/productSelect/components/productGroup/index.d.ts +11 -7
  204. package/lib/components/productSelect/components/productGroup/index.js +12 -10
  205. package/lib/components/productSelect/components/productGroup/index.less +17 -3
  206. package/lib/components/productSelect/index.d.ts +3 -2
  207. package/lib/components/productSelect/index.js +17 -3
  208. package/lib/components/productSelect/index.less +7 -0
  209. package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
  210. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  211. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  212. package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  213. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  214. package/lib/components/shoppingCart/index.d.ts +0 -1
  215. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +9 -1
  216. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  217. package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  218. package/lib/components/ticketBooking/index.d.ts +0 -1
  219. package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -1
  220. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  221. package/lowcode/product-select/meta.ts +18 -34
  222. package/package.json +2 -2
@@ -20,17 +20,17 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
20
20
  _useState2 = _slicedToArray(_useState, 2),
21
21
  selectedResource = _useState2[0],
22
22
  setSelectedResource = _useState2[1];
23
- var _useAppointmentBookin = useAppointmentBookingContext(),
24
- times = _useAppointmentBookin.times,
25
- appointmentBooking = _useAppointmentBookin.appointmentBooking,
26
- setSelectedTime = _useAppointmentBookin.setSelectedTime,
27
- resourceOtherParams = _useAppointmentBookin.resourceOtherParams,
28
- carts = _useAppointmentBookin.carts;
29
- var _useAppointmentBookin2 = useAppointmentBookingResource(),
30
- getResourceTimeSlot = _useAppointmentBookin2.getResourceTimeSlot,
31
- getResourceList = _useAppointmentBookin2.getResourceList;
32
- var _useAppointmentBookin3 = useAppointmentBookingStep(),
33
- nextStep = _useAppointmentBookin3.nextStep;
23
+ var _ref = useAppointmentBookingContext(),
24
+ times = _ref.times,
25
+ appointmentBooking = _ref.appointmentBooking,
26
+ setSelectedTime = _ref.setSelectedTime,
27
+ resourceOtherParams = _ref.resourceOtherParams,
28
+ carts = _ref.carts;
29
+ var _useAppointmentBookin = useAppointmentBookingResource(),
30
+ getResourceTimeSlot = _useAppointmentBookin.getResourceTimeSlot,
31
+ getResourceList = _useAppointmentBookin.getResourceList;
32
+ var _useAppointmentBookin2 = useAppointmentBookingStep(),
33
+ nextStep = _useAppointmentBookin2.nextStep;
34
34
  useImperativeHandle(ref, function () {
35
35
  return {
36
36
  next: function next() {
@@ -47,31 +47,24 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
47
47
  getResourceTimeSlot();
48
48
  }, []);
49
49
  var getAutoSelect = /*#__PURE__*/function () {
50
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
51
- var _getResourceList, resourceCodes, _yield$appointmentBoo, errorList, result;
50
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
51
+ var result;
52
52
  return _regeneratorRuntime().wrap(function _callee$(_context) {
53
53
  while (1) switch (_context.prev = _context.next) {
54
54
  case 0:
55
55
  setSelectedTime(val);
56
- _getResourceList = getResourceList(), resourceCodes = _getResourceList.resourceCodes;
57
- _context.next = 4;
58
- return appointmentBooking.autoSelectAllProductResources(resourceCodes === null || resourceCodes === void 0 ? void 0 : resourceCodes[1], val);
59
- case 4:
60
- _yield$appointmentBoo = _context.sent;
61
- errorList = _yield$appointmentBoo.errorList;
62
- _context.next = 8;
56
+ _context.next = 3;
63
57
  return appointmentBooking.submitTimeSlot(val);
64
- case 8:
58
+ case 3:
65
59
  result = _context.sent;
66
- console.log(errorList, result, 'wh9896788');
67
- case 10:
60
+ case 4:
68
61
  case "end":
69
62
  return _context.stop();
70
63
  }
71
64
  }, _callee);
72
65
  }));
73
66
  return function getAutoSelect(_x) {
74
- return _ref.apply(this, arguments);
67
+ return _ref2.apply(this, arguments);
75
68
  };
76
69
  }();
77
70
  useEffect(function () {
@@ -84,9 +77,9 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
84
77
  // 如果没有选择时间,则默认选中第一个时间
85
78
  getAutoSelect(times === null || times === void 0 ? void 0 : times[0]);
86
79
  }
87
- }, [times]);
80
+ }, [times, carts]);
88
81
  var _onClick = /*#__PURE__*/function () {
89
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
82
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
90
83
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
91
84
  while (1) switch (_context2.prev = _context2.next) {
92
85
  case 0:
@@ -99,7 +92,7 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
99
92
  }, _callee2);
100
93
  }));
101
94
  return function onClick(_x2) {
102
- return _ref2.apply(this, arguments);
95
+ return _ref3.apply(this, arguments);
103
96
  };
104
97
  }();
105
98
  return (times === null || times === void 0 ? void 0 : times.length) > 0 ? /*#__PURE__*/React.createElement("div", {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import '../../../booking/components/voucher/index.less';
3
2
  import './index.less';
4
3
  declare const VoucherCard: (props: any) => JSX.Element;
@@ -8,9 +8,10 @@ import React, { createContext, useContext, useState, useEffect, useMemo, useRef
8
8
  import { useAppointmentBooking } from "./hooks";
9
9
  import useEngineContext from "../../hooks/useEngineContext";
10
10
  import { TasksManager } from "../../utils/tasks";
11
+ import { getCartCurrentResourceData } from "./utils";
11
12
  var AppointmentBookingContext = /*#__PURE__*/createContext(undefined);
12
13
  export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref) {
13
- var _appHelper$utils, _currentStep$step2, _appointmentBooking$s;
14
+ var _appHelper$utils, _appointmentBooking$s2, _currentStep$step2, _appointmentBooking$s3, _currentStep$step4;
14
15
  var children = _ref.children;
15
16
  var policyIdsRef = useRef([]);
16
17
  var appointmentBooking = useAppointmentBooking();
@@ -69,6 +70,10 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
69
70
  _useState26 = _slicedToArray(_useState25, 2),
70
71
  policyParams = _useState26[0],
71
72
  setPolicyParams = _useState26[1];
73
+ var _useState27 = useState(),
74
+ _useState28 = _slicedToArray(_useState27, 2),
75
+ currentSelectedResources = _useState28[0],
76
+ setCurrentSelectedResources = _useState28[1];
72
77
  var _useEngineContext = useEngineContext(),
73
78
  appHelper = _useEngineContext.appHelper;
74
79
  var symbolic = appHelper === null || appHelper === void 0 || (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : _appHelper$utils.getSymbolic();
@@ -124,6 +129,10 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
124
129
  policyParams.callback();
125
130
  }
126
131
  };
132
+ var stepLists = useMemo(function () {
133
+ var _appointmentBooking$s;
134
+ return (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) || [];
135
+ }, [appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.step) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.store) === null || _appointmentBooking$s2 === void 0 ? void 0 : _appointmentBooking$s2.stepList]);
127
136
 
128
137
  /**
129
138
  * @title: 是否是最后一步
@@ -137,7 +146,42 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
137
146
  var _currentStep$step;
138
147
  var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
139
148
  return key === 'confirm-information';
140
- }, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, 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]);
149
+ }, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s3 = appointmentBooking.store) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.step) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.store) === null || _appointmentBooking$s3 === void 0 ? void 0 : _appointmentBooking$s3.stepList]);
150
+ var currentStepParams = useMemo(function () {
151
+ var _currentStep$step3;
152
+ var key = currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key;
153
+ var index = stepLists.findIndex(function (item) {
154
+ return item.key === key;
155
+ });
156
+ return {
157
+ key: key,
158
+ index: index,
159
+ stepLists: stepLists
160
+ };
161
+ }, [currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key, stepLists]);
162
+ useEffect(function () {
163
+ var _currentStepParams$ke, _currentStepParams$ke2;
164
+ // 如果当前步骤是选择资源,则更新当前资源的数据
165
+ if (currentStepParams !== null && currentStepParams !== void 0 && (_currentStepParams$ke = currentStepParams.key) !== null && _currentStepParams$ke !== void 0 && _currentStepParams$ke.startsWith('select-resource') || currentStepParams !== null && currentStepParams !== void 0 && (_currentStepParams$ke2 = currentStepParams.key) !== null && _currentStepParams$ke2 !== void 0 && _currentStepParams$ke2.startsWith('fill-form')) {
166
+ if (!(carts !== null && carts !== void 0 && carts.length) || !(resources !== null && resources !== void 0 && resources.length)) {
167
+ return setCurrentSelectedResources(null);
168
+ }
169
+ var _currentSelectedResources = carts.map(function (item) {
170
+ return {
171
+ _id: item === null || item === void 0 ? void 0 : item._id,
172
+ currentSelectedResource: getCartCurrentResourceData(item, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, resources)
173
+ };
174
+ });
175
+ setCurrentSelectedResources(_currentSelectedResources);
176
+
177
+ // 并且将当前资源的数据设置到本地
178
+ appointmentBooking.setOtherData('current_selected_resources', _currentSelectedResources);
179
+ }
180
+ }, [currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, carts, resources]);
181
+ useEffect(function () {
182
+ var currentSelectedResources = appointmentBooking.getOtherData('current_selected_resources');
183
+ setCurrentSelectedResources(currentSelectedResources || []);
184
+ }, []);
141
185
  var value = {
142
186
  appointmentBooking: appointmentBooking,
143
187
  times: times,
@@ -171,7 +215,10 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
171
215
  policyIdsRef: policyIdsRef,
172
216
  setPolicyIds: setPolicyIds,
173
217
  openPolicy: openPolicy,
174
- closePolicy: closePolicy
218
+ closePolicy: closePolicy,
219
+ currentStepParams: currentStepParams,
220
+ currentSelectedResources: currentSelectedResources,
221
+ setCurrentSelectedResources: setCurrentSelectedResources
175
222
  };
176
223
  return /*#__PURE__*/React.createElement(AppointmentBookingContext.Provider, {
177
224
  value: value
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Deposit: (props: any) => JSX.Element;
4
3
  export default Deposit;
@@ -75,7 +75,6 @@ export declare const useAppointmentBookingResource: () => {
75
75
  resources: any;
76
76
  resourceCodes: any;
77
77
  };
78
- autoSelectAllProductResources: (index?: number) => Promise<any>;
79
78
  };
80
79
  /**
81
80
  * @title: 是否跳过资源选择步骤
@@ -85,7 +84,7 @@ export declare const useAppointmentBookingResource: () => {
85
84
  * @Date: 2025-04-21 11:47
86
85
  */
87
86
  export declare const useIsSkipResourceStep: () => {
88
- checkSkipResourceStep: (isSkipUpdateFormStep?: boolean) => Promise<boolean>;
87
+ checkSkipResourceStep: () => Promise<boolean>;
89
88
  };
90
89
  /**
91
90
  * @title: 获取预约配置