@pisell/private-materials 3.3.42 → 3.3.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +5 -5
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +5 -5
  9. package/es/businessModel/SalesModel/index.d.ts +0 -1
  10. package/es/components/Sales/Summary/utils.d.ts +1 -1
  11. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -25
  12. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Cart/Item/index.js +31 -16
  14. package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  15. package/es/components/appointmentBooking/components/Content/index.js +39 -20
  16. package/es/components/appointmentBooking/components/Date/index.js +2 -13
  17. package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  18. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  19. package/es/components/appointmentBooking/components/Form/index.js +76 -167
  20. package/es/components/appointmentBooking/components/Form/utils.d.ts +8 -0
  21. package/es/components/appointmentBooking/components/Form/utils.js +36 -0
  22. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  23. package/es/components/appointmentBooking/components/Header/index.js +78 -46
  24. package/es/components/appointmentBooking/components/Resource/index.js +92 -115
  25. package/es/components/appointmentBooking/components/Services/index.js +19 -4
  26. package/es/components/appointmentBooking/components/TimeSlicing/index.js +20 -27
  27. package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  28. package/es/components/appointmentBooking/context.js +50 -3
  29. package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
  30. package/es/components/appointmentBooking/hooks.d.ts +1 -2
  31. package/es/components/appointmentBooking/hooks.js +377 -269
  32. package/es/components/appointmentBooking/utils.d.ts +91 -2
  33. package/es/components/appointmentBooking/utils.js +350 -61
  34. package/es/components/booking/components/footer/index.d.ts +0 -1
  35. package/es/components/booking/components/voucher/index.d.ts +0 -1
  36. package/es/components/booking/components/voucher/index.js +2 -1
  37. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  38. package/es/components/booking/hooks/useClearCart.d.ts +0 -1
  39. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  40. package/es/components/booking/info/index.d.ts +0 -1
  41. package/es/components/booking/info/service/Lists.d.ts +0 -1
  42. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  43. package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
  44. package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
  45. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  46. package/es/components/booking/info/service2/utils.d.ts +1 -1
  47. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  48. package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  49. package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
  50. package/es/components/booking/utils.d.ts +2 -2
  51. package/es/components/eftposPay/amount.d.ts +1 -1
  52. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  53. package/es/components/eftposPay/component/fail/index.d.ts +1 -0
  54. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  55. package/es/components/eftposPay/device.d.ts +1 -1
  56. package/es/components/eftposPay/hooks.d.ts +1 -1
  57. package/es/components/eftposPay/index.d.ts +1 -0
  58. package/es/components/eftposPay/pay.d.ts +1 -0
  59. package/es/components/eftposPay/store/index.d.ts +2 -2
  60. package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
  61. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  62. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  63. package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
  64. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  65. package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  66. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  67. package/es/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
  68. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  69. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  70. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  71. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  72. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  73. package/es/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
  74. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  75. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  76. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  77. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  78. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
  79. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  80. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  81. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  82. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
  83. package/es/components/eventBooking/index.d.ts +0 -1
  84. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  85. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  86. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  87. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  88. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  89. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  90. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
  91. package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
  92. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  93. package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  94. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  95. package/es/components/productExtension/index.d.ts +0 -1
  96. package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
  97. package/es/components/productSelect/components/productGroup/index.d.ts +11 -7
  98. package/es/components/productSelect/components/productGroup/index.js +32 -19
  99. package/es/components/productSelect/components/productGroup/index.less +17 -3
  100. package/es/components/productSelect/index.d.ts +3 -2
  101. package/es/components/productSelect/index.js +20 -6
  102. package/es/components/productSelect/index.less +7 -0
  103. package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
  104. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  105. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  106. package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  107. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  108. package/es/components/shoppingCart/index.d.ts +0 -1
  109. package/es/components/ticketBooking/components/addServiceVariant/addService.js +11 -3
  110. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  111. package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  112. package/es/components/ticketBooking/index.d.ts +0 -1
  113. package/es/components/wallet/hooks/useWalletCard.d.ts +0 -1
  114. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  115. package/lib/businessModel/SalesModel/index.d.ts +0 -1
  116. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  117. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +0 -5
  118. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  119. package/lib/components/appointmentBooking/components/Cart/Item/index.js +35 -16
  120. package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  121. package/lib/components/appointmentBooking/components/Content/index.js +37 -21
  122. package/lib/components/appointmentBooking/components/Date/index.js +0 -6
  123. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  124. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  125. package/lib/components/appointmentBooking/components/Form/index.js +56 -108
  126. package/lib/components/appointmentBooking/components/Form/utils.d.ts +8 -0
  127. package/lib/components/appointmentBooking/components/Form/utils.js +49 -0
  128. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  129. package/lib/components/appointmentBooking/components/Header/index.js +49 -19
  130. package/lib/components/appointmentBooking/components/Resource/index.js +51 -69
  131. package/lib/components/appointmentBooking/components/Services/index.js +16 -3
  132. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +1 -7
  133. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  134. package/lib/components/appointmentBooking/context.js +52 -4
  135. package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
  136. package/lib/components/appointmentBooking/hooks.d.ts +1 -2
  137. package/lib/components/appointmentBooking/hooks.js +153 -57
  138. package/lib/components/appointmentBooking/utils.d.ts +91 -2
  139. package/lib/components/appointmentBooking/utils.js +210 -50
  140. package/lib/components/booking/components/footer/index.d.ts +0 -1
  141. package/lib/components/booking/components/voucher/index.d.ts +0 -1
  142. package/lib/components/booking/components/voucher/index.js +2 -1
  143. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  144. package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
  145. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  146. package/lib/components/booking/info/index.d.ts +0 -1
  147. package/lib/components/booking/info/service/Lists.d.ts +0 -1
  148. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  149. package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
  150. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
  151. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  152. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  153. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  154. package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  155. package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
  156. package/lib/components/booking/utils.d.ts +2 -2
  157. package/lib/components/eftposPay/amount.d.ts +1 -1
  158. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  159. package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
  160. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  161. package/lib/components/eftposPay/device.d.ts +1 -1
  162. package/lib/components/eftposPay/hooks.d.ts +1 -1
  163. package/lib/components/eftposPay/index.d.ts +1 -0
  164. package/lib/components/eftposPay/pay.d.ts +1 -0
  165. package/lib/components/eftposPay/store/index.d.ts +2 -2
  166. package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
  167. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  168. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  169. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
  170. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  171. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  172. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  173. package/lib/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
  174. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  175. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  176. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  177. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  178. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  179. package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
  180. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  181. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  182. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  183. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  184. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
  185. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  186. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  187. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  188. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
  189. package/lib/components/eventBooking/index.d.ts +0 -1
  190. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  191. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  192. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  193. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  194. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  195. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  196. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
  197. package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
  198. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  199. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  200. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  201. package/lib/components/productExtension/index.d.ts +0 -1
  202. package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
  203. package/lib/components/productSelect/components/productGroup/index.d.ts +11 -7
  204. package/lib/components/productSelect/components/productGroup/index.js +12 -10
  205. package/lib/components/productSelect/components/productGroup/index.less +17 -3
  206. package/lib/components/productSelect/index.d.ts +3 -2
  207. package/lib/components/productSelect/index.js +17 -3
  208. package/lib/components/productSelect/index.less +7 -0
  209. package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
  210. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  211. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  212. package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  213. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  214. package/lib/components/shoppingCart/index.d.ts +0 -1
  215. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +9 -1
  216. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  217. package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  218. package/lib/components/ticketBooking/index.d.ts +0 -1
  219. package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -1
  220. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  221. package/lowcode/product-select/meta.ts +18 -34
  222. package/package.json +2 -2
@@ -20,7 +20,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
20
  import { getUniqueId, locales } from '@pisell/utils';
21
21
  import React, { useEffect, useMemo, useState } from 'react';
22
22
  import { useMemoizedFn } from 'ahooks';
23
- import { PisellToast } from "@pisell/materials";
23
+ import { PisellToast } from '@pisell/materials';
24
24
  import useEngineContext from "../../../../hooks/useEngineContext";
25
25
  import { isSessionProduct, request, getProductTotalPrice } from "../../../booking/utils";
26
26
  import { getProductExtend } from "../../../booking/info2/service/addService/utils";
@@ -323,7 +323,7 @@ var AddSerivce = function AddSerivce(props) {
323
323
  cacheItem.autoClose = false;
324
324
  _list = [].concat(_toConsumableArray(state.service.value), [cacheItem]);
325
325
  PisellToast({
326
- content: locales.getText("pisell2.ticket-booking.add-to-cart")
326
+ content: locales.getText('pisell2.ticket-booking.add-to-cart')
327
327
  });
328
328
  dispatch({
329
329
  type: 'setService',
@@ -395,7 +395,15 @@ var AddSerivce = function AddSerivce(props) {
395
395
  },
396
396
  onChange: handleSelectProduct,
397
397
  value: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.id,
398
- loading: !renderList.length && loading
398
+ loading: !renderList.length && loading,
399
+ productListSetting: {
400
+ isProductCover: 1,
401
+ isTitle: 1,
402
+ isSubtitle: 1,
403
+ isPrice: 1,
404
+ isOriginPrice: 1,
405
+ isStock: 1
406
+ }
399
407
  });
400
408
  }
401
409
  return null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const TicketBooking: () => JSX.Element;
4
3
  export default TicketBooking;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Dayjs } from 'dayjs';
3
2
  import './index.less';
4
3
  interface ITimeBarProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  interface TicketBookingProps {
4
3
  productExtensionType: string[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IWalletListItemProps } from '../serve';
3
2
  /**
4
3
  * 钱包卡片Hook的参数
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Modal as AntModal, ModalFuncProps as AntModalFuncProps, ModalProps as AntModalProps } from 'antd';
3
2
  import './index.less';
4
3
  interface ModalProps extends AntModalProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const SalesModel: ({ children, hooks, config }: any) => JSX.Element;
3
2
  export * from './Sales';
4
3
  export default SalesModel;
@@ -25,7 +25,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
25
25
  * @return {*}
26
26
  * @Author: xiangfeng.xue
27
27
  */
28
- export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
28
+ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
29
29
  /**
30
30
  * 计算所有价格明细
31
31
  * @param items - 购物车商品数组
@@ -86,11 +86,6 @@ var ContinueButton = ({ onNext }) => {
86
86
  };
87
87
  const handleContinue = async () => {
88
88
  try {
89
- if ((currentStep == null ? void 0 : currentStep.index) + 2 >= (stepList == null ? void 0 : stepList.length)) {
90
- const loginOk = await handleLoginCheck();
91
- if (!loginOk) return;
92
- if (handleCheckAccount()) return;
93
- }
94
89
  return onNext && onNext();
95
90
  } catch (error) {
96
91
  console.log(error, "handleContinue_error");
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Total: ({ className, isFooter }: any) => JSX.Element;
4
3
  export default Total;
@@ -46,18 +46,20 @@ var import_Deposit = __toESM(require("../../Deposit"));
46
46
  var import_utils3 = require("../utils");
47
47
  var import_index = require("./index.less");
48
48
  var CartItem = ({ onNext }) => {
49
- var _a, _b, _c;
49
+ var _a, _b, _c, _d;
50
50
  const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
51
51
  const {
52
52
  carts,
53
53
  currentStep,
54
- resources,
55
54
  setResourceOtherParams,
56
55
  resourceOtherParams,
57
56
  summary,
58
- isLastStep
57
+ isLastStep,
58
+ currentSelectedResources,
59
+ currentStepParams,
60
+ isErrorHolder
59
61
  } = (0, import_context.useAppointmentBookingContext)();
60
- const { accountLists, getHolders, form_id, addAccount } = (0, import_hooks2.useAppointmentBookingAccount)();
62
+ const { accountLists, getHolders, addAccount } = (0, import_hooks2.useAppointmentBookingAccount)();
61
63
  const { getResourceList } = (0, import_hooks2.useAppointmentBookingResource)();
62
64
  const { isFormSubject, bookingSubject, isRetailTemplate } = (0, import_hooks2.useAppointmentBookingSetting)();
63
65
  const { isLogin } = (0, import_hooks2.useAppointmentBookingLogin)();
@@ -95,14 +97,10 @@ var CartItem = ({ onNext }) => {
95
97
  ...resourceOtherParams,
96
98
  errorList: null
97
99
  });
98
- if (!val) {
99
- appointmentBooking.deleteCartItemInfo("resource", e == null ? void 0 : e._id);
100
- } else {
101
- appointmentBooking.updateCart({
102
- _id: e == null ? void 0 : e._id,
103
- resources: val ? [val] : []
104
- });
105
- }
100
+ appointmentBooking.updateCart({
101
+ _id: e == null ? void 0 : e._id,
102
+ resources: (0, import_utils2.updateCartResources)(e, val, currentSelectedResources)
103
+ });
106
104
  getResourceList();
107
105
  return;
108
106
  }
@@ -150,8 +148,29 @@ var CartItem = ({ onNext }) => {
150
148
  }
151
149
  };
152
150
  const products = (0, import_react.useMemo)(() => {
153
- return (0, import_utils2.formatCarts)(carts, resources, utils, accountLists);
154
- }, [carts, resources, accountLists]);
151
+ if (!(carts == null ? void 0 : carts.length)) return [];
152
+ if ((currentSelectedResources == null ? void 0 : currentSelectedResources.length) > 0) {
153
+ const newCarts = carts.map((item) => {
154
+ const currentResourceData = currentSelectedResources.find(
155
+ (resource) => (resource == null ? void 0 : resource._id) === (item == null ? void 0 : item._id)
156
+ );
157
+ const multiResources = (0, import_utils2.getMultiResources)(
158
+ item,
159
+ currentResourceData == null ? void 0 : currentResourceData.currentSelectedResource,
160
+ currentStepParams == null ? void 0 : currentStepParams.key
161
+ );
162
+ return {
163
+ ...item,
164
+ isMultipleResource: true,
165
+ multiResources,
166
+ isErrorHolder: isErrorHolder || false
167
+ };
168
+ });
169
+ return newCarts;
170
+ } else {
171
+ return carts;
172
+ }
173
+ }, [carts, currentSelectedResources, currentStepParams == null ? void 0 : currentStepParams.key, isErrorHolder]);
155
174
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
156
175
  "div",
157
176
  {
@@ -165,8 +184,8 @@ var CartItem = ({ onNext }) => {
165
184
  hideAddBtn: false,
166
185
  holders,
167
186
  disabledEdit: isLastStep,
168
- isShowChangeResource: ((_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key) === "select-resource",
169
- isShowDelete: ((_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.key) === "select-service",
187
+ isShowChangeResource: (_c = (_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key) == null ? void 0 : _c.startsWith("select-resource"),
188
+ isShowDelete: ((_d = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _d.key) === "select-service",
170
189
  isShowPackageNote: false,
171
190
  isShowChangeHolder: isLastStep ? false : isFormSubject && isLogin,
172
191
  isShowHolder: isFormSubject,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Cart: ({ open, onCancel, onNext }: any) => JSX.Element;
4
3
  export default Cart;
@@ -51,7 +51,6 @@ var import_index = require("./index.less");
51
51
  var Layout = () => {
52
52
  var _a, _b, _c, _d, _e;
53
53
  const stepRef = (0, import_react.useRef)();
54
- const formRef = (0, import_react.useRef)();
55
54
  const {
56
55
  currentStep,
57
56
  setResourceOtherParams,
@@ -60,17 +59,20 @@ var Layout = () => {
60
59
  appointmentBooking,
61
60
  setLoading,
62
61
  policyParams,
63
- closePolicy
62
+ closePolicy,
63
+ currentStepParams,
64
+ setIsErrorHolder
64
65
  } = (0, import_context.useAppointmentBookingContext)();
65
66
  const { isDateSelectedFirst, isFormSubject, isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
66
67
  const { isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
67
68
  const { getHolders } = (0, import_hooks.useAppointmentBookingAccount)();
68
- const { removeStep, stepList } = (0, import_hooks.useAppointmentBookingStep)();
69
+ const { removeStep } = (0, import_hooks.useAppointmentBookingStep)();
69
70
  const { shopDiscount } = (0, import_hooks.useShopDiscount)();
70
71
  (0, import_hooks.useAppointmentBookingCart)();
71
72
  (0, import_hooks.useAppointmentBookingStep)();
72
73
  const [params, setParams] = (0, import_react.useState)({});
73
74
  (0, import_react.useEffect)(() => {
75
+ appointmentBooking.removeStep("fill-form");
74
76
  return () => {
75
77
  var _a2;
76
78
  setIsAgreeDepositPolicy(false);
@@ -78,6 +80,16 @@ var Layout = () => {
78
80
  (_a2 = shopDiscount == null ? void 0 : shopDiscount.destroy) == null ? void 0 : _a2.call(shopDiscount);
79
81
  };
80
82
  }, []);
83
+ (0, import_react.useEffect)(() => {
84
+ var _a2;
85
+ if ((currentStepParams == null ? void 0 : currentStepParams.index) < 0) return;
86
+ const resourceStepIndex = (_a2 = currentStepParams == null ? void 0 : currentStepParams.stepLists) == null ? void 0 : _a2.findIndex(
87
+ (item) => item.key === "select-resource"
88
+ );
89
+ if ((currentStepParams == null ? void 0 : currentStepParams.index) < resourceStepIndex) {
90
+ appointmentBooking.setOtherData("current_selected_resources", null);
91
+ }
92
+ }, [currentStepParams]);
81
93
  (0, import_react.useEffect)(() => {
82
94
  try {
83
95
  if (!(appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || isRetailTemplate) return;
@@ -107,34 +119,38 @@ var Layout = () => {
107
119
  ...resourceOtherParams,
108
120
  errorList: null
109
121
  });
122
+ setIsErrorHolder(false);
110
123
  window.scrollTo({
111
124
  top: 0,
112
125
  behavior: "smooth"
113
126
  });
114
127
  }, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key]);
128
+ const components = {
129
+ // 选择服务
130
+ "select-service": import_Services.default,
131
+ // 添加客户
132
+ "select-guest": import_Guest.default,
133
+ // 选择时间
134
+ "select-date": import_Date.default,
135
+ // 时间切片
136
+ "select-time": import_TimeSlicing.default,
137
+ // 确认信息
138
+ "confirm-information": import_ConfirmInformation.default
139
+ };
115
140
  const Com = (0, import_react.useMemo)(() => {
116
141
  var _a2;
117
142
  const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
118
143
  if (!key) return null;
119
- const components = {
120
- // 选择服务
121
- "select-service": import_Services.default,
122
- // 添加客户
123
- "select-guest": import_Guest.default,
124
- // 选择时间
125
- "select-date": import_Date.default,
126
- // 选择资源
127
- "select-resource": import_Resource.default,
128
- // 时间切片
129
- "select-time": import_TimeSlicing.default,
130
- // 填写表单
131
- "fill-form": import_Form.default,
132
- // 确认信息
133
- "confirm-information": import_ConfirmInformation.default
134
- };
135
- let Com2 = components[key];
144
+ let Com2;
145
+ if (key.startsWith("select-resource")) {
146
+ Com2 = import_Resource.default;
147
+ } else if (key.startsWith("fill-form")) {
148
+ Com2 = import_Form.default;
149
+ } else {
150
+ Com2 = components[key];
151
+ }
136
152
  return /* @__PURE__ */ import_react.default.createElement(Com2, { onChange: setParams, params, ref: stepRef });
137
- }, [(_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key, stepRef]);
153
+ }, [(_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key]);
138
154
  (0, import_react.useEffect)(() => {
139
155
  var _a2, _b2;
140
156
  if ((0, import_utils.isMobile)()) {
@@ -64,12 +64,6 @@ var Date = (0, import_react.forwardRef)((props, ref) => {
64
64
  if (!(data == null ? void 0 : data.length)) {
65
65
  return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unselect.date"));
66
66
  }
67
- if (!isDateSelectedFirst) {
68
- const result = appointmentBooking.checkResourceListForDate();
69
- if (!result) {
70
- return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.date"));
71
- }
72
- }
73
67
  nextStep();
74
68
  };
75
69
  const weekListText = [
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Deposit: () => JSX.Element;
4
3
  export default Deposit;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Footer: ({ onNext, isOpen }: any) => JSX.Element;
4
3
  export default Footer;
@@ -37,143 +37,91 @@ var import_useComponents = __toESM(require("../../../../hooks/useComponents"));
37
37
  var import_utils = require("../../utils");
38
38
  var import_context = require("../../context");
39
39
  var import_hooks = require("../../hooks");
40
- var import_PolicyModal = __toESM(require("../../deposit/components/PolicyModal"));
40
+ var import_utils2 = require("./utils");
41
41
  var import_index = require("./index.less");
42
42
  var Form = (0, import_react.forwardRef)((props, ref) => {
43
43
  const manualRef = (0, import_react.useRef)();
44
- const [currentFormIndex, setCurrentFormIndex] = (0, import_react.useState)(0);
45
- const [showAgreement, setShowAgreement] = (0, import_react.useState)(false);
46
- const [agreementContent, setAgreementContent] = (0, import_react.useState)({});
47
- const [formStatus, setFormStatus] = (0, import_react.useState)([]);
48
- const [isClearData, setIsClearData] = (0, import_react.useState)(false);
49
- const [formId, setFormId] = (0, import_react.useState)(0);
50
- const { carts, appointmentBooking, setLoading } = (0, import_context.useAppointmentBookingContext)();
44
+ const { appointmentBooking, setLoading, currentStepParams, carts } = (0, import_context.useAppointmentBookingContext)();
51
45
  const { getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
52
- const { setOtherData, getOtherData } = (0, import_hooks.useAppointmentBookingSetting)();
46
+ const { setOtherData, getOtherData, isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
53
47
  const { nextStep } = (0, import_hooks.useAppointmentBookingStep)();
54
- const utils = (0, import_hooks.contextUtils)();
48
+ const { isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
49
+ const { checkAccount } = (0, import_hooks.useAppointmentBookingAccount)();
55
50
  (0, import_react.useImperativeHandle)(ref, () => ({
56
51
  next: () => {
57
- var _a, _b;
52
+ var _a, _b, _c;
53
+ const stepLists = (currentStepParams == null ? void 0 : currentStepParams.stepLists) || [];
54
+ const nextStepKey = (_a = stepLists[(currentStepParams == null ? void 0 : currentStepParams.index) + 1]) == null ? void 0 : _a.key;
58
55
  setLoading(true);
59
- (_b = (_a = manualRef.current) == null ? void 0 : _a.submit) == null ? void 0 : _b.call(_a);
56
+ (_c = (_b = manualRef.current) == null ? void 0 : _b.submit) == null ? void 0 : _c.call(_b);
60
57
  }
61
58
  }));
62
- const key = "booking_form";
63
- const formStorage = getOtherData("booking_form") || {};
64
- const resources = (0, import_react.useMemo)(() => {
65
- const _resource = getResourceList();
66
- return (_resource == null ? void 0 : _resource.resources) || [];
67
- }, []);
68
- const forms = (0, import_react.useMemo)(() => {
69
- const newCarts = (0, import_utils.formatCarts)(carts, resources, utils);
70
- if (!(newCarts == null ? void 0 : newCarts.length) || !(resources == null ? void 0 : resources.length)) return [];
71
- return (0, import_utils.formatForms)(newCarts) || [];
72
- }, [carts, resources]);
73
- (0, import_react.useEffect)(() => {
74
- var _a;
75
- if (!(forms == null ? void 0 : forms.length)) return;
76
- setFormId(((_a = forms == null ? void 0 : forms[currentFormIndex]) == null ? void 0 : _a.form_id) || 0);
77
- }, [forms, currentFormIndex]);
78
59
  const [FormCard] = (0, import_useComponents.default)({
79
60
  components: ["FormCard"]
80
61
  });
81
- const goToNextForm = () => {
82
- var _a, _b, _c;
83
- const nextIndex = currentFormIndex + 1;
84
- if (nextIndex < forms.length) {
85
- setIsClearData(true);
86
- setCurrentFormIndex(nextIndex);
87
- if (!((_a = forms == null ? void 0 : forms[nextIndex]) == null ? void 0 : _a.form_id) && ((_b = forms == null ? void 0 : forms[nextIndex]) == null ? void 0 : _b.policy_id)) {
88
- setLoading(true);
89
- setAgreementContent({ id: (_c = forms == null ? void 0 : forms[nextIndex]) == null ? void 0 : _c.policy_id });
90
- setShowAgreement(true);
91
- } else {
92
- setLoading(false);
93
- }
94
- } else {
95
- nextStep();
96
- }
97
- };
62
+ const key = "booking_form";
63
+ const formStorage = getOtherData("booking_form") || {};
64
+ const appointmentBoard = (0, import_react.useMemo)(() => {
65
+ const { resources } = getResourceList();
66
+ return (0, import_utils.currentAppointmentBoard)(
67
+ currentStepParams.key,
68
+ resources,
69
+ appointmentBooking
70
+ );
71
+ }, [currentStepParams.key]);
72
+ const formId = (0, import_react.useMemo)(() => {
73
+ return (appointmentBoard == null ? void 0 : appointmentBoard.resource_form_id) || 0;
74
+ }, [appointmentBoard == null ? void 0 : appointmentBoard.resource_form_id]);
98
75
  const updateFormStatus = (status) => {
99
76
  if (status === "error") {
100
77
  setLoading(false);
101
78
  }
102
- const newFormStatus = (0, import_utils.updateLists)(formStatus, "id", formId, {
103
- status
104
- });
105
- setFormStatus(newFormStatus);
106
79
  };
107
80
  const setFormStorage = (values) => {
108
- var _a;
109
- const cart_id = (_a = forms == null ? void 0 : forms[currentFormIndex]) == null ? void 0 : _a.cart_id;
110
81
  const oldData = getOtherData(key);
111
- const newData = (0, import_utils.updateBookingFormStorage)(oldData, cart_id, values);
82
+ const newData = (0, import_utils.updateBookingFormStorage)(
83
+ oldData,
84
+ currentStepParams == null ? void 0 : currentStepParams.key,
85
+ values
86
+ );
112
87
  setOtherData(key, { ...newData });
113
88
  appointmentBooking.updateCart({
114
- _id: cart_id,
115
- relationForms: [
116
- {
117
- form_id: formId,
118
- form_record_ids: [values == null ? void 0 : values.form_record_id]
119
- }
120
- ]
89
+ _id: appointmentBoard == null ? void 0 : appointmentBoard.cart_id,
90
+ relationForms: (0, import_utils2.updateRelationForms)(carts, appointmentBoard, values)
121
91
  });
122
92
  };
123
93
  const handleFormFinish = (status, values) => {
124
- var _a, _b;
125
- setIsClearData(false);
126
- updateFormStatus(status);
127
- if (status === "success") {
128
- setFormStorage(values);
129
- if ((_a = forms == null ? void 0 : forms[currentFormIndex]) == null ? void 0 : _a.policy_id) {
130
- setAgreementContent({ id: (_b = forms == null ? void 0 : forms[currentFormIndex]) == null ? void 0 : _b.policy_id });
131
- setShowAgreement(true);
132
- } else {
133
- goToNextForm();
94
+ try {
95
+ updateFormStatus(status);
96
+ if (status === "success") {
97
+ setFormStorage(values);
98
+ nextStep();
134
99
  }
100
+ } catch (error) {
101
+ setLoading(false);
135
102
  }
136
103
  };
137
- const handleAgreementOk = () => {
138
- setShowAgreement(false);
139
- goToNextForm();
140
- };
141
- const formCom = (0, import_react.useMemo)(() => {
142
- var _a;
143
- if (!formId) return;
144
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-form-wrap" }, /* @__PURE__ */ import_react.default.createElement(
145
- FormCard,
146
- {
147
- id: formId,
148
- ref: manualRef,
149
- isGetLastData: false,
150
- setting: { isHidden: 1 },
151
- formWrapStyle: { padding: "16px" },
152
- isV2API: true,
153
- isShowSkeleton: true,
154
- onSubmit: (status, values) => {
155
- handleFormFinish(status, values);
156
- },
157
- onFinishFailed: (e) => {
158
- updateFormStatus("error");
159
- },
160
- onFormValueChange: (values) => {
161
- },
162
- defaultValues: (formStorage == null ? void 0 : formStorage[(_a = forms == null ? void 0 : forms[currentFormIndex]) == null ? void 0 : _a.cart_id]) || {},
163
- isClearData: false
164
- }
165
- ));
166
- }, [currentFormIndex, formId]);
167
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, formCom, showAgreement ? /* @__PURE__ */ import_react.default.createElement(
168
- import_PolicyModal.default,
104
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-form-wrap", key: currentStepParams == null ? void 0 : currentStepParams.key }, /* @__PURE__ */ import_react.default.createElement(
105
+ FormCard,
169
106
  {
170
- open: showAgreement,
171
- onCancel: () => setShowAgreement(false),
172
- onConfirm: () => handleAgreementOk(),
173
- item: agreementContent,
174
- onChange: () => setLoading(false),
175
- isHideCheckout: false
107
+ id: formId,
108
+ ref: manualRef,
109
+ isGetLastData: false,
110
+ setting: { isHidden: 1 },
111
+ formWrapStyle: { padding: "16px" },
112
+ isV2API: true,
113
+ isShowSkeleton: true,
114
+ onSubmit: (status, values) => {
115
+ handleFormFinish(status, values);
116
+ },
117
+ onFinishFailed: (e) => {
118
+ updateFormStatus("error");
119
+ },
120
+ onFormValueChange: (values) => {
121
+ },
122
+ defaultValues: (formStorage == null ? void 0 : formStorage[currentStepParams == null ? void 0 : currentStepParams.key]) || {},
123
+ isClearData: false
176
124
  }
177
- ) : null);
125
+ )));
178
126
  });
179
127
  var Form_default = Form;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @title: 更新表单数据
3
+ * @description:
4
+ * @return {*}
5
+ * @Author: WangHan
6
+ * @Date: 2025-05-26 16:58
7
+ */
8
+ export declare const updateRelationForms: (carts: any[], currentCart: any, values: any) => any;
@@ -0,0 +1,49 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/appointmentBooking/components/Form/utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ updateRelationForms: () => updateRelationForms
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ var updateRelationForms = (carts, currentCart, values) => {
26
+ var _a, _b;
27
+ if (!(currentCart == null ? void 0 : currentCart.cart_id)) return [];
28
+ const cartItem = carts == null ? void 0 : carts.find(
29
+ (item) => (item == null ? void 0 : item._id) === (currentCart == null ? void 0 : currentCart.cart_id)
30
+ );
31
+ let oldLists = ((_a = cartItem == null ? void 0 : cartItem._origin) == null ? void 0 : _a.relation_forms) || [];
32
+ const newData = { form_id: Number(values == null ? void 0 : values.form_id), form_record_id: values == null ? void 0 : values.form_record_id };
33
+ const exist = oldLists.find((item) => item.form_id === (newData == null ? void 0 : newData.form_id));
34
+ if (exist) {
35
+ if (!((_b = exist == null ? void 0 : exist.form_record_ids) == null ? void 0 : _b.includes(newData.form_record_id))) {
36
+ exist.form_record_ids.push(newData.form_record_id);
37
+ }
38
+ } else {
39
+ oldLists.push({
40
+ form_id: newData.form_id,
41
+ form_record_ids: [newData.form_record_id]
42
+ });
43
+ }
44
+ return oldLists;
45
+ };
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ updateRelationForms
49
+ });
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const GuestOptionsModal: (props: any) => JSX.Element;
4
3
  export default GuestOptionsModal;