@pisell/private-materials 3.3.33 → 3.3.34
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +13 -13
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +25 -4
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +25 -45
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.js +36 -53
- 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 +161 -61
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.js +50 -64
- package/es/components/appointmentBooking/components/Resource/index.js +102 -119
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +12 -5
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/es/components/appointmentBooking/context.js +3 -43
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/es/components/appointmentBooking/hooks.d.ts +3 -2
- package/es/components/appointmentBooking/hooks.js +209 -293
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/appointmentBooking/utils.d.ts +2 -88
- package/es/components/appointmentBooking/utils.js +63 -325
- package/es/components/booking/addons/model.js +5 -5
- package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
- package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
- package/es/components/booking/components/browserSelect/index.js +1 -1
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/voucher/index.d.ts +0 -1
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/forms/model.js +5 -5
- 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/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/addService/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/index.js +11 -11
- package/es/components/booking/notes/model.js +5 -5
- package/es/components/booking/payments/model.js +5 -5
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- 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/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Information/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/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/Schedule.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/listComponent/index.js +5 -5
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/es/components/productExtension/card/index.js +3 -3
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
- package/es/components/productExtension/fields/Forms/index.js +12 -12
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/server.js +2 -2
- package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/es/components/productSelect/components/productGroup/index.d.ts +0 -1
- package/es/components/ruleSetting/ruleBorder/index.js +1 -1
- package/es/components/schedules/calendar/index.js +4 -4
- package/es/components/schedules/calendar/serve.js +2 -2
- package/es/components/schedules/components/CurrentDay/index.js +5 -5
- package/es/components/schedules/components/CurrentDay/serve.js +2 -2
- package/es/components/schedules/components/DropdownSort/index.js +1 -1
- package/es/components/schedules/components/ResourceList/index.js +1 -1
- package/es/components/schedules/components/Search/index.js +5 -5
- package/es/components/schedules/model.js +5 -5
- package/es/components/schedules/openHours/index.js +1 -1
- package/es/components/schedules/openHours/serve.js +2 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
- package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
- package/es/components/schedules/products/serve.js +2 -2
- package/es/components/schedules/products/utils.js +5 -5
- package/es/components/schedules/resources/detail/detailContent.js +2 -2
- package/es/components/schedules/resources/detail/index.js +10 -10
- package/es/components/schedules/resources/list/index.js +2 -2
- package/es/components/schedules/resources/relationProduct/index.js +1 -1
- package/es/components/schedules/resources/serve.js +2 -2
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/schedules/utils.js +4 -4
- package/es/components/selectModal/index.js +2 -2
- package/es/components/shoppingCart/components/Cart/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/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/es/hooks/useComponents.js +1 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +5 -0
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +9 -33
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.js +21 -35
- 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 +98 -54
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.js +20 -39
- package/lib/components/appointmentBooking/components/Resource/index.js +59 -41
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +7 -1
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/lib/components/appointmentBooking/context.js +4 -48
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/lib/components/appointmentBooking/hooks.d.ts +3 -2
- package/lib/components/appointmentBooking/hooks.js +57 -143
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/appointmentBooking/utils.d.ts +2 -88
- package/lib/components/appointmentBooking/utils.js +51 -191
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/voucher/index.d.ts +0 -1
- package/lib/components/booking/deposit/index.d.ts +1 -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/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -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/utils.js +1 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- 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/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Information/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/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/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/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 +0 -1
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/schedules/utils.js +1 -1
- package/lib/components/shoppingCart/components/Cart/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/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/lib/utils/index.d.ts +1 -1
- package/package.json +4 -4
- package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +0 -4
- package/es/components/eventBooking/components/Provider/SelectProduct/index.js +0 -77
- package/es/components/eventBooking/components/Provider/SelectProduct/index.less +0 -131
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +0 -4
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +0 -69
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +0 -131
|
@@ -48,7 +48,7 @@ var import_useEngineContext = require("../../hooks/useEngineContext");
|
|
|
48
48
|
var import_useEngineContext2 = __toESM(require("../../hooks/useEngineContext"));
|
|
49
49
|
var import_utils2 = require("./utils");
|
|
50
50
|
var import_context = require("./context");
|
|
51
|
-
var import_utils3 = require("./components/
|
|
51
|
+
var import_utils3 = require("./components/Cart/utils");
|
|
52
52
|
var useAppointmentBooking = () => {
|
|
53
53
|
const pisellOS = (0, import_useEngineContext.usePisellOS)();
|
|
54
54
|
return pisellOS.getModule("appointmentBooking");
|
|
@@ -66,13 +66,8 @@ var contextUtils = () => {
|
|
|
66
66
|
var useAppointmentBookingStep = () => {
|
|
67
67
|
var _a, _b, _c;
|
|
68
68
|
const pisellOS = (0, import_useEngineContext.usePisellOS)();
|
|
69
|
-
const { appointmentBooking, setCurrentStep,
|
|
69
|
+
const { appointmentBooking, setCurrentStep, policyIdsRef, openPolicy } = (0, import_context.useAppointmentBookingContext)();
|
|
70
70
|
const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
|
|
71
|
-
const { isLogin, openLoginModal } = useAppointmentBookingLogin();
|
|
72
|
-
const { isFormSubject } = useAppointmentBookingSetting();
|
|
73
|
-
const { accountLists, getHolders, checkAccount } = useAppointmentBookingAccount();
|
|
74
|
-
const { getResourceList } = useAppointmentBookingResource();
|
|
75
|
-
const utils = contextUtils();
|
|
76
71
|
const getCurrentAndLastStep = () => {
|
|
77
72
|
const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
|
|
78
73
|
setCurrentStep(currentStep);
|
|
@@ -119,113 +114,34 @@ var useAppointmentBookingStep = () => {
|
|
|
119
114
|
});
|
|
120
115
|
};
|
|
121
116
|
const nextStep = () => {
|
|
122
|
-
var _a2, _b2, _c2, _d
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
117
|
+
var _a2, _b2, _c2, _d;
|
|
118
|
+
const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
|
|
119
|
+
const stepList2 = ((_c2 = (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.step) == null ? void 0 : _b2.store) == null ? void 0 : _c2.stepList) || [];
|
|
120
|
+
if ((currentStep == null ? void 0 : currentStep.index) + 2 === (stepList2 == null ? void 0 : stepList2.length)) {
|
|
121
|
+
if ((_d = policyIdsRef == null ? void 0 : policyIdsRef.current) == null ? void 0 : _d.length) {
|
|
122
|
+
let idx = 0;
|
|
123
|
+
const showNextPolicy = () => {
|
|
124
|
+
if (idx < policyIdsRef.current.length) {
|
|
125
|
+
openPolicy({ id: policyIdsRef.current[idx] }, () => {
|
|
126
|
+
idx++;
|
|
127
|
+
showNextPolicy();
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
appointmentBooking.next();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
showNextPolicy();
|
|
129
134
|
return;
|
|
130
135
|
}
|
|
131
|
-
(_a2 = currentSelectedResourcesRef == null ? void 0 : currentSelectedResourcesRef.current) == null ? void 0 : _a2.forEach((cart) => {
|
|
132
|
-
var _a3, _b3;
|
|
133
|
-
const selectedResource2 = cart == null ? void 0 : cart.currentSelectedResource;
|
|
134
|
-
const resourceItem = (selectedResource2 == null ? void 0 : selectedResource2.resourceItem) || {};
|
|
135
|
-
const formId = (_a3 = selectedResource2 == null ? void 0 : selectedResource2.renderItem) == null ? void 0 : _a3.resource_form_id;
|
|
136
|
-
const policyId = (_b3 = selectedResource2 == null ? void 0 : selectedResource2.renderItem) == null ? void 0 : _b3.policy_id;
|
|
137
|
-
const formKey = `fill-form_@${resourceItem == null ? void 0 : resourceItem.form_id}-${resourceItem == null ? void 0 : resourceItem.code}-${cart == null ? void 0 : cart._id}-${formId}-${policyId}`;
|
|
138
|
-
if (formId) {
|
|
139
|
-
const description = import_utils.locales.getText("pisell2.appointment.fill-form");
|
|
140
|
-
const beforeKey = (0, import_utils2.getFormInsertBeforeKey)(currentKey, stepList2);
|
|
141
|
-
appointmentBooking.addStep({ key: formKey, description }, beforeKey);
|
|
142
|
-
} else {
|
|
143
|
-
appointmentBooking.removeStep(formKey);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
const selectedResource = (_c2 = (_b2 = currentSelectedResourcesRef == null ? void 0 : currentSelectedResourcesRef.current) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.currentSelectedResource;
|
|
147
|
-
if (selectedResource) {
|
|
148
|
-
const originRenderLists = ((_d = selectedResource == null ? void 0 : selectedResource.resourceItem) == null ? void 0 : _d.originRenderLists) || [];
|
|
149
|
-
const currentResourceIndex = originRenderLists == null ? void 0 : originRenderLists.findIndex((item) => {
|
|
150
|
-
var _a3;
|
|
151
|
-
return item.id === ((_a3 = selectedResource == null ? void 0 : selectedResource.renderItem) == null ? void 0 : _a3.form_id);
|
|
152
|
-
});
|
|
153
|
-
const nextResource = originRenderLists == null ? void 0 : originRenderLists[currentResourceIndex + 1];
|
|
154
|
-
const resourceKey = `select-resource_@${nextResource == null ? void 0 : nextResource.form_id}-${nextResource == null ? void 0 : nextResource.code}`;
|
|
155
|
-
if (nextResource) {
|
|
156
|
-
const beforeKey = (_e = stepList2[stepList2.length - 2]) == null ? void 0 : _e.key;
|
|
157
|
-
appointmentBooking.addStep({ key: resourceKey, description: "" }, beforeKey);
|
|
158
|
-
} else {
|
|
159
|
-
appointmentBooking.removeStep(resourceKey);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
const nextStep2 = stepList2[(currentStepParams == null ? void 0 : currentStepParams.index) + 1];
|
|
164
|
-
if (((_f = nextStep2 == null ? void 0 : nextStep2.key) == null ? void 0 : _f.startsWith("select-resource_")) || (nextStep2 == null ? void 0 : nextStep2.key) === "confirm-information") {
|
|
165
|
-
const selectedResource = (_h = (_g = currentSelectedResourcesRef.current) == null ? void 0 : _g[0]) == null ? void 0 : _h.currentSelectedResource;
|
|
166
|
-
const renderItem = (selectedResource == null ? void 0 : selectedResource.renderItem) || {};
|
|
167
|
-
const checkHolder = () => {
|
|
168
|
-
setLoading(false);
|
|
169
|
-
const { hasError, updatedCartList } = (0, import_utils2.checkAndGoNext)(isFormSubject, checkAccount, carts);
|
|
170
|
-
if (hasError) {
|
|
171
|
-
setIsErrorHolder(hasError);
|
|
172
|
-
setCarts(updatedCartList);
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
if (!!(renderItem == null ? void 0 : renderItem.policy_id)) {
|
|
176
|
-
openPolicy({ id: renderItem == null ? void 0 : renderItem.policy_id }, () => {
|
|
177
|
-
return appointmentBooking.next();
|
|
178
|
-
});
|
|
179
|
-
} else {
|
|
180
|
-
return appointmentBooking.next();
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
const checkLogin = () => {
|
|
184
|
-
if (!isLogin) {
|
|
185
|
-
return openLoginModal({
|
|
186
|
-
callback: (status) => {
|
|
187
|
-
var _a3;
|
|
188
|
-
if (status === "success") {
|
|
189
|
-
if (!isFormSubject) {
|
|
190
|
-
const user = JSON.parse(((_a3 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a3.get("customer")) || "{}");
|
|
191
|
-
const currentUser = (0, import_utils2.formatCustomer)(user);
|
|
192
|
-
const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
|
|
193
|
-
appointmentBooking.setLoginAccount(meAccount == null ? void 0 : meAccount.id, currentUser);
|
|
194
|
-
} else {
|
|
195
|
-
getHolders();
|
|
196
|
-
}
|
|
197
|
-
checkHolder();
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
} else {
|
|
202
|
-
return checkHolder();
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
if ((nextStep2 == null ? void 0 : nextStep2.key) !== "confirm-information") {
|
|
206
|
-
if (!(renderItem == null ? void 0 : renderItem.policy_id)) {
|
|
207
|
-
return appointmentBooking.next();
|
|
208
|
-
}
|
|
209
|
-
return openPolicy({ id: renderItem == null ? void 0 : renderItem.policy_id }, () => {
|
|
210
|
-
const cartItem = carts == null ? void 0 : carts[0];
|
|
211
|
-
appointmentBooking.updateCart({
|
|
212
|
-
_id: cartItem == null ? void 0 : cartItem._id,
|
|
213
|
-
...cartItem
|
|
214
|
-
});
|
|
215
|
-
appointmentBooking.next();
|
|
216
|
-
});
|
|
217
|
-
} else {
|
|
218
|
-
return checkLogin();
|
|
219
|
-
}
|
|
220
136
|
}
|
|
221
137
|
appointmentBooking.next();
|
|
222
138
|
};
|
|
223
139
|
return { getStepIndex, stepList, removeStep, addStep, updateStep, nextStep };
|
|
224
140
|
};
|
|
225
141
|
var useAppointmentBookingProduct = () => {
|
|
226
|
-
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
142
|
+
const { appointmentBooking, carts } = (0, import_context.useAppointmentBookingContext)();
|
|
227
143
|
const { productModuleParams } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
|
|
228
|
-
const { bookingProcess } = productModuleParams || {};
|
|
144
|
+
const { bookingProcess, bookingSubject } = productModuleParams || {};
|
|
229
145
|
const getProducts = async () => {
|
|
230
146
|
var _a;
|
|
231
147
|
if (bookingProcess === "date_first") {
|
|
@@ -254,29 +170,14 @@ var useAppointmentBookingCart = () => {
|
|
|
254
170
|
var _a;
|
|
255
171
|
const pisellOS = (0, import_useEngineContext.usePisellOS)();
|
|
256
172
|
const utils = contextUtils();
|
|
257
|
-
const { appointmentBooking,
|
|
173
|
+
const { appointmentBooking, setCarts, setSummary, setIsAgreeDepositPolicy } = (0, import_context.useAppointmentBookingContext)();
|
|
258
174
|
const { bookingSubject } = ((_a = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a.productModuleParams) || {};
|
|
259
175
|
const getCartAndSummary = async () => {
|
|
260
|
-
var _a2;
|
|
261
|
-
const locale = ((_a2 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a2.get("umi_locale")) || "en-US";
|
|
262
|
-
const symbol = (utils == null ? void 0 : utils.getSymbolic()) || "$";
|
|
263
176
|
const carts = await appointmentBooking.getCart();
|
|
264
|
-
const accountLists = await appointmentBooking.getAccounts();
|
|
265
177
|
const newCarts = carts == null ? void 0 : carts.map((item) => {
|
|
266
|
-
var _a3;
|
|
267
178
|
return {
|
|
268
179
|
...item,
|
|
269
|
-
addHolderButtonText: utils == null ? void 0 : utils.translation(bookingSubject == null ? void 0 : bookingSubject.form_name)
|
|
270
|
-
format: ["HH:mm", "HH:mm"],
|
|
271
|
-
show_time: true,
|
|
272
|
-
duration_type: ((_a3 = item == null ? void 0 : item.duration) == null ? void 0 : _a3.type) || "minutes",
|
|
273
|
-
locale,
|
|
274
|
-
symbol,
|
|
275
|
-
holders: (0, import_utils2.formatHolder)(accountLists),
|
|
276
|
-
allowClearHolder: true,
|
|
277
|
-
allowClearResource: true,
|
|
278
|
-
isErrorHolder: isErrorHolder || false,
|
|
279
|
-
isMultipleResource: true
|
|
180
|
+
addHolderButtonText: utils == null ? void 0 : utils.translation(bookingSubject == null ? void 0 : bookingSubject.form_name)
|
|
280
181
|
};
|
|
281
182
|
});
|
|
282
183
|
setCarts(newCarts || []);
|
|
@@ -369,7 +270,7 @@ var useAppointmentBookingAccount = () => {
|
|
|
369
270
|
return { accountLists, getHolders, form_id, addAccount, checkAccount };
|
|
370
271
|
};
|
|
371
272
|
var useAppointmentBookingResource = () => {
|
|
372
|
-
const { appointmentBooking, setResources, setTimes } = (0, import_context.useAppointmentBookingContext)();
|
|
273
|
+
const { appointmentBooking, setResources, setTimes, setResourceOtherParams, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
|
|
373
274
|
const { resourceSort } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
|
|
374
275
|
const getResourceList = () => {
|
|
375
276
|
var _a;
|
|
@@ -391,40 +292,53 @@ var useAppointmentBookingResource = () => {
|
|
|
391
292
|
const data = await appointmentBooking.getTimeSlotByAllResources(code);
|
|
392
293
|
setTimes(data || []);
|
|
393
294
|
};
|
|
394
|
-
|
|
295
|
+
const autoSelectAllProductResources = async (index) => {
|
|
296
|
+
const { resourceCodes } = getResourceList();
|
|
297
|
+
const code = resourceCodes == null ? void 0 : resourceCodes[index || 0];
|
|
298
|
+
const data = await appointmentBooking.getTimeSlotByAllResources(code);
|
|
299
|
+
let res = await appointmentBooking.autoSelectAllProductResources(code);
|
|
300
|
+
setResourceOtherParams({
|
|
301
|
+
...resourceOtherParams,
|
|
302
|
+
...res,
|
|
303
|
+
resourceCodes
|
|
304
|
+
});
|
|
305
|
+
return res;
|
|
306
|
+
};
|
|
307
|
+
return { getResourceTimeSlot, getResourceList, autoSelectAllProductResources };
|
|
395
308
|
};
|
|
396
309
|
var useIsSkipResourceStep = () => {
|
|
397
|
-
|
|
398
|
-
const {
|
|
310
|
+
var _a, _b, _c;
|
|
311
|
+
const { currentStep, setCarts, setPolicyIds } = (0, import_context.useAppointmentBookingContext)();
|
|
312
|
+
const { getResourceList, autoSelectAllProductResources } = useAppointmentBookingResource();
|
|
399
313
|
const { isFormSubject } = useAppointmentBookingSetting();
|
|
400
314
|
const appointmentBooking = useAppointmentBooking();
|
|
315
|
+
const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
|
|
316
|
+
const { isLogin, openLoginModal } = useAppointmentBookingLogin();
|
|
317
|
+
const { getHolders, checkAccount } = useAppointmentBookingAccount();
|
|
401
318
|
const { nextStep } = useAppointmentBookingStep();
|
|
402
|
-
const
|
|
319
|
+
const utils = contextUtils();
|
|
320
|
+
const checkSkipResourceStep = async (isSkipUpdateFormStep) => {
|
|
321
|
+
var _a2, _b2, _c2, _d, _e;
|
|
403
322
|
try {
|
|
404
|
-
const { resources } = getResourceList();
|
|
405
323
|
const accountLists = await appointmentBooking.getAccounts();
|
|
406
|
-
const
|
|
407
|
-
if (isSystem) {
|
|
408
|
-
nextStep();
|
|
409
|
-
return true;
|
|
410
|
-
}
|
|
324
|
+
const carts = await appointmentBooking.getCart();
|
|
411
325
|
if ((accountLists == null ? void 0 : accountLists.length) === 1 || isFormSubject) {
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
if ((
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
if (_isSkip) {
|
|
420
|
-
nextStep();
|
|
326
|
+
const res = await autoSelectAllProductResources();
|
|
327
|
+
const { resources } = getResourceList();
|
|
328
|
+
if (!((_a2 = res == null ? void 0 : res.errorList) == null ? void 0 : _a2.length) && ((_e = (_d = (_c2 = (_b2 = resources == null ? void 0 : resources[0]) == null ? void 0 : _b2.resources) == null ? void 0 : _c2[0]) == null ? void 0 : _d.renderList) == null ? void 0 : _e.length) === 1) {
|
|
329
|
+
if (!isSkipUpdateFormStep) {
|
|
330
|
+
const resultCarts = (0, import_utils2.formatCartsResources)(carts, resources, setPolicyIds);
|
|
331
|
+
(0, import_utils2.checkHasFormStep)({ nextStep, isSkip: true, openLoginModal, utils, accountLists, getHolders, checkHolder: import_utils3.checkHolder, setCarts, checkAccount, carts, isFormSubject, hasResourceFormId: (resultCarts == null ? void 0 : resultCarts.length) > 0, currentStep, stepList, appointmentBooking, locales: import_utils.locales, isLogin });
|
|
332
|
+
}
|
|
421
333
|
return true;
|
|
334
|
+
} else {
|
|
335
|
+
return false;
|
|
422
336
|
}
|
|
423
|
-
return _isSkip;
|
|
424
337
|
} else {
|
|
425
338
|
return false;
|
|
426
339
|
}
|
|
427
340
|
} catch (error) {
|
|
341
|
+
console.log(error, "checkSkipResourceStep33");
|
|
428
342
|
return false;
|
|
429
343
|
}
|
|
430
344
|
};
|
|
@@ -101,7 +101,7 @@ export declare function updateLists<T extends Record<string, any>>(list: T[], ke
|
|
|
101
101
|
* @Author: WangHan
|
|
102
102
|
* @Date: 2025-04-27 17:27
|
|
103
103
|
*/
|
|
104
|
-
export declare const updateBookingFormStorage: (bookingForm: any, id: number
|
|
104
|
+
export declare const updateBookingFormStorage: (bookingForm: any, id: number, newData: any) => any;
|
|
105
105
|
export declare const Toast: (text: string) => void;
|
|
106
106
|
/**
|
|
107
107
|
* @title: 添加或移除表单步骤
|
|
@@ -111,90 +111,4 @@ export declare const Toast: (text: string) => void;
|
|
|
111
111
|
* @Author: WangHan
|
|
112
112
|
* @Date: 2025-05-06 21:51
|
|
113
113
|
*/
|
|
114
|
-
export declare const checkHasFormStep: ({ nextStep, isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId, currentStep, stepList, appointmentBooking, locales, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }: any) =>
|
|
115
|
-
export declare const getCartCurrentResourceData: (cart: any, currentKey: any, resources: any[]) => any;
|
|
116
|
-
/**
|
|
117
|
-
* @title: 获取购物车资源列表
|
|
118
|
-
* @description:
|
|
119
|
-
* @return {*}
|
|
120
|
-
* @Author: WangHan
|
|
121
|
-
* @Date: 2025-05-25 13:56
|
|
122
|
-
*/
|
|
123
|
-
export declare const getMultiResources: (cart: any, resourceItem: any, currentKey: string) => any[];
|
|
124
|
-
export declare const getCurrentBoard: (appointmentBooking: any, code: string) => any;
|
|
125
|
-
/**
|
|
126
|
-
* @title:
|
|
127
|
-
* @description: 根据资源code获取资源标题
|
|
128
|
-
* @param {any} appointmentBooking
|
|
129
|
-
* @param {string} code
|
|
130
|
-
* @return {*}
|
|
131
|
-
* @Author: WangHan
|
|
132
|
-
* @Date: 2025-05-24 18:51
|
|
133
|
-
*/
|
|
134
|
-
export declare const getResourceTitle: (appointmentBooking: any, code: string, utils: any, originResource: any) => string;
|
|
135
|
-
/**
|
|
136
|
-
* @title: 监测购物车中是否有没有选择资源的
|
|
137
|
-
* @description:
|
|
138
|
-
* @param {any} carts
|
|
139
|
-
* @return {*}
|
|
140
|
-
* @Author: WangHan
|
|
141
|
-
* @Date: 2025-05-24 18:47
|
|
142
|
-
*/
|
|
143
|
-
export declare const checkAndMarkCartRenderError: (carts: any, appointmentBooking?: any, utils?: any) => {
|
|
144
|
-
hasError: boolean;
|
|
145
|
-
updatedCartList: any;
|
|
146
|
-
};
|
|
147
|
-
/**
|
|
148
|
-
* @title: 查表表单步骤插入到哪个步骤的后面的key
|
|
149
|
-
* @description:
|
|
150
|
-
* @param {string} currentKey
|
|
151
|
-
* @param {any} stepList
|
|
152
|
-
* @return {*}
|
|
153
|
-
* @Author: WangHan
|
|
154
|
-
* @Date: 2025-05-24 19:05
|
|
155
|
-
*/
|
|
156
|
-
export declare const getFormInsertBeforeKey: (currentKey: string, stepList: any[]) => any;
|
|
157
|
-
/**
|
|
158
|
-
* @title: 监测holder数据
|
|
159
|
-
* @description:
|
|
160
|
-
* @param {any} isFormSubject
|
|
161
|
-
* @param {any} checkAccount
|
|
162
|
-
* @param {any} carts
|
|
163
|
-
* @return {*}
|
|
164
|
-
* @Author: WangHan
|
|
165
|
-
* @Date: 2025-05-24 22:46
|
|
166
|
-
*/
|
|
167
|
-
export declare const checkAndGoNext: (isFormSubject: any, checkAccount: any, carts: any[]) => {
|
|
168
|
-
hasError: boolean;
|
|
169
|
-
updatedCartList: any[];
|
|
170
|
-
};
|
|
171
|
-
export declare const currentAppointmentBoard: (currentKey: string, resources: any[], appointmentBooking: any) => {
|
|
172
|
-
isRequired: boolean;
|
|
173
|
-
isSystem: boolean;
|
|
174
|
-
isSkip: boolean;
|
|
175
|
-
form_id: number;
|
|
176
|
-
form_code: any;
|
|
177
|
-
cart_id: string;
|
|
178
|
-
resource_form_id: string;
|
|
179
|
-
policy_id: string;
|
|
180
|
-
} | {
|
|
181
|
-
isRequired?: undefined;
|
|
182
|
-
isSystem?: undefined;
|
|
183
|
-
isSkip?: undefined;
|
|
184
|
-
form_id?: undefined;
|
|
185
|
-
form_code?: undefined;
|
|
186
|
-
cart_id?: undefined;
|
|
187
|
-
resource_form_id?: undefined;
|
|
188
|
-
policy_id?: undefined;
|
|
189
|
-
};
|
|
190
|
-
export declare const currentRenderLists: (resources: any[], code: any) => any;
|
|
191
|
-
/**
|
|
192
|
-
* @title: 更新购物车
|
|
193
|
-
* @description:
|
|
194
|
-
* @param {any} carts
|
|
195
|
-
* @param {any} value
|
|
196
|
-
* @return {*}
|
|
197
|
-
* @Author: WangHan
|
|
198
|
-
* @Date: 2025-05-25 23:17
|
|
199
|
-
*/
|
|
200
|
-
export declare const updateCartResources: (item: any, value: any) => any;
|
|
114
|
+
export declare const checkHasFormStep: ({ nextStep, isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId, currentStep, stepList, appointmentBooking, locales, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }: any) => true | undefined;
|