@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
|
@@ -46,18 +46,20 @@ var import_Deposit = __toESM(require("../../Deposit"));
|
|
|
46
46
|
var import_utils3 = require("../utils");
|
|
47
47
|
var import_index = require("./index.less");
|
|
48
48
|
var CartItem = ({ onNext }) => {
|
|
49
|
-
var _a, _b, _c;
|
|
49
|
+
var _a, _b, _c, _d;
|
|
50
50
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
51
51
|
const {
|
|
52
52
|
carts,
|
|
53
53
|
currentStep,
|
|
54
|
-
resources,
|
|
55
54
|
setResourceOtherParams,
|
|
56
55
|
resourceOtherParams,
|
|
57
56
|
summary,
|
|
58
|
-
isLastStep
|
|
57
|
+
isLastStep,
|
|
58
|
+
currentSelectedResources,
|
|
59
|
+
currentStepParams,
|
|
60
|
+
isErrorHolder
|
|
59
61
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
60
|
-
const { accountLists, getHolders,
|
|
62
|
+
const { accountLists, getHolders, addAccount } = (0, import_hooks2.useAppointmentBookingAccount)();
|
|
61
63
|
const { getResourceList } = (0, import_hooks2.useAppointmentBookingResource)();
|
|
62
64
|
const { isFormSubject, bookingSubject, isRetailTemplate } = (0, import_hooks2.useAppointmentBookingSetting)();
|
|
63
65
|
const { isLogin } = (0, import_hooks2.useAppointmentBookingLogin)();
|
|
@@ -95,14 +97,10 @@ var CartItem = ({ onNext }) => {
|
|
|
95
97
|
...resourceOtherParams,
|
|
96
98
|
errorList: null
|
|
97
99
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
_id: e == null ? void 0 : e._id,
|
|
103
|
-
resources: val ? [val] : []
|
|
104
|
-
});
|
|
105
|
-
}
|
|
100
|
+
appointmentBooking.updateCart({
|
|
101
|
+
_id: e == null ? void 0 : e._id,
|
|
102
|
+
resources: (0, import_utils2.updateCartResources)(e, val, currentSelectedResources)
|
|
103
|
+
});
|
|
106
104
|
getResourceList();
|
|
107
105
|
return;
|
|
108
106
|
}
|
|
@@ -150,8 +148,29 @@ var CartItem = ({ onNext }) => {
|
|
|
150
148
|
}
|
|
151
149
|
};
|
|
152
150
|
const products = (0, import_react.useMemo)(() => {
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
if (!(carts == null ? void 0 : carts.length)) return [];
|
|
152
|
+
if ((currentSelectedResources == null ? void 0 : currentSelectedResources.length) > 0) {
|
|
153
|
+
const newCarts = carts.map((item) => {
|
|
154
|
+
const currentResourceData = currentSelectedResources.find(
|
|
155
|
+
(resource) => (resource == null ? void 0 : resource._id) === (item == null ? void 0 : item._id)
|
|
156
|
+
);
|
|
157
|
+
const multiResources = (0, import_utils2.getMultiResources)(
|
|
158
|
+
item,
|
|
159
|
+
currentResourceData == null ? void 0 : currentResourceData.currentSelectedResource,
|
|
160
|
+
currentStepParams == null ? void 0 : currentStepParams.key
|
|
161
|
+
);
|
|
162
|
+
return {
|
|
163
|
+
...item,
|
|
164
|
+
isMultipleResource: true,
|
|
165
|
+
multiResources,
|
|
166
|
+
isErrorHolder: isErrorHolder || false
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
return newCarts;
|
|
170
|
+
} else {
|
|
171
|
+
return carts;
|
|
172
|
+
}
|
|
173
|
+
}, [carts, currentSelectedResources, currentStepParams == null ? void 0 : currentStepParams.key, isErrorHolder]);
|
|
155
174
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
156
175
|
"div",
|
|
157
176
|
{
|
|
@@ -165,8 +184,8 @@ var CartItem = ({ onNext }) => {
|
|
|
165
184
|
hideAddBtn: false,
|
|
166
185
|
holders,
|
|
167
186
|
disabledEdit: isLastStep,
|
|
168
|
-
isShowChangeResource: ((_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key)
|
|
169
|
-
isShowDelete: ((
|
|
187
|
+
isShowChangeResource: (_c = (_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key) == null ? void 0 : _c.startsWith("select-resource"),
|
|
188
|
+
isShowDelete: ((_d = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _d.key) === "select-service",
|
|
170
189
|
isShowPackageNote: false,
|
|
171
190
|
isShowChangeHolder: isLastStep ? false : isFormSubject && isLogin,
|
|
172
191
|
isShowHolder: isFormSubject,
|
|
@@ -51,7 +51,6 @@ var import_index = require("./index.less");
|
|
|
51
51
|
var Layout = () => {
|
|
52
52
|
var _a, _b, _c, _d, _e;
|
|
53
53
|
const stepRef = (0, import_react.useRef)();
|
|
54
|
-
const formRef = (0, import_react.useRef)();
|
|
55
54
|
const {
|
|
56
55
|
currentStep,
|
|
57
56
|
setResourceOtherParams,
|
|
@@ -60,17 +59,20 @@ var Layout = () => {
|
|
|
60
59
|
appointmentBooking,
|
|
61
60
|
setLoading,
|
|
62
61
|
policyParams,
|
|
63
|
-
closePolicy
|
|
62
|
+
closePolicy,
|
|
63
|
+
currentStepParams,
|
|
64
|
+
setIsErrorHolder
|
|
64
65
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
65
66
|
const { isDateSelectedFirst, isFormSubject, isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
66
67
|
const { isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
67
68
|
const { getHolders } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
68
|
-
const { removeStep
|
|
69
|
+
const { removeStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
69
70
|
const { shopDiscount } = (0, import_hooks.useShopDiscount)();
|
|
70
71
|
(0, import_hooks.useAppointmentBookingCart)();
|
|
71
72
|
(0, import_hooks.useAppointmentBookingStep)();
|
|
72
73
|
const [params, setParams] = (0, import_react.useState)({});
|
|
73
74
|
(0, import_react.useEffect)(() => {
|
|
75
|
+
appointmentBooking.removeStep("fill-form");
|
|
74
76
|
return () => {
|
|
75
77
|
var _a2;
|
|
76
78
|
setIsAgreeDepositPolicy(false);
|
|
@@ -78,6 +80,16 @@ var Layout = () => {
|
|
|
78
80
|
(_a2 = shopDiscount == null ? void 0 : shopDiscount.destroy) == null ? void 0 : _a2.call(shopDiscount);
|
|
79
81
|
};
|
|
80
82
|
}, []);
|
|
83
|
+
(0, import_react.useEffect)(() => {
|
|
84
|
+
var _a2;
|
|
85
|
+
if ((currentStepParams == null ? void 0 : currentStepParams.index) < 0) return;
|
|
86
|
+
const resourceStepIndex = (_a2 = currentStepParams == null ? void 0 : currentStepParams.stepLists) == null ? void 0 : _a2.findIndex(
|
|
87
|
+
(item) => item.key === "select-resource"
|
|
88
|
+
);
|
|
89
|
+
if ((currentStepParams == null ? void 0 : currentStepParams.index) < resourceStepIndex) {
|
|
90
|
+
appointmentBooking.setOtherData("current_selected_resources", null);
|
|
91
|
+
}
|
|
92
|
+
}, [currentStepParams]);
|
|
81
93
|
(0, import_react.useEffect)(() => {
|
|
82
94
|
try {
|
|
83
95
|
if (!(appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || isRetailTemplate) return;
|
|
@@ -107,34 +119,38 @@ var Layout = () => {
|
|
|
107
119
|
...resourceOtherParams,
|
|
108
120
|
errorList: null
|
|
109
121
|
});
|
|
122
|
+
setIsErrorHolder(false);
|
|
110
123
|
window.scrollTo({
|
|
111
124
|
top: 0,
|
|
112
125
|
behavior: "smooth"
|
|
113
126
|
});
|
|
114
127
|
}, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key]);
|
|
128
|
+
const components = {
|
|
129
|
+
// 选择服务
|
|
130
|
+
"select-service": import_Services.default,
|
|
131
|
+
// 添加客户
|
|
132
|
+
"select-guest": import_Guest.default,
|
|
133
|
+
// 选择时间
|
|
134
|
+
"select-date": import_Date.default,
|
|
135
|
+
// 时间切片
|
|
136
|
+
"select-time": import_TimeSlicing.default,
|
|
137
|
+
// 确认信息
|
|
138
|
+
"confirm-information": import_ConfirmInformation.default
|
|
139
|
+
};
|
|
115
140
|
const Com = (0, import_react.useMemo)(() => {
|
|
116
141
|
var _a2;
|
|
117
142
|
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
118
143
|
if (!key) return null;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"select-resource": import_Resource.default,
|
|
128
|
-
// 时间切片
|
|
129
|
-
"select-time": import_TimeSlicing.default,
|
|
130
|
-
// 填写表单
|
|
131
|
-
"fill-form": import_Form.default,
|
|
132
|
-
// 确认信息
|
|
133
|
-
"confirm-information": import_ConfirmInformation.default
|
|
134
|
-
};
|
|
135
|
-
let Com2 = components[key];
|
|
144
|
+
let Com2;
|
|
145
|
+
if (key.startsWith("select-resource")) {
|
|
146
|
+
Com2 = import_Resource.default;
|
|
147
|
+
} else if (key.startsWith("fill-form")) {
|
|
148
|
+
Com2 = import_Form.default;
|
|
149
|
+
} else {
|
|
150
|
+
Com2 = components[key];
|
|
151
|
+
}
|
|
136
152
|
return /* @__PURE__ */ import_react.default.createElement(Com2, { onChange: setParams, params, ref: stepRef });
|
|
137
|
-
}, [(_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key
|
|
153
|
+
}, [(_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key]);
|
|
138
154
|
(0, import_react.useEffect)(() => {
|
|
139
155
|
var _a2, _b2;
|
|
140
156
|
if ((0, import_utils.isMobile)()) {
|
|
@@ -64,12 +64,6 @@ var Date = (0, import_react.forwardRef)((props, ref) => {
|
|
|
64
64
|
if (!(data == null ? void 0 : data.length)) {
|
|
65
65
|
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unselect.date"));
|
|
66
66
|
}
|
|
67
|
-
if (!isDateSelectedFirst) {
|
|
68
|
-
const result = appointmentBooking.checkResourceListForDate();
|
|
69
|
-
if (!result) {
|
|
70
|
-
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.date"));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
67
|
nextStep();
|
|
74
68
|
};
|
|
75
69
|
const weekListText = [
|
|
@@ -37,143 +37,91 @@ var import_useComponents = __toESM(require("../../../../hooks/useComponents"));
|
|
|
37
37
|
var import_utils = require("../../utils");
|
|
38
38
|
var import_context = require("../../context");
|
|
39
39
|
var import_hooks = require("../../hooks");
|
|
40
|
-
var
|
|
40
|
+
var import_utils2 = require("./utils");
|
|
41
41
|
var import_index = require("./index.less");
|
|
42
42
|
var Form = (0, import_react.forwardRef)((props, ref) => {
|
|
43
43
|
const manualRef = (0, import_react.useRef)();
|
|
44
|
-
const
|
|
45
|
-
const [showAgreement, setShowAgreement] = (0, import_react.useState)(false);
|
|
46
|
-
const [agreementContent, setAgreementContent] = (0, import_react.useState)({});
|
|
47
|
-
const [formStatus, setFormStatus] = (0, import_react.useState)([]);
|
|
48
|
-
const [isClearData, setIsClearData] = (0, import_react.useState)(false);
|
|
49
|
-
const [formId, setFormId] = (0, import_react.useState)(0);
|
|
50
|
-
const { carts, appointmentBooking, setLoading } = (0, import_context.useAppointmentBookingContext)();
|
|
44
|
+
const { appointmentBooking, setLoading, currentStepParams, carts } = (0, import_context.useAppointmentBookingContext)();
|
|
51
45
|
const { getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
|
|
52
|
-
const { setOtherData, getOtherData } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
46
|
+
const { setOtherData, getOtherData, isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
53
47
|
const { nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
54
|
-
const
|
|
48
|
+
const { isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
49
|
+
const { checkAccount } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
55
50
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
56
51
|
next: () => {
|
|
57
|
-
var _a, _b;
|
|
52
|
+
var _a, _b, _c;
|
|
53
|
+
const stepLists = (currentStepParams == null ? void 0 : currentStepParams.stepLists) || [];
|
|
54
|
+
const nextStepKey = (_a = stepLists[(currentStepParams == null ? void 0 : currentStepParams.index) + 1]) == null ? void 0 : _a.key;
|
|
58
55
|
setLoading(true);
|
|
59
|
-
(
|
|
56
|
+
(_c = (_b = manualRef.current) == null ? void 0 : _b.submit) == null ? void 0 : _c.call(_b);
|
|
60
57
|
}
|
|
61
58
|
}));
|
|
62
|
-
const key = "booking_form";
|
|
63
|
-
const formStorage = getOtherData("booking_form") || {};
|
|
64
|
-
const resources = (0, import_react.useMemo)(() => {
|
|
65
|
-
const _resource = getResourceList();
|
|
66
|
-
return (_resource == null ? void 0 : _resource.resources) || [];
|
|
67
|
-
}, []);
|
|
68
|
-
const forms = (0, import_react.useMemo)(() => {
|
|
69
|
-
const newCarts = (0, import_utils.formatCarts)(carts, resources, utils);
|
|
70
|
-
if (!(newCarts == null ? void 0 : newCarts.length) || !(resources == null ? void 0 : resources.length)) return [];
|
|
71
|
-
return (0, import_utils.formatForms)(newCarts) || [];
|
|
72
|
-
}, [carts, resources]);
|
|
73
|
-
(0, import_react.useEffect)(() => {
|
|
74
|
-
var _a;
|
|
75
|
-
if (!(forms == null ? void 0 : forms.length)) return;
|
|
76
|
-
setFormId(((_a = forms == null ? void 0 : forms[currentFormIndex]) == null ? void 0 : _a.form_id) || 0);
|
|
77
|
-
}, [forms, currentFormIndex]);
|
|
78
59
|
const [FormCard] = (0, import_useComponents.default)({
|
|
79
60
|
components: ["FormCard"]
|
|
80
61
|
});
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
} else {
|
|
95
|
-
nextStep();
|
|
96
|
-
}
|
|
97
|
-
};
|
|
62
|
+
const key = "booking_form";
|
|
63
|
+
const formStorage = getOtherData("booking_form") || {};
|
|
64
|
+
const appointmentBoard = (0, import_react.useMemo)(() => {
|
|
65
|
+
const { resources } = getResourceList();
|
|
66
|
+
return (0, import_utils.currentAppointmentBoard)(
|
|
67
|
+
currentStepParams.key,
|
|
68
|
+
resources,
|
|
69
|
+
appointmentBooking
|
|
70
|
+
);
|
|
71
|
+
}, [currentStepParams.key]);
|
|
72
|
+
const formId = (0, import_react.useMemo)(() => {
|
|
73
|
+
return (appointmentBoard == null ? void 0 : appointmentBoard.resource_form_id) || 0;
|
|
74
|
+
}, [appointmentBoard == null ? void 0 : appointmentBoard.resource_form_id]);
|
|
98
75
|
const updateFormStatus = (status) => {
|
|
99
76
|
if (status === "error") {
|
|
100
77
|
setLoading(false);
|
|
101
78
|
}
|
|
102
|
-
const newFormStatus = (0, import_utils.updateLists)(formStatus, "id", formId, {
|
|
103
|
-
status
|
|
104
|
-
});
|
|
105
|
-
setFormStatus(newFormStatus);
|
|
106
79
|
};
|
|
107
80
|
const setFormStorage = (values) => {
|
|
108
|
-
var _a;
|
|
109
|
-
const cart_id = (_a = forms == null ? void 0 : forms[currentFormIndex]) == null ? void 0 : _a.cart_id;
|
|
110
81
|
const oldData = getOtherData(key);
|
|
111
|
-
const newData = (0, import_utils.updateBookingFormStorage)(
|
|
82
|
+
const newData = (0, import_utils.updateBookingFormStorage)(
|
|
83
|
+
oldData,
|
|
84
|
+
currentStepParams == null ? void 0 : currentStepParams.key,
|
|
85
|
+
values
|
|
86
|
+
);
|
|
112
87
|
setOtherData(key, { ...newData });
|
|
113
88
|
appointmentBooking.updateCart({
|
|
114
|
-
_id: cart_id,
|
|
115
|
-
relationForms:
|
|
116
|
-
{
|
|
117
|
-
form_id: formId,
|
|
118
|
-
form_record_ids: [values == null ? void 0 : values.form_record_id]
|
|
119
|
-
}
|
|
120
|
-
]
|
|
89
|
+
_id: appointmentBoard == null ? void 0 : appointmentBoard.cart_id,
|
|
90
|
+
relationForms: (0, import_utils2.updateRelationForms)(carts, appointmentBoard, values)
|
|
121
91
|
});
|
|
122
92
|
};
|
|
123
93
|
const handleFormFinish = (status, values) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if ((_a = forms == null ? void 0 : forms[currentFormIndex]) == null ? void 0 : _a.policy_id) {
|
|
130
|
-
setAgreementContent({ id: (_b = forms == null ? void 0 : forms[currentFormIndex]) == null ? void 0 : _b.policy_id });
|
|
131
|
-
setShowAgreement(true);
|
|
132
|
-
} else {
|
|
133
|
-
goToNextForm();
|
|
94
|
+
try {
|
|
95
|
+
updateFormStatus(status);
|
|
96
|
+
if (status === "success") {
|
|
97
|
+
setFormStorage(values);
|
|
98
|
+
nextStep();
|
|
134
99
|
}
|
|
100
|
+
} catch (error) {
|
|
101
|
+
setLoading(false);
|
|
135
102
|
}
|
|
136
103
|
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
goToNextForm();
|
|
140
|
-
};
|
|
141
|
-
const formCom = (0, import_react.useMemo)(() => {
|
|
142
|
-
var _a;
|
|
143
|
-
if (!formId) return;
|
|
144
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-form-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
145
|
-
FormCard,
|
|
146
|
-
{
|
|
147
|
-
id: formId,
|
|
148
|
-
ref: manualRef,
|
|
149
|
-
isGetLastData: false,
|
|
150
|
-
setting: { isHidden: 1 },
|
|
151
|
-
formWrapStyle: { padding: "16px" },
|
|
152
|
-
isV2API: true,
|
|
153
|
-
isShowSkeleton: true,
|
|
154
|
-
onSubmit: (status, values) => {
|
|
155
|
-
handleFormFinish(status, values);
|
|
156
|
-
},
|
|
157
|
-
onFinishFailed: (e) => {
|
|
158
|
-
updateFormStatus("error");
|
|
159
|
-
},
|
|
160
|
-
onFormValueChange: (values) => {
|
|
161
|
-
},
|
|
162
|
-
defaultValues: (formStorage == null ? void 0 : formStorage[(_a = forms == null ? void 0 : forms[currentFormIndex]) == null ? void 0 : _a.cart_id]) || {},
|
|
163
|
-
isClearData: false
|
|
164
|
-
}
|
|
165
|
-
));
|
|
166
|
-
}, [currentFormIndex, formId]);
|
|
167
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, formCom, showAgreement ? /* @__PURE__ */ import_react.default.createElement(
|
|
168
|
-
import_PolicyModal.default,
|
|
104
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-form-wrap", key: currentStepParams == null ? void 0 : currentStepParams.key }, /* @__PURE__ */ import_react.default.createElement(
|
|
105
|
+
FormCard,
|
|
169
106
|
{
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
107
|
+
id: formId,
|
|
108
|
+
ref: manualRef,
|
|
109
|
+
isGetLastData: false,
|
|
110
|
+
setting: { isHidden: 1 },
|
|
111
|
+
formWrapStyle: { padding: "16px" },
|
|
112
|
+
isV2API: true,
|
|
113
|
+
isShowSkeleton: true,
|
|
114
|
+
onSubmit: (status, values) => {
|
|
115
|
+
handleFormFinish(status, values);
|
|
116
|
+
},
|
|
117
|
+
onFinishFailed: (e) => {
|
|
118
|
+
updateFormStatus("error");
|
|
119
|
+
},
|
|
120
|
+
onFormValueChange: (values) => {
|
|
121
|
+
},
|
|
122
|
+
defaultValues: (formStorage == null ? void 0 : formStorage[currentStepParams == null ? void 0 : currentStepParams.key]) || {},
|
|
123
|
+
isClearData: false
|
|
176
124
|
}
|
|
177
|
-
)
|
|
125
|
+
)));
|
|
178
126
|
});
|
|
179
127
|
var Form_default = Form;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/appointmentBooking/components/Form/utils.ts
|
|
20
|
+
var utils_exports = {};
|
|
21
|
+
__export(utils_exports, {
|
|
22
|
+
updateRelationForms: () => updateRelationForms
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
var updateRelationForms = (carts, currentCart, values) => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
if (!(currentCart == null ? void 0 : currentCart.cart_id)) return [];
|
|
28
|
+
const cartItem = carts == null ? void 0 : carts.find(
|
|
29
|
+
(item) => (item == null ? void 0 : item._id) === (currentCart == null ? void 0 : currentCart.cart_id)
|
|
30
|
+
);
|
|
31
|
+
let oldLists = ((_a = cartItem == null ? void 0 : cartItem._origin) == null ? void 0 : _a.relation_forms) || [];
|
|
32
|
+
const newData = { form_id: Number(values == null ? void 0 : values.form_id), form_record_id: values == null ? void 0 : values.form_record_id };
|
|
33
|
+
const exist = oldLists.find((item) => item.form_id === (newData == null ? void 0 : newData.form_id));
|
|
34
|
+
if (exist) {
|
|
35
|
+
if (!((_b = exist == null ? void 0 : exist.form_record_ids) == null ? void 0 : _b.includes(newData.form_record_id))) {
|
|
36
|
+
exist.form_record_ids.push(newData.form_record_id);
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
oldLists.push({
|
|
40
|
+
form_id: newData.form_id,
|
|
41
|
+
form_record_ids: [newData.form_record_id]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return oldLists;
|
|
45
|
+
};
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
updateRelationForms
|
|
49
|
+
});
|
|
@@ -38,26 +38,41 @@ var import_progressBar = __toESM(require("../../../eventBooking/components/progr
|
|
|
38
38
|
var import_context = require("../../context");
|
|
39
39
|
var import_hooks = require("../../hooks");
|
|
40
40
|
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
41
|
+
var import_utils2 = require("../../utils");
|
|
41
42
|
var import_index = require("./index.less");
|
|
42
43
|
var Header = () => {
|
|
43
44
|
var _a;
|
|
44
|
-
const {
|
|
45
|
+
const {
|
|
46
|
+
currentStep,
|
|
47
|
+
appointmentBooking,
|
|
48
|
+
setTimes,
|
|
49
|
+
carts,
|
|
50
|
+
currentStepParams,
|
|
51
|
+
currentSelectedResources
|
|
52
|
+
} = (0, import_context.useAppointmentBookingContext)();
|
|
45
53
|
const shopDiscount = (0, import_hooks.useShopDiscount)();
|
|
46
54
|
const context = (0, import_useEngineContext.default)();
|
|
47
|
-
const {
|
|
48
|
-
const {
|
|
49
|
-
const { setOtherData } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
55
|
+
const { stepList, updateStep, removeStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
56
|
+
const { setOtherData, getOtherData } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
50
57
|
const { checkProductType } = (0, import_hooks.useAppointmentBookingProduct)();
|
|
58
|
+
const utils = (0, import_hooks.contextUtils)();
|
|
51
59
|
const stepName = (0, import_react.useMemo)(() => {
|
|
52
|
-
var _a2, _b, _c
|
|
60
|
+
var _a2, _b, _c;
|
|
53
61
|
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
54
62
|
if (!key) return "";
|
|
55
|
-
if (key
|
|
56
|
-
const
|
|
63
|
+
if (key.startsWith("select-resource")) {
|
|
64
|
+
const currentResource = (_b = currentSelectedResources == null ? void 0 : currentSelectedResources[0]) == null ? void 0 : _b.currentSelectedResource;
|
|
65
|
+
const resourceItem = (currentResource == null ? void 0 : currentResource.resourceItem) || {};
|
|
66
|
+
const name = (0, import_utils2.getResourceTitle)(
|
|
67
|
+
appointmentBooking,
|
|
68
|
+
resourceItem == null ? void 0 : resourceItem.code,
|
|
69
|
+
utils,
|
|
70
|
+
resourceItem
|
|
71
|
+
);
|
|
57
72
|
return import_utils.locales.getText("pisell2.event.select.category")(name);
|
|
58
73
|
}
|
|
59
|
-
return ((
|
|
60
|
-
}, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key,
|
|
74
|
+
return ((_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.description) || "";
|
|
75
|
+
}, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key, currentSelectedResources]);
|
|
61
76
|
const handleBack = async () => {
|
|
62
77
|
var _a2, _b;
|
|
63
78
|
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
@@ -82,29 +97,44 @@ var Header = () => {
|
|
|
82
97
|
if (key === "select-time") {
|
|
83
98
|
setTimes([]);
|
|
84
99
|
}
|
|
85
|
-
if (key
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if ((resourceStep == null ? void 0 : resourceStep.isSkip) && (resourceStep == null ? void 0 : resourceStep.key) === "select-resource") {
|
|
90
|
-
appointmentBooking.deleteCartItemInfo("resource");
|
|
100
|
+
if (key.startsWith("fill-form")) {
|
|
101
|
+
const form_key = "booking_form";
|
|
102
|
+
let booking_form = getOtherData(form_key);
|
|
103
|
+
setOtherData(form_key, { ...booking_form, [key]: {} });
|
|
91
104
|
}
|
|
92
105
|
appointmentBooking.back();
|
|
93
|
-
const prevStepData = stepList[(
|
|
94
|
-
const currentStepData = stepList[
|
|
106
|
+
const prevStepData = stepList[(currentStepParams == null ? void 0 : currentStepParams.index) - 1];
|
|
107
|
+
const currentStepData = stepList[currentStepParams == null ? void 0 : currentStepParams.index];
|
|
95
108
|
if ((currentStepData == null ? void 0 : currentStepData.isSkip) || (prevStepData == null ? void 0 : prevStepData.isSkip)) {
|
|
96
109
|
const key2 = (currentStepData == null ? void 0 : currentStepData.isSkip) ? currentStepData == null ? void 0 : currentStepData.key : prevStepData == null ? void 0 : prevStepData.key;
|
|
110
|
+
if (key2 === "select-resource") {
|
|
111
|
+
appointmentBooking.deleteCartItemInfo("resource");
|
|
112
|
+
}
|
|
97
113
|
updateStep(key2, {
|
|
98
114
|
isSkip: false
|
|
99
115
|
});
|
|
100
116
|
}
|
|
117
|
+
if ((prevStepData == null ? void 0 : prevStepData.key) === "select-service") {
|
|
118
|
+
stepList.forEach((item) => {
|
|
119
|
+
if (item.key.startsWith("select-resource_") || item.key.startsWith("fill-form_")) {
|
|
120
|
+
removeStep(item.key);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if ((currentStepData == null ? void 0 : currentStepData.key) === "select-resource") {
|
|
125
|
+
stepList.forEach((item) => {
|
|
126
|
+
if (item.key.startsWith("fill-form_")) {
|
|
127
|
+
removeStep(item.key);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
101
131
|
};
|
|
102
132
|
const handleClose = () => {
|
|
103
133
|
var _a2, _b;
|
|
104
134
|
appointmentBooking.destroy();
|
|
105
135
|
(_a2 = shopDiscount == null ? void 0 : shopDiscount.destroy) == null ? void 0 : _a2.call(shopDiscount);
|
|
106
|
-
const
|
|
107
|
-
(_b =
|
|
136
|
+
const utils2 = context.appHelper.utils || {};
|
|
137
|
+
(_b = utils2 == null ? void 0 : utils2.history) == null ? void 0 : _b.replace("/");
|
|
108
138
|
};
|
|
109
139
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
110
140
|
import_progressBar.default,
|