@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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Cart/index.js +8 -3
- package/es/components/Sales/Checkout/utils.d.ts +6 -1
- package/es/components/Sales/Checkout/utils.js +9 -4
- package/es/components/Sales/Customer/index.d.ts +1 -0
- package/es/components/Sales/Customer/index.js +1 -0
- package/es/components/appointmentBooking/components/Form/index.js +1 -1
- package/es/components/appointmentBooking/components/Form/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Form/utils.js +17 -15
- package/es/components/appointmentBooking/components/Header/index.js +2 -1
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceManager/index.js +4 -4
- package/es/components/booking/info2/service/editService/index.js +1 -1
- package/es/components/booking/info2/utils.d.ts +4 -0
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +13 -4
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Cart/index.js +8 -4
- package/lib/components/Sales/Checkout/utils.d.ts +6 -1
- package/lib/components/Sales/Checkout/utils.js +5 -3
- package/lib/components/Sales/Customer/index.d.ts +1 -0
- package/lib/components/Sales/Customer/index.js +1 -0
- package/lib/components/appointmentBooking/components/Form/index.js +6 -1
- package/lib/components/appointmentBooking/components/Form/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Form/utils.js +9 -12
- package/lib/components/appointmentBooking/components/Header/index.js +1 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceManager/index.js +3 -3
- package/lib/components/booking/info2/service/editService/index.js +1 -1
- package/lib/components/booking/info2/utils.d.ts +4 -0
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +14 -5
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/package.json +3 -3
|
@@ -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
|
-
|
|
235
|
-
|
|
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: (
|
|
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(
|
|
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
|
-
},
|
|
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:
|
|
129
|
+
appointment_type: 'event_booking_v2'
|
|
125
130
|
};
|
|
126
131
|
};
|
|
@@ -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
|
-
|
|
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
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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.
|
|
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
|
|
|
@@ -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
|
}
|
|
@@ -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(
|
|
104
|
-
|
|
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(
|
|
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:
|
|
@@ -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
|
-
|
|
210
|
-
|
|
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: (
|
|
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 = (
|
|
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
|
-
...
|
|
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);
|
|
@@ -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)(
|
|
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
|
|
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),
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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.
|
|
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();
|
|
@@ -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
|
}
|