@pisell/private-materials 3.3.106 → 3.4.1

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 (87) 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/businessModel/SalesModel/index.d.ts +0 -1
  8. package/es/components/Sales/Cart/index.js +8 -3
  9. package/es/components/Sales/Checkout/utils.d.ts +6 -1
  10. package/es/components/Sales/Checkout/utils.js +9 -4
  11. package/es/components/Sales/Customer/index.d.ts +1 -0
  12. package/es/components/Sales/Customer/index.js +1 -0
  13. package/es/components/appointmentBooking/components/Form/index.js +1 -1
  14. package/es/components/appointmentBooking/components/Form/utils.d.ts +1 -1
  15. package/es/components/appointmentBooking/components/Form/utils.js +17 -15
  16. package/es/components/appointmentBooking/components/Header/index.js +2 -1
  17. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  18. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  19. package/es/components/booking/info/service/like/index.d.ts +0 -1
  20. package/es/components/booking/info/service/serviceManager/index.js +4 -4
  21. package/es/components/booking/info2/service/editService/index.js +1 -1
  22. package/es/components/booking/info2/utils.d.ts +4 -0
  23. package/es/components/eftpos/deviceList/index.d.ts +0 -1
  24. package/es/components/eftpos/form/index.d.ts +0 -1
  25. package/es/components/eftpos/group/index.d.ts +0 -1
  26. package/es/components/eftpos/hooks.d.ts +0 -1
  27. package/es/components/eftpos/icon/apiKey.d.ts +0 -1
  28. package/es/components/eftpos/icon/device.d.ts +0 -1
  29. package/es/components/eftpos/receipt/index.d.ts +0 -1
  30. package/es/components/eftpos/surcharge/index.d.ts +0 -1
  31. package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
  32. package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
  33. package/es/components/eftposPay/component/step/step.d.ts +0 -1
  34. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  35. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +13 -4
  36. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  37. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  38. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  39. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  40. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  41. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  42. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  43. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  44. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  45. package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
  46. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  47. package/lib/businessModel/SalesModel/index.d.ts +0 -1
  48. package/lib/components/Sales/Cart/index.js +8 -4
  49. package/lib/components/Sales/Checkout/utils.d.ts +6 -1
  50. package/lib/components/Sales/Checkout/utils.js +5 -3
  51. package/lib/components/Sales/Customer/index.d.ts +1 -0
  52. package/lib/components/Sales/Customer/index.js +1 -0
  53. package/lib/components/appointmentBooking/components/Form/index.js +6 -1
  54. package/lib/components/appointmentBooking/components/Form/utils.d.ts +1 -1
  55. package/lib/components/appointmentBooking/components/Form/utils.js +9 -12
  56. package/lib/components/appointmentBooking/components/Header/index.js +1 -0
  57. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  58. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  59. package/lib/components/booking/info/service/like/index.d.ts +0 -1
  60. package/lib/components/booking/info/service/serviceManager/index.js +3 -3
  61. package/lib/components/booking/info2/service/editService/index.js +1 -1
  62. package/lib/components/booking/info2/utils.d.ts +4 -0
  63. package/lib/components/eftpos/deviceList/index.d.ts +0 -1
  64. package/lib/components/eftpos/form/index.d.ts +0 -1
  65. package/lib/components/eftpos/group/index.d.ts +0 -1
  66. package/lib/components/eftpos/hooks.d.ts +0 -1
  67. package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
  68. package/lib/components/eftpos/icon/device.d.ts +0 -1
  69. package/lib/components/eftpos/receipt/index.d.ts +0 -1
  70. package/lib/components/eftpos/surcharge/index.d.ts +0 -1
  71. package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
  72. package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
  73. package/lib/components/eftposPay/component/step/step.d.ts +0 -1
  74. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  75. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +14 -5
  76. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  77. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  78. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  79. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  80. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  81. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  82. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  83. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  84. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  85. package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
  86. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  87. package/package.json +3 -3
@@ -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;
@@ -31,6 +31,7 @@ export var CartContext = /*#__PURE__*/createContext(undefined);
31
31
  export var CartProvider = function CartProvider(_ref) {
32
32
  var children = _ref.children;
33
33
  var _useCustomer = useCustomer(),
34
+ appContext = _useCustomer.appContext,
34
35
  appUtils = _useCustomer.appUtils,
35
36
  getUserInfo = _useCustomer.getUserInfo;
36
37
  var _useSales = useSales(),
@@ -228,12 +229,16 @@ export var CartProvider = function CartProvider(_ref) {
228
229
  */
229
230
  var checkBeforeAddToCart = function checkBeforeAddToCart() {
230
231
  return new Promise(function (resolve) {
232
+ var _appContext$appHelper;
231
233
  var _cartData = getCurrentData().cartData;
232
234
  var newCartItem = createCartItemData() || {};
233
235
  var params = formatValues({
234
- cartData: {
235
- cartItems: [].concat(_toConsumableArray(_cartData.cartItems || []), [newCartItem])
236
- }
236
+ state: {
237
+ cartData: {
238
+ cartItems: [].concat(_toConsumableArray(_cartData.cartItems || []), [newCartItem])
239
+ }
240
+ },
241
+ platform: appContext === null || appContext === void 0 || (_appContext$appHelper = appContext.appHelper) === null || _appContext$appHelper === void 0 || (_appContext$appHelper = _appContext$appHelper.constants) === null || _appContext$appHelper === void 0 ? void 0 : _appContext$appHelper.platform
237
242
  });
238
243
  checkRef.current = {
239
244
  callback: function callback(res) {
@@ -24,7 +24,12 @@ export declare const formatProductBundle: (bundle: any) => any;
24
24
  * @Author: xiangfeng.xue
25
25
  * @Date: 2025-01-21 17:57
26
26
  */
27
- export declare const formatValues: (state: any, excludeDisabled?: boolean, otherValue?: Record<string, any>) => any;
27
+ export declare const formatValues: (params: {
28
+ state: any;
29
+ platform: 'h5' | 'pc';
30
+ excludeDisabled?: boolean;
31
+ extra?: Record<string, any>;
32
+ }) => any;
28
33
  /**
29
34
  * @title: 获取拉开表单弹窗参数
30
35
  * @param state
@@ -84,16 +84,21 @@ var formatBookings = function formatBookings(list) {
84
84
  * @Author: xiangfeng.xue
85
85
  * @Date: 2025-01-21 17:57
86
86
  */
87
- export var formatValues = function formatValues(state, excludeDisabled, otherValue) {
87
+ export var formatValues = function formatValues(params) {
88
+ var state = params.state,
89
+ platform = params.platform,
90
+ excludeDisabled = params.excludeDisabled,
91
+ extra = params.extra;
88
92
  var values = _objectSpread({
89
93
  type: 'event_booking_v2',
90
- platform: 'H5',
94
+ platform: platform === 'pc' ? 'PC' : 'H5',
91
95
  sales_channel: 'my_pisel',
92
96
  order_sales_channel: 'online_store',
93
97
  bookings: [],
94
98
  shop_note: '',
95
99
  schedule_date: ''
96
- }, otherValue || {});
100
+ }, extra || {});
101
+ console.log('values', values);
97
102
  var data = [];
98
103
  if (excludeDisabled) {
99
104
  var _state$cartData$cartI, _state$cartData$cartI2;
@@ -121,6 +126,6 @@ export var getFormParams = function getFormParams(state) {
121
126
  });
122
127
  return {
123
128
  product_id: product_id,
124
- appointment_type: "event_booking_v2"
129
+ appointment_type: 'event_booking_v2'
125
130
  };
126
131
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  interface CustomerData {
3
3
  }
4
4
  interface CustomerContextType {
5
+ appContext: any;
5
6
  appUtils: any;
6
7
  isLogin: () => boolean;
7
8
  openLoginModal: (params: any) => void;
@@ -34,6 +34,7 @@ export var CustomerProvider = function CustomerProvider(_ref) {
34
34
  return userInfo !== null && userInfo !== void 0 && userInfo.id ? userInfo : localUserInfo;
35
35
  };
36
36
  var contextValue = {
37
+ appContext: context,
37
38
  appUtils: utils,
38
39
  isLogin: isLogin,
39
40
  openLoginModal: openLoginModal,
@@ -104,7 +104,7 @@ var Form = /*#__PURE__*/forwardRef(function (props, ref) {
104
104
  // 更新表单购物车
105
105
  appointmentBooking.updateCart({
106
106
  _id: appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.cart_id,
107
- relationForms: updateRelationForms(carts, appointmentBoard, values)
107
+ relationForms: updateRelationForms(carts, appointmentBoard, values, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key)
108
108
  });
109
109
  };
110
110
 
@@ -5,4 +5,4 @@
5
5
  * @Author: WangHan
6
6
  * @Date: 2025-05-26 16:58
7
7
  */
8
- export declare const updateRelationForms: (carts: any[], currentCart: any, values: any) => any;
8
+ export declare const updateRelationForms: (carts: any[], currentCart: any, values: any, currentStepKey?: string) => any;
@@ -5,32 +5,34 @@
5
5
  * @Author: WangHan
6
6
  * @Date: 2025-05-26 16:58
7
7
  */
8
- export var updateRelationForms = function updateRelationForms(carts, currentCart, values) {
8
+ export var updateRelationForms = function updateRelationForms(carts, currentCart, values, currentStepKey) {
9
9
  var _cartItem$_origin;
10
10
  if (!(currentCart !== null && currentCart !== void 0 && currentCart.cart_id)) return [];
11
+ // 不同情况如下:
12
+ // 1. 一个商品,一个资源,一个表单
13
+ // 2. 一个商品,多个资源,多个表单
14
+ // 3. 多个商品,一个资源,一个表单
15
+ // 4. 多个商品,多个资源,多个表单
16
+
11
17
  var cartItem = carts === null || carts === void 0 ? void 0 : carts.find(function (item) {
12
18
  return (item === null || item === void 0 ? void 0 : item._id) === (currentCart === null || currentCart === void 0 ? void 0 : currentCart.cart_id);
13
19
  });
14
20
  var oldLists = (cartItem === null || cartItem === void 0 || (_cartItem$_origin = cartItem._origin) === null || _cartItem$_origin === void 0 ? void 0 : _cartItem$_origin.relation_forms) || [];
15
21
  var newData = {
16
22
  form_id: Number(values === null || values === void 0 ? void 0 : values.form_id),
17
- form_record_id: values === null || values === void 0 ? void 0 : values.form_record_id
23
+ form_record_ids: [values === null || values === void 0 ? void 0 : values.form_record_id],
24
+ cartId: currentCart === null || currentCart === void 0 ? void 0 : currentCart.cart_id,
25
+ currentStepKey: currentStepKey
18
26
  };
19
- var exist = oldLists.find(function (item) {
20
- return item.form_id === (newData === null || newData === void 0 ? void 0 : newData.form_id);
21
- });
22
27
 
23
- // 如果在目前的数组中找到form_id相同的,则更新form_record_ids参数,否则新增一条数据
24
- if (exist) {
25
- var _exist$form_record_id;
26
- if (!(exist !== null && exist !== void 0 && (_exist$form_record_id = exist.form_record_ids) !== null && _exist$form_record_id !== void 0 && _exist$form_record_id.includes(newData.form_record_id))) {
27
- exist.form_record_ids.push(newData.form_record_id);
28
- }
28
+ // 查找是否有相同 cartId 和 form_id 的项
29
+ var existIndex = oldLists.findIndex(function (item) {
30
+ return item.cartId === newData.cartId && item.form_id === newData.form_id && item.currentStepKey === newData.currentStepKey;
31
+ });
32
+ if (existIndex > -1) {
33
+ oldLists[existIndex].form_record_ids = newData.form_record_ids;
29
34
  } else {
30
- oldLists.push({
31
- form_id: newData.form_id,
32
- form_record_ids: [newData.form_record_id]
33
- });
35
+ oldLists = oldLists.concat(newData);
34
36
  }
35
37
  return oldLists;
36
38
  };
@@ -106,7 +106,8 @@ var Header = function Header() {
106
106
  // 5. 清空表单数据
107
107
  if (key.startsWith('fill-form')) {
108
108
  form_key = 'booking_form';
109
- booking_form = getOtherData(form_key);
109
+ booking_form = getOtherData(form_key); // 移除表单步骤
110
+ removeStep(key);
110
111
  setOtherData(form_key, _objectSpread(_objectSpread({}, booking_form), {}, _defineProperty({}, key, {})));
111
112
  }
112
113
 
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const FormItemChildrenWrap: (props: any) => JSX.Element;
3
2
  export default FormItemChildrenWrap;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useIsLowSpeedNetwork: () => import("react").MutableRefObject<boolean>;
3
2
  export default useIsLowSpeedNetwork;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const Like: ({ status, onChange, className, style, }: {
4
3
  style?: any;
@@ -166,10 +166,10 @@ export var useService = function useService(_ref) {
166
166
  _extend.endDate = endDate;
167
167
  }
168
168
  resourceItem = currentResource(changeValues.resource);
169
- _ref6 = (resourceItem === null || resourceItem === void 0 || (_resourceItem$_extend = resourceItem._extend) === null || _resourceItem$_extend === void 0 ? void 0 : _resourceItem$_extend.usableTime) || {}, relation_type = _ref6.relation_type, item_id = _ref6.item_id, schedule_id = _ref6.schedule_id;
170
- _extend.relation_type = relation_type || 'form';
171
- _extend.relation_id = item_id || (resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.form_record_id) || 0;
172
- _extend.schedule_id = schedule_id || 0;
169
+ _ref6 = (resourceItem === null || resourceItem === void 0 || (_resourceItem$_extend = resourceItem._extend) === null || _resourceItem$_extend === void 0 ? void 0 : _resourceItem$_extend.usableTime) || {}, relation_type = _ref6.relation_type, item_id = _ref6.item_id, schedule_id = _ref6.schedule_id; // 资源item中的数据 > 原数据 > 兜底
170
+ _extend.relation_type = relation_type || (_extend === null || _extend === void 0 ? void 0 : _extend.relation_type) || 'form';
171
+ _extend.relation_id = item_id || (resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.form_record_id) || (_extend === null || _extend === void 0 ? void 0 : _extend.relation_id) || 0;
172
+ _extend.schedule_id = schedule_id || (_extend === null || _extend === void 0 ? void 0 : _extend.schedule_id) || 0;
173
173
  if (_extend.bundle_edit !== undefined) {
174
174
  _extend.bundle_edit = 1;
175
175
  }
@@ -700,7 +700,7 @@ var Info = function Info(_, ref) {
700
700
  })), /*#__PURE__*/React.createElement(Button, {
701
701
  type: "primary",
702
702
  className: "pisell-lowcode__booking-service-body-edit-footer-apple",
703
- disabled: !((_state$service$resour = state.service.resourcesOrigin) !== null && _state$service$resour !== void 0 && _state$service$resour.length),
703
+ disabled: !isNormalProduct && !((_state$service$resour = state.service.resourcesOrigin) !== null && _state$service$resour !== void 0 && _state$service$resour.length),
704
704
  onClick: function onClick() {
705
705
  form.submit();
706
706
  }
@@ -0,0 +1,4 @@
1
+ export declare const getFormatResourceListAndMap: (data: any[], bookingId?: number[]) => {
2
+ list: any[];
3
+ listMap: any;
4
+ };
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const _default: ({ input, ...formItemProps }: any) => JSX.Element;
3
2
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @title: 递归循环表单数据
4
3
  * @Author: hongbing.wang
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { RadioGroupProps } from 'antd';
3
2
  export declare const CheckboxGroup: ({ direction, options, ...props }: any) => JSX.Element;
4
3
  export declare const RadioGroup: ({ direction, options, ...props }: RadioGroupProps & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Eftpos } from './const';
3
2
  /**
4
3
  * @title: tyro 设备连接
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const _default: ({ color }: {
3
2
  color?: string | undefined;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const _default: ({ color }: {
3
2
  color?: string | undefined;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @title: 自定义组件设置
4
3
  * @description: 自定义组件设置
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.css';
3
2
  /**
4
3
  * @title: 自定义组件设置
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const _default: () => JSX.Element;
3
2
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './titlebar.less';
3
2
  declare enum EPopupTitleBarVariantType {
4
3
  BackTitleClose = "back-title-cancel",
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const _default: (props: {
3
2
  status: string;
4
3
  pedding?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @title: 获取 Tyro 资源
4
3
  * @description:
@@ -90,6 +90,7 @@ var ContinueButton = function ContinueButton() {
90
90
  data: params,
91
91
  callback: function () {
92
92
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
93
+ var _context$appHelper2;
93
94
  var value, result, _result$err;
94
95
  return _regeneratorRuntime().wrap(function _callee$(_context) {
95
96
  while (1) switch (_context.prev = _context.next) {
@@ -100,8 +101,13 @@ var ContinueButton = function ContinueButton() {
100
101
  }
101
102
  return _context.abrupt("return");
102
103
  case 2:
103
- value = formatValues(data, false, {
104
- relation_forms: e
104
+ value = formatValues({
105
+ state: data,
106
+ platform: context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.constants) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.platform,
107
+ excludeDisabled: false,
108
+ extra: {
109
+ relation_forms: e
110
+ }
105
111
  }); // 如果检测成功,则直接下单
106
112
  _context.next = 5;
107
113
  return onCheckout(value);
@@ -384,7 +390,7 @@ var ContinueButton = function ContinueButton() {
384
390
  */
385
391
  var handleContinue = /*#__PURE__*/function () {
386
392
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
387
- var value, checkRes, emptyHolders;
393
+ var _context$appHelper3, value, checkRes, emptyHolders;
388
394
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
389
395
  while (1) switch (_context6.prev = _context6.next) {
390
396
  case 0:
@@ -392,7 +398,10 @@ var ContinueButton = function ContinueButton() {
392
398
  _context6.next = 14;
393
399
  break;
394
400
  }
395
- value = formatValues(data); // 检测商品是否可以下单
401
+ value = formatValues({
402
+ state: data,
403
+ platform: context === null || context === void 0 || (_context$appHelper3 = context.appHelper) === null || _context$appHelper3 === void 0 || (_context$appHelper3 = _context$appHelper3.constants) === null || _context$appHelper3 === void 0 ? void 0 : _context$appHelper3.platform
404
+ }); // 检测商品是否可以下单
396
405
  _context6.next = 4;
397
406
  return onCheckBeforeBooking(value);
398
407
  case 4:
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const DayItem: (props: any) => JSX.Element;
4
3
  export default DayItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  import { CalendarItemProps } from '../../../../../type';
4
3
  declare const Item: (props: CalendarItemProps) => JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const StripePayment: () => JSX.Element;
3
2
  export default StripePayment;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const StripeSDK: ({ public_key, client_secret, children, lang, }: {
3
2
  public_key: string;
4
3
  client_secret?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const StripeSDK: ({ public_key, client_secret, children, lang, }: {
3
2
  public_key: string;
4
3
  client_secret?: string | undefined;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const PageLoading: () => JSX.Element;
3
2
  export default PageLoading;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const PaymentRequestForm: () => JSX.Element | null;
3
2
  export default PaymentRequestForm;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.module.less';
3
2
  declare const StripePayment: () => JSX.Element;
4
3
  export default StripePayment;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  import { ScheduleItem } from '../../../type';
4
3
  declare type Item = any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const RelationProduct: ({ value, onChange, }: {
4
3
  value?: any;
@@ -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
  declare const SalesModel: ({ children, hooks, config }: any) => JSX.Element;
3
2
  export * from './Sales';
4
3
  export default SalesModel;
@@ -52,7 +52,7 @@ var CartContext = (0, import_react.createContext)(
52
52
  void 0
53
53
  );
54
54
  var CartProvider = ({ children }) => {
55
- const { appUtils, getUserInfo } = (0, import_Customer.useCustomer)();
55
+ const { appContext, appUtils, getUserInfo } = (0, import_Customer.useCustomer)();
56
56
  const { data, setData, hooks, getCurrentData } = (0, import_SalesModel.useSales)();
57
57
  const [openCart, setOpen] = (0, import_react.useState)(false);
58
58
  const checkRef = (0, import_react.useRef)(null);
@@ -203,12 +203,16 @@ var CartProvider = ({ children }) => {
203
203
  });
204
204
  const checkBeforeAddToCart = () => {
205
205
  return new Promise((resolve) => {
206
+ var _a, _b;
206
207
  const _cartData = getCurrentData().cartData;
207
208
  const newCartItem = createCartItemData() || {};
208
209
  const params = (0, import_utils2.formatValues)({
209
- cartData: {
210
- cartItems: [..._cartData.cartItems || [], newCartItem]
211
- }
210
+ state: {
211
+ cartData: {
212
+ cartItems: [..._cartData.cartItems || [], newCartItem]
213
+ }
214
+ },
215
+ platform: (_b = (_a = appContext == null ? void 0 : appContext.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.platform
212
216
  });
213
217
  checkRef.current = {
214
218
  callback: (res) => {
@@ -24,7 +24,12 @@ export declare const formatProductBundle: (bundle: any) => any;
24
24
  * @Author: xiangfeng.xue
25
25
  * @Date: 2025-01-21 17:57
26
26
  */
27
- export declare const formatValues: (state: any, excludeDisabled?: boolean, otherValue?: Record<string, any>) => any;
27
+ export declare const formatValues: (params: {
28
+ state: any;
29
+ platform: 'h5' | 'pc';
30
+ excludeDisabled?: boolean;
31
+ extra?: Record<string, any>;
32
+ }) => any;
28
33
  /**
29
34
  * @title: 获取拉开表单弹窗参数
30
35
  * @param state
@@ -61,18 +61,20 @@ var formatBookings = (list) => {
61
61
  });
62
62
  return bookings;
63
63
  };
64
- var formatValues = (state, excludeDisabled, otherValue) => {
64
+ var formatValues = (params) => {
65
65
  var _a, _b;
66
+ const { state, platform, excludeDisabled, extra } = params;
66
67
  let values = {
67
68
  type: "event_booking_v2",
68
- platform: "H5",
69
+ platform: platform === "pc" ? "PC" : "H5",
69
70
  sales_channel: "my_pisel",
70
71
  order_sales_channel: "online_store",
71
72
  bookings: [],
72
73
  shop_note: "",
73
74
  schedule_date: "",
74
- ...otherValue || {}
75
+ ...extra || {}
75
76
  };
77
+ console.log("values", values);
76
78
  let data = [];
77
79
  if (excludeDisabled) {
78
80
  data = (_b = (_a = state.cartData.cartItems) == null ? void 0 : _a.filter) == null ? void 0 : _b.call(_a, (v) => v.disabled !== true);
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  interface CustomerData {
3
3
  }
4
4
  interface CustomerContextType {
5
+ appContext: any;
5
6
  appUtils: any;
6
7
  isLogin: () => boolean;
7
8
  openLoginModal: (params: any) => void;
@@ -67,6 +67,7 @@ var CustomerProvider = ({
67
67
  return (userInfo == null ? void 0 : userInfo.id) ? userInfo : localUserInfo;
68
68
  };
69
69
  const contextValue = {
70
+ appContext: context,
70
71
  appUtils: utils,
71
72
  isLogin,
72
73
  openLoginModal,
@@ -87,7 +87,12 @@ var Form = (0, import_react.forwardRef)((props, ref) => {
87
87
  setOtherData(key, { ...newData });
88
88
  appointmentBooking.updateCart({
89
89
  _id: appointmentBoard == null ? void 0 : appointmentBoard.cart_id,
90
- relationForms: (0, import_utils2.updateRelationForms)(carts, appointmentBoard, values)
90
+ relationForms: (0, import_utils2.updateRelationForms)(
91
+ carts,
92
+ appointmentBoard,
93
+ values,
94
+ currentStepParams == null ? void 0 : currentStepParams.key
95
+ )
91
96
  });
92
97
  };
93
98
  const handleFormFinish = (status, values) => {
@@ -5,4 +5,4 @@
5
5
  * @Author: WangHan
6
6
  * @Date: 2025-05-26 16:58
7
7
  */
8
- export declare const updateRelationForms: (carts: any[], currentCart: any, values: any) => any;
8
+ export declare const updateRelationForms: (carts: any[], currentCart: any, values: any, currentStepKey?: string) => any;
@@ -22,24 +22,21 @@ __export(utils_exports, {
22
22
  updateRelationForms: () => updateRelationForms
23
23
  });
24
24
  module.exports = __toCommonJS(utils_exports);
25
- var updateRelationForms = (carts, currentCart, values) => {
26
- var _a, _b;
25
+ var updateRelationForms = (carts, currentCart, values, currentStepKey) => {
26
+ var _a;
27
27
  if (!(currentCart == null ? void 0 : currentCart.cart_id)) return [];
28
28
  const cartItem = carts == null ? void 0 : carts.find(
29
29
  (item) => (item == null ? void 0 : item._id) === (currentCart == null ? void 0 : currentCart.cart_id)
30
30
  );
31
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
- }
32
+ const newData = { form_id: Number(values == null ? void 0 : values.form_id), form_record_ids: [values == null ? void 0 : values.form_record_id], cartId: currentCart == null ? void 0 : currentCart.cart_id, currentStepKey };
33
+ const existIndex = oldLists.findIndex(
34
+ (item) => item.cartId === newData.cartId && item.form_id === newData.form_id && item.currentStepKey === newData.currentStepKey
35
+ );
36
+ if (existIndex > -1) {
37
+ oldLists[existIndex].form_record_ids = newData.form_record_ids;
38
38
  } else {
39
- oldLists.push({
40
- form_id: newData.form_id,
41
- form_record_ids: [newData.form_record_id]
42
- });
39
+ oldLists = oldLists.concat(newData);
43
40
  }
44
41
  return oldLists;
45
42
  };
@@ -99,6 +99,7 @@ var Header = () => {
99
99
  if (key.startsWith("fill-form")) {
100
100
  const form_key = "booking_form";
101
101
  let booking_form = getOtherData(form_key);
102
+ removeStep(key);
102
103
  setOtherData(form_key, { ...booking_form, [key]: {} });
103
104
  }
104
105
  appointmentBooking.back();
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const FormItemChildrenWrap: (props: any) => JSX.Element;
3
2
  export default FormItemChildrenWrap;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useIsLowSpeedNetwork: () => import("react").MutableRefObject<boolean>;
3
2
  export default useIsLowSpeedNetwork;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const Like: ({ status, onChange, className, style, }: {
4
3
  style?: any;
@@ -143,9 +143,9 @@ var useService = ({
143
143
  }
144
144
  const resourceItem = currentResource(changeValues.resource);
145
145
  const { relation_type, item_id, schedule_id } = ((_a2 = resourceItem == null ? void 0 : resourceItem._extend) == null ? void 0 : _a2.usableTime) || {};
146
- _extend.relation_type = relation_type || "form";
147
- _extend.relation_id = item_id || (resourceItem == null ? void 0 : resourceItem.form_record_id) || 0;
148
- _extend.schedule_id = schedule_id || 0;
146
+ _extend.relation_type = relation_type || (_extend == null ? void 0 : _extend.relation_type) || "form";
147
+ _extend.relation_id = item_id || (resourceItem == null ? void 0 : resourceItem.form_record_id) || (_extend == null ? void 0 : _extend.relation_id) || 0;
148
+ _extend.schedule_id = schedule_id || (_extend == null ? void 0 : _extend.schedule_id) || 0;
149
149
  if (_extend.bundle_edit !== void 0) {
150
150
  _extend.bundle_edit = 1;
151
151
  }
@@ -568,7 +568,7 @@ var Info = (_, ref) => {
568
568
  {
569
569
  type: "primary",
570
570
  className: "pisell-lowcode__booking-service-body-edit-footer-apple",
571
- disabled: !((_F = state.service.resourcesOrigin) == null ? void 0 : _F.length),
571
+ disabled: !isNormalProduct && !((_F = state.service.resourcesOrigin) == null ? void 0 : _F.length),
572
572
  onClick: () => {
573
573
  form.submit();
574
574
  }
@@ -0,0 +1,4 @@
1
+ export declare const getFormatResourceListAndMap: (data: any[], bookingId?: number[]) => {
2
+ list: any[];
3
+ listMap: any;
4
+ };