@pisell/private-materials 3.3.43 → 3.3.45
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.css +1 -1
- package/build/lowcode/render/default/view.js +5 -5
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -25
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +31 -16
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +39 -20
- package/es/components/appointmentBooking/components/Date/index.js +2 -13
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Form/index.js +76 -167
- package/es/components/appointmentBooking/components/Form/utils.d.ts +8 -0
- package/es/components/appointmentBooking/components/Form/utils.js +36 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +78 -46
- package/es/components/appointmentBooking/components/Resource/index.js +92 -115
- package/es/components/appointmentBooking/components/Services/index.js +19 -4
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +20 -27
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/es/components/appointmentBooking/context.js +50 -3
- package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/es/components/appointmentBooking/hooks.d.ts +1 -2
- package/es/components/appointmentBooking/hooks.js +377 -269
- package/es/components/appointmentBooking/utils.d.ts +91 -2
- package/es/components/appointmentBooking/utils.js +350 -61
- package/es/components/booking/components/footer/amount.d.ts +24 -0
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/addService/index.d.ts +11 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/service2/utils.d.ts +244 -0
- package/es/components/booking/info/utils.d.ts +50 -0
- package/es/components/booking/info2/service/addService/index.d.ts +12 -0
- package/es/components/booking/info2/service/editService/index.d.ts +7 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +172 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/component/fail/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +1 -0
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/es/components/productExtension/index.d.ts +0 -1
- package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/es/components/productSelect/components/productGroup/index.d.ts +11 -7
- package/es/components/productSelect/components/productGroup/index.js +32 -19
- package/es/components/productSelect/components/productGroup/index.less +17 -3
- package/es/components/productSelect/index.d.ts +3 -2
- package/es/components/productSelect/index.js +20 -6
- package/es/components/productSelect/index.less +7 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/es/components/shoppingCart/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +11 -3
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/ticketBooking/utils/index.d.ts +14 -0
- package/es/components/wallet/hooks/useWalletCard.d.ts +0 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +0 -5
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +35 -16
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +37 -21
- package/lib/components/appointmentBooking/components/Date/index.js +0 -6
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Form/index.js +56 -108
- package/lib/components/appointmentBooking/components/Form/utils.d.ts +8 -0
- package/lib/components/appointmentBooking/components/Form/utils.js +49 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +49 -19
- package/lib/components/appointmentBooking/components/Resource/index.js +51 -69
- package/lib/components/appointmentBooking/components/Services/index.js +16 -3
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +1 -7
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/lib/components/appointmentBooking/context.js +52 -4
- package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/lib/components/appointmentBooking/hooks.d.ts +1 -2
- package/lib/components/appointmentBooking/hooks.js +153 -57
- package/lib/components/appointmentBooking/utils.d.ts +91 -2
- package/lib/components/appointmentBooking/utils.js +210 -50
- package/lib/components/booking/components/footer/amount.d.ts +24 -0
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/addService/index.d.ts +11 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.d.ts +244 -0
- package/lib/components/booking/info/utils.d.ts +50 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +12 -0
- package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +172 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +1 -0
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/lib/components/productExtension/index.d.ts +0 -1
- package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/lib/components/productSelect/components/productGroup/index.d.ts +11 -7
- package/lib/components/productSelect/components/productGroup/index.js +12 -10
- package/lib/components/productSelect/components/productGroup/index.less +17 -3
- package/lib/components/productSelect/index.d.ts +3 -2
- package/lib/components/productSelect/index.js +17 -3
- package/lib/components/productSelect/index.less +7 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/lib/components/shoppingCart/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +9 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/utils/index.d.ts +14 -0
- package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lowcode/product-select/meta.ts +18 -34
- package/package.json +4 -4
|
@@ -20,17 +20,17 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
20
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
21
|
selectedResource = _useState2[0],
|
|
22
22
|
setSelectedResource = _useState2[1];
|
|
23
|
-
var
|
|
24
|
-
times =
|
|
25
|
-
appointmentBooking =
|
|
26
|
-
setSelectedTime =
|
|
27
|
-
resourceOtherParams =
|
|
28
|
-
carts =
|
|
29
|
-
var
|
|
30
|
-
getResourceTimeSlot =
|
|
31
|
-
getResourceList =
|
|
32
|
-
var
|
|
33
|
-
nextStep =
|
|
23
|
+
var _ref = useAppointmentBookingContext(),
|
|
24
|
+
times = _ref.times,
|
|
25
|
+
appointmentBooking = _ref.appointmentBooking,
|
|
26
|
+
setSelectedTime = _ref.setSelectedTime,
|
|
27
|
+
resourceOtherParams = _ref.resourceOtherParams,
|
|
28
|
+
carts = _ref.carts;
|
|
29
|
+
var _useAppointmentBookin = useAppointmentBookingResource(),
|
|
30
|
+
getResourceTimeSlot = _useAppointmentBookin.getResourceTimeSlot,
|
|
31
|
+
getResourceList = _useAppointmentBookin.getResourceList;
|
|
32
|
+
var _useAppointmentBookin2 = useAppointmentBookingStep(),
|
|
33
|
+
nextStep = _useAppointmentBookin2.nextStep;
|
|
34
34
|
useImperativeHandle(ref, function () {
|
|
35
35
|
return {
|
|
36
36
|
next: function next() {
|
|
@@ -47,31 +47,24 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
47
47
|
getResourceTimeSlot();
|
|
48
48
|
}, []);
|
|
49
49
|
var getAutoSelect = /*#__PURE__*/function () {
|
|
50
|
-
var
|
|
51
|
-
var
|
|
50
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
|
|
51
|
+
var result;
|
|
52
52
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
53
53
|
while (1) switch (_context.prev = _context.next) {
|
|
54
54
|
case 0:
|
|
55
55
|
setSelectedTime(val);
|
|
56
|
-
|
|
57
|
-
_context.next = 4;
|
|
58
|
-
return appointmentBooking.autoSelectAllProductResources(resourceCodes === null || resourceCodes === void 0 ? void 0 : resourceCodes[1], val);
|
|
59
|
-
case 4:
|
|
60
|
-
_yield$appointmentBoo = _context.sent;
|
|
61
|
-
errorList = _yield$appointmentBoo.errorList;
|
|
62
|
-
_context.next = 8;
|
|
56
|
+
_context.next = 3;
|
|
63
57
|
return appointmentBooking.submitTimeSlot(val);
|
|
64
|
-
case
|
|
58
|
+
case 3:
|
|
65
59
|
result = _context.sent;
|
|
66
|
-
|
|
67
|
-
case 10:
|
|
60
|
+
case 4:
|
|
68
61
|
case "end":
|
|
69
62
|
return _context.stop();
|
|
70
63
|
}
|
|
71
64
|
}, _callee);
|
|
72
65
|
}));
|
|
73
66
|
return function getAutoSelect(_x) {
|
|
74
|
-
return
|
|
67
|
+
return _ref2.apply(this, arguments);
|
|
75
68
|
};
|
|
76
69
|
}();
|
|
77
70
|
useEffect(function () {
|
|
@@ -84,9 +77,9 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
84
77
|
// 如果没有选择时间,则默认选中第一个时间
|
|
85
78
|
getAutoSelect(times === null || times === void 0 ? void 0 : times[0]);
|
|
86
79
|
}
|
|
87
|
-
}, [times]);
|
|
80
|
+
}, [times, carts]);
|
|
88
81
|
var _onClick = /*#__PURE__*/function () {
|
|
89
|
-
var
|
|
82
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
90
83
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
91
84
|
while (1) switch (_context2.prev = _context2.next) {
|
|
92
85
|
case 0:
|
|
@@ -99,7 +92,7 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
99
92
|
}, _callee2);
|
|
100
93
|
}));
|
|
101
94
|
return function onClick(_x2) {
|
|
102
|
-
return
|
|
95
|
+
return _ref3.apply(this, arguments);
|
|
103
96
|
};
|
|
104
97
|
}();
|
|
105
98
|
return (times === null || times === void 0 ? void 0 : times.length) > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -8,9 +8,10 @@ import React, { createContext, useContext, useState, useEffect, useMemo, useRef
|
|
|
8
8
|
import { useAppointmentBooking } from "./hooks";
|
|
9
9
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
10
10
|
import { TasksManager } from "../../utils/tasks";
|
|
11
|
+
import { getCartCurrentResourceData } from "./utils";
|
|
11
12
|
var AppointmentBookingContext = /*#__PURE__*/createContext(undefined);
|
|
12
13
|
export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref) {
|
|
13
|
-
var _appHelper$utils, _currentStep$step2, _appointmentBooking$
|
|
14
|
+
var _appHelper$utils, _appointmentBooking$s2, _currentStep$step2, _appointmentBooking$s3, _currentStep$step4;
|
|
14
15
|
var children = _ref.children;
|
|
15
16
|
var policyIdsRef = useRef([]);
|
|
16
17
|
var appointmentBooking = useAppointmentBooking();
|
|
@@ -69,6 +70,10 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
69
70
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
70
71
|
policyParams = _useState26[0],
|
|
71
72
|
setPolicyParams = _useState26[1];
|
|
73
|
+
var _useState27 = useState(),
|
|
74
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
75
|
+
currentSelectedResources = _useState28[0],
|
|
76
|
+
setCurrentSelectedResources = _useState28[1];
|
|
72
77
|
var _useEngineContext = useEngineContext(),
|
|
73
78
|
appHelper = _useEngineContext.appHelper;
|
|
74
79
|
var symbolic = appHelper === null || appHelper === void 0 || (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : _appHelper$utils.getSymbolic();
|
|
@@ -124,6 +129,10 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
124
129
|
policyParams.callback();
|
|
125
130
|
}
|
|
126
131
|
};
|
|
132
|
+
var stepLists = useMemo(function () {
|
|
133
|
+
var _appointmentBooking$s;
|
|
134
|
+
return (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
|
|
135
|
+
}, [appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.step) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.store) === null || _appointmentBooking$s2 === void 0 ? void 0 : _appointmentBooking$s2.stepList]);
|
|
127
136
|
|
|
128
137
|
/**
|
|
129
138
|
* @title: 是否是最后一步
|
|
@@ -137,7 +146,42 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
137
146
|
var _currentStep$step;
|
|
138
147
|
var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
139
148
|
return key === 'confirm-information';
|
|
140
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$
|
|
149
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s3 = appointmentBooking.store) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.step) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.store) === null || _appointmentBooking$s3 === void 0 ? void 0 : _appointmentBooking$s3.stepList]);
|
|
150
|
+
var currentStepParams = useMemo(function () {
|
|
151
|
+
var _currentStep$step3;
|
|
152
|
+
var key = currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key;
|
|
153
|
+
var index = stepLists.findIndex(function (item) {
|
|
154
|
+
return item.key === key;
|
|
155
|
+
});
|
|
156
|
+
return {
|
|
157
|
+
key: key,
|
|
158
|
+
index: index,
|
|
159
|
+
stepLists: stepLists
|
|
160
|
+
};
|
|
161
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key, stepLists]);
|
|
162
|
+
useEffect(function () {
|
|
163
|
+
var _currentStepParams$ke, _currentStepParams$ke2;
|
|
164
|
+
// 如果当前步骤是选择资源,则更新当前资源的数据
|
|
165
|
+
if (currentStepParams !== null && currentStepParams !== void 0 && (_currentStepParams$ke = currentStepParams.key) !== null && _currentStepParams$ke !== void 0 && _currentStepParams$ke.startsWith('select-resource') || currentStepParams !== null && currentStepParams !== void 0 && (_currentStepParams$ke2 = currentStepParams.key) !== null && _currentStepParams$ke2 !== void 0 && _currentStepParams$ke2.startsWith('fill-form')) {
|
|
166
|
+
if (!(carts !== null && carts !== void 0 && carts.length) || !(resources !== null && resources !== void 0 && resources.length)) {
|
|
167
|
+
return setCurrentSelectedResources(null);
|
|
168
|
+
}
|
|
169
|
+
var _currentSelectedResources = carts.map(function (item) {
|
|
170
|
+
return {
|
|
171
|
+
_id: item === null || item === void 0 ? void 0 : item._id,
|
|
172
|
+
currentSelectedResource: getCartCurrentResourceData(item, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, resources)
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
setCurrentSelectedResources(_currentSelectedResources);
|
|
176
|
+
|
|
177
|
+
// 并且将当前资源的数据设置到本地
|
|
178
|
+
appointmentBooking.setOtherData('current_selected_resources', _currentSelectedResources);
|
|
179
|
+
}
|
|
180
|
+
}, [currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, carts, resources]);
|
|
181
|
+
useEffect(function () {
|
|
182
|
+
var currentSelectedResources = appointmentBooking.getOtherData('current_selected_resources');
|
|
183
|
+
setCurrentSelectedResources(currentSelectedResources || []);
|
|
184
|
+
}, []);
|
|
141
185
|
var value = {
|
|
142
186
|
appointmentBooking: appointmentBooking,
|
|
143
187
|
times: times,
|
|
@@ -171,7 +215,10 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
171
215
|
policyIdsRef: policyIdsRef,
|
|
172
216
|
setPolicyIds: setPolicyIds,
|
|
173
217
|
openPolicy: openPolicy,
|
|
174
|
-
closePolicy: closePolicy
|
|
218
|
+
closePolicy: closePolicy,
|
|
219
|
+
currentStepParams: currentStepParams,
|
|
220
|
+
currentSelectedResources: currentSelectedResources,
|
|
221
|
+
setCurrentSelectedResources: setCurrentSelectedResources
|
|
175
222
|
};
|
|
176
223
|
return /*#__PURE__*/React.createElement(AppointmentBookingContext.Provider, {
|
|
177
224
|
value: value
|
|
@@ -75,7 +75,6 @@ export declare const useAppointmentBookingResource: () => {
|
|
|
75
75
|
resources: any;
|
|
76
76
|
resourceCodes: any;
|
|
77
77
|
};
|
|
78
|
-
autoSelectAllProductResources: (index?: number) => Promise<any>;
|
|
79
78
|
};
|
|
80
79
|
/**
|
|
81
80
|
* @title: 是否跳过资源选择步骤
|
|
@@ -85,7 +84,7 @@ export declare const useAppointmentBookingResource: () => {
|
|
|
85
84
|
* @Date: 2025-04-21 11:47
|
|
86
85
|
*/
|
|
87
86
|
export declare const useIsSkipResourceStep: () => {
|
|
88
|
-
checkSkipResourceStep: (
|
|
87
|
+
checkSkipResourceStep: () => Promise<boolean>;
|
|
89
88
|
};
|
|
90
89
|
/**
|
|
91
90
|
* @title: 获取预约配置
|