@pisell/private-materials 3.3.34 → 3.3.36

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 (148) 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 +3 -3
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +5 -5
  9. package/es/components/Sales/Cart/index.js +26 -13
  10. package/es/components/Sales/Cart/types.d.ts +12 -0
  11. package/es/components/Sales/Cart/utils.d.ts +23 -0
  12. package/es/components/Sales/Cart/utils.js +161 -0
  13. package/es/components/Sales/Checkout/utils.d.ts +9 -1
  14. package/es/components/Sales/Checkout/utils.js +25 -3
  15. package/es/components/Sales/Event/Detail.d.ts +2 -0
  16. package/es/components/Sales/Event/Detail.js +56 -13
  17. package/es/components/Sales/Event/serve.d.ts +10 -0
  18. package/es/components/Sales/Event/serve.js +26 -1
  19. package/es/components/Sales/Summary/utils.js +1 -0
  20. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +18 -17
  21. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
  22. package/es/components/appointmentBooking/components/Cart/Item/index.js +21 -20
  23. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +156 -53
  24. package/es/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
  25. package/es/components/appointmentBooking/components/ConfirmInformation/utils.js +17 -0
  26. package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
  27. package/es/components/appointmentBooking/components/Content/index.js +26 -25
  28. package/es/components/appointmentBooking/components/Content/index.less +23 -1
  29. package/es/components/appointmentBooking/components/Footer/index.js +5 -5
  30. package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
  31. package/es/components/appointmentBooking/components/Header/index.js +7 -7
  32. package/es/components/appointmentBooking/components/Services/index.js +50 -25
  33. package/es/components/appointmentBooking/hooks.d.ts +2 -1
  34. package/es/components/appointmentBooking/hooks.js +52 -47
  35. package/es/components/appointmentBooking/index.d.ts +0 -1
  36. package/es/components/booking/components/TabProduct/index.d.ts +0 -1
  37. package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  38. package/es/components/booking/components/footer/index.d.ts +0 -1
  39. package/es/components/booking/deposit/index.d.ts +0 -1
  40. package/es/components/booking/forms/single/index.d.ts +0 -1
  41. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  42. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  43. package/es/components/booking/info/date/index.d.ts +0 -1
  44. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  45. package/es/components/booking/info/index.d.ts +0 -1
  46. package/es/components/booking/info/service/Lists.d.ts +0 -1
  47. package/es/components/booking/info/service/actions/index.d.ts +0 -1
  48. package/es/components/booking/info/service/addService/index.d.ts +0 -1
  49. package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  50. package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
  51. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  52. package/es/components/booking/info2/service/actions/index.d.ts +0 -1
  53. package/es/components/booking/info2/service/addService/index.d.ts +0 -1
  54. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  55. package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
  56. package/es/components/booking/materiels/duration/index.d.ts +0 -1
  57. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  58. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  59. package/es/components/booking/utils.d.ts +2 -2
  60. package/es/components/booking/utils.js +19 -11
  61. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +218 -73
  62. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  63. package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  64. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  65. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  66. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +3 -1
  67. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -4
  68. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  69. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  70. package/es/components/eventBooking/components/bookingDetailModal/index.js +70 -13
  71. package/es/components/eventBooking/index.d.ts +0 -1
  72. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  73. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  74. package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  75. package/es/components/productExtension/index.d.ts +0 -1
  76. package/es/components/productSelect/components/TabProduct/index.js +4 -2
  77. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  78. package/es/components/ticketBooking/index.d.ts +0 -1
  79. package/lib/components/Sales/Cart/index.js +30 -18
  80. package/lib/components/Sales/Cart/types.d.ts +12 -0
  81. package/lib/components/Sales/Cart/utils.d.ts +23 -0
  82. package/lib/components/Sales/Cart/utils.js +149 -0
  83. package/lib/components/Sales/Checkout/utils.d.ts +9 -1
  84. package/lib/components/Sales/Checkout/utils.js +18 -4
  85. package/lib/components/Sales/Event/Detail.d.ts +2 -0
  86. package/lib/components/Sales/Event/Detail.js +34 -10
  87. package/lib/components/Sales/Event/serve.d.ts +10 -0
  88. package/lib/components/Sales/Event/serve.js +5 -2
  89. package/lib/components/Sales/Summary/utils.js +1 -0
  90. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +3 -3
  91. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
  92. package/lib/components/appointmentBooking/components/Cart/Item/index.js +1 -1
  93. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +43 -6
  94. package/lib/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
  95. package/lib/components/appointmentBooking/components/ConfirmInformation/utils.js +37 -0
  96. package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
  97. package/lib/components/appointmentBooking/components/Content/index.js +7 -7
  98. package/lib/components/appointmentBooking/components/Content/index.less +23 -1
  99. package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
  100. package/lib/components/appointmentBooking/components/Header/index.js +5 -3
  101. package/lib/components/appointmentBooking/components/Services/index.js +18 -10
  102. package/lib/components/appointmentBooking/hooks.d.ts +2 -1
  103. package/lib/components/appointmentBooking/hooks.js +9 -3
  104. package/lib/components/appointmentBooking/index.d.ts +0 -1
  105. package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
  106. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  107. package/lib/components/booking/components/footer/index.d.ts +0 -1
  108. package/lib/components/booking/deposit/index.d.ts +0 -1
  109. package/lib/components/booking/forms/single/index.d.ts +0 -1
  110. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  111. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  112. package/lib/components/booking/info/date/index.d.ts +0 -1
  113. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  114. package/lib/components/booking/info/index.d.ts +0 -1
  115. package/lib/components/booking/info/service/Lists.d.ts +0 -1
  116. package/lib/components/booking/info/service/actions/index.d.ts +0 -1
  117. package/lib/components/booking/info/service/addService/index.d.ts +0 -1
  118. package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  119. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
  120. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  121. package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
  122. package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
  123. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  124. package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
  125. package/lib/components/booking/materiels/duration/index.d.ts +0 -1
  126. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  127. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  128. package/lib/components/booking/utils.d.ts +2 -2
  129. package/lib/components/booking/utils.js +5 -1
  130. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +128 -42
  131. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  132. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  133. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  134. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  135. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +3 -1
  136. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -2
  137. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  138. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  139. package/lib/components/eventBooking/components/bookingDetailModal/index.js +79 -24
  140. package/lib/components/eventBooking/index.d.ts +0 -1
  141. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  142. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  143. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  144. package/lib/components/productExtension/index.d.ts +0 -1
  145. package/lib/components/productSelect/components/TabProduct/index.js +6 -2
  146. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  147. package/lib/components/ticketBooking/index.d.ts +0 -1
  148. package/package.json +4 -4
@@ -51,11 +51,15 @@ var EventDetailProvider = ({
51
51
  const [currentBookingOption, setCurrentBookingOption] = (0, import_react.useState)(null);
52
52
  const { selectEvent } = (0, import_index.useEvent)();
53
53
  const customer = (0, import_useLoginUser.default)();
54
+ const currentBookingOptionRef = (0, import_react.useRef)(null);
54
55
  const _setDetail = (detailData) => {
55
56
  detailRef.current = { ...detailRef.current || {}, ...detailData || {} };
56
- console.log(detailRef.current, "55555555");
57
57
  setDetail({ ...detailRef.current });
58
58
  };
59
+ const _setCurrentBookingOption = (id) => {
60
+ currentBookingOptionRef.current = id;
61
+ setCurrentBookingOption(id);
62
+ };
59
63
  const onOpenEventDetail = (eventItem) => {
60
64
  var _a;
61
65
  setOpen(true);
@@ -73,7 +77,8 @@ var EventDetailProvider = ({
73
77
  num: 100,
74
78
  skip: 1,
75
79
  customer_id: customer == null ? void 0 : customer.id,
76
- open_quotation: 1
80
+ open_quotation: 1,
81
+ is_eject: 1
77
82
  });
78
83
  getEventDetailSelectDate.run(eventItem.id, {
79
84
  days: 366
@@ -83,16 +88,19 @@ var EventDetailProvider = ({
83
88
  setOpen(false);
84
89
  _setDetail(null);
85
90
  detailRef.current = null;
91
+ setCurrentBookingOption(null);
92
+ currentBookingOptionRef.current = null;
86
93
  };
87
94
  const onSelectEventDetail = () => {
88
- var _a, _b;
95
+ var _a, _b, _c;
89
96
  selectEvent({
90
97
  ...eventRef.current,
91
98
  eventDetail: {
92
- ...detail,
99
+ ...detailRef.current || {},
93
100
  bookingOptionItem: (_b = (_a = detail.bookingOptions) == null ? void 0 : _a.filter(
94
- (v) => v.value === currentBookingOption
95
- )) == null ? void 0 : _b[0]
101
+ (v) => v.value === currentBookingOptionRef.current
102
+ )) == null ? void 0 : _b[0],
103
+ productDetail: (_c = detailRef.current) == null ? void 0 : _c.productDetail
96
104
  }
97
105
  });
98
106
  onCloseEventDetail();
@@ -178,7 +186,7 @@ var EventDetailProvider = ({
178
186
  price: v.price,
179
187
  _originData: v
180
188
  };
181
- if (!current || current.price > v.price) {
189
+ if (!current || Number((current == null ? void 0 : current.price) || 0) > Number(v.price || 0)) {
182
190
  current = { ...option };
183
191
  }
184
192
  return option;
@@ -197,9 +205,23 @@ var EventDetailProvider = ({
197
205
  ...introduction,
198
206
  price: option.price,
199
207
  origin_price: option.original_price
200
- }
208
+ },
209
+ selectedProduct: option
210
+ // 选中的活动关联的商品
201
211
  });
202
- setCurrentBookingOption(id);
212
+ _setCurrentBookingOption(id);
213
+ };
214
+ const selectEventDetailProductDetail = (productDetail) => {
215
+ _setDetail({ productDetail });
216
+ };
217
+ const checkBeforeSelectEventDetail = () => {
218
+ var _a;
219
+ const { selectedProduct, productDetail } = detailRef.current || {};
220
+ console.log("selectedProduct", selectedProduct, productDetail);
221
+ if (((_a = selectedProduct == null ? void 0 : selectedProduct._originData) == null ? void 0 : _a.is_eject) === 1 && !productDetail) {
222
+ return false;
223
+ }
224
+ return true;
203
225
  };
204
226
  const contextValue = {
205
227
  detail,
@@ -209,7 +231,9 @@ var EventDetailProvider = ({
209
231
  onSelectEventDetail,
210
232
  selectEventDetailBookingOptions,
211
233
  getEventDetailSelectDate,
212
- currentBookingOption
234
+ currentBookingOption,
235
+ selectEventDetailProductDetail,
236
+ checkBeforeSelectEventDetail
213
237
  };
214
238
  return /* @__PURE__ */ import_react.default.createElement(EventDetailContext.Provider, { value: contextValue }, children);
215
239
  };
@@ -22,8 +22,18 @@ export declare const getEventDetailBookingOptionsApi: (params: {
22
22
  skip: number;
23
23
  customer_id?: number;
24
24
  open_quotation?: number;
25
+ is_eject?: number;
25
26
  }) => Promise<any>;
26
27
  export declare const getEventDetailSelectDateApi: (id: number | string, params: {
27
28
  days: number;
28
29
  start_date?: string;
29
30
  }) => Promise<any>;
31
+ /**
32
+ * 批量查询指定商品的最新价格
33
+ * @param params
34
+ */
35
+ export declare const getProductPrice: (params: {
36
+ ids: number[];
37
+ customer_id: number;
38
+ schedule_date?: string;
39
+ }) => Promise<any>;
@@ -23,7 +23,8 @@ __export(serve_exports, {
23
23
  getEventDetailIntroductionApi: () => getEventDetailIntroductionApi,
24
24
  getEventDetailSelectDateApi: () => getEventDetailSelectDateApi,
25
25
  getEventDetailTeacherApi: () => getEventDetailTeacherApi,
26
- getEventListApi: () => getEventListApi
26
+ getEventListApi: () => getEventListApi,
27
+ getProductPrice: () => getProductPrice
27
28
  });
28
29
  module.exports = __toCommonJS(serve_exports);
29
30
  var import_utils = require("../../../utils");
@@ -44,11 +45,13 @@ var getEventDetailSelectDateApi = (id, params) => {
44
45
  useCache: true
45
46
  });
46
47
  };
48
+ var getProductPrice = async (params) => import_utils.request.getRequest().post(`/h5/product/query/price`, params);
47
49
  // Annotate the CommonJS export names for ESM import in node:
48
50
  0 && (module.exports = {
49
51
  getEventDetailBookingOptionsApi,
50
52
  getEventDetailIntroductionApi,
51
53
  getEventDetailSelectDateApi,
52
54
  getEventDetailTeacherApi,
53
- getEventListApi
55
+ getEventListApi,
56
+ getProductPrice
54
57
  });
@@ -51,6 +51,7 @@ var calculateTaxFee = (shopInfo, items) => {
51
51
  return "0.00";
52
52
  }
53
53
  const { is_price_include_tax, tax_rate } = shopInfo || {};
54
+ console.log("shopInfo>>>", is_price_include_tax, tax_rate);
54
55
  const totalTaxFee = items.reduce((sum, item) => {
55
56
  const price = new import_decimal.default(item.price || 0);
56
57
  const taxRate = new import_decimal.default(tax_rate || 0).div(100);
@@ -46,7 +46,6 @@ var ContinueButton = ({ onNext }) => {
46
46
  const utils = context.appHelper.utils || {};
47
47
  const { isLogin, openLoginModal } = (0, import_hooks.useAppointmentBookingLogin)();
48
48
  const { accountLists, getHolders, checkAccount } = (0, import_hooks.useAppointmentBookingAccount)();
49
- const shopDiscount = (0, import_hooks.useShopDiscount)();
50
49
  const {
51
50
  currentStep,
52
51
  carts,
@@ -56,12 +55,13 @@ var ContinueButton = ({ onNext }) => {
56
55
  setIsErrorHolder,
57
56
  isLastStep
58
57
  } = (0, import_context.useAppointmentBookingContext)();
59
- const { isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
58
+ const { isFormSubject, isDateSelectedFirst } = (0, import_hooks.useAppointmentBookingSetting)();
60
59
  const stepList = (0, import_react.useMemo)(() => {
61
60
  var _a2, _b2, _c2;
62
61
  return (_c2 = (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.step) == null ? void 0 : _b2.store) == null ? void 0 : _c2.stepList;
63
62
  }, [(_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList]);
64
63
  const handleCheckAccount = () => {
64
+ if (isDateSelectedFirst) return false;
65
65
  const result = (0, import_utils2.checkHolder)({
66
66
  isFormSubject,
67
67
  checkAccount,
@@ -86,7 +86,7 @@ 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)) {
89
+ if ((currentStep == null ? void 0 : currentStep.index) + 2 >= (stepList == null ? void 0 : stepList.length)) {
90
90
  const loginOk = await handleLoginCheck();
91
91
  if (!loginOk) return;
92
92
  if (handleCheckAccount()) return;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const CartItem: ({ onNext }: any) => JSX.Element;
4
3
  export default CartItem;
@@ -59,7 +59,7 @@ var CartItem = ({ onNext }) => {
59
59
  } = (0, import_context.useAppointmentBookingContext)();
60
60
  const { accountLists, getHolders, form_id, addAccount } = (0, import_hooks2.useAppointmentBookingAccount)();
61
61
  const { getResourceList } = (0, import_hooks2.useAppointmentBookingResource)();
62
- const { isFormSubject, bookingSubject } = (0, import_hooks2.useAppointmentBookingSetting)();
62
+ const { isFormSubject, bookingSubject, isRetailTemplate } = (0, import_hooks2.useAppointmentBookingSetting)();
63
63
  const { isLogin } = (0, import_hooks2.useAppointmentBookingLogin)();
64
64
  const utils = (0, import_hooks2.contextUtils)();
65
65
  const { businessUtils } = utils;
@@ -39,6 +39,7 @@ var import_context = require("../../context");
39
39
  var import_hooks = require("../../hooks");
40
40
  var import_Item = __toESM(require("../Cart/Item"));
41
41
  var import_utils2 = require("../../utils");
42
+ var import_utils3 = require("./utils");
42
43
  var import_index = require("./index.less");
43
44
  var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
44
45
  var _a, _b;
@@ -46,12 +47,7 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
46
47
  const config = ((_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.config) || {};
47
48
  const utils = (0, import_hooks.contextUtils)();
48
49
  const { appointmentBooking, summary, isAgreeDepositPolicy, setLoading } = (0, import_context.useAppointmentBookingContext)();
49
- const shopDiscount = (0, import_hooks.useShopDiscount)();
50
- const clearData = () => {
51
- var _a2;
52
- appointmentBooking.destroy();
53
- (_a2 = shopDiscount == null ? void 0 : shopDiscount.destroy) == null ? void 0 : _a2.call(shopDiscount);
54
- };
50
+ const { isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
55
51
  const goPaymentFinish = (order_id, amount) => {
56
52
  var _a2;
57
53
  const url = `/payment-finish/success?order_id=${order_id}&amount=${Number(
@@ -60,14 +56,55 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
60
56
  (_a2 = utils == null ? void 0 : utils.history) == null ? void 0 : _a2.replace(url);
61
57
  setLoading(false);
62
58
  };
59
+ (0, import_react.useEffect)(() => {
60
+ if (isRetailTemplate) {
61
+ handleForm();
62
+ }
63
+ }, [isRetailTemplate]);
64
+ const handleForm = async (isSubmit) => {
65
+ var _a2;
66
+ const carts = await appointmentBooking.getCart();
67
+ const key = "isRetailFormSubmit";
68
+ const isRetailFormSubmit = appointmentBooking.getOtherData(key);
69
+ const callback = () => {
70
+ if (isSubmit) {
71
+ onCheckout();
72
+ }
73
+ };
74
+ if (isRetailFormSubmit) {
75
+ return callback();
76
+ }
77
+ const params = (0, import_utils3.getFormParams)(carts);
78
+ (_a2 = utils == null ? void 0 : utils.action) == null ? void 0 : _a2.call(utils, {
79
+ type: "pisell1.goProductForm",
80
+ data: params,
81
+ callback: async (e) => {
82
+ var _a3;
83
+ await appointmentBooking.updateCart({
84
+ _id: (_a3 = carts == null ? void 0 : carts[0]) == null ? void 0 : _a3._id,
85
+ relationForms: e
86
+ });
87
+ appointmentBooking.setOtherData(key, true);
88
+ callback();
89
+ }
90
+ });
91
+ };
63
92
  const handleNext = async () => {
64
93
  var _a2;
65
94
  const { deposit } = summary;
66
95
  if ((deposit == null ? void 0 : deposit.hasDeposit) && ((_a2 = deposit == null ? void 0 : deposit.protocols) == null ? void 0 : _a2.length) > 0 && !isAgreeDepositPolicy) {
67
96
  return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.deposit.agree.policy"));
68
97
  }
98
+ if (isRetailTemplate) {
99
+ handleForm(true);
100
+ return;
101
+ }
102
+ onCheckout();
103
+ };
104
+ const onCheckout = async () => {
69
105
  setLoading(true);
70
106
  try {
107
+ const { deposit } = summary;
71
108
  const { data } = await appointmentBooking.submitOrder();
72
109
  const { is_deposit, deposit_amount, total_amount, order_id } = data || {};
73
110
  const _total = is_deposit ? deposit_amount : total_amount;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @title: 获取拉开表单弹窗参数
3
+ * @description:
4
+ * @param {any} state
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2025-05-28 15:40
8
+ */
9
+ export declare const getFormParams: (carts: any[]) => {
10
+ product_id: any[];
11
+ appointment_type: string;
12
+ };
@@ -0,0 +1,37 @@
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/ConfirmInformation/utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ getFormParams: () => getFormParams
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ var getFormParams = (carts) => {
26
+ const product_id = (carts || []).map((item) => {
27
+ return item.id;
28
+ });
29
+ return {
30
+ product_id,
31
+ appointment_type: "virtual"
32
+ };
33
+ };
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ getFormParams
37
+ });
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Layout: () => JSX.Element;
4
3
  export default Layout;
@@ -62,7 +62,7 @@ var Layout = () => {
62
62
  policyParams,
63
63
  closePolicy
64
64
  } = (0, import_context.useAppointmentBookingContext)();
65
- const { isDateSelectedFirst, isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
65
+ const { isDateSelectedFirst, isFormSubject, isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
66
66
  const { isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
67
67
  const { getHolders } = (0, import_hooks.useAppointmentBookingAccount)();
68
68
  const { removeStep, stepList } = (0, import_hooks.useAppointmentBookingStep)();
@@ -80,12 +80,12 @@ var Layout = () => {
80
80
  }, []);
81
81
  (0, import_react.useEffect)(() => {
82
82
  try {
83
+ if (!(appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || isRetailTemplate) return;
83
84
  if (isFormSubject) {
84
85
  removeStep("select-guest");
85
86
  } else {
86
87
  appointmentBooking.addStep(
87
88
  {
88
- index: (currentStep == null ? void 0 : currentStep.index) + 1,
89
89
  key: "select-guest",
90
90
  description: import_utils.locales.getText("pisell2.appointment.add-guests")
91
91
  },
@@ -94,12 +94,12 @@ var Layout = () => {
94
94
  }
95
95
  } catch (error) {
96
96
  }
97
- }, [isFormSubject]);
97
+ }, [isFormSubject, isRetailTemplate]);
98
98
  (0, import_react.useEffect)(() => {
99
- if (isFormSubject && isLogin) {
99
+ if (isFormSubject && isLogin && !isRetailTemplate) {
100
100
  getHolders();
101
101
  }
102
- }, [isFormSubject, isLogin]);
102
+ }, [isFormSubject, isLogin, isRetailTemplate]);
103
103
  (0, import_react.useEffect)(() => {
104
104
  if (!(currentStep == null ? void 0 : currentStep.step)) return;
105
105
  setLoading(false);
@@ -172,10 +172,10 @@ var Layout = () => {
172
172
  if (isDateSelectedFirst && key === "select-date") return false;
173
173
  return key !== "confirm-information";
174
174
  }, [isDateSelectedFirst, (_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.key]);
175
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Header.default, null), /* @__PURE__ */ import_react.default.createElement(
175
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !isRetailTemplate ? /* @__PURE__ */ import_react.default.createElement(import_Header.default, null) : null, /* @__PURE__ */ import_react.default.createElement(
176
176
  "div",
177
177
  {
178
- className: `parallel-content-wrap ${(0, import_utils.isMobile)() ? "parallel-content-mobile-wrap" : ""}`
178
+ className: `parallel-content-wrap ${(0, import_utils.isMobile)() ? "parallel-content-mobile-wrap" : ""} ${isRetailTemplate ? "parallel-content-retail-wrap" : ""}`
179
179
  },
180
180
  /* @__PURE__ */ import_react.default.createElement("div", { className: "parallel-content-left" }, Com),
181
181
  isShowCartCom
@@ -1,5 +1,6 @@
1
1
  .parallel-content-wrap {
2
2
  width: 1000px;
3
+ max-width: 100%;
3
4
  display: flex;
4
5
  gap: 6px;
5
6
  // align-items: center;
@@ -13,7 +14,9 @@
13
14
 
14
15
  .parallel-content-left {
15
16
  flex: 1;
16
- width: 634px;
17
+ // width: 634px;
18
+ width: auto;
19
+ min-width: 0;
17
20
  // padding: 16px 0;
18
21
 
19
22
  .appointment-resource-wrap {
@@ -37,6 +40,8 @@
37
40
  position: sticky;
38
41
  top: 93px;
39
42
  height: fit-content;
43
+ flex: 0 0 360px;
44
+ background-color: #fff;
40
45
  }
41
46
  }
42
47
 
@@ -89,3 +94,20 @@
89
94
  }
90
95
  }
91
96
  }
97
+
98
+ .parallel-content-retail-wrap {
99
+ .pisell-product-select-wrapper {
100
+ .pisell-product-select-tabs-wrapper {
101
+ top: 0px !important;
102
+ }
103
+ }
104
+
105
+ .parallel-content-right {
106
+ top: 16px;
107
+ margin-top: 0;
108
+
109
+ .appointment-cart-item-wrap {
110
+ height: calc(100vh - 16px) !important;
111
+ }
112
+ }
113
+ }
@@ -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;
@@ -90,9 +90,11 @@ var Header = () => {
90
90
  appointmentBooking.deleteCartItemInfo("resource");
91
91
  }
92
92
  appointmentBooking.back();
93
- if ((resourceStep == null ? void 0 : resourceStep.isSkip) && ((resourceStep == null ? void 0 : resourceStep.key) === "select-resource" || (resourceStep == null ? void 0 : resourceStep.key) === "select-service")) {
94
- updateStep(resourceStep == null ? void 0 : resourceStep.key, {
95
- index: currentStep == null ? void 0 : currentStep.index,
93
+ const prevStepData = stepList[(currentStep == null ? void 0 : currentStep.index) - 1];
94
+ const currentStepData = stepList[currentStep == null ? void 0 : currentStep.index];
95
+ if ((currentStepData == null ? void 0 : currentStepData.isSkip) || (prevStepData == null ? void 0 : prevStepData.isSkip)) {
96
+ const key2 = (currentStepData == null ? void 0 : currentStepData.isSkip) ? currentStepData == null ? void 0 : currentStepData.key : prevStepData == null ? void 0 : prevStepData.key;
97
+ updateStep(key2, {
96
98
  isSkip: false
97
99
  });
98
100
  }
@@ -45,7 +45,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
45
45
  const context = (0, import_useEngineContext.default)();
46
46
  const { utils } = context.appHelper || {};
47
47
  const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
48
- const { isDateSelectedFirst } = (0, import_hooks.useAppointmentBookingSetting)();
48
+ const { isDateSelectedFirst, isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
49
49
  const { getProducts, checkProductType } = (0, import_hooks.useAppointmentBookingProduct)();
50
50
  const { removeStep, nextStep } = (0, import_hooks.useAppointmentBookingStep)();
51
51
  const { currentStep } = (0, import_context.useAppointmentBookingContext)();
@@ -67,9 +67,12 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
67
67
  });
68
68
  }, [isDateSelectedFirst]);
69
69
  const handleSelectProduct = async (item) => {
70
- const type = await checkProductType(item == null ? void 0 : item.id);
71
- if (type === "session") {
72
- appointmentBooking.openProductDetail(item.id);
70
+ let type = "";
71
+ if (!isRetailTemplate) {
72
+ type = await checkProductType(item == null ? void 0 : item.id);
73
+ if (type === "session") {
74
+ appointmentBooking.openProductDetail(item.id);
75
+ }
73
76
  }
74
77
  utils == null ? void 0 : utils.action({
75
78
  type: "pisell1.productDetail",
@@ -78,6 +81,16 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
78
81
  },
79
82
  callback: async (data) => {
80
83
  var _a, _b;
84
+ const product = {
85
+ ...data,
86
+ options: (data == null ? void 0 : data.option) || []
87
+ };
88
+ delete product.option;
89
+ if (isRetailTemplate) {
90
+ if (data == null ? void 0 : data.isCancel) return;
91
+ appointmentBooking.storeProduct(product);
92
+ return;
93
+ }
81
94
  if (data == null ? void 0 : data.isCancel) {
82
95
  if (type === "session") {
83
96
  appointmentBooking.closeProductDetail();
@@ -86,11 +99,6 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
86
99
  return;
87
100
  }
88
101
  const session = data == null ? void 0 : data.session;
89
- const product = {
90
- ...data,
91
- options: (data == null ? void 0 : data.option) || []
92
- };
93
- delete product.option;
94
102
  if (session) {
95
103
  const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
96
104
  const endDate = (0, import_dayjs.default)(session == null ? void 0 : session.end_at).format("YYYY-MM-DD");
@@ -102,7 +110,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
102
110
  }
103
111
  });
104
112
  appointmentBooking.closeProductDetail();
105
- appointmentBooking.getAvailableDate({
113
+ await appointmentBooking.getAvailableDate({
106
114
  startDate,
107
115
  endDate
108
116
  });
@@ -14,7 +14,7 @@ export declare const useAppointmentBookingStep: () => {
14
14
  removeStep: (key: string) => any;
15
15
  addStep: (props: any, stepKey?: string) => any;
16
16
  updateStep: (key: string, step: any) => void;
17
- nextStep: () => void;
17
+ nextStep: () => any;
18
18
  };
19
19
  /**
20
20
  * @title: 获取商品数据
@@ -97,6 +97,7 @@ export declare const useIsSkipResourceStep: () => {
97
97
  export declare const useAppointmentBookingSetting: () => {
98
98
  isDateSelectedFirst: boolean;
99
99
  isFormSubject: boolean;
100
+ isRetailTemplate: any;
100
101
  customPageId: any;
101
102
  channel: any;
102
103
  bookingSubject: any;
@@ -67,6 +67,7 @@ var useAppointmentBookingStep = () => {
67
67
  var _a, _b, _c;
68
68
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
69
69
  const { appointmentBooking, setCurrentStep, policyIdsRef, openPolicy } = (0, import_context.useAppointmentBookingContext)();
70
+ const { isRetailTemplate } = useAppointmentBookingSetting();
70
71
  const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
71
72
  const getCurrentAndLastStep = () => {
72
73
  const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
@@ -115,6 +116,9 @@ var useAppointmentBookingStep = () => {
115
116
  };
116
117
  const nextStep = () => {
117
118
  var _a2, _b2, _c2, _d;
119
+ if (isRetailTemplate) {
120
+ return appointmentBooking.next();
121
+ }
118
122
  const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
119
123
  const stepList2 = ((_c2 = (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.step) == null ? void 0 : _b2.store) == null ? void 0 : _c2.stepList) || [];
120
124
  if ((currentStep == null ? void 0 : currentStep.index) + 2 === (stepList2 == null ? void 0 : stepList2.length)) {
@@ -139,9 +143,9 @@ var useAppointmentBookingStep = () => {
139
143
  return { getStepIndex, stepList, removeStep, addStep, updateStep, nextStep };
140
144
  };
141
145
  var useAppointmentBookingProduct = () => {
142
- const { appointmentBooking, carts } = (0, import_context.useAppointmentBookingContext)();
146
+ const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
143
147
  const { productModuleParams } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
144
- const { bookingProcess, bookingSubject } = productModuleParams || {};
148
+ const { bookingProcess } = productModuleParams || {};
145
149
  const getProducts = async () => {
146
150
  var _a;
147
151
  if (bookingProcess === "date_first") {
@@ -345,7 +349,7 @@ var useIsSkipResourceStep = () => {
345
349
  return { checkSkipResourceStep };
346
350
  };
347
351
  var useAppointmentBookingSetting = () => {
348
- var _a;
352
+ var _a, _b;
349
353
  const utils = contextUtils();
350
354
  const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
351
355
  const { bookingProcess, bookingSubject, customPageId, channel } = ((_a = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a.productModuleParams) || {};
@@ -363,6 +367,8 @@ var useAppointmentBookingSetting = () => {
363
367
  isDateSelectedFirst: bookingProcess === "date_first",
364
368
  // 主体是否是表单
365
369
  isFormSubject: (bookingSubject == null ? void 0 : bookingSubject.type) === "form",
370
+ // 是否是零售模版
371
+ isRetailTemplate: ((_b = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _b.isRetailTemplate) || false,
366
372
  customPageId,
367
373
  channel,
368
374
  bookingSubject,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const AppointmentBooking: () => JSX.Element;
4
3
  export default AppointmentBooking;
@@ -1,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: 底部
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Deposit: (props: any) => JSX.Element;
3
2
  export default Deposit;
@@ -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
  interface AddServiceVariantProps {
3
2
  globalState: any;
4
3
  setGlobalState: any;
@@ -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 { EditServiceRef } from "../service/editService";
3
2
  declare const useInfoHolder: (state: any, dispatch: any) => {
4
3
  detailRef: import("react").MutableRefObject<EditServiceRef | undefined>;
@@ -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 Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
3
2
  export default Lists;