@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
@@ -6,14 +6,10 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useMemo, useState } from 'react';
8
8
  import { Dropdown } from 'antd';
9
- import { Button, Iconfont, PisellCard, PisellAvatar } from '@pisell/materials';
9
+ import { Button, Iconfont, PisellCard, PisellAvatar, PisellToast } from '@pisell/materials';
10
10
  import { locales, isMobile, getUniqueId } from '@pisell/utils';
11
- // import SelectHolderModal from '../Provider/SelectHolderModal';
12
- // import InformationOptionsModal from '../Provider/InformationOptionsModal/index';
13
- // import RemoveOptionConfirmModal from '../Provider/RemoveOptionConfirmModal';
14
- import { useAppointmentBookingAccount } from "../../hooks";
15
11
  import { useAppointmentBookingContext } from "../../context";
16
- // import appointmentBookingAccount from '../../hooks';
12
+ import { useAppointmentBookingAccount } from "../../hooks";
17
13
  import { formatGuest } from "../../utils";
18
14
  import "./index.less";
19
15
  var Guest = function Guest() {
@@ -21,19 +17,6 @@ var Guest = function Guest() {
21
17
  _useState2 = _slicedToArray(_useState, 2),
22
18
  openOption = _useState2[0],
23
19
  setOpenOption = _useState2[1];
24
- // 编辑哪个holder
25
- var _useState3 = useState(null),
26
- _useState4 = _slicedToArray(_useState3, 2),
27
- holderItem = _useState4[0],
28
- setHolderItem = _useState4[1];
29
- // 移除确认
30
- var _useState5 = useState(false),
31
- _useState6 = _slicedToArray(_useState5, 2),
32
- removeOpen = _useState6[0],
33
- setRemoveOpen = _useState6[1];
34
-
35
- // const appointmentBooking = useAppointmentBooking();
36
- // const { products } = useAppointmentBookingCart();
37
20
  var _useAppointmentBookin = useAppointmentBookingContext(),
38
21
  carts = _useAppointmentBookin.carts,
39
22
  appointmentBooking = _useAppointmentBookin.appointmentBooking;
@@ -104,7 +87,6 @@ var Guest = function Guest() {
104
87
  return /*#__PURE__*/React.createElement(Button, {
105
88
  size: "large",
106
89
  onClick: function onClick() {
107
- setHolderItem(item);
108
90
  setOpenOption(true);
109
91
  }
110
92
  }, locales.getText('pisell2.event.option'));
@@ -113,7 +95,6 @@ var Guest = function Guest() {
113
95
  menu: {
114
96
  items: _options,
115
97
  onClick: function onClick(e) {
116
- setHolderItem(item);
117
98
  handleClick(e, item);
118
99
  }
119
100
  },
@@ -122,6 +103,12 @@ var Guest = function Guest() {
122
103
  }, /*#__PURE__*/React.createElement(Button, null, locales.getText('pisell2.event.option')));
123
104
  };
124
105
  var handleAddGuest = function handleAddGuest() {
106
+ // 最多添加6个人
107
+ if (accountLists.length >= 6) {
108
+ return PisellToast({
109
+ content: locales.getText('pisell2.appointment.max.guest')
110
+ });
111
+ }
125
112
  var guest = {
126
113
  id: getUniqueId(),
127
114
  username: "Guest".concat(accountLists.length + 1),
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Header: () => JSX.Element;
4
3
  export default Header;
@@ -1,14 +1,35 @@
1
- import React from 'react';
1
+ import React, { useMemo } from 'react';
2
+ import { locales } from '@pisell/utils';
2
3
  import ProgressBar from "../../../eventBooking/components/progressBar";
3
4
  import { useAppointmentBookingContext } from "../../context";
4
5
  import "./index.less";
5
6
  var Header = function Header() {
6
- var _currentStep$step, _currentStep$step2;
7
- // const appointmentBooking = useAppointmentBooking();
8
- // const { currentStep } = useAppointmentBookingStep();
7
+ var _currentStep$step3, _currentStep$step5;
9
8
  var _useAppointmentBookin = useAppointmentBookingContext(),
10
9
  currentStep = _useAppointmentBookin.currentStep,
11
- appointmentBooking = _useAppointmentBookin.appointmentBooking;
10
+ appointmentBooking = _useAppointmentBookin.appointmentBooking,
11
+ resources = _useAppointmentBookin.resources;
12
+
13
+ /**
14
+ * @title: 获取资源名称
15
+ * @description:
16
+ * @param {*} useMemo
17
+ * @return {*}
18
+ * @Author: WangHan
19
+ * @Date: 2025-04-15 21:37
20
+ */
21
+ var stepName = useMemo(function () {
22
+ var _currentStep$step, _currentStep$step2;
23
+ var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
24
+
25
+ // 选择资源则获取资源列表的第一个名称
26
+ if (key === 'select-resource') {
27
+ var _resources$;
28
+ var name = (resources === null || resources === void 0 || (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[0]) === null || _resources$ === void 0 ? void 0 : _resources$.title) || '';
29
+ return locales.getText('pisell2.event.select.category')(name);
30
+ }
31
+ return currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.description;
32
+ }, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key, resources]);
12
33
 
13
34
  /**
14
35
  * @title: 返回
@@ -18,6 +39,22 @@ var Header = function Header() {
18
39
  * @Date: 2025-01-18 22:28
19
40
  */
20
41
  var handleBack = function handleBack() {
42
+ var _currentStep$step4;
43
+ var key = currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key;
44
+
45
+ // 删除缓存
46
+ var types = {
47
+ 'select-time': 'time',
48
+ 'select-resource': 'resource'
49
+ };
50
+ if (types[key]) {
51
+ appointmentBooking.deleteCartItemInfo(types[key]);
52
+ }
53
+
54
+ // 清空选中的日期
55
+ if (key === 'select-date') {
56
+ appointmentBooking.clearDateRange();
57
+ }
21
58
  appointmentBooking.back();
22
59
  };
23
60
 
@@ -32,8 +69,8 @@ var Header = function Header() {
32
69
  appointmentBooking.close();
33
70
  };
34
71
  return /*#__PURE__*/React.createElement(ProgressBar, {
35
- title: currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.title,
36
- description: currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.description,
72
+ title: currentStep === null || currentStep === void 0 || (_currentStep$step5 = currentStep.step) === null || _currentStep$step5 === void 0 ? void 0 : _currentStep$step5.title,
73
+ description: stepName,
37
74
  showBack: (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) > 0,
38
75
  onBack: function onBack() {
39
76
  return handleBack();
@@ -1,3 +1,3 @@
1
1
  import './index.less';
2
- declare const Resource: ({ onChange }: any) => JSX.Element;
2
+ declare const Resource: () => JSX.Element;
3
3
  export default Resource;
@@ -7,13 +7,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useState, useEffect, useMemo } from 'react';
8
8
  import { Skeleton } from 'antd';
9
9
  import ResourceDisplay from "../../../eventBooking/components/resourceDisplay";
10
- import { PisellCustomCheckboxGroup } from '@pisell/materials';
10
+ import { PisellCustomCheckboxGroup, PisellToast } from '@pisell/materials';
11
11
  import { useAppointmentBookingResource } from "../../hooks";
12
12
  import { useAppointmentBookingContext } from "../../context";
13
- import { isMobile } from '@pisell/utils';
13
+ import guestsImg from "../../assets/guests.svg";
14
+ import { isMobile, locales } from '@pisell/utils';
14
15
  import "./index.less";
15
- var Resource = function Resource(_ref) {
16
- var onChange = _ref.onChange;
16
+ var Resource = function Resource() {
17
17
  var _useState = useState(0),
18
18
  _useState2 = _slicedToArray(_useState, 2),
19
19
  selectedResource = _useState2[0],
@@ -26,33 +26,34 @@ var Resource = function Resource(_ref) {
26
26
  resourceOtherParams = _useAppointmentBookin.resourceOtherParams;
27
27
  var _useAppointmentBookin2 = useAppointmentBookingResource(),
28
28
  getResourceList = _useAppointmentBookin2.getResourceList,
29
- getResourceTimeSlot = _useAppointmentBookin2.getResourceTimeSlot,
30
29
  autoSelectAllProductResources = _useAppointmentBookin2.autoSelectAllProductResources;
31
- // const { products } = useAppointmentBookingCart();
32
30
  console.log(resources, carts, appointmentBooking, 'lists, products');
33
31
  useEffect(function () {
32
+ var _resources$;
34
33
  var _resources = getResourceList();
35
- autoSelectAllProductResources('resources');
34
+ var code = _resources === null || _resources === void 0 || (_resources$ = _resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[0]) === null || _resources$ === void 0 ? void 0 : _resources$.code;
35
+ autoSelectAllProductResources(code);
36
36
  }, []);
37
37
  useEffect(function () {
38
38
  var _resourceOtherParams$;
39
- console.log(resourceOtherParams === null || resourceOtherParams === void 0 ? void 0 : resourceOtherParams.errorList, 'errorListerrorListerrorList');
39
+ // 无可用时间提示
40
40
  if ((resourceOtherParams === null || resourceOtherParams === void 0 || (_resourceOtherParams$ = resourceOtherParams.errorList) === null || _resourceOtherParams$ === void 0 ? void 0 : _resourceOtherParams$.length) > 0) {
41
- return;
41
+ return PisellToast({
42
+ content: locales.getText('pisell2.appointment.no.available.time')
43
+ });
42
44
  }
43
45
  }, [resourceOtherParams === null || resourceOtherParams === void 0 ? void 0 : resourceOtherParams.errorList]);
44
46
  var anyResource = [{
45
47
  id: 0,
46
- image: 'https://cdn-partners-api.fresha.com/employee-avatars/processed/399178/medium/3b77991b-0ee2-4d0f-9d6f-a7501b39afcd-tempImageHYe20U.jpg',
48
+ image: guestsImg,
47
49
  title: 'Any professional',
48
50
  subtitle: 'for maximum availability'
49
51
  }];
50
52
  var currentResource = useMemo(function () {
51
53
  if (resources.length && carts.length) {
52
- console.log(resources, carts, 'lists, products');
53
54
  if (carts.length === 1) {
54
- var _resources$;
55
- return (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 ? void 0 : _resources$[0];
55
+ var _resources$2;
56
+ return (_resources$2 = resources[0]) === null || _resources$2 === void 0 || (_resources$2 = _resources$2.resources) === null || _resources$2 === void 0 ? void 0 : _resources$2[0];
56
57
  } else {
57
58
  return {
58
59
  renderList: []
@@ -66,15 +67,21 @@ var Resource = function Resource(_ref) {
66
67
  }, [currentResource]);
67
68
  var _onClick = function onClick(e) {
68
69
  setSelectedResource(e.id);
69
- console.log(currentResource, e, 'whcurrentResourcecurrentResource');
70
+ console.log(currentResource, e, carts, 'whcurrentResourcecurrentResource');
70
71
  if (e.id) {
71
- var _resources$2;
72
- getResourceTimeSlot({
73
- product: resources === null || resources === void 0 || (_resources$2 = resources[0]) === null || _resources$2 === void 0 ? void 0 : _resources$2.product,
74
- resources: currentResource === null || currentResource === void 0 ? void 0 : currentResource.renderList,
75
- currentResourceId: e.id
72
+ var _carts$;
73
+ // getResourceTimeSlot('resources');
74
+ return appointmentBooking.updateCart({
75
+ _id: carts === null || carts === void 0 || (_carts$ = carts[0]) === null || _carts$ === void 0 ? void 0 : _carts$._id,
76
+ resources: [e]
76
77
  });
77
78
 
79
+ // getResourceTimeSlot({
80
+ // product: resources?.[0]?.product,
81
+ // resources: currentResource?.renderList,
82
+ // currentResourceId: e.id,
83
+ // });
84
+
78
85
  // onChange({
79
86
  // times: times,
80
87
  // product: resources?.[0]?.product,
@@ -97,7 +104,8 @@ var Resource = function Resource(_ref) {
97
104
  dataSource: item,
98
105
  direction: "vertical",
99
106
  children: !(item !== null && item !== void 0 && item.image) ? item === null || item === void 0 || (_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.charAt(0).toUpperCase() : null,
100
- selected: selectedResource === (item === null || item === void 0 ? void 0 : item.id)
107
+ selected: selectedResource === (item === null || item === void 0 ? void 0 : item.id),
108
+ className: !item.id ? 'appointment-resource-guest-card' : ''
101
109
  });
102
110
  },
103
111
  columns: isMobile() ? 2 : 3,
@@ -3,4 +3,9 @@
3
3
  .pisell-lowcode-card {
4
4
  min-height: 166px !important;
5
5
  }
6
+
7
+ .appointment-resource-guest-card .pisell-lowcode-avatar-image img {
8
+ width: 50%;
9
+ height: 50%;
10
+ }
6
11
  }
@@ -11,14 +11,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import React, { useRef, useState, useMemo, useEffect } from 'react';
14
+ import { Input } from 'antd';
14
15
  import SearchLg from '@pisell/icon/es/SearchLg';
15
16
  import { locales } from '@pisell/utils';
16
- import { PisellEmpty } from '@pisell/materials';
17
- import { Input } from 'antd';
17
+ import { PisellEmpty, PisellToast } from '@pisell/materials';
18
18
  import TabProduct from "../../../booking/components/TabProduct";
19
19
  import { formatProductListByCategory } from "../../../booking/utils";
20
20
  import useEngineContext from "../../../../hooks/useEngineContext";
21
21
  import { useAppointmentBookingContext } from "../../context";
22
+ import { useAppointmentBookingAccount, useAppointmentBooking } from "../../hooks";
23
+ import { formatCurrentUser } from "../../utils";
22
24
  import "./index.less";
23
25
  var Services = function Services() {
24
26
  var searchRef = useRef();
@@ -29,11 +31,23 @@ var Services = function Services() {
29
31
  var context = useEngineContext();
30
32
  var _ref = context.appHelper || {},
31
33
  utils = _ref.utils;
34
+ var appointmentBooking = useAppointmentBooking();
32
35
  var _useAppointmentBookin = useAppointmentBookingContext(),
33
- appointmentBooking = _useAppointmentBookin.appointmentBooking,
34
36
  products = _useAppointmentBookin.products,
35
37
  setProducts = _useAppointmentBookin.setProducts;
38
+ var _useAppointmentBookin2 = useAppointmentBookingAccount(),
39
+ accountLists = _useAppointmentBookin2.accountLists;
40
+ var accountRef = useRef(accountLists);
41
+ var currentUser = formatCurrentUser();
36
42
  useEffect(function () {
43
+ console.log(accountLists, accountRef, 'wh978896786');
44
+ }, [accountLists, accountRef]);
45
+ useEffect(function () {
46
+ var _accountRef$current;
47
+ console.log(accountRef.current, currentUser, 'accountRef');
48
+ if (!((_accountRef$current = accountRef.current) !== null && _accountRef$current !== void 0 && _accountRef$current.length) && currentUser) {
49
+ appointmentBooking.addAccount([currentUser]);
50
+ }
37
51
  var _ref2 = appointmentBooking.otherParams || {},
38
52
  productModuleParams = _ref2.productModuleParams;
39
53
  appointmentBooking.loadProducts(productModuleParams).then(function (res) {
@@ -53,12 +67,9 @@ var Services = function Services() {
53
67
  return item.status === 1;
54
68
  });
55
69
  if (!activeStatus) {
56
- // console.log(PisellToast, 'PisellToast');
57
- // return PisellToast({
58
- // content: locales.getText(
59
- // 'pisell2.appointment.no.available.service'
60
- // ),
61
- // });
70
+ return PisellToast({
71
+ content: locales.getText('pisell2.appointment.no.available.service')
72
+ });
62
73
  }
63
74
  var product = _objectSpread(_objectSpread({}, data), {}, {
64
75
  options: (data === null || data === void 0 ? void 0 : data.option) || []
@@ -8,8 +8,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
9
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import React, { useState } from 'react';
12
- import { Iconfont } from '@pisell/materials';
11
+ import React, { useEffect, useState } from 'react';
12
+ import { Iconfont, PisellEmpty } from '@pisell/materials';
13
+ import { locales } from '@pisell/utils';
13
14
  import { useAppointmentBookingContext } from "../../context";
14
15
  import "./index.less";
15
16
  var Resource = function Resource(_ref) {
@@ -22,49 +23,61 @@ var Resource = function Resource(_ref) {
22
23
  times = _useAppointmentBookin.times,
23
24
  resources = _useAppointmentBookin.resources,
24
25
  appointmentBooking = _useAppointmentBookin.appointmentBooking,
25
- carts = _useAppointmentBookin.carts;
26
+ carts = _useAppointmentBookin.carts,
27
+ setSelectedTime = _useAppointmentBookin.setSelectedTime;
26
28
  console.log(params, resources, times, 'wh8765');
27
- var _onClick = /*#__PURE__*/function () {
28
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
29
- var _resources$;
30
- var data, _resources$2, _resources$3, _resources, aa;
29
+ var getAutoSelect = /*#__PURE__*/function () {
30
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
31
+ var _yield$appointmentBoo, errorList, result;
31
32
  return _regeneratorRuntime().wrap(function _callee$(_context) {
32
33
  while (1) switch (_context.prev = _context.next) {
33
34
  case 0:
34
- setSelectedResource(e === null || e === void 0 ? void 0 : e.start_time);
35
+ setSelectedTime(val);
35
36
  _context.next = 3;
36
- return appointmentBooking.autoSelectResource({
37
- resourceProductData: resources === null || resources === void 0 ? void 0 : resources[0],
38
- resources: resources === null || resources === void 0 || (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[1]) === null || _resources$ === void 0 ? void 0 : _resources$.renderList,
39
- timeSlots: e
40
- });
37
+ return appointmentBooking.autoSelectAllProductResources('sites', val);
41
38
  case 3:
42
- data = _context.sent;
43
- if (!data) {
44
- _context.next = 10;
45
- break;
46
- }
47
- _resources = [resources === null || resources === void 0 || (_resources$2 = resources[0]) === null || _resources$2 === void 0 || (_resources$2 = _resources$2.resources) === null || _resources$2 === void 0 || (_resources$2 = _resources$2[0]) === null || _resources$2 === void 0 || (_resources$2 = _resources$2.renderList) === null || _resources$2 === void 0 ? void 0 : _resources$2[0], resources === null || resources === void 0 || (_resources$3 = resources[0]) === null || _resources$3 === void 0 || (_resources$3 = _resources$3.resources) === null || _resources$3 === void 0 || (_resources$3 = _resources$3[1]) === null || _resources$3 === void 0 || (_resources$3 = _resources$3.renderList) === null || _resources$3 === void 0 ? void 0 : _resources$3[0]];
48
- _context.next = 8;
49
- return appointmentBooking.submitTimeSlot({
50
- resourceProductData: resources === null || resources === void 0 ? void 0 : resources[0],
51
- selectedResources: _resources,
52
- timeSlots: e
53
- });
54
- case 8:
55
- aa = _context.sent;
56
- console.log(data, _resources, aa, 'wh9879676');
57
- case 10:
39
+ _yield$appointmentBoo = _context.sent;
40
+ errorList = _yield$appointmentBoo.errorList;
41
+ _context.next = 7;
42
+ return appointmentBooking.submitTimeSlot(val);
43
+ case 7:
44
+ result = _context.sent;
45
+ console.log(errorList, result, 'wh9896788');
46
+ case 9:
58
47
  case "end":
59
48
  return _context.stop();
60
49
  }
61
50
  }, _callee);
62
51
  }));
63
- return function onClick(_x) {
52
+ return function getAutoSelect(_x) {
64
53
  return _ref2.apply(this, arguments);
65
54
  };
66
55
  }();
67
- return /*#__PURE__*/React.createElement("div", {
56
+ useEffect(function () {
57
+ if ((times === null || times === void 0 ? void 0 : times.length) > 0) {
58
+ var _times$;
59
+ setSelectedResource(times === null || times === void 0 || (_times$ = times[0]) === null || _times$ === void 0 ? void 0 : _times$.start_time);
60
+ getAutoSelect(times === null || times === void 0 ? void 0 : times[0]);
61
+ }
62
+ }, [times]);
63
+ var _onClick = /*#__PURE__*/function () {
64
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
65
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
66
+ while (1) switch (_context2.prev = _context2.next) {
67
+ case 0:
68
+ setSelectedResource(e === null || e === void 0 ? void 0 : e.start_time);
69
+ getAutoSelect(e);
70
+ case 2:
71
+ case "end":
72
+ return _context2.stop();
73
+ }
74
+ }, _callee2);
75
+ }));
76
+ return function onClick(_x2) {
77
+ return _ref3.apply(this, arguments);
78
+ };
79
+ }();
80
+ return (times === null || times === void 0 ? void 0 : times.length) > 0 ? /*#__PURE__*/React.createElement("div", {
68
81
  className: 'appointment-time-slicing-wrap'
69
82
  }, times.map(function (item, index) {
70
83
  return /*#__PURE__*/React.createElement("div", {
@@ -77,6 +90,8 @@ var Resource = function Resource(_ref) {
77
90
  type: "pisell2-chevron-right",
78
91
  className: "icon"
79
92
  }));
80
- }));
93
+ })) : /*#__PURE__*/React.createElement(PisellEmpty, {
94
+ description: locales.getText('pisell2.appointment.booking.empty.time')
95
+ });
81
96
  };
82
97
  export default Resource;
@@ -18,6 +18,10 @@
18
18
 
19
19
  &:hover {
20
20
  background-color: #f1f1f1;
21
+ cursor: pointer;
22
+ }
23
+ &.active {
24
+ background-color: #f1f1f1;
21
25
  }
22
26
  }
23
27
  }
@@ -22,7 +22,8 @@ import { locales } from '@pisell/utils';
22
22
  import useEngineContext from "../../../../hooks/useEngineContext";
23
23
  import { PisellInput, PisellTooltip, PisellGoodPassCard, PisellText, PisellToast } from '@pisell/materials';
24
24
  import { QuestionCircleOutlined } from '@ant-design/icons';
25
- import { useAppointmentBooking, useShopDiscount } from "../../hooks";
25
+ import { useAppointmentBooking, useShopDiscount, useAppointmentBookingLogin, useAppointmentBookingAccount } from "../../hooks";
26
+ import { formatCustomer } from "../../utils";
26
27
  import "../../../booking/components/voucher/index.less";
27
28
  import "./index.less";
28
29
  var ShopDiscountHooks = {
@@ -62,6 +63,10 @@ var VoucherCard = function VoucherCard(props) {
62
63
  discountList = _useState6[0],
63
64
  setDisCountList = _useState6[1];
64
65
  var productRef = useRef(products);
66
+ var _useAppointmentBookin = useAppointmentBookingLogin(),
67
+ openLoginModal = _useAppointmentBookin.openLoginModal;
68
+ var _useAppointmentBookin2 = useAppointmentBookingAccount(),
69
+ accountLists = _useAppointmentBookin2.accountLists;
65
70
  var cart = appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.cart;
66
71
  var isUserLoggedIn = useMemo(function () {
67
72
  var _utils$token, _utils$token$get;
@@ -77,32 +82,31 @@ var VoucherCard = function VoucherCard(props) {
77
82
  });
78
83
  }, [discountList]);
79
84
  useEffect(function () {
80
- var shopDiscount = pisellos.getModule('shopDiscount');
81
- shopDiscount.setCustomer(currentUser);
82
- }, [currentUser.id]);
85
+ if (isUserLoggedIn) {
86
+ var _shopDiscount = pisellos.getModule('shopDiscount');
87
+ _shopDiscount.setCustomer(currentUser);
88
+ }
89
+ }, [currentUser.id, isUserLoggedIn]);
83
90
 
84
91
  // // 设置productList
85
92
  useEffect(function () {
86
93
  shopDiscount.setProductList(products);
87
94
  }, [products]);
88
-
89
- // // 更新productList
90
- useEffect(function () {
91
- if (productRef.current === products) {
92
- return;
93
- }
95
+ var onCartChange = function onCartChange() {
96
+ var products = cart === null || cart === void 0 ? void 0 : cart.getItems();
94
97
  var val = shopDiscount.calcDiscount(products);
95
- console.log('input: ', products);
96
- console.log('output: ', val);
97
- productRef.current = val.productList;
98
98
  cart === null || cart === void 0 || cart.batchSetItems(val.productList);
99
- }, [products]);
99
+ };
100
100
 
101
101
  // // 监听customer变化
102
102
  useEffect(function () {
103
+ var val = shopDiscount.getDiscountList();
104
+ setDisCountList(val);
103
105
  pisellos.effects.on(ShopDiscountHooks.onLoadPrepareCalcResult, function (result) {
104
106
  cart === null || cart === void 0 || cart.batchSetItems(result.productList);
105
107
  });
108
+ pisellos.effects.on('appointmentBooking_cart:onAddItem', onCartChange);
109
+ pisellos.effects.on('appointmentBooking_cart:onRemoveItem', onCartChange);
106
110
  pisellos.effects.on(ShopDiscountHooks.onDiscountListChange, function (discount) {
107
111
  console.log(discount, 'discountChange');
108
112
  setDisCountList(discount);
@@ -150,11 +154,17 @@ var VoucherCard = function VoucherCard(props) {
150
154
  className: "login-btn",
151
155
  onClick: function onClick() {
152
156
  if (!action) return;
153
- action({
154
- type: 'pisell1.login',
155
- data: {},
157
+ openLoginModal({
156
158
  callback: function callback(status) {
157
- if (status === 'success') {}
159
+ var _utils$store;
160
+ var user = (_utils$store = utils.store) === null || _utils$store === void 0 || (_utils$store = _utils$store.getState()) === null || _utils$store === void 0 || (_utils$store = _utils$store.global) === null || _utils$store === void 0 ? void 0 : _utils$store.userInfo;
161
+ var currentUser = formatCustomer(user);
162
+ var meAccount = accountLists === null || accountLists === void 0 ? void 0 : accountLists.find(function (d) {
163
+ return !(d !== null && d !== void 0 && d.isGuest);
164
+ });
165
+ if (status === 'success') {
166
+ appointmentBooking.setLoginAccount(meAccount === null || meAccount === void 0 ? void 0 : meAccount.id, currentUser);
167
+ }
158
168
  }
159
169
  });
160
170
  }
@@ -19,6 +19,8 @@ interface AppointmentBookingContextType {
19
19
  symbolic?: any;
20
20
  resourceOtherParams?: any;
21
21
  setResourceOtherParams: (val: any) => void;
22
+ selectedTime: any;
23
+ setSelectedTime: (val: any) => void;
22
24
  }
23
25
  export declare const AppointmentBookingProvider: ({ children, }: {
24
26
  children: ReactNode;
@@ -46,6 +46,10 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
46
46
  _useState16 = _slicedToArray(_useState15, 2),
47
47
  resourceOtherParams = _useState16[0],
48
48
  setResourceOtherParams = _useState16[1];
49
+ var _useState17 = useState(null),
50
+ _useState18 = _slicedToArray(_useState17, 2),
51
+ selectedTime = _useState18[0],
52
+ setSelectedTime = _useState18[1];
49
53
  var _useEngineContext = useEngineContext(),
50
54
  appHelper = _useEngineContext.appHelper;
51
55
  var symbolic = appHelper === null || appHelper === void 0 || (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : _appHelper$utils.getSymbolic();
@@ -69,7 +73,9 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
69
73
  appHelper: appHelper,
70
74
  symbolic: symbolic,
71
75
  resourceOtherParams: resourceOtherParams,
72
- setResourceOtherParams: setResourceOtherParams
76
+ setResourceOtherParams: setResourceOtherParams,
77
+ selectedTime: selectedTime,
78
+ setSelectedTime: setSelectedTime
73
79
  };
74
80
  return /*#__PURE__*/React.createElement(AppointmentBookingContext.Provider, {
75
81
  value: value
@@ -1,25 +1,61 @@
1
1
  export declare const useAppointmentBooking: () => any;
2
2
  export declare const useShopDiscount: () => any;
3
+ /**
4
+ * @title: 监听步骤发生变化
5
+ * @description:
6
+ * @return {*}
7
+ * @Author: WangHan
8
+ * @Date: 2025-04-15 11:11
9
+ */
3
10
  export declare const useAppointmentBookingStep: () => void;
11
+ /**
12
+ * @title: 获取商品数据
13
+ * @description:
14
+ * @return {*}
15
+ * @Author: WangHan
16
+ * @Date: 2025-04-15 11:12
17
+ */
4
18
  export declare const useAppointmentBookingProduct: () => void;
5
- export declare const useAppointmentBookingCart: () => {
6
- cart: any;
7
- };
19
+ /**
20
+ * @title: 更新购物车数据
21
+ * @description:
22
+ * @return {*}
23
+ * @Author: WangHan
24
+ * @Date: 2025-04-15 11:12
25
+ */
26
+ export declare const useAppointmentBookingCart: () => void;
27
+ /**
28
+ * @title: 获取登录状态
29
+ * @description:
30
+ * @return {*}
31
+ * @Author: WangHan
32
+ * @Date: 2025-04-15 11:14
33
+ */
8
34
  export declare const useAppointmentBookingLogin: () => {
9
35
  isLogin: boolean;
10
36
  openLoginModal: (params: {
11
37
  callback: any;
12
38
  }) => void;
13
39
  };
40
+ /**
41
+ * @title: 获取账户
42
+ * @description:
43
+ * @return {*}
44
+ * @Author: WangHan
45
+ * @Date: 2025-04-15 11:15
46
+ */
14
47
  export declare const useAppointmentBookingAccount: () => {
15
- currentUser: {
16
- id: any;
17
- username: string;
18
- };
19
48
  accountLists: any;
20
49
  };
50
+ /**
51
+ * @title: 获取资源数据
52
+ * @description:
53
+ * @return {*}
54
+ * @Author: WangHan
55
+ * @Date: 2025-04-15 11:29
56
+ */
21
57
  export declare const useAppointmentBookingResource: () => {
22
58
  getResourceTimeSlot: (params: any) => Promise<void>;
23
- getResourceList: () => Promise<any>;
24
- autoSelectAllProductResources: (code: string) => Promise<void>;
59
+ getResourceList: () => any;
60
+ autoSelectAllProductResources: (code: string) => Promise<any>;
25
61
  };