@pisell/private-materials 3.3.20 → 3.3.22

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 (191) 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.js +2 -2
  6. package/build/lowcode/view.js +2 -2
  7. package/es/components/appointmentBooking/components/Cart/Item/index.js +19 -7
  8. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +2 -1
  9. package/es/components/appointmentBooking/components/Content/index.js +0 -1
  10. package/es/components/appointmentBooking/components/Date/index.js +1 -5
  11. package/es/components/appointmentBooking/components/Form/index.js +4 -3
  12. package/es/components/appointmentBooking/components/Services/index.js +21 -11
  13. package/es/components/appointmentBooking/hooks.d.ts +0 -1
  14. package/es/components/appointmentBooking/hooks.js +12 -18
  15. package/es/components/appointmentBooking/index.js +3 -5
  16. package/es/components/appointmentBooking/utils.d.ts +3 -3
  17. package/es/components/appointmentBooking/utils.js +15 -15
  18. package/es/components/booking/components/TabProduct/index.d.ts +0 -1
  19. package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  20. package/es/components/booking/components/footer/index.d.ts +0 -1
  21. package/es/components/booking/components/footer/utils.js +1 -1
  22. package/es/components/booking/components/voucher/index.js +4 -2
  23. package/es/components/booking/forms/single/index.d.ts +0 -1
  24. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  25. package/es/components/booking/info/date/index.d.ts +0 -1
  26. package/es/components/booking/info/index.d.ts +0 -1
  27. package/es/components/booking/info/notes/index.d.ts +0 -1
  28. package/es/components/booking/info/service/Lists.d.ts +0 -1
  29. package/es/components/booking/info/service/actions/index.d.ts +0 -1
  30. package/es/components/booking/info/service/addService/index.js +14 -16
  31. package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  32. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  33. package/es/components/booking/info/service2/utils.d.ts +1 -1
  34. package/es/components/booking/info/service2/utils.js +1 -0
  35. package/es/components/booking/info2/service/actions/index.d.ts +0 -1
  36. package/es/components/booking/info2/service/addService/index.d.ts +0 -1
  37. package/es/components/booking/info2/service/addService/index.js +14 -15
  38. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  39. package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
  40. package/es/components/booking/materiels/duration/index.d.ts +0 -1
  41. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  42. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  43. package/es/components/booking/utils.d.ts +2 -2
  44. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  45. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  46. package/es/components/ticketBooking/components/timeBar/index.js +1 -0
  47. package/lib/components/appointmentBooking/components/Cart/Item/index.js +12 -9
  48. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +7 -1
  49. package/lib/components/appointmentBooking/components/Content/index.js +1 -1
  50. package/lib/components/appointmentBooking/components/Date/index.js +1 -1
  51. package/lib/components/appointmentBooking/components/Form/index.js +3 -2
  52. package/lib/components/appointmentBooking/components/Services/index.js +8 -1
  53. package/lib/components/appointmentBooking/hooks.d.ts +0 -1
  54. package/lib/components/appointmentBooking/hooks.js +2 -6
  55. package/lib/components/appointmentBooking/index.js +2 -2
  56. package/lib/components/appointmentBooking/utils.d.ts +3 -3
  57. package/lib/components/appointmentBooking/utils.js +14 -23
  58. package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
  59. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  60. package/lib/components/booking/components/footer/index.d.ts +0 -1
  61. package/lib/components/booking/components/footer/utils.js +1 -1
  62. package/lib/components/booking/components/voucher/index.js +4 -2
  63. package/lib/components/booking/forms/single/index.d.ts +0 -1
  64. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  65. package/lib/components/booking/info/date/index.d.ts +0 -1
  66. package/lib/components/booking/info/index.d.ts +0 -1
  67. package/lib/components/booking/info/notes/index.d.ts +0 -1
  68. package/lib/components/booking/info/service/Lists.d.ts +0 -1
  69. package/lib/components/booking/info/service/actions/index.d.ts +0 -1
  70. package/lib/components/booking/info/service/addService/index.js +14 -14
  71. package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  72. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  73. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  74. package/lib/components/booking/info/service2/utils.js +1 -0
  75. package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
  76. package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
  77. package/lib/components/booking/info2/service/addService/index.js +15 -13
  78. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  79. package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
  80. package/lib/components/booking/materiels/duration/index.d.ts +0 -1
  81. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  82. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  83. package/lib/components/booking/utils.d.ts +2 -2
  84. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  85. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  86. package/lib/components/ticketBooking/components/timeBar/index.js +1 -0
  87. package/package.json +3 -3
  88. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -3
  89. package/es/components/appointmentBooking/components/Date/state.d.ts +0 -63
  90. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
  91. package/es/components/appointmentBooking/locales.d.ts +0 -354
  92. package/es/components/booking/components/customSelect/index.d.ts +0 -38
  93. package/es/components/booking/forms/footer.d.ts +0 -6
  94. package/es/components/booking/forms/sendModal/index.d.ts +0 -27
  95. package/es/components/booking/info/clientVariant/utils.d.ts +0 -1
  96. package/es/components/booking/info2/utils.d.ts +0 -4
  97. package/es/components/booking/locales.d.ts +0 -807
  98. package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -3
  99. package/es/components/eftposPay/component/fail/index.d.ts +0 -3
  100. package/es/components/eftposPay/component/fail/unknow.d.ts +0 -10
  101. package/es/components/eftposPay/hooks.d.ts +0 -35
  102. package/es/components/eftposPay/index.d.ts +0 -4
  103. package/es/components/eftposPay/locales.d.ts +0 -330
  104. package/es/components/eftposPay/pay.d.ts +0 -20
  105. package/es/components/eftposPay/payo/config.d.ts +0 -12
  106. package/es/components/eftposPay/payo/hooks.d.ts +0 -10
  107. package/es/components/eftposPay/tyro/index.d.ts +0 -9
  108. package/es/components/eftposPay/windcave/helper.d.ts +0 -23
  109. package/es/components/eventBooking/components/Provider/Information/index.d.ts +0 -3
  110. package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +0 -10
  111. package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/serve.d.ts +0 -2
  112. package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +0 -10
  113. package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/serve.d.ts +0 -2
  114. package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/serve.d.ts +0 -2
  115. package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +0 -10
  116. package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/serve.d.ts +0 -2
  117. package/es/components/pay/toC/PaymentMethods/StripePay/serve.d.ts +0 -2
  118. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +0 -10
  119. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/serve.d.ts +0 -2
  120. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +0 -10
  121. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/serve.d.ts +0 -2
  122. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -111
  123. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +0 -3
  124. package/es/components/pay/toC/index.d.ts +0 -3
  125. package/es/components/pay/toC/utils.d.ts +0 -49
  126. package/es/components/ruleSetting/index.d.ts +0 -9
  127. package/es/components/ruleSetting/server.d.ts +0 -4
  128. package/es/components/shoppingCart/Provider.d.ts +0 -3
  129. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -3
  130. package/es/components/shoppingCart/components/Render/index.d.ts +0 -3
  131. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -2
  132. package/es/components/workSpaceList/components/AppearanceEdit/IconPanel.d.ts +0 -11
  133. package/es/components/workSpaceList/components/AppearanceEdit/constants.d.ts +0 -8
  134. package/es/components/workSpaceList/components/Card/constants.d.ts +0 -2
  135. package/es/components/workSpaceList/components/EditableString/index.d.ts +0 -21
  136. package/es/components/workSpaceList/components/SearchBar/index.d.ts +0 -17
  137. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -3
  138. package/es/components/workSpaceList/components/Sort/index.d.ts +0 -7
  139. package/es/components/workSpaceList/components/WorkspaceItem/index.d.ts +0 -22
  140. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -3
  141. package/lib/components/appointmentBooking/components/Date/state.d.ts +0 -63
  142. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
  143. package/lib/components/appointmentBooking/locales.d.ts +0 -354
  144. package/lib/components/booking/components/customSelect/index.d.ts +0 -38
  145. package/lib/components/booking/forms/footer.d.ts +0 -6
  146. package/lib/components/booking/forms/sendModal/index.d.ts +0 -27
  147. package/lib/components/booking/info/clientVariant/utils.d.ts +0 -1
  148. package/lib/components/booking/info2/utils.d.ts +0 -4
  149. package/lib/components/booking/locales.d.ts +0 -807
  150. package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -3
  151. package/lib/components/eftposPay/component/fail/index.d.ts +0 -3
  152. package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -10
  153. package/lib/components/eftposPay/hooks.d.ts +0 -35
  154. package/lib/components/eftposPay/index.d.ts +0 -4
  155. package/lib/components/eftposPay/locales.d.ts +0 -330
  156. package/lib/components/eftposPay/pay.d.ts +0 -20
  157. package/lib/components/eftposPay/payo/config.d.ts +0 -12
  158. package/lib/components/eftposPay/payo/hooks.d.ts +0 -10
  159. package/lib/components/eftposPay/tyro/index.d.ts +0 -9
  160. package/lib/components/eftposPay/windcave/helper.d.ts +0 -23
  161. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +0 -3
  162. package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.d.ts +0 -10
  163. package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/serve.d.ts +0 -2
  164. package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.d.ts +0 -10
  165. package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/serve.d.ts +0 -2
  166. package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/serve.d.ts +0 -2
  167. package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.d.ts +0 -10
  168. package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/serve.d.ts +0 -2
  169. package/lib/components/pay/toC/PaymentMethods/StripePay/serve.d.ts +0 -2
  170. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.d.ts +0 -10
  171. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/serve.d.ts +0 -2
  172. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.d.ts +0 -10
  173. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/serve.d.ts +0 -2
  174. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -111
  175. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +0 -3
  176. package/lib/components/pay/toC/index.d.ts +0 -3
  177. package/lib/components/pay/toC/utils.d.ts +0 -49
  178. package/lib/components/ruleSetting/index.d.ts +0 -9
  179. package/lib/components/ruleSetting/server.d.ts +0 -4
  180. package/lib/components/shoppingCart/Provider.d.ts +0 -3
  181. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -3
  182. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -3
  183. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -2
  184. package/lib/components/workSpaceList/components/AppearanceEdit/IconPanel.d.ts +0 -11
  185. package/lib/components/workSpaceList/components/AppearanceEdit/constants.d.ts +0 -8
  186. package/lib/components/workSpaceList/components/Card/constants.d.ts +0 -2
  187. package/lib/components/workSpaceList/components/EditableString/index.d.ts +0 -21
  188. package/lib/components/workSpaceList/components/SearchBar/index.d.ts +0 -17
  189. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -3
  190. package/lib/components/workSpaceList/components/Sort/index.d.ts +0 -7
  191. package/lib/components/workSpaceList/components/WorkspaceItem/index.d.ts +0 -22
@@ -13,16 +13,15 @@ import ShoppingCart from "../../../../shoppingCart";
13
13
  import ContinueButton from "../ContinueButton";
14
14
  import { useAppointmentBooking } from "../../../hooks";
15
15
  import { useAppointmentBookingContext } from "../../../context";
16
- import { useAppointmentBookingAccount, useAppointmentBookingResource, useAppointmentBookingSetting, useAppointmentBookingLogin } from "../../../hooks";
16
+ import { useAppointmentBookingAccount, useAppointmentBookingResource, useAppointmentBookingSetting, useAppointmentBookingLogin, contextUtils } from "../../../hooks";
17
17
  import { formatHolder, formatCarts, formatCurrentUser, openForm } from "../../../utils";
18
18
  import VoucherCard from "../../Voucher";
19
19
  import Total from "./Total";
20
20
  import Deposit from "../../Deposit";
21
- import useEngineContext from "../../../../../hooks/useEngineContext";
22
21
  import { handleAddHolder } from "../utils";
23
22
  import "./index.less";
24
23
  var CartItem = function CartItem(_ref) {
25
- var _context$appHelper, _businessUtils$getApp, _currentStep$step, _currentStep$step2;
24
+ var _businessUtils$getApp, _currentStep$step, _currentStep$step2;
26
25
  var onNext = _ref.onNext;
27
26
  var appointmentBooking = useAppointmentBooking();
28
27
  var _useAppointmentBookin = useAppointmentBookingContext(),
@@ -45,12 +44,22 @@ var CartItem = function CartItem(_ref) {
45
44
  bookingSubject = _useAppointmentBookin4.bookingSubject;
46
45
  var _useAppointmentBookin5 = useAppointmentBookingLogin(),
47
46
  isLogin = _useAppointmentBookin5.isLogin;
48
- var context = useEngineContext();
49
- var utils = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils;
47
+ var utils = contextUtils();
50
48
  var businessUtils = utils.businessUtils;
51
- var currentUser = formatCurrentUser();
52
49
  var deposit = summary.deposit;
53
50
 
51
+ /**
52
+ * @title: 当前客户
53
+ * @description:
54
+ * @param {*} useMemo
55
+ * @return {*}
56
+ * @Author: WangHan
57
+ * @Date: 2025-05-14 14:59
58
+ */
59
+ var currentUser = useMemo(function () {
60
+ return formatCurrentUser(utils) || {};
61
+ }, []);
62
+
54
63
  /**
55
64
  * @title: 格式化购物车ids
56
65
  * @description:
@@ -188,13 +197,16 @@ var CartItem = function CartItem(_ref) {
188
197
  });
189
198
  }
190
199
  };
200
+ var products = useMemo(function () {
201
+ return formatCarts(carts, resources, utils, accountLists);
202
+ }, [carts, resources, accountLists]);
191
203
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
192
204
  className: "appointment-cart-item-wrap ".concat(isMobile() ? 'appointment-cart-mobile-item-wrap' : '')
193
205
  }, /*#__PURE__*/React.createElement("div", {
194
206
  className: "content"
195
207
  }, /*#__PURE__*/React.createElement(ShoppingCart, {
196
208
  productParams: {
197
- products: formatCarts(carts, resources, accountLists),
209
+ products: products,
198
210
  hideAddBtn: false,
199
211
  holders: holders,
200
212
  disabledEdit: isLastStep,
@@ -155,7 +155,8 @@ var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
155
155
  }, /*#__PURE__*/React.createElement("div", {
156
156
  className: "image"
157
157
  }, /*#__PURE__*/React.createElement("img", {
158
- src: "".concat(config === null || config === void 0 ? void 0 : config.awsStatic, "/checkout_confirm.png")
158
+ src: "".concat(config === null || config === void 0 ? void 0 : config.awsStatic, "/checkout_confirm.png"),
159
+ loading: "lazy"
159
160
  })), /*#__PURE__*/React.createElement("span", {
160
161
  className: "tips"
161
162
  }, locales.getText('pisell2.appointment.tips')), /*#__PURE__*/React.createElement("span", {
@@ -40,7 +40,6 @@ var Layout = function Layout() {
40
40
  policyParams = _useAppointmentBookin.policyParams,
41
41
  closePolicy = _useAppointmentBookin.closePolicy;
42
42
  var _useAppointmentBookin2 = useAppointmentBookingSetting(),
43
- getLoadAllSchedule = _useAppointmentBookin2.getLoadAllSchedule,
44
43
  isDateSelectedFirst = _useAppointmentBookin2.isDateSelectedFirst,
45
44
  isFormSubject = _useAppointmentBookin2.isFormSubject;
46
45
  var _useAppointmentBookin3 = useAppointmentBookingLogin(),
@@ -52,7 +52,6 @@ var Date = /*#__PURE__*/forwardRef(function (props, ref) {
52
52
  var _useAppointmentBookin2 = useAppointmentBookingSetting(),
53
53
  isDateSelectedFirst = _useAppointmentBookin2.isDateSelectedFirst,
54
54
  customPageId = _useAppointmentBookin2.customPageId,
55
- getLoadAllSchedule = _useAppointmentBookin2.getLoadAllSchedule,
56
55
  channel = _useAppointmentBookin2.channel;
57
56
  var _useAppointmentBookin3 = useAppointmentBookingStep(),
58
57
  nextStep = _useAppointmentBookin3.nextStep;
@@ -282,10 +281,7 @@ var Date = /*#__PURE__*/forwardRef(function (props, ref) {
282
281
  });
283
282
  }
284
283
  return day;
285
- }); // 先选日期,加载schedule数据
286
- // if (isDateSelectedFirst) {
287
- // getLoadAllSchedule();
288
- // }
284
+ });
289
285
  setLoading(false);
290
286
  setDateMonthList(updatedDates);
291
287
  _context4.next = 23;
@@ -14,7 +14,7 @@ import React, { useMemo, useRef, useState, useImperativeHandle, forwardRef, useE
14
14
  import useComponents from "../../../../hooks/useComponents";
15
15
  import { formatForms, formatCarts, updateLists, updateBookingFormStorage } from "../../utils";
16
16
  import { useAppointmentBookingContext } from "../../context";
17
- import { useAppointmentBookingResource, useAppointmentBookingSetting, useAppointmentBookingStep } from "../../hooks";
17
+ import { useAppointmentBookingResource, useAppointmentBookingSetting, useAppointmentBookingStep, contextUtils } from "../../hooks";
18
18
  import PolicyModal from "../../deposit/components/PolicyModal";
19
19
  import "./index.less";
20
20
  var Form = /*#__PURE__*/forwardRef(function (props, ref) {
@@ -54,6 +54,7 @@ var Form = /*#__PURE__*/forwardRef(function (props, ref) {
54
54
  getOtherData = _useAppointmentBookin3.getOtherData;
55
55
  var _useAppointmentBookin4 = useAppointmentBookingStep(),
56
56
  nextStep = _useAppointmentBookin4.nextStep;
57
+ var utils = contextUtils();
57
58
  useImperativeHandle(ref, function () {
58
59
  return {
59
60
  next: function next() {
@@ -80,11 +81,11 @@ var Form = /*#__PURE__*/forwardRef(function (props, ref) {
80
81
  var _resource = getResourceList();
81
82
  return (_resource === null || _resource === void 0 ? void 0 : _resource.resources) || [];
82
83
  }, []);
83
- var newCarts = formatCarts(carts, resources);
84
84
  var forms = useMemo(function () {
85
+ var newCarts = formatCarts(carts, resources, utils);
85
86
  if (!(newCarts !== null && newCarts !== void 0 && newCarts.length) || !(resources !== null && resources !== void 0 && resources.length)) return [];
86
87
  return formatForms(newCarts) || [];
87
- }, [newCarts, resources]);
88
+ }, [carts, resources]);
88
89
  useEffect(function () {
89
90
  var _forms$currentFormInd;
90
91
  if (!(forms !== null && forms !== void 0 && forms.length)) return;
@@ -84,17 +84,27 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
84
84
  },
85
85
  callback: function () {
86
86
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
87
- var product, session, startDate, endDate, _data$origin, resources, activeStatus, index, description;
87
+ var session, product, startDate, endDate, _data$origin, resources, activeStatus, index, description;
88
88
  return _regeneratorRuntime().wrap(function _callee$(_context) {
89
89
  while (1) switch (_context.prev = _context.next) {
90
90
  case 0:
91
+ if (!(data !== null && data !== void 0 && data.isCancel)) {
92
+ _context.next = 3;
93
+ break;
94
+ }
95
+ if (type === 'session') {
96
+ appointmentBooking.closeProductDetail();
97
+ appointmentBooking.getAvailableDate();
98
+ }
99
+ return _context.abrupt("return");
100
+ case 3:
101
+ session = data === null || data === void 0 ? void 0 : data.session;
91
102
  product = _objectSpread(_objectSpread({}, data), {}, {
92
103
  options: (data === null || data === void 0 ? void 0 : data.option) || []
93
104
  });
94
105
  delete product.option;
95
- session = data === null || data === void 0 ? void 0 : data.session;
96
106
  if (!session) {
97
- _context.next = 11;
107
+ _context.next = 14;
98
108
  break;
99
109
  }
100
110
  startDate = dayjs(session === null || session === void 0 ? void 0 : session.start_at).format('YYYY-MM-DD');
@@ -111,28 +121,28 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
111
121
  startDate: startDate,
112
122
  endDate: endDate
113
123
  });
114
- _context.next = 19;
124
+ _context.next = 22;
115
125
  break;
116
- case 11:
126
+ case 14:
117
127
  resources = (data === null || data === void 0 || (_data$origin = data.origin) === null || _data$origin === void 0 || (_data$origin = _data$origin.product_resource) === null || _data$origin === void 0 ? void 0 : _data$origin.resources) || [];
118
128
  activeStatus = resources.find(function (item) {
119
129
  return item.status === 1;
120
130
  });
121
131
  if (activeStatus) {
122
- _context.next = 15;
132
+ _context.next = 18;
123
133
  break;
124
134
  }
125
135
  return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
126
- case 15:
136
+ case 18:
127
137
  appointmentBooking.storeProduct(product);
128
138
  // duration 类型的商品,要获取一下资源
129
139
  if (!(type === 'duration')) {
130
- _context.next = 19;
140
+ _context.next = 22;
131
141
  break;
132
142
  }
133
- _context.next = 19;
143
+ _context.next = 22;
134
144
  return appointmentBooking.getAvailableDate();
135
- case 19:
145
+ case 22:
136
146
  // 先选择日期流程
137
147
  if (isDateSelectedFirst) {
138
148
  index = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2; //先选择日期流程:如果商品类型是duration的商品,则需要增加选择时间步骤
@@ -151,7 +161,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
151
161
  removeStep('select-time');
152
162
  }
153
163
  }
154
- case 20:
164
+ case 23:
155
165
  case "end":
156
166
  return _context.stop();
157
167
  }
@@ -99,7 +99,6 @@ export declare const useAppointmentBookingSetting: () => {
99
99
  isFormSubject: boolean;
100
100
  customPageId: any;
101
101
  channel: any;
102
- getLoadAllSchedule: () => void;
103
102
  bookingSubject: any;
104
103
  setOtherData: (key: string, val: any) => any;
105
104
  getOtherData: (key: string) => any;
@@ -372,7 +372,6 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
372
372
  var _ref12 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o2 = appointmentBooking.otherParams) === null || _appointmentBooking$o2 === void 0 ? void 0 : _appointmentBooking$o2.productModuleParams) || {},
373
373
  bookingSubject = _ref12.bookingSubject;
374
374
  var form_id = bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id;
375
- var customer = getCustomer();
376
375
 
377
376
  // 获取账户列表数据
378
377
  var getAccountLists = /*#__PURE__*/function () {
@@ -423,17 +422,18 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
423
422
  var getHolders = /*#__PURE__*/function () {
424
423
  var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
425
424
  var _utils$getStore$getSt;
426
- var shop_id, params, data, newData;
425
+ var shop_id, customer, params, data, newData;
427
426
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
428
427
  while (1) switch (_context8.prev = _context8.next) {
429
428
  case 0:
430
429
  shop_id = (_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 || (_utils$getStore$getSt = _utils$getStore$getSt.shop) === null || _utils$getStore$getSt === void 0 ? void 0 : _utils$getStore$getSt.id;
430
+ customer = getCustomer(utils);
431
431
  if (!(!shop_id || !form_id || !(customer !== null && customer !== void 0 && customer.id))) {
432
- _context8.next = 3;
432
+ _context8.next = 4;
433
433
  break;
434
434
  }
435
435
  return _context8.abrupt("return", []);
436
- case 3:
436
+ case 4:
437
437
  params = {
438
438
  url: '/form/data/v1',
439
439
  query: {
@@ -442,9 +442,9 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
442
442
  shop_id: shop_id
443
443
  }
444
444
  };
445
- _context8.next = 6;
445
+ _context8.next = 7;
446
446
  return appointmentBooking.fetchHolderAccountsAsync(params);
447
- case 6:
447
+ case 7:
448
448
  data = _context8.sent;
449
449
  newData = data === null || data === void 0 ? void 0 : data.map(function (item) {
450
450
  return {
@@ -453,7 +453,7 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
453
453
  };
454
454
  });
455
455
  return _context8.abrupt("return", newData || []);
456
- case 9:
456
+ case 10:
457
457
  case "end":
458
458
  return _context8.stop();
459
459
  }
@@ -467,19 +467,20 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
467
467
  // 添加账户
468
468
  var addAccount = /*#__PURE__*/function () {
469
469
  var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(val, type) {
470
- var result;
470
+ var customer, result;
471
471
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
472
472
  while (1) switch (_context9.prev = _context9.next) {
473
473
  case 0:
474
- _context9.next = 2;
474
+ customer = getCustomer(utils);
475
+ _context9.next = 3;
475
476
  return appointmentBooking.addAccount(val, {
476
477
  type: type,
477
478
  customerId: customer === null || customer === void 0 ? void 0 : customer.id
478
479
  });
479
- case 2:
480
+ case 3:
480
481
  result = _context9.sent;
481
482
  return _context9.abrupt("return", result);
482
- case 4:
483
+ case 5:
483
484
  case "end":
484
485
  return _context9.stop();
485
486
  }
@@ -731,12 +732,6 @@ export var useAppointmentBookingSetting = function useAppointmentBookingSetting(
731
732
  customPageId = _ref21.customPageId,
732
733
  channel = _ref21.channel;
733
734
 
734
- // 加载日历接口
735
- var getLoadAllSchedule = function getLoadAllSchedule() {
736
- var res = appointmentBooking.loadAllSchedule();
737
- console.log(res, 'loadAllSchedule');
738
- };
739
-
740
735
  // 设置缓存
741
736
  var setOtherData = function setOtherData(key, val) {
742
737
  return appointmentBooking.setOtherData(key, val);
@@ -756,7 +751,6 @@ export var useAppointmentBookingSetting = function useAppointmentBookingSetting(
756
751
  isFormSubject: (bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.type) === 'form',
757
752
  customPageId: customPageId,
758
753
  channel: channel,
759
- getLoadAllSchedule: getLoadAllSchedule,
760
754
  bookingSubject: bookingSubject,
761
755
  setOtherData: setOtherData,
762
756
  getOtherData: getOtherData,
@@ -4,18 +4,15 @@ import useEngineContext from "../../hooks/useEngineContext";
4
4
  import { AppointmentBookingProvider } from "./context";
5
5
  import Content from "./components/Content";
6
6
  import localeTexts from "./locales";
7
- import { useAppointmentBooking } from "./hooks";
7
+ import { useAppointmentBooking, contextUtils } from "./hooks";
8
8
  import { formatCurrentUser } from "./utils";
9
9
  import "./index.less";
10
10
  var AppointmentBooking = function AppointmentBooking() {
11
11
  var _context$engine;
12
12
  var context = useEngineContext();
13
13
  locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
14
+ var utils = contextUtils();
14
15
  var appointmentBooking = useAppointmentBooking();
15
-
16
- // 初始化项目的时候,用于预加载 schedule 数据
17
- appointmentBooking.loadAllSchedule();
18
- var currentUser = formatCurrentUser();
19
16
  useEffect(function () {
20
17
  var _appointmentBooking$o;
21
18
  var _ref = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.productModuleParams) || {},
@@ -25,6 +22,7 @@ var AppointmentBooking = function AppointmentBooking() {
25
22
  if ((bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.type) === 'form') return;
26
23
  appointmentBooking.getAccounts().then(function (data) {
27
24
  if (!data.length) {
25
+ var currentUser = formatCurrentUser(utils);
28
26
  appointmentBooking.addAccounts([currentUser]);
29
27
  }
30
28
  });
@@ -28,7 +28,7 @@ export declare const formatCartsResources: (carts: any[], resources: any[], setP
28
28
  * @Author: WangHan
29
29
  * @Date: 2025-05-07 21:22
30
30
  */
31
- export declare const formatCarts: (data: any[], resources: any[], accountLists?: any) => any[];
31
+ export declare const formatCarts: (data: any[], resources: any[], utils: any, accountLists?: any) => any[];
32
32
  /**
33
33
  * @title: 对资源进行排序
34
34
  * @description:
@@ -40,12 +40,12 @@ export declare const formatCarts: (data: any[], resources: any[], accountLists?:
40
40
  */
41
41
  export declare const sortResources: (resources: any[], resourceSort: any[]) => any[] | undefined;
42
42
  export declare const getMeAccount: (val: any[]) => any;
43
- export declare const getCustomer: () => any;
43
+ export declare const getCustomer: (utils: any) => any;
44
44
  export declare const formatCustomer: (val: any) => {
45
45
  id: any;
46
46
  username: string;
47
47
  };
48
- export declare const formatCurrentUser: () => {
48
+ export declare const formatCurrentUser: (utils: any) => {
49
49
  id: any;
50
50
  username: string;
51
51
  };
@@ -12,8 +12,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
12
12
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
13
  import { getUniqueId, locales } from "@pisell/utils";
14
14
  import { PisellToast } from '@pisell/materials';
15
- import useEngineContext from "../../hooks/useEngineContext";
16
-
17
15
  /**
18
16
  * @title: 格式化holder表数据
19
17
  * @description:
@@ -102,11 +100,10 @@ export var formatCartsResources = function formatCartsResources(carts, resources
102
100
  * @Author: WangHan
103
101
  * @Date: 2025-05-07 21:22
104
102
  */
105
- export var formatCarts = function formatCarts(data, resources, accountLists) {
103
+ export var formatCarts = function formatCarts(data, resources, utils, accountLists) {
106
104
  try {
107
105
  var _utils$storage;
108
- var context = useEngineContext();
109
- var utils = context.appHelper.utils || {};
106
+ if (!utils || !(data !== null && data !== void 0 && data.length)) return [];
110
107
  var locale = (utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('umi_locale')) || 'en-US';
111
108
  var symbol = (utils === null || utils === void 0 ? void 0 : utils.getSymbolic()) || '$';
112
109
  var newCarts = data === null || data === void 0 ? void 0 : data.map(function (d) {
@@ -182,14 +179,17 @@ export var getMeAccount = function getMeAccount(val) {
182
179
  return !(d !== null && d !== void 0 && d.isGuest);
183
180
  });
184
181
  };
185
- export var getCustomer = function getCustomer() {
186
- var _utils$getStore$getSt, _userInfo;
187
- var context = useEngineContext();
188
- var utils = context.appHelper.utils || {};
189
- 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;
190
- var localUserInfo = JSON.parse(utils.storage.get('customer') || '{}');
191
- userInfo = (_userInfo = userInfo) !== null && _userInfo !== void 0 && _userInfo.id ? userInfo : localUserInfo;
192
- return userInfo;
182
+ export var getCustomer = function getCustomer(utils) {
183
+ try {
184
+ var _utils$getStore$getSt, _userInfo;
185
+ if (!utils) return;
186
+ 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;
187
+ var localUserInfo = JSON.parse(utils.storage.get('customer') || '{}');
188
+ userInfo = (_userInfo = userInfo) !== null && _userInfo !== void 0 && _userInfo.id ? userInfo : localUserInfo;
189
+ return userInfo;
190
+ } catch (error) {
191
+ console.log("getCustomer ".concat(error));
192
+ }
193
193
  };
194
194
  export var formatCustomer = function formatCustomer(val) {
195
195
  var currentUserName = "".concat((val === null || val === void 0 ? void 0 : val.first_name) || '').concat(val !== null && val !== void 0 && val.last_name ? " ".concat(val === null || val === void 0 ? void 0 : val.last_name) : '');
@@ -199,8 +199,8 @@ export var formatCustomer = function formatCustomer(val) {
199
199
  username: currentUserName
200
200
  };
201
201
  };
202
- export var formatCurrentUser = function formatCurrentUser() {
203
- var userInfo = getCustomer();
202
+ export var formatCurrentUser = function formatCurrentUser(utils) {
203
+ var userInfo = getCustomer(utils);
204
204
  var customer = formatCustomer(userInfo);
205
205
  return customer;
206
206
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  interface TabProductProps {
4
3
  list: any[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ProductItem: ({ item, onClick, amountSymbol, style, className, }: any) => JSX.Element;
4
3
  export default ProductItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  /**
4
3
  * @title: 底部
@@ -165,7 +165,7 @@ var checkResourcesFormat = function checkResourcesFormat(resources, service, isC
165
165
  children: (_resource$children = resource.children) !== null && _resource$children !== void 0 && _resource$children.length ? checkResourcesFormat(resource.children, service, true) : undefined,
166
166
  form_id: resource.form_id,
167
167
  relation_type: resource.relation_type || 'form',
168
- relation_id: resource.relation_id || resource.id || 0,
168
+ relation_id: resource.relation_id || 0,
169
169
  capacity: resource.capacity,
170
170
  like_status: resource.like_status || 'common',
171
171
  metadata: resource.metadata || {}
@@ -39,7 +39,7 @@ var VoucherCard = function VoucherCard(props) {
39
39
  var context = useEngineContext();
40
40
  var state = props.state,
41
41
  dispatch = props.dispatch;
42
- var _useState = useState(!state.bookingId),
42
+ var _useState = useState(false),
43
43
  _useState2 = _slicedToArray(_useState, 2),
44
44
  showDetail = _useState2[0],
45
45
  setShowDetail = _useState2[1];
@@ -169,10 +169,12 @@ var VoucherCard = function VoucherCard(props) {
169
169
  val = _context.sent;
170
170
  console.log(val);
171
171
  if (val !== null && val !== void 0 && val.isAvailable) {
172
+ productRef.current = val.productList;
172
173
  dispatch({
173
174
  type: 'setService',
174
175
  payload: {
175
- value: val.productList
176
+ value: val.productList,
177
+ edit: true
176
178
  }
177
179
  });
178
180
  setCode('');
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  /**
4
3
  * @title: 表单选择器
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from '../../../model';
3
2
  interface useClientFnParams {
4
3
  state: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  export declare const updateServiceDate: (services: any[], date: any, isTime: boolean) => any[];
4
3
  declare const DateCom: () => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InfoProps } from './main';
3
2
  declare const APP: (props: InfoProps) => JSX.Element;
4
3
  export default APP;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Notes: () => JSX.Element | null;
3
2
  export default Notes;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
3
2
  export default Lists;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const Actions: ({ currentService }: {
4
3
  currentService: any;
@@ -251,7 +251,7 @@ var Info = function Info(props) {
251
251
  dayParams.customer_id = customerId;
252
252
  }
253
253
  _context2.next = 9;
254
- return state.apis.getServices(_objectSpread(_objectSpread({
254
+ return state.apis.getServices(_objectSpread({
255
255
  skip: 1,
256
256
  num: 500,
257
257
  extension_type: state.renderType === 'eventBooking' ? undefined : ['product_appointment', 'appointment_ticket', 'session_product', 'session_ticket'],
@@ -261,14 +261,9 @@ var Info = function Info(props) {
261
261
  with_schedule: 1,
262
262
  with_count: ['bundleGroup', 'optionGroup'],
263
263
  order_by_string: 'sort:desc',
264
- status: 'published'
265
- }, state.isBookingCreatePage ? {
264
+ status: 'published',
266
265
  schedule_date: params === null || params === void 0 ? void 0 : params.schedule_date
267
- } : {
268
- _config: {
269
- useCache: true
270
- }
271
- }), dayParams));
266
+ }, dayParams));
272
267
  case 9:
273
268
  data = _context2.sent;
274
269
  setLoading(false);
@@ -408,16 +403,17 @@ var Info = function Info(props) {
408
403
  var showAddButton = useMemo(function () {
409
404
  return !state.disabledEdit && !state.channelDisabledEdit;
410
405
  }, [state.disabledEdit, state.channelDisabledEdit]);
406
+ var currentDate = useMemo(function () {
407
+ return state.date.value.format('YYYY-MM-DD');
408
+ }, [state.date.value]);
411
409
  useUpdateEffect(function () {
412
410
  if (state.service.addModal) {
413
- getServices();
411
+ getServices({
412
+ schedule_date: currentDate
413
+ });
414
414
  setSearch('');
415
415
  }
416
- }, [state.service.addModal]);
417
- var currentDate = useMemo(function () {
418
- return state.date.value.format('YYYY-MM-DD');
419
- }, [state.date.value]);
420
- console.log(currentDate, 'currentDate');
416
+ }, [state.service.addModal, currentDate]);
421
417
  useEffect(function () {
422
418
  if (renderMode === 'current') {
423
419
  getServices({
@@ -427,9 +423,11 @@ var Info = function Info(props) {
427
423
  }, [renderMode, currentDate]);
428
424
  useEffect(function () {
429
425
  if (state.renderType === 'eventBooking' && state.modalOpen) {
430
- getServices();
426
+ getServices({
427
+ schedule_date: currentDate
428
+ });
431
429
  }
432
- }, [state.renderType, state.modalOpen]);
430
+ }, [state.renderType, state.modalOpen, currentDate]);
433
431
  var addButton = useMemo(function () {
434
432
  // 跨日预约不显示添加服务按钮
435
433
  if (isDay) {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const AddTimeModal: () => JSX.Element;
4
3
  export default AddTimeModal;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
3
2
  export default Lists;
@@ -240,4 +240,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
240
240
  * @Author: WangHan
241
241
  * @Date: 2024-12-24 11:32
242
242
  */
243
- export declare const updateServicePrice: (state: any) => Promise<any> | never[];
243
+ export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
@@ -348,6 +348,7 @@ export var updateServices = function updateServices(state, currentItem, type, ot
348
348
  // 更新holder
349
349
  if (type === 'change_holder') {
350
350
  products = handleChangeHolder(products, currentItem, other);
351
+ return products;
351
352
  }
352
353
  if (type === 'add_holder') {
353
354
  var _actions$handleAddHol;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import '../../../info/service/actions/index.less';
3
2
  declare const Actions: ({ currentService }: {
4
3
  currentService: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PisellDrawerProps } from '../../../components/drawer';
3
2
  import '../../../info/service/addService/index.less';
4
3
  interface AddServiceProps {