@pisell/private-materials 3.3.33 → 3.3.35
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/Sales/Cart/index.js +26 -13
- package/es/components/Sales/Cart/types.d.ts +12 -0
- package/es/components/Sales/Cart/utils.d.ts +23 -0
- package/es/components/Sales/Cart/utils.js +161 -0
- package/es/components/Sales/Checkout/utils.d.ts +9 -1
- package/es/components/Sales/Checkout/utils.js +25 -3
- package/es/components/Sales/Event/Detail.d.ts +2 -0
- package/es/components/Sales/Event/Detail.js +56 -13
- package/es/components/Sales/Event/serve.d.ts +10 -0
- package/es/components/Sales/Event/serve.js +26 -1
- package/es/components/Sales/Summary/utils.js +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +42 -20
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +10 -29
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +156 -53
- package/es/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
- package/es/components/appointmentBooking/components/ConfirmInformation/utils.js +17 -0
- package/es/components/appointmentBooking/components/Content/index.js +28 -44
- package/es/components/appointmentBooking/components/Content/index.less +23 -1
- 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/Footer/index.js +5 -5
- 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.js +47 -61
- package/es/components/appointmentBooking/components/Resource/index.js +102 -119
- package/es/components/appointmentBooking/components/Services/index.js +50 -25
- 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 -1
- package/es/components/appointmentBooking/hooks.js +215 -294
- 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/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- 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/voucher/index.d.ts +0 -1
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/es/components/booking/info/date/index.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +0 -1
- 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/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +0 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- 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/materiels/duration/index.d.ts +0 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/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/booking/utils.d.ts +2 -2
- package/es/components/booking/utils.js +19 -11
- 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/ContinueButton/index.js +218 -73
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.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/Footer/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/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/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 +3 -2
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -4
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/index.js +70 -13
- 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/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -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/index.d.ts +0 -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/index.d.ts +0 -1
- package/es/components/productExtension/server.js +2 -2
- package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/es/components/productSelect/components/TabProduct/index.js +4 -2
- 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/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/ticketBooking/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/Sales/Cart/index.js +30 -18
- package/lib/components/Sales/Cart/types.d.ts +12 -0
- package/lib/components/Sales/Cart/utils.d.ts +23 -0
- package/lib/components/Sales/Cart/utils.js +149 -0
- package/lib/components/Sales/Checkout/utils.d.ts +9 -1
- package/lib/components/Sales/Checkout/utils.js +18 -4
- package/lib/components/Sales/Event/Detail.d.ts +2 -0
- package/lib/components/Sales/Event/Detail.js +34 -10
- package/lib/components/Sales/Event/serve.d.ts +10 -0
- package/lib/components/Sales/Event/serve.js +5 -2
- package/lib/components/Sales/Summary/utils.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +7 -2
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +10 -34
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +43 -6
- package/lib/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
- package/lib/components/appointmentBooking/components/ConfirmInformation/utils.js +37 -0
- package/lib/components/appointmentBooking/components/Content/index.js +28 -42
- package/lib/components/appointmentBooking/components/Content/index.less +23 -1
- 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.js +19 -36
- package/lib/components/appointmentBooking/components/Resource/index.js +59 -41
- package/lib/components/appointmentBooking/components/Services/index.js +18 -10
- 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 -1
- package/lib/components/appointmentBooking/hooks.js +62 -142
- package/lib/components/appointmentBooking/utils.d.ts +2 -88
- package/lib/components/appointmentBooking/utils.js +51 -191
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.d.ts +0 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/lib/components/booking/info/date/index.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +0 -1
- 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/utils.js +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- 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/materiels/duration/index.d.ts +0 -1
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/booking/utils.js +5 -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/ContinueButton/index.js +128 -42
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.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/Footer/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/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/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 +3 -2
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -2
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +79 -24
- 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/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/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/TabProduct/index.js +6 -2
- 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/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/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 +1 -1
- 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
|
@@ -17,9 +17,9 @@ import { useState, useEffect, useMemo } from 'react';
|
|
|
17
17
|
import { locales } from "@pisell/utils";
|
|
18
18
|
import { usePisellOS } from "../../hooks/useEngineContext";
|
|
19
19
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
20
|
-
import { sortResources, getCustomer,
|
|
20
|
+
import { sortResources, getCustomer, formatCartsResources, checkHasFormStep } from "./utils";
|
|
21
21
|
import { useAppointmentBookingContext } from "./context";
|
|
22
|
-
import {
|
|
22
|
+
import { checkHolder } from "./components/Cart/utils";
|
|
23
23
|
export var useAppointmentBooking = function useAppointmentBooking() {
|
|
24
24
|
var pisellOS = usePisellOS();
|
|
25
25
|
return pisellOS.getModule('appointmentBooking');
|
|
@@ -45,29 +45,14 @@ export var contextUtils = function contextUtils() {
|
|
|
45
45
|
export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
46
46
|
var _appointmentBooking$s;
|
|
47
47
|
var pisellOS = usePisellOS();
|
|
48
|
-
var
|
|
49
|
-
appointmentBooking =
|
|
50
|
-
setCurrentStep =
|
|
51
|
-
|
|
52
|
-
openPolicy =
|
|
53
|
-
setCarts = _ref.setCarts,
|
|
54
|
-
setLoading = _ref.setLoading,
|
|
55
|
-
currentSelectedResourcesRef = _ref.currentSelectedResourcesRef,
|
|
56
|
-
currentStepParams = _ref.currentStepParams,
|
|
57
|
-
setIsErrorHolder = _ref.setIsErrorHolder;
|
|
58
|
-
var stepList = (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) || [];
|
|
59
|
-
var _useAppointmentBookin = useAppointmentBookingLogin(),
|
|
60
|
-
isLogin = _useAppointmentBookin.isLogin,
|
|
61
|
-
openLoginModal = _useAppointmentBookin.openLoginModal;
|
|
48
|
+
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
49
|
+
appointmentBooking = _useAppointmentBookin.appointmentBooking,
|
|
50
|
+
setCurrentStep = _useAppointmentBookin.setCurrentStep,
|
|
51
|
+
policyIdsRef = _useAppointmentBookin.policyIdsRef,
|
|
52
|
+
openPolicy = _useAppointmentBookin.openPolicy;
|
|
62
53
|
var _useAppointmentBookin2 = useAppointmentBookingSetting(),
|
|
63
|
-
|
|
64
|
-
var
|
|
65
|
-
accountLists = _useAppointmentBookin3.accountLists,
|
|
66
|
-
getHolders = _useAppointmentBookin3.getHolders,
|
|
67
|
-
checkAccount = _useAppointmentBookin3.checkAccount;
|
|
68
|
-
var _useAppointmentBookin4 = useAppointmentBookingResource(),
|
|
69
|
-
getResourceList = _useAppointmentBookin4.getResourceList;
|
|
70
|
-
var utils = contextUtils();
|
|
54
|
+
isRetailTemplate = _useAppointmentBookin2.isRetailTemplate;
|
|
55
|
+
var stepList = (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) || [];
|
|
71
56
|
|
|
72
57
|
// 判断是否是最后一步
|
|
73
58
|
var getCurrentAndLastStep = function getCurrentAndLastStep() {
|
|
@@ -77,7 +62,7 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
77
62
|
useEffect(function () {
|
|
78
63
|
getCurrentAndLastStep();
|
|
79
64
|
pisellOS.effects.on('appointmentBooking_step:changed', /*#__PURE__*/function () {
|
|
80
|
-
var
|
|
65
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
|
|
81
66
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
82
67
|
while (1) switch (_context.prev = _context.next) {
|
|
83
68
|
case 0:
|
|
@@ -91,7 +76,7 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
91
76
|
}, _callee);
|
|
92
77
|
}));
|
|
93
78
|
return function (_x) {
|
|
94
|
-
return
|
|
79
|
+
return _ref.apply(this, arguments);
|
|
95
80
|
};
|
|
96
81
|
}());
|
|
97
82
|
}, []);
|
|
@@ -139,145 +124,35 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
139
124
|
|
|
140
125
|
// 下一步
|
|
141
126
|
var nextStep = function nextStep() {
|
|
142
|
-
var
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (currentKey !== null && currentKey !== void 0 && currentKey.startsWith('select-resource')) {
|
|
146
|
-
var _currentSelectedResou, _currentSelectedResou2;
|
|
147
|
-
// 1. 检测购物车中是否选择了资源
|
|
148
|
-
var _checkAndMarkCartRend = checkAndMarkCartRenderError((currentSelectedResourcesRef === null || currentSelectedResourcesRef === void 0 ? void 0 : currentSelectedResourcesRef.current) || [], appointmentBooking, utils),
|
|
149
|
-
hasError = _checkAndMarkCartRend.hasError,
|
|
150
|
-
updatedCartList = _checkAndMarkCartRend.updatedCartList;
|
|
151
|
-
if (hasError) {
|
|
152
|
-
// setCarts(updatedCartList)
|
|
153
|
-
scrollToFirstErrorCard();
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// 2. 插入表单步骤
|
|
158
|
-
currentSelectedResourcesRef === null || currentSelectedResourcesRef === void 0 || (_currentSelectedResou = currentSelectedResourcesRef.current) === null || _currentSelectedResou === void 0 || _currentSelectedResou.forEach(function (cart) {
|
|
159
|
-
var _selectedResource$ren, _selectedResource$ren2;
|
|
160
|
-
var selectedResource = cart === null || cart === void 0 ? void 0 : cart.currentSelectedResource;
|
|
161
|
-
var resourceItem = (selectedResource === null || selectedResource === void 0 ? void 0 : selectedResource.resourceItem) || {};
|
|
162
|
-
var formId = selectedResource === null || selectedResource === void 0 || (_selectedResource$ren = selectedResource.renderItem) === null || _selectedResource$ren === void 0 ? void 0 : _selectedResource$ren.resource_form_id;
|
|
163
|
-
var policyId = selectedResource === null || selectedResource === void 0 || (_selectedResource$ren2 = selectedResource.renderItem) === null || _selectedResource$ren2 === void 0 ? void 0 : _selectedResource$ren2.policy_id;
|
|
164
|
-
var formKey = "fill-form_@".concat(resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.form_id, "-").concat(resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.code, "-").concat(cart === null || cart === void 0 ? void 0 : cart._id, "-").concat(formId, "-").concat(policyId);
|
|
165
|
-
|
|
166
|
-
// 如果有表单id则插入表单步骤
|
|
167
|
-
if (formId) {
|
|
168
|
-
var description = locales.getText('pisell2.appointment.fill-form');
|
|
169
|
-
var beforeKey = getFormInsertBeforeKey(currentKey, stepList);
|
|
170
|
-
appointmentBooking.addStep({
|
|
171
|
-
key: formKey,
|
|
172
|
-
description: description
|
|
173
|
-
}, beforeKey);
|
|
174
|
-
} else {
|
|
175
|
-
appointmentBooking.removeStep(formKey);
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
// 3. 插入下一个资源步骤
|
|
180
|
-
var selectedResource = currentSelectedResourcesRef === null || currentSelectedResourcesRef === void 0 || (_currentSelectedResou2 = currentSelectedResourcesRef.current) === null || _currentSelectedResou2 === void 0 || (_currentSelectedResou2 = _currentSelectedResou2[0]) === null || _currentSelectedResou2 === void 0 ? void 0 : _currentSelectedResou2.currentSelectedResource;
|
|
181
|
-
if (selectedResource) {
|
|
182
|
-
var _selectedResource$res;
|
|
183
|
-
var originRenderLists = (selectedResource === null || selectedResource === void 0 || (_selectedResource$res = selectedResource.resourceItem) === null || _selectedResource$res === void 0 ? void 0 : _selectedResource$res.originRenderLists) || [];
|
|
184
|
-
var currentResourceIndex = originRenderLists === null || originRenderLists === void 0 ? void 0 : originRenderLists.findIndex(function (item) {
|
|
185
|
-
var _selectedResource$ren3;
|
|
186
|
-
return item.id === (selectedResource === null || selectedResource === void 0 || (_selectedResource$ren3 = selectedResource.renderItem) === null || _selectedResource$ren3 === void 0 ? void 0 : _selectedResource$ren3.form_id);
|
|
187
|
-
});
|
|
188
|
-
var nextResource = originRenderLists === null || originRenderLists === void 0 ? void 0 : originRenderLists[currentResourceIndex + 1];
|
|
189
|
-
var resourceKey = "select-resource_@".concat(nextResource === null || nextResource === void 0 ? void 0 : nextResource.form_id, "-").concat(nextResource === null || nextResource === void 0 ? void 0 : nextResource.code);
|
|
190
|
-
|
|
191
|
-
// 如果有下一个资源数据,则插入下一个资源步骤
|
|
192
|
-
if (nextResource) {
|
|
193
|
-
var _stepList;
|
|
194
|
-
var beforeKey = (_stepList = stepList[stepList.length - 2]) === null || _stepList === void 0 ? void 0 : _stepList.key;
|
|
195
|
-
appointmentBooking.addStep({
|
|
196
|
-
key: resourceKey,
|
|
197
|
-
description: ''
|
|
198
|
-
}, beforeKey);
|
|
199
|
-
} else {
|
|
200
|
-
appointmentBooking.removeStep(resourceKey);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
127
|
+
var _appointmentBooking$s2;
|
|
128
|
+
if (isRetailTemplate) {
|
|
129
|
+
return appointmentBooking.next();
|
|
203
130
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
var
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
} else {
|
|
230
|
-
return appointmentBooking.next();
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
// 检测是否登录
|
|
235
|
-
var checkLogin = function checkLogin() {
|
|
236
|
-
// 如果没有登录,则验证登录
|
|
237
|
-
if (!isLogin) {
|
|
238
|
-
return openLoginModal({
|
|
239
|
-
callback: function callback(status) {
|
|
240
|
-
if (status === 'success') {
|
|
241
|
-
if (!isFormSubject) {
|
|
242
|
-
var _utils$storage;
|
|
243
|
-
var user = JSON.parse((utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('customer')) || '{}');
|
|
244
|
-
var currentUser = formatCustomer(user);
|
|
245
|
-
var meAccount = accountLists === null || accountLists === void 0 ? void 0 : accountLists.find(function (d) {
|
|
246
|
-
return !(d !== null && d !== void 0 && d.isGuest);
|
|
247
|
-
});
|
|
248
|
-
appointmentBooking.setLoginAccount(meAccount === null || meAccount === void 0 ? void 0 : meAccount.id, currentUser);
|
|
249
|
-
} else {
|
|
250
|
-
getHolders();
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// 继续后续流程
|
|
254
|
-
checkHolder();
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
} else {
|
|
259
|
-
return checkHolder();
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
// 如果下一步不是确认信息,则打开协议弹窗
|
|
264
|
-
if ((nextStep === null || nextStep === void 0 ? void 0 : nextStep.key) !== 'confirm-information') {
|
|
265
|
-
if (!(renderItem !== null && renderItem !== void 0 && renderItem.policy_id)) {
|
|
266
|
-
return appointmentBooking.next();
|
|
267
|
-
}
|
|
268
|
-
return openPolicy({
|
|
269
|
-
id: renderItem === null || renderItem === void 0 ? void 0 : renderItem.policy_id
|
|
270
|
-
}, function () {
|
|
271
|
-
// 触发购物车数据发生改变,重新得出当前的资源
|
|
272
|
-
var cartItem = carts === null || carts === void 0 ? void 0 : carts[0];
|
|
273
|
-
appointmentBooking.updateCart(_objectSpread({
|
|
274
|
-
_id: cartItem === null || cartItem === void 0 ? void 0 : cartItem._id
|
|
275
|
-
}, cartItem));
|
|
276
|
-
appointmentBooking.next();
|
|
277
|
-
});
|
|
278
|
-
} else {
|
|
279
|
-
// 如果下一步是确认信息,则检测是否需要登录和检测holder数据
|
|
280
|
-
return checkLogin();
|
|
131
|
+
var currentStep = appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.getCurrentStep();
|
|
132
|
+
var stepList = (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) || [];
|
|
133
|
+
|
|
134
|
+
// 倒数第二步
|
|
135
|
+
if ((currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2 === (stepList === null || stepList === void 0 ? void 0 : stepList.length)) {
|
|
136
|
+
var _policyIdsRef$current;
|
|
137
|
+
// 如果没有同意资源上挂接的协议,则打开协议弹窗
|
|
138
|
+
if (policyIdsRef !== null && policyIdsRef !== void 0 && (_policyIdsRef$current = policyIdsRef.current) !== null && _policyIdsRef$current !== void 0 && _policyIdsRef$current.length) {
|
|
139
|
+
// 依次弹出所有协议
|
|
140
|
+
var idx = 0;
|
|
141
|
+
var showNextPolicy = function showNextPolicy() {
|
|
142
|
+
if (idx < policyIdsRef.current.length) {
|
|
143
|
+
openPolicy({
|
|
144
|
+
id: policyIdsRef.current[idx]
|
|
145
|
+
}, function () {
|
|
146
|
+
idx++;
|
|
147
|
+
showNextPolicy();
|
|
148
|
+
});
|
|
149
|
+
} else {
|
|
150
|
+
// 全部同意后,进入下一步
|
|
151
|
+
appointmentBooking.next();
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
showNextPolicy();
|
|
155
|
+
return;
|
|
281
156
|
}
|
|
282
157
|
}
|
|
283
158
|
appointmentBooking.next();
|
|
@@ -300,17 +175,17 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
300
175
|
* @Date: 2025-04-15 11:12
|
|
301
176
|
*/
|
|
302
177
|
export var useAppointmentBookingProduct = function useAppointmentBookingProduct() {
|
|
303
|
-
var
|
|
304
|
-
appointmentBooking =
|
|
305
|
-
var
|
|
306
|
-
productModuleParams =
|
|
307
|
-
var
|
|
308
|
-
bookingProcess =
|
|
178
|
+
var _ref2 = useAppointmentBookingContext(),
|
|
179
|
+
appointmentBooking = _ref2.appointmentBooking;
|
|
180
|
+
var _ref3 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
|
|
181
|
+
productModuleParams = _ref3.productModuleParams;
|
|
182
|
+
var _ref4 = productModuleParams || {},
|
|
183
|
+
bookingProcess = _ref4.bookingProcess;
|
|
309
184
|
|
|
310
185
|
// 获取商品列表
|
|
311
186
|
var getProducts = /*#__PURE__*/function () {
|
|
312
|
-
var
|
|
313
|
-
var _dates$, dates,
|
|
187
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
188
|
+
var _dates$, dates, _ref6, _productModuleParams, _productList, _ref7, productModuleParams, productList;
|
|
314
189
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
315
190
|
while (1) switch (_context2.prev = _context2.next) {
|
|
316
191
|
case 0:
|
|
@@ -328,7 +203,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
328
203
|
}
|
|
329
204
|
return _context2.abrupt("return");
|
|
330
205
|
case 6:
|
|
331
|
-
|
|
206
|
+
_ref6 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, _productModuleParams = _ref6.productModuleParams;
|
|
332
207
|
_context2.next = 9;
|
|
333
208
|
return appointmentBooking.loadProductByScheduleDate(_objectSpread({
|
|
334
209
|
date: (_dates$ = dates[0]) === null || _dates$ === void 0 ? void 0 : _dates$.date
|
|
@@ -338,7 +213,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
338
213
|
return _context2.abrupt("return", _productList);
|
|
339
214
|
case 11:
|
|
340
215
|
// 先选商品
|
|
341
|
-
|
|
216
|
+
_ref7 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, productModuleParams = _ref7.productModuleParams;
|
|
342
217
|
_context2.next = 14;
|
|
343
218
|
return appointmentBooking.loadProducts(productModuleParams);
|
|
344
219
|
case 14:
|
|
@@ -351,13 +226,13 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
351
226
|
}, _callee2);
|
|
352
227
|
}));
|
|
353
228
|
return function getProducts() {
|
|
354
|
-
return
|
|
229
|
+
return _ref5.apply(this, arguments);
|
|
355
230
|
};
|
|
356
231
|
}();
|
|
357
232
|
|
|
358
233
|
// 检测商品类型
|
|
359
234
|
var checkProductType = /*#__PURE__*/function () {
|
|
360
|
-
var
|
|
235
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(productId) {
|
|
361
236
|
var result;
|
|
362
237
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
363
238
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -374,7 +249,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
374
249
|
}, _callee3);
|
|
375
250
|
}));
|
|
376
251
|
return function checkProductType(_x2) {
|
|
377
|
-
return
|
|
252
|
+
return _ref8.apply(this, arguments);
|
|
378
253
|
};
|
|
379
254
|
}();
|
|
380
255
|
return {
|
|
@@ -394,51 +269,32 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
394
269
|
var _appointmentBooking$o;
|
|
395
270
|
var pisellOS = usePisellOS();
|
|
396
271
|
var utils = contextUtils();
|
|
397
|
-
var
|
|
398
|
-
appointmentBooking =
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
bookingSubject = _ref11.bookingSubject;
|
|
272
|
+
var _useAppointmentBookin3 = useAppointmentBookingContext(),
|
|
273
|
+
appointmentBooking = _useAppointmentBookin3.appointmentBooking,
|
|
274
|
+
setCarts = _useAppointmentBookin3.setCarts,
|
|
275
|
+
setSummary = _useAppointmentBookin3.setSummary,
|
|
276
|
+
setIsAgreeDepositPolicy = _useAppointmentBookin3.setIsAgreeDepositPolicy;
|
|
277
|
+
var _ref9 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.productModuleParams) || {},
|
|
278
|
+
bookingSubject = _ref9.bookingSubject;
|
|
405
279
|
var getCartAndSummary = /*#__PURE__*/function () {
|
|
406
|
-
var
|
|
407
|
-
var
|
|
408
|
-
var locale, symbol, carts, accountLists, newCarts, summary;
|
|
280
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
281
|
+
var carts, newCarts, summary;
|
|
409
282
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
410
283
|
while (1) switch (_context4.prev = _context4.next) {
|
|
411
284
|
case 0:
|
|
412
|
-
|
|
413
|
-
symbol = (utils === null || utils === void 0 ? void 0 : utils.getSymbolic()) || '$';
|
|
414
|
-
_context4.next = 4;
|
|
285
|
+
_context4.next = 2;
|
|
415
286
|
return appointmentBooking.getCart();
|
|
416
|
-
case
|
|
287
|
+
case 2:
|
|
417
288
|
carts = _context4.sent;
|
|
418
|
-
_context4.next = 7;
|
|
419
|
-
return appointmentBooking.getAccounts();
|
|
420
|
-
case 7:
|
|
421
|
-
accountLists = _context4.sent;
|
|
422
289
|
newCarts = carts === null || carts === void 0 ? void 0 : carts.map(function (item) {
|
|
423
|
-
var _item$duration;
|
|
424
290
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
425
|
-
addHolderButtonText: utils === null || utils === void 0 ? void 0 : utils.translation(bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_name)
|
|
426
|
-
format: ['HH:mm', 'HH:mm'],
|
|
427
|
-
show_time: true,
|
|
428
|
-
duration_type: (item === null || item === void 0 || (_item$duration = item.duration) === null || _item$duration === void 0 ? void 0 : _item$duration.type) || 'minutes',
|
|
429
|
-
locale: locale,
|
|
430
|
-
symbol: symbol,
|
|
431
|
-
holders: formatHolder(accountLists),
|
|
432
|
-
allowClearHolder: true,
|
|
433
|
-
allowClearResource: true,
|
|
434
|
-
isErrorHolder: isErrorHolder || false,
|
|
435
|
-
isMultipleResource: true
|
|
291
|
+
addHolderButtonText: utils === null || utils === void 0 ? void 0 : utils.translation(bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_name)
|
|
436
292
|
});
|
|
437
293
|
});
|
|
438
294
|
setCarts(newCarts || []);
|
|
439
|
-
_context4.next =
|
|
295
|
+
_context4.next = 7;
|
|
440
296
|
return appointmentBooking.getSummary();
|
|
441
|
-
case
|
|
297
|
+
case 7:
|
|
442
298
|
summary = _context4.sent;
|
|
443
299
|
setSummary(summary || {});
|
|
444
300
|
|
|
@@ -446,14 +302,14 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
446
302
|
if (!carts.length) {
|
|
447
303
|
setIsAgreeDepositPolicy(false);
|
|
448
304
|
}
|
|
449
|
-
case
|
|
305
|
+
case 10:
|
|
450
306
|
case "end":
|
|
451
307
|
return _context4.stop();
|
|
452
308
|
}
|
|
453
309
|
}, _callee4);
|
|
454
310
|
}));
|
|
455
311
|
return function getCartAndSummary() {
|
|
456
|
-
return
|
|
312
|
+
return _ref10.apply(this, arguments);
|
|
457
313
|
};
|
|
458
314
|
}();
|
|
459
315
|
useEffect(function () {
|
|
@@ -484,8 +340,8 @@ export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
|
|
|
484
340
|
var utils = contextUtils();
|
|
485
341
|
var isLogin = !!(utils !== null && utils !== void 0 && (_utils$token = utils.token) !== null && _utils$token !== void 0 && (_utils$token$get = _utils$token.get) !== null && _utils$token$get !== void 0 && _utils$token$get.call(_utils$token));
|
|
486
342
|
var openLoginModal = function openLoginModal(params) {
|
|
487
|
-
var
|
|
488
|
-
callback =
|
|
343
|
+
var _ref12 = params || {},
|
|
344
|
+
callback = _ref12.callback;
|
|
489
345
|
utils.action({
|
|
490
346
|
type: 'pisell1.login',
|
|
491
347
|
data: {
|
|
@@ -516,13 +372,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
516
372
|
_useState2 = _slicedToArray(_useState, 2),
|
|
517
373
|
accountLists = _useState2[0],
|
|
518
374
|
setAccountLists = _useState2[1];
|
|
519
|
-
var
|
|
520
|
-
bookingSubject =
|
|
375
|
+
var _ref13 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o2 = appointmentBooking.otherParams) === null || _appointmentBooking$o2 === void 0 ? void 0 : _appointmentBooking$o2.productModuleParams) || {},
|
|
376
|
+
bookingSubject = _ref13.bookingSubject;
|
|
521
377
|
var form_id = bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id;
|
|
522
378
|
|
|
523
379
|
// 获取账户列表数据
|
|
524
380
|
var getAccountLists = /*#__PURE__*/function () {
|
|
525
|
-
var
|
|
381
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
526
382
|
var data;
|
|
527
383
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
528
384
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -539,13 +395,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
539
395
|
}, _callee6);
|
|
540
396
|
}));
|
|
541
397
|
return function getAccountLists() {
|
|
542
|
-
return
|
|
398
|
+
return _ref14.apply(this, arguments);
|
|
543
399
|
};
|
|
544
400
|
}();
|
|
545
401
|
useEffect(function () {
|
|
546
402
|
getAccountLists();
|
|
547
403
|
pisellOS.effects.on('appointmentBooking_accountList:changed', /*#__PURE__*/function () {
|
|
548
|
-
var
|
|
404
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(res) {
|
|
549
405
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
550
406
|
while (1) switch (_context7.prev = _context7.next) {
|
|
551
407
|
case 0:
|
|
@@ -560,14 +416,14 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
560
416
|
}, _callee7);
|
|
561
417
|
}));
|
|
562
418
|
return function (_x3) {
|
|
563
|
-
return
|
|
419
|
+
return _ref15.apply(this, arguments);
|
|
564
420
|
};
|
|
565
421
|
}());
|
|
566
422
|
}, []);
|
|
567
423
|
|
|
568
424
|
// 获取表单数据
|
|
569
425
|
var getHolders = /*#__PURE__*/function () {
|
|
570
|
-
var
|
|
426
|
+
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
571
427
|
var _utils$getStore$getSt;
|
|
572
428
|
var shop_id, customer, params, data, newData;
|
|
573
429
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
@@ -607,13 +463,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
607
463
|
}, _callee8);
|
|
608
464
|
}));
|
|
609
465
|
return function getHolders() {
|
|
610
|
-
return
|
|
466
|
+
return _ref16.apply(this, arguments);
|
|
611
467
|
};
|
|
612
468
|
}();
|
|
613
469
|
|
|
614
470
|
// 添加账户
|
|
615
471
|
var addAccount = /*#__PURE__*/function () {
|
|
616
|
-
var
|
|
472
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(val, type) {
|
|
617
473
|
var customer, result;
|
|
618
474
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
619
475
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -634,7 +490,7 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
634
490
|
}, _callee9);
|
|
635
491
|
}));
|
|
636
492
|
return function addAccount(_x4, _x5) {
|
|
637
|
-
return
|
|
493
|
+
return _ref17.apply(this, arguments);
|
|
638
494
|
};
|
|
639
495
|
}();
|
|
640
496
|
|
|
@@ -659,12 +515,14 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
659
515
|
* @Date: 2025-04-15 11:29
|
|
660
516
|
*/
|
|
661
517
|
export var useAppointmentBookingResource = function useAppointmentBookingResource() {
|
|
662
|
-
var
|
|
663
|
-
appointmentBooking =
|
|
664
|
-
setResources =
|
|
665
|
-
setTimes =
|
|
666
|
-
|
|
667
|
-
|
|
518
|
+
var _useAppointmentBookin4 = useAppointmentBookingContext(),
|
|
519
|
+
appointmentBooking = _useAppointmentBookin4.appointmentBooking,
|
|
520
|
+
setResources = _useAppointmentBookin4.setResources,
|
|
521
|
+
setTimes = _useAppointmentBookin4.setTimes,
|
|
522
|
+
setResourceOtherParams = _useAppointmentBookin4.setResourceOtherParams,
|
|
523
|
+
resourceOtherParams = _useAppointmentBookin4.resourceOtherParams;
|
|
524
|
+
var _ref18 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
|
|
525
|
+
resourceSort = _ref18.resourceSort;
|
|
668
526
|
|
|
669
527
|
// 设置资源列表
|
|
670
528
|
var getResourceList = function getResourceList() {
|
|
@@ -688,7 +546,7 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
688
546
|
|
|
689
547
|
// 设置时间切片
|
|
690
548
|
var getResourceTimeSlot = /*#__PURE__*/function () {
|
|
691
|
-
var
|
|
549
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(index) {
|
|
692
550
|
var _getResourceList, resourceCodes, code, data;
|
|
693
551
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
694
552
|
while (1) switch (_context10.prev = _context10.next) {
|
|
@@ -707,12 +565,45 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
707
565
|
}, _callee10);
|
|
708
566
|
}));
|
|
709
567
|
return function getResourceTimeSlot(_x6) {
|
|
710
|
-
return
|
|
568
|
+
return _ref19.apply(this, arguments);
|
|
569
|
+
};
|
|
570
|
+
}();
|
|
571
|
+
|
|
572
|
+
// 获取自动分配
|
|
573
|
+
var autoSelectAllProductResources = /*#__PURE__*/function () {
|
|
574
|
+
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(index) {
|
|
575
|
+
var _getResourceList2, resourceCodes, code, data, res;
|
|
576
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
577
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
578
|
+
case 0:
|
|
579
|
+
_getResourceList2 = getResourceList(), resourceCodes = _getResourceList2.resourceCodes;
|
|
580
|
+
code = resourceCodes === null || resourceCodes === void 0 ? void 0 : resourceCodes[index || 0]; // 获取时间切片
|
|
581
|
+
_context11.next = 4;
|
|
582
|
+
return appointmentBooking.getTimeSlotByAllResources(code);
|
|
583
|
+
case 4:
|
|
584
|
+
data = _context11.sent;
|
|
585
|
+
_context11.next = 7;
|
|
586
|
+
return appointmentBooking.autoSelectAllProductResources(code);
|
|
587
|
+
case 7:
|
|
588
|
+
res = _context11.sent;
|
|
589
|
+
setResourceOtherParams(_objectSpread(_objectSpread(_objectSpread({}, resourceOtherParams), res), {}, {
|
|
590
|
+
resourceCodes: resourceCodes
|
|
591
|
+
}));
|
|
592
|
+
return _context11.abrupt("return", res);
|
|
593
|
+
case 10:
|
|
594
|
+
case "end":
|
|
595
|
+
return _context11.stop();
|
|
596
|
+
}
|
|
597
|
+
}, _callee11);
|
|
598
|
+
}));
|
|
599
|
+
return function autoSelectAllProductResources(_x7) {
|
|
600
|
+
return _ref20.apply(this, arguments);
|
|
711
601
|
};
|
|
712
602
|
}();
|
|
713
603
|
return {
|
|
714
604
|
getResourceTimeSlot: getResourceTimeSlot,
|
|
715
|
-
getResourceList: getResourceList
|
|
605
|
+
getResourceList: getResourceList,
|
|
606
|
+
autoSelectAllProductResources: autoSelectAllProductResources
|
|
716
607
|
};
|
|
717
608
|
};
|
|
718
609
|
|
|
@@ -724,73 +615,101 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
724
615
|
* @Date: 2025-04-21 11:47
|
|
725
616
|
*/
|
|
726
617
|
export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
727
|
-
var
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
618
|
+
var _appointmentBooking$s3;
|
|
619
|
+
var _useAppointmentBookin5 = useAppointmentBookingContext(),
|
|
620
|
+
currentStep = _useAppointmentBookin5.currentStep,
|
|
621
|
+
setCarts = _useAppointmentBookin5.setCarts,
|
|
622
|
+
setPolicyIds = _useAppointmentBookin5.setPolicyIds;
|
|
623
|
+
var _useAppointmentBookin6 = useAppointmentBookingResource(),
|
|
624
|
+
getResourceList = _useAppointmentBookin6.getResourceList,
|
|
625
|
+
autoSelectAllProductResources = _useAppointmentBookin6.autoSelectAllProductResources;
|
|
626
|
+
var _useAppointmentBookin7 = useAppointmentBookingSetting(),
|
|
627
|
+
isFormSubject = _useAppointmentBookin7.isFormSubject;
|
|
733
628
|
var appointmentBooking = useAppointmentBooking();
|
|
734
|
-
var
|
|
735
|
-
|
|
629
|
+
var stepList = (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) || [];
|
|
630
|
+
var _useAppointmentBookin8 = useAppointmentBookingLogin(),
|
|
631
|
+
isLogin = _useAppointmentBookin8.isLogin,
|
|
632
|
+
openLoginModal = _useAppointmentBookin8.openLoginModal;
|
|
633
|
+
var _useAppointmentBookin9 = useAppointmentBookingAccount(),
|
|
634
|
+
getHolders = _useAppointmentBookin9.getHolders,
|
|
635
|
+
checkAccount = _useAppointmentBookin9.checkAccount;
|
|
636
|
+
var _useAppointmentBookin10 = useAppointmentBookingStep(),
|
|
637
|
+
nextStep = _useAppointmentBookin10.nextStep;
|
|
638
|
+
var utils = contextUtils();
|
|
736
639
|
var checkSkipResourceStep = /*#__PURE__*/function () {
|
|
737
|
-
var
|
|
738
|
-
var
|
|
739
|
-
return _regeneratorRuntime().wrap(function
|
|
740
|
-
while (1) switch (
|
|
640
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(isSkipUpdateFormStep) {
|
|
641
|
+
var accountLists, carts, _res$errorList, _resources$, res, _getResourceList3, resources, resultCarts;
|
|
642
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
643
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
741
644
|
case 0:
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
_context11.next = 4;
|
|
645
|
+
_context12.prev = 0;
|
|
646
|
+
_context12.next = 3;
|
|
745
647
|
return appointmentBooking.getAccounts();
|
|
746
|
-
case
|
|
747
|
-
accountLists =
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}
|
|
753
|
-
nextStep();
|
|
754
|
-
return _context11.abrupt("return", true);
|
|
755
|
-
case 9:
|
|
648
|
+
case 3:
|
|
649
|
+
accountLists = _context12.sent;
|
|
650
|
+
_context12.next = 6;
|
|
651
|
+
return appointmentBooking.getCart();
|
|
652
|
+
case 6:
|
|
653
|
+
carts = _context12.sent;
|
|
756
654
|
if (!((accountLists === null || accountLists === void 0 ? void 0 : accountLists.length) === 1 || isFormSubject)) {
|
|
757
|
-
|
|
655
|
+
_context12.next = 20;
|
|
758
656
|
break;
|
|
759
657
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
// 如果跳过资源选择步骤,则执行跳过的逻辑
|
|
769
|
-
if (!_isSkip) {
|
|
770
|
-
_context11.next = 16;
|
|
658
|
+
_context12.next = 10;
|
|
659
|
+
return autoSelectAllProductResources();
|
|
660
|
+
case 10:
|
|
661
|
+
res = _context12.sent;
|
|
662
|
+
_getResourceList3 = getResourceList(), resources = _getResourceList3.resources; // 如果分配成功,并且只有一个资源则跳过资源选择步骤,默认选中该资源
|
|
663
|
+
if (!(!(res !== null && res !== void 0 && (_res$errorList = res.errorList) !== null && _res$errorList !== void 0 && _res$errorList.length) && (resources === null || resources === void 0 || (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.renderList) === null || _resources$ === void 0 ? void 0 : _resources$.length) === 1)) {
|
|
664
|
+
_context12.next = 17;
|
|
771
665
|
break;
|
|
772
666
|
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
667
|
+
if (!isSkipUpdateFormStep) {
|
|
668
|
+
resultCarts = formatCartsResources(carts, resources, setPolicyIds); // 如果当前资源有表单,则添加表单步骤,否则删除表单步骤
|
|
669
|
+
checkHasFormStep({
|
|
670
|
+
nextStep: nextStep,
|
|
671
|
+
isSkip: true,
|
|
672
|
+
openLoginModal: openLoginModal,
|
|
673
|
+
utils: utils,
|
|
674
|
+
accountLists: accountLists,
|
|
675
|
+
getHolders: getHolders,
|
|
676
|
+
checkHolder: checkHolder,
|
|
677
|
+
setCarts: setCarts,
|
|
678
|
+
checkAccount: checkAccount,
|
|
679
|
+
carts: carts,
|
|
680
|
+
isFormSubject: isFormSubject,
|
|
681
|
+
hasResourceFormId: (resultCarts === null || resultCarts === void 0 ? void 0 : resultCarts.length) > 0,
|
|
682
|
+
currentStep: currentStep,
|
|
683
|
+
stepList: stepList,
|
|
684
|
+
appointmentBooking: appointmentBooking,
|
|
685
|
+
locales: locales,
|
|
686
|
+
isLogin: isLogin
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
return _context12.abrupt("return", true);
|
|
690
|
+
case 17:
|
|
691
|
+
return _context12.abrupt("return", false);
|
|
692
|
+
case 18:
|
|
693
|
+
_context12.next = 21;
|
|
694
|
+
break;
|
|
779
695
|
case 20:
|
|
780
|
-
|
|
696
|
+
return _context12.abrupt("return", false);
|
|
697
|
+
case 21:
|
|
698
|
+
_context12.next = 27;
|
|
781
699
|
break;
|
|
782
|
-
case
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
700
|
+
case 23:
|
|
701
|
+
_context12.prev = 23;
|
|
702
|
+
_context12.t0 = _context12["catch"](0);
|
|
703
|
+
console.log(_context12.t0, 'checkSkipResourceStep33');
|
|
704
|
+
return _context12.abrupt("return", false);
|
|
705
|
+
case 27:
|
|
787
706
|
case "end":
|
|
788
|
-
return
|
|
707
|
+
return _context12.stop();
|
|
789
708
|
}
|
|
790
|
-
},
|
|
709
|
+
}, _callee12, null, [[0, 23]]);
|
|
791
710
|
}));
|
|
792
|
-
return function checkSkipResourceStep() {
|
|
793
|
-
return
|
|
711
|
+
return function checkSkipResourceStep(_x8) {
|
|
712
|
+
return _ref21.apply(this, arguments);
|
|
794
713
|
};
|
|
795
714
|
}();
|
|
796
715
|
return {
|
|
@@ -806,15 +725,15 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
806
725
|
* @Date: 2025-04-24 18:15
|
|
807
726
|
*/
|
|
808
727
|
export var useAppointmentBookingSetting = function useAppointmentBookingSetting() {
|
|
809
|
-
var _appointmentBooking$o3;
|
|
728
|
+
var _appointmentBooking$o3, _appointmentBooking$o4;
|
|
810
729
|
var utils = contextUtils();
|
|
811
|
-
var
|
|
812
|
-
appointmentBooking =
|
|
813
|
-
var
|
|
814
|
-
bookingProcess =
|
|
815
|
-
bookingSubject =
|
|
816
|
-
customPageId =
|
|
817
|
-
channel =
|
|
730
|
+
var _ref22 = useAppointmentBookingContext(),
|
|
731
|
+
appointmentBooking = _ref22.appointmentBooking;
|
|
732
|
+
var _ref23 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o3 = appointmentBooking.otherParams) === null || _appointmentBooking$o3 === void 0 ? void 0 : _appointmentBooking$o3.productModuleParams) || {},
|
|
733
|
+
bookingProcess = _ref23.bookingProcess,
|
|
734
|
+
bookingSubject = _ref23.bookingSubject,
|
|
735
|
+
customPageId = _ref23.customPageId,
|
|
736
|
+
channel = _ref23.channel;
|
|
818
737
|
|
|
819
738
|
// 设置缓存
|
|
820
739
|
var setOtherData = function setOtherData(key, val) {
|
|
@@ -833,6 +752,8 @@ export var useAppointmentBookingSetting = function useAppointmentBookingSetting(
|
|
|
833
752
|
isDateSelectedFirst: bookingProcess === 'date_first',
|
|
834
753
|
// 主体是否是表单
|
|
835
754
|
isFormSubject: (bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.type) === 'form',
|
|
755
|
+
// 是否是零售模版
|
|
756
|
+
isRetailTemplate: (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o4 = appointmentBooking.otherParams) === null || _appointmentBooking$o4 === void 0 ? void 0 : _appointmentBooking$o4.isRetailTemplate) || false,
|
|
836
757
|
customPageId: customPageId,
|
|
837
758
|
channel: channel,
|
|
838
759
|
bookingSubject: bookingSubject,
|