@pisell/private-materials 3.3.32 → 3.3.33
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/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 +6 -6
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -25
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +45 -25
- package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.js +53 -36
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Form/index.js +61 -161
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.js +64 -50
- package/es/components/appointmentBooking/components/Resource/index.js +119 -102
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +5 -12
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
- package/es/components/appointmentBooking/context.js +43 -3
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/deposit/index.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.d.ts +2 -3
- package/es/components/appointmentBooking/hooks.js +293 -209
- package/es/components/appointmentBooking/utils.d.ts +88 -2
- package/es/components/appointmentBooking/utils.js +325 -63
- package/es/components/booking/addons/model.js +5 -5
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
- package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
- package/es/components/booking/components/browserSelect/index.js +1 -1
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/components/voucher/index.d.ts +1 -0
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +2 -1
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/header/index.d.ts +1 -0
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/materiels/contacts/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/index.js +11 -11
- package/es/components/booking/notes/addNote/index.d.ts +1 -0
- 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/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/index.d.ts +1 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftpos/surcharge/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +2 -1
- package/es/components/eftposPay/app.d.ts +2 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/component/fail/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/network.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/manual/index.d.ts +1 -0
- package/es/components/eftposPay/component/signature/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +2 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +1 -0
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/payo/config.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eftposPay/tip.d.ts +1 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
- package/es/components/eventBooking/components/Provider/SelectProduct/index.js +77 -0
- package/es/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/listComponent/index.js +5 -5
- package/es/components/login/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/index.d.ts +1 -0
- 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 +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.js +12 -12
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/productExtension/server.js +2 -2
- package/es/components/productSelect/components/TabProduct/index.d.ts +1 -0
- package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/es/components/ruleSetting/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.js +1 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- 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.d.ts +1 -0
- 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/ScheduleDetailList/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
- 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.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/es/components/schedules/products/list/index.d.ts +1 -0
- 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/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.js +2 -2
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.js +1 -1
- package/es/components/schedules/resources/serve.js +2 -2
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
- package/es/components/schedules/schedules/index.d.ts +1 -0
- 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 +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/ticketBooking/components/menuBar/index.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/es/hooks/useComponents.js +1 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +0 -5
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +33 -9
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.js +35 -21
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Form/index.js +54 -98
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.js +39 -20
- package/lib/components/appointmentBooking/components/Resource/index.js +41 -59
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +1 -7
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
- package/lib/components/appointmentBooking/context.js +48 -4
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/deposit/index.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.d.ts +2 -3
- package/lib/components/appointmentBooking/hooks.js +143 -57
- package/lib/components/appointmentBooking/utils.d.ts +88 -2
- package/lib/components/appointmentBooking/utils.js +191 -51
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/components/voucher/index.d.ts +1 -0
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +2 -1
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/header/index.d.ts +1 -0
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/lib/components/booking/notes/addNote/index.d.ts +1 -0
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/index.d.ts +1 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftpos/surcharge/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +2 -1
- package/lib/components/eftposPay/app.d.ts +2 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +2 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +1 -0
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/payo/config.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eftposPay/tip.d.ts +1 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +69 -0
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/login/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/productSelect/components/TabProduct/index.d.ts +1 -0
- package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/lib/components/ruleSetting/index.d.ts +1 -0
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/calendar/index.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/lib/components/schedules/products/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/resources/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/schedules/index.d.ts +1 -0
- 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 +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/taxSelect/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/menuBar/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/utils/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
8
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
9
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
10
|
import React, { useMemo } from 'react';
|
|
6
11
|
import { locales } from '@pisell/utils';
|
|
7
12
|
import ProgressBar from "../../../eventBooking/components/progressBar";
|
|
8
13
|
import { useAppointmentBookingContext } from "../../context";
|
|
9
|
-
import { useShopDiscount,
|
|
14
|
+
import { useShopDiscount, useAppointmentBookingStep, useAppointmentBookingSetting, useAppointmentBookingProduct, contextUtils } from "../../hooks";
|
|
10
15
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
16
|
+
import { getResourceTitle } from "../../utils";
|
|
11
17
|
import "./index.less";
|
|
12
18
|
var Header = function Header() {
|
|
13
19
|
var _currentStep$step3;
|
|
14
|
-
var
|
|
15
|
-
currentStep =
|
|
16
|
-
appointmentBooking =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
var _ref = useAppointmentBookingContext(),
|
|
21
|
+
currentStep = _ref.currentStep,
|
|
22
|
+
appointmentBooking = _ref.appointmentBooking,
|
|
23
|
+
setTimes = _ref.setTimes,
|
|
24
|
+
carts = _ref.carts,
|
|
25
|
+
currentStepParams = _ref.currentStepParams,
|
|
26
|
+
currentSelectedResourcesRef = _ref.currentSelectedResourcesRef;
|
|
20
27
|
var shopDiscount = useShopDiscount();
|
|
21
28
|
var context = useEngineContext();
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _useAppointmentBookin3 =
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
checkProductType = _useAppointmentBookin4.checkProductType;
|
|
29
|
+
var _useAppointmentBookin = useAppointmentBookingStep(),
|
|
30
|
+
stepList = _useAppointmentBookin.stepList,
|
|
31
|
+
updateStep = _useAppointmentBookin.updateStep;
|
|
32
|
+
var _useAppointmentBookin2 = useAppointmentBookingSetting(),
|
|
33
|
+
setOtherData = _useAppointmentBookin2.setOtherData,
|
|
34
|
+
getOtherData = _useAppointmentBookin2.getOtherData;
|
|
35
|
+
var _useAppointmentBookin3 = useAppointmentBookingProduct(),
|
|
36
|
+
checkProductType = _useAppointmentBookin3.checkProductType;
|
|
37
|
+
var utils = contextUtils();
|
|
32
38
|
|
|
33
39
|
/**
|
|
34
40
|
* @title: 获取资源名称
|
|
@@ -44,13 +50,15 @@ var Header = function Header() {
|
|
|
44
50
|
if (!key) return '';
|
|
45
51
|
|
|
46
52
|
// 选择资源则获取资源列表的第一个名称
|
|
47
|
-
if (key
|
|
48
|
-
var
|
|
49
|
-
var
|
|
53
|
+
if (key.startsWith('select-resource')) {
|
|
54
|
+
var _currentSelectedResou;
|
|
55
|
+
var currentResource = (_currentSelectedResou = currentSelectedResourcesRef.current) === null || _currentSelectedResou === void 0 || (_currentSelectedResou = _currentSelectedResou[0]) === null || _currentSelectedResou === void 0 ? void 0 : _currentSelectedResou.currentSelectedResource;
|
|
56
|
+
var resourceItem = (currentResource === null || currentResource === void 0 ? void 0 : currentResource.resourceItem) || {};
|
|
57
|
+
var name = getResourceTitle(appointmentBooking, resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.code, utils, resourceItem);
|
|
50
58
|
return locales.getText('pisell2.event.select.category')(name);
|
|
51
59
|
}
|
|
52
60
|
return (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.description) || '';
|
|
53
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key,
|
|
61
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key, currentSelectedResourcesRef.current]);
|
|
54
62
|
|
|
55
63
|
/**
|
|
56
64
|
* @title: 返回
|
|
@@ -60,9 +68,9 @@ var Header = function Header() {
|
|
|
60
68
|
* @Date: 2025-01-18 22:28
|
|
61
69
|
*/
|
|
62
70
|
var handleBack = /*#__PURE__*/function () {
|
|
63
|
-
var
|
|
71
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
64
72
|
var _currentStep$step4;
|
|
65
|
-
var key, types, _carts$, type,
|
|
73
|
+
var key, types, _carts$, type, form_key, booking_form, prevStepData, currentStepData, _key;
|
|
66
74
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
67
75
|
while (1) switch (_context.prev = _context.next) {
|
|
68
76
|
case 0:
|
|
@@ -99,48 +107,54 @@ var Header = function Header() {
|
|
|
99
107
|
if (key === 'select-time') {
|
|
100
108
|
setTimes([]);
|
|
101
109
|
}
|
|
102
|
-
if (key === 'fill-form') {
|
|
103
|
-
setOtherData('booking_form', {});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// // 5. 判断是否需要跳过资源步骤
|
|
107
|
-
// const isHasForm = stepList?.some((item: any) => item.key === 'fill-form');
|
|
108
|
-
// const shouldCheckSkip =
|
|
109
|
-
// (isHasForm && key === 'fill-form') || key === 'select-time';
|
|
110
110
|
|
|
111
|
-
//
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// }
|
|
118
|
-
// }
|
|
111
|
+
// 5. 清空表单数据
|
|
112
|
+
if (key.startsWith('fill-form')) {
|
|
113
|
+
form_key = 'booking_form';
|
|
114
|
+
booking_form = getOtherData(form_key);
|
|
115
|
+
setOtherData(form_key, _objectSpread(_objectSpread({}, booking_form), {}, _defineProperty({}, key, {})));
|
|
116
|
+
}
|
|
119
117
|
|
|
120
118
|
// 如果前一步是资源步骤,并且被跳过了,则清空资源
|
|
121
|
-
resourceStep = stepList[
|
|
122
|
-
if (resourceStep
|
|
123
|
-
|
|
124
|
-
}
|
|
119
|
+
// const resourceStep = stepList[currentStep?.index - 1];
|
|
120
|
+
// if (resourceStep?.isSkip && resourceStep?.key === 'select-resource') {
|
|
121
|
+
// appointmentBooking.deleteCartItemInfo('resource');
|
|
122
|
+
// }
|
|
125
123
|
|
|
126
124
|
// 6. 默认回退一步
|
|
127
125
|
appointmentBooking.back();
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
prevStepData = stepList[(currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.index) - 1];
|
|
127
|
+
currentStepData = stepList[currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.index];
|
|
128
|
+
debugger;
|
|
129
|
+
if (currentStepData !== null && currentStepData !== void 0 && currentStepData.isSkip || prevStepData !== null && prevStepData !== void 0 && prevStepData.isSkip) {
|
|
130
|
+
_key = currentStepData !== null && currentStepData !== void 0 && currentStepData.isSkip ? currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key : prevStepData === null || prevStepData === void 0 ? void 0 : prevStepData.key;
|
|
131
|
+
if (_key === 'select-resource') {
|
|
132
|
+
appointmentBooking.deleteCartItemInfo('resource');
|
|
133
|
+
}
|
|
134
|
+
updateStep(_key, {
|
|
133
135
|
isSkip: false
|
|
134
136
|
});
|
|
135
137
|
}
|
|
136
|
-
|
|
138
|
+
|
|
139
|
+
// 再次将步骤更新为false, 增加这个判断为了跳过那一步没有设置holder,但是直接后退了
|
|
140
|
+
// if (
|
|
141
|
+
// resourceStep?.isSkip &&
|
|
142
|
+
// (resourceStep?.key === 'select-resource' ||
|
|
143
|
+
// resourceStep?.key === 'select-service')
|
|
144
|
+
// ) {
|
|
145
|
+
// updateStep(resourceStep?.key, {
|
|
146
|
+
// index: currentStep?.index,
|
|
147
|
+
// isSkip: false,
|
|
148
|
+
// });
|
|
149
|
+
// }
|
|
150
|
+
case 17:
|
|
137
151
|
case "end":
|
|
138
152
|
return _context.stop();
|
|
139
153
|
}
|
|
140
154
|
}, _callee);
|
|
141
155
|
}));
|
|
142
156
|
return function handleBack() {
|
|
143
|
-
return
|
|
157
|
+
return _ref2.apply(this, arguments);
|
|
144
158
|
};
|
|
145
159
|
}();
|
|
146
160
|
|
|
@@ -19,9 +19,7 @@ import ResourceDisplay from "../../../eventBooking/components/resourceDisplay";
|
|
|
19
19
|
import { PisellCustomCheckboxGroup } from '@pisell/materials';
|
|
20
20
|
import { useAppointmentBookingResource, useIsSkipResourceStep, useAppointmentBookingStep, useAppointmentBookingLogin, contextUtils, useAppointmentBookingAccount, useAppointmentBookingSetting } from "../../hooks";
|
|
21
21
|
import { useAppointmentBookingContext } from "../../context";
|
|
22
|
-
import {
|
|
23
|
-
import { checkResource, checkHolder } from "../../components/Cart/utils";
|
|
24
|
-
import { scrollToFirstErrorCard } from "./utils";
|
|
22
|
+
import { formatCartsResources, currentAppointmentBoard, currentRenderLists, updateCartResources } from "../../utils";
|
|
25
23
|
import guestsImg from "../../assets/guests.svg";
|
|
26
24
|
import { isMobile, locales } from '@pisell/utils';
|
|
27
25
|
import "./index.less";
|
|
@@ -30,98 +28,87 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
30
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
31
29
|
selectedResource = _useState2[0],
|
|
32
30
|
setSelectedResource = _useState2[1];
|
|
33
|
-
var
|
|
34
|
-
appointmentBooking =
|
|
35
|
-
carts =
|
|
36
|
-
resourceOtherParams =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
autoSelectAllProductResources = _useAppointmentBookin2.autoSelectAllProductResources,
|
|
45
|
-
getResourceTimeSlot = _useAppointmentBookin2.getResourceTimeSlot;
|
|
31
|
+
var _ref = useAppointmentBookingContext(),
|
|
32
|
+
appointmentBooking = _ref.appointmentBooking,
|
|
33
|
+
carts = _ref.carts,
|
|
34
|
+
resourceOtherParams = _ref.resourceOtherParams,
|
|
35
|
+
currentStep = _ref.currentStep,
|
|
36
|
+
setResourceOtherParams = _ref.setResourceOtherParams,
|
|
37
|
+
setPolicyIds = _ref.setPolicyIds,
|
|
38
|
+
currentStepParams = _ref.currentStepParams;
|
|
39
|
+
var _useAppointmentBookin = useAppointmentBookingResource(),
|
|
40
|
+
getResourceList = _useAppointmentBookin.getResourceList,
|
|
41
|
+
getResourceTimeSlot = _useAppointmentBookin.getResourceTimeSlot;
|
|
46
42
|
var _useIsSkipResourceSte = useIsSkipResourceStep(),
|
|
47
43
|
checkSkipResourceStep = _useIsSkipResourceSte.checkSkipResourceStep;
|
|
48
|
-
var
|
|
49
|
-
updateStep =
|
|
50
|
-
nextStep =
|
|
51
|
-
var
|
|
52
|
-
openLoginModal =
|
|
53
|
-
isLogin =
|
|
54
|
-
var
|
|
55
|
-
getHolders =
|
|
56
|
-
checkAccount =
|
|
57
|
-
var
|
|
58
|
-
isFormSubject =
|
|
44
|
+
var _useAppointmentBookin2 = useAppointmentBookingStep(),
|
|
45
|
+
updateStep = _useAppointmentBookin2.updateStep,
|
|
46
|
+
nextStep = _useAppointmentBookin2.nextStep;
|
|
47
|
+
var _useAppointmentBookin3 = useAppointmentBookingLogin(),
|
|
48
|
+
openLoginModal = _useAppointmentBookin3.openLoginModal,
|
|
49
|
+
isLogin = _useAppointmentBookin3.isLogin;
|
|
50
|
+
var _useAppointmentBookin4 = useAppointmentBookingAccount(),
|
|
51
|
+
getHolders = _useAppointmentBookin4.getHolders,
|
|
52
|
+
checkAccount = _useAppointmentBookin4.checkAccount;
|
|
53
|
+
var _useAppointmentBookin5 = useAppointmentBookingSetting(),
|
|
54
|
+
isFormSubject = _useAppointmentBookin5.isFormSubject;
|
|
59
55
|
var utils = contextUtils();
|
|
60
56
|
useImperativeHandle(ref, function () {
|
|
61
57
|
return {
|
|
62
58
|
next: function () {
|
|
63
59
|
var _next2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
64
60
|
var _appointmentBooking$s;
|
|
65
|
-
var
|
|
61
|
+
var resultCarts, stepList, accountLists;
|
|
66
62
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
67
63
|
while (1) switch (_context.prev = _context.next) {
|
|
68
64
|
case 0:
|
|
69
|
-
result = checkResource({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
setCarts(result);
|
|
75
|
-
}
|
|
76
|
-
setIsErrorHolder(!!result);
|
|
77
|
-
|
|
65
|
+
// const result = checkResource({ carts, resources });
|
|
66
|
+
// if (result) {
|
|
67
|
+
// setCarts(result);
|
|
68
|
+
// }
|
|
69
|
+
// setIsErrorHolder(!!result);
|
|
78
70
|
// 验证购物车是否有资源
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
scrollToFirstErrorCard();
|
|
84
|
-
return _context.abrupt("return");
|
|
85
|
-
case 6:
|
|
71
|
+
// if (!!result) {
|
|
72
|
+
// scrollToFirstErrorCard();
|
|
73
|
+
// return;
|
|
74
|
+
// }
|
|
86
75
|
resultCarts = formatCartsResources(carts, resources, setPolicyIds);
|
|
87
76
|
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) || [];
|
|
88
|
-
_context.next =
|
|
77
|
+
_context.next = 4;
|
|
89
78
|
return appointmentBooking.getAccounts();
|
|
90
|
-
case
|
|
79
|
+
case 4:
|
|
91
80
|
accountLists = _context.sent;
|
|
92
|
-
checkResult = checkHasFormStep({
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
return _context.abrupt("return");
|
|
115
|
-
case 14:
|
|
81
|
+
// const checkResult = checkHasFormStep({
|
|
82
|
+
// nextStep,
|
|
83
|
+
// hasResourceFormId: resultCarts?.length > 0,
|
|
84
|
+
// currentStep,
|
|
85
|
+
// stepList,
|
|
86
|
+
// appointmentBooking,
|
|
87
|
+
// locales,
|
|
88
|
+
// openLoginModal,
|
|
89
|
+
// utils,
|
|
90
|
+
// accountLists,
|
|
91
|
+
// getHolders,
|
|
92
|
+
// checkHolder,
|
|
93
|
+
// checkAccount,
|
|
94
|
+
// setCarts,
|
|
95
|
+
// carts,
|
|
96
|
+
// isFormSubject,
|
|
97
|
+
// isLogin,
|
|
98
|
+
// });
|
|
99
|
+
|
|
100
|
+
// if (checkResult) return;
|
|
101
|
+
|
|
116
102
|
// 清空资源分配失败数据
|
|
117
103
|
setResourceOtherParams(_objectSpread(_objectSpread({}, resourceOtherParams), {}, {
|
|
118
104
|
errorList: null
|
|
119
105
|
}));
|
|
120
106
|
|
|
121
107
|
// 获取时间切片
|
|
122
|
-
getResourceTimeSlot();
|
|
108
|
+
// getResourceTimeSlot();
|
|
109
|
+
|
|
123
110
|
nextStep();
|
|
124
|
-
case
|
|
111
|
+
case 7:
|
|
125
112
|
case "end":
|
|
126
113
|
return _context.stop();
|
|
127
114
|
}
|
|
@@ -142,7 +129,7 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
142
129
|
useEffect(function () {
|
|
143
130
|
// 检查是否可以跳过资源选择步骤
|
|
144
131
|
var checkAndSkipResourceStep = /*#__PURE__*/function () {
|
|
145
|
-
var
|
|
132
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
146
133
|
var _currentStep$step, _resources, skipResourceStep, key;
|
|
147
134
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
148
135
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -150,16 +137,13 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
150
137
|
_context2.prev = 0;
|
|
151
138
|
// 获取资源列表数据
|
|
152
139
|
_resources = getResourceList(); // 获取自动分配资源
|
|
153
|
-
|
|
154
|
-
return autoSelectAllProductResources();
|
|
155
|
-
case 4:
|
|
140
|
+
// await autoSelectAllProductResources();
|
|
156
141
|
// 根据自动分配之后的资源重新拉取资源列表
|
|
157
|
-
getResourceList();
|
|
158
|
-
|
|
142
|
+
// getResourceList();
|
|
159
143
|
// 检测资源步骤是否跳过
|
|
160
|
-
_context2.next =
|
|
144
|
+
_context2.next = 4;
|
|
161
145
|
return checkSkipResourceStep();
|
|
162
|
-
case
|
|
146
|
+
case 4:
|
|
163
147
|
skipResourceStep = _context2.sent;
|
|
164
148
|
// 更新步骤是否有跳过标识
|
|
165
149
|
key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
@@ -168,23 +152,23 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
168
152
|
isSkip: skipResourceStep
|
|
169
153
|
});
|
|
170
154
|
if (!skipResourceStep) {
|
|
171
|
-
_context2.next =
|
|
155
|
+
_context2.next = 9;
|
|
172
156
|
break;
|
|
173
157
|
}
|
|
174
158
|
return _context2.abrupt("return", true);
|
|
175
|
-
case
|
|
159
|
+
case 9:
|
|
176
160
|
return _context2.abrupt("return", false);
|
|
177
|
-
case
|
|
178
|
-
_context2.prev =
|
|
161
|
+
case 12:
|
|
162
|
+
_context2.prev = 12;
|
|
179
163
|
_context2.t0 = _context2["catch"](0);
|
|
180
|
-
case
|
|
164
|
+
case 14:
|
|
181
165
|
case "end":
|
|
182
166
|
return _context2.stop();
|
|
183
167
|
}
|
|
184
|
-
}, _callee2, null, [[0,
|
|
168
|
+
}, _callee2, null, [[0, 12]]);
|
|
185
169
|
}));
|
|
186
170
|
return function checkAndSkipResourceStep() {
|
|
187
|
-
return
|
|
171
|
+
return _ref2.apply(this, arguments);
|
|
188
172
|
};
|
|
189
173
|
}();
|
|
190
174
|
checkAndSkipResourceStep();
|
|
@@ -195,28 +179,61 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
195
179
|
title: locales.getText('pisell2.appointment.any.professional'),
|
|
196
180
|
subtitle: locales.getText('pisell2.appointment.for.maximum.availability')
|
|
197
181
|
}];
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
182
|
+
var appointmentBoard = useMemo(function () {
|
|
183
|
+
return currentAppointmentBoard(currentStepParams.key, resources, appointmentBooking);
|
|
184
|
+
}, [currentStepParams.key, resources]);
|
|
185
|
+
var renderLists = useMemo(function () {
|
|
186
|
+
return currentRenderLists(resources, appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_code);
|
|
187
|
+
}, [resources, appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_code]);
|
|
188
|
+
useEffect(function () {
|
|
189
|
+
var autoSelectResources = /*#__PURE__*/function () {
|
|
190
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
191
|
+
var res, cartItem;
|
|
192
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
193
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
194
|
+
case 0:
|
|
195
|
+
if (!(appointmentBoard !== null && appointmentBoard !== void 0 && appointmentBoard.isRequired || !(appointmentBoard !== null && appointmentBoard !== void 0 && appointmentBoard.form_code))) {
|
|
196
|
+
_context3.next = 2;
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
return _context3.abrupt("return");
|
|
200
|
+
case 2:
|
|
201
|
+
_context3.next = 4;
|
|
202
|
+
return appointmentBooking.autoSelectAllProductResources(appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_code);
|
|
203
|
+
case 4:
|
|
204
|
+
res = _context3.sent;
|
|
205
|
+
setResourceOtherParams(_objectSpread(_objectSpread({}, resourceOtherParams), res));
|
|
206
|
+
|
|
207
|
+
// 自动分派之后获取重新获取资源列表数据;
|
|
208
|
+
getResourceList();
|
|
209
|
+
cartItem = carts === null || carts === void 0 ? void 0 : carts[0];
|
|
210
|
+
appointmentBooking.updateCart(_objectSpread({
|
|
211
|
+
_id: cartItem === null || cartItem === void 0 ? void 0 : cartItem._id
|
|
212
|
+
}, cartItem));
|
|
213
|
+
case 9:
|
|
214
|
+
case "end":
|
|
215
|
+
return _context3.stop();
|
|
216
|
+
}
|
|
217
|
+
}, _callee3);
|
|
218
|
+
}));
|
|
219
|
+
return function autoSelectResources() {
|
|
220
|
+
return _ref3.apply(this, arguments);
|
|
221
|
+
};
|
|
222
|
+
}();
|
|
223
|
+
autoSelectResources();
|
|
224
|
+
}, [appointmentBoard]);
|
|
210
225
|
var resourcesResult = useMemo(function () {
|
|
211
|
-
|
|
212
|
-
|
|
226
|
+
// 如果是必选资源,则不显示随机分配选项
|
|
227
|
+
var _anyResource = appointmentBoard !== null && appointmentBoard !== void 0 && appointmentBoard.isRequired ? [] : [].concat(anyResource);
|
|
228
|
+
return _anyResource.concat(renderLists || []);
|
|
229
|
+
}, [renderLists, appointmentBoard]);
|
|
213
230
|
var _onClick = function onClick(e) {
|
|
214
231
|
setSelectedResource(e.id);
|
|
215
232
|
if (e.id) {
|
|
216
233
|
var _carts$;
|
|
217
234
|
return appointmentBooking.updateCart({
|
|
218
235
|
_id: carts === null || carts === void 0 || (_carts$ = carts[0]) === null || _carts$ === void 0 ? void 0 : _carts$._id,
|
|
219
|
-
resources: [e
|
|
236
|
+
resources: updateCartResources(carts === null || carts === void 0 ? void 0 : carts[0], e)
|
|
220
237
|
});
|
|
221
238
|
}
|
|
222
239
|
};
|
|
@@ -48,23 +48,16 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
48
48
|
}, []);
|
|
49
49
|
var getAutoSelect = /*#__PURE__*/function () {
|
|
50
50
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
|
|
51
|
-
var
|
|
51
|
+
var result;
|
|
52
52
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
53
53
|
while (1) switch (_context.prev = _context.next) {
|
|
54
54
|
case 0:
|
|
55
55
|
setSelectedTime(val);
|
|
56
|
-
|
|
57
|
-
_context.next = 4;
|
|
58
|
-
return appointmentBooking.autoSelectAllProductResources(resourceCodes === null || resourceCodes === void 0 ? void 0 : resourceCodes[1], val);
|
|
59
|
-
case 4:
|
|
60
|
-
_yield$appointmentBoo = _context.sent;
|
|
61
|
-
errorList = _yield$appointmentBoo.errorList;
|
|
62
|
-
_context.next = 8;
|
|
56
|
+
_context.next = 3;
|
|
63
57
|
return appointmentBooking.submitTimeSlot(val);
|
|
64
|
-
case
|
|
58
|
+
case 3:
|
|
65
59
|
result = _context.sent;
|
|
66
|
-
|
|
67
|
-
case 10:
|
|
60
|
+
case 4:
|
|
68
61
|
case "end":
|
|
69
62
|
return _context.stop();
|
|
70
63
|
}
|
|
@@ -84,7 +77,7 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
84
77
|
// 如果没有选择时间,则默认选中第一个时间
|
|
85
78
|
getAutoSelect(times === null || times === void 0 ? void 0 : times[0]);
|
|
86
79
|
}
|
|
87
|
-
}, [times]);
|
|
80
|
+
}, [times, carts]);
|
|
88
81
|
var _onClick = /*#__PURE__*/function () {
|
|
89
82
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
90
83
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -8,10 +8,12 @@ import React, { createContext, useContext, useState, useEffect, useMemo, useRef
|
|
|
8
8
|
import { useAppointmentBooking } from "./hooks";
|
|
9
9
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
10
10
|
import { TasksManager } from "../../utils/tasks";
|
|
11
|
+
import { getCartCurrentResourceData } from "./utils";
|
|
11
12
|
var AppointmentBookingContext = /*#__PURE__*/createContext(undefined);
|
|
12
13
|
export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref) {
|
|
13
|
-
var _appHelper$utils, _currentStep$step2, _appointmentBooking$
|
|
14
|
+
var _appHelper$utils, _appointmentBooking$s2, _currentStep$step2, _appointmentBooking$s3, _currentStep$step4;
|
|
14
15
|
var children = _ref.children;
|
|
16
|
+
var currentSelectedResourcesRef = useRef(null);
|
|
15
17
|
var policyIdsRef = useRef([]);
|
|
16
18
|
var appointmentBooking = useAppointmentBooking();
|
|
17
19
|
// 总计计算
|
|
@@ -124,6 +126,10 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
124
126
|
policyParams.callback();
|
|
125
127
|
}
|
|
126
128
|
};
|
|
129
|
+
var stepLists = useMemo(function () {
|
|
130
|
+
var _appointmentBooking$s;
|
|
131
|
+
return (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
|
|
132
|
+
}, [appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.step) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.store) === null || _appointmentBooking$s2 === void 0 ? void 0 : _appointmentBooking$s2.stepList]);
|
|
127
133
|
|
|
128
134
|
/**
|
|
129
135
|
* @title: 是否是最后一步
|
|
@@ -137,7 +143,39 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
137
143
|
var _currentStep$step;
|
|
138
144
|
var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
139
145
|
return key === 'confirm-information';
|
|
140
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$
|
|
146
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s3 = appointmentBooking.store) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.step) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.store) === null || _appointmentBooking$s3 === void 0 ? void 0 : _appointmentBooking$s3.stepList]);
|
|
147
|
+
var currentStepParams = useMemo(function () {
|
|
148
|
+
var _currentStep$step3;
|
|
149
|
+
var key = currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key;
|
|
150
|
+
var index = stepLists.findIndex(function (item) {
|
|
151
|
+
return item.key === key;
|
|
152
|
+
});
|
|
153
|
+
return {
|
|
154
|
+
key: key,
|
|
155
|
+
index: index,
|
|
156
|
+
stepLists: stepLists
|
|
157
|
+
};
|
|
158
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key, stepLists]);
|
|
159
|
+
useEffect(function () {
|
|
160
|
+
var _currentStepParams$ke;
|
|
161
|
+
// 如果当前步骤是选择资源,则更新当前资源的数据
|
|
162
|
+
if (currentStepParams !== null && currentStepParams !== void 0 && (_currentStepParams$ke = currentStepParams.key) !== null && _currentStepParams$ke !== void 0 && _currentStepParams$ke.startsWith('select-resource')) {
|
|
163
|
+
var currentSelectedResources = carts.map(function (item) {
|
|
164
|
+
return {
|
|
165
|
+
_id: item === null || item === void 0 ? void 0 : item._id,
|
|
166
|
+
currentSelectedResource: getCartCurrentResourceData(item, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, resources)
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
currentSelectedResourcesRef.current = currentSelectedResources;
|
|
170
|
+
|
|
171
|
+
// 并且将当前资源的数据设置到本地
|
|
172
|
+
appointmentBooking.setOtherData('current_selected_resources', currentSelectedResources);
|
|
173
|
+
}
|
|
174
|
+
}, [currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, resources, carts]);
|
|
175
|
+
useEffect(function () {
|
|
176
|
+
var currentSelectedResources = appointmentBooking.getOtherData('current_selected_resources');
|
|
177
|
+
currentSelectedResourcesRef.current = currentSelectedResources || [];
|
|
178
|
+
}, []);
|
|
141
179
|
var value = {
|
|
142
180
|
appointmentBooking: appointmentBooking,
|
|
143
181
|
times: times,
|
|
@@ -171,7 +209,9 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
171
209
|
policyIdsRef: policyIdsRef,
|
|
172
210
|
setPolicyIds: setPolicyIds,
|
|
173
211
|
openPolicy: openPolicy,
|
|
174
|
-
closePolicy: closePolicy
|
|
212
|
+
closePolicy: closePolicy,
|
|
213
|
+
currentStepParams: currentStepParams,
|
|
214
|
+
currentSelectedResourcesRef: currentSelectedResourcesRef
|
|
175
215
|
};
|
|
176
216
|
return /*#__PURE__*/React.createElement(AppointmentBookingContext.Provider, {
|
|
177
217
|
value: value
|