@pisell/private-materials 6.5.14 → 6.5.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/booking/addons/model.d.ts +1 -10
- 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/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/footer/amount.js +7 -2
- package/es/components/booking/components/footer/utils.js +8 -1
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/forms/model.d.ts +1 -10
- 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/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/header/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- 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/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- 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/model.d.ts +1 -9
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/booking/notes/addNote/index.d.ts +1 -0
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/booking/utils.js +1 -1
- package/es/components/checkout/PaymentModal.js +25 -18
- package/es/components/checkout/PaymentPlugin.d.ts +1 -0
- 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 +1 -0
- package/es/components/eftposPay/app.d.ts +1 -0
- 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/hooks.d.ts +2 -2
- 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 +4 -4
- 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/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/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/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/list/styles/content.less +1 -0
- package/es/components/login/index.d.ts +1 -0
- package/es/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/es/components/pay/toB/components/Content/Header.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/model.d.ts +1 -9
- 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/productExtension/fields/Forms/index.d.ts +1 -0
- 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/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- 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/model.d.ts +1 -9
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- 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/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/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/resources/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- 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/index.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +634 -208
- package/es/components/ticketBooking/components/addServiceVariant/index.js +2 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +86 -22
- package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/es/components/ticketBooking/components/timeBar/index.js +4 -1
- package/es/components/ticketBooking/context/OsKeyContext.js +1 -1
- package/es/components/ticketBooking/hooks/pisellos/bookingTicket.js +1 -1
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +141 -4
- package/es/components/ticketBooking/hooks/pisellos/useShopDiscountModule.js +1 -1
- package/es/components/ticketBooking/index.js +1 -1
- package/es/components/ticketBooking/utils/index.js +33 -8
- package/es/components/ticketBooking/utils/productCache.js +184 -0
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/es/hooks/usePaymentLogger.d.ts +1 -0
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/es/plus/saasCreateOrganization/index.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/es/plus/saasRegister/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/booking/addons/model.d.ts +1 -10
- 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/footer/amount.js +5 -2
- package/lib/components/booking/components/footer/utils.js +8 -1
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/lib/components/booking/deposit/index.d.ts +1 -0
- package/lib/components/booking/forms/model.d.ts +1 -10
- 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/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/header/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- 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/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- 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/model.d.ts +1 -9
- 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/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/booking/utils.js +1 -1
- package/lib/components/checkout/PaymentModal.js +13 -9
- package/lib/components/checkout/PaymentPlugin.d.ts +1 -0
- 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 +1 -0
- package/lib/components/eftposPay/app.d.ts +1 -0
- 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/hooks.d.ts +2 -2
- 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 +4 -4
- 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/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/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/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/list/styles/content.less +1 -0
- package/lib/components/login/index.d.ts +1 -0
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Content/Header.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/model.d.ts +1 -9
- 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/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/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/model.d.ts +1 -9
- 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/taxSelect/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +286 -213
- package/lib/components/ticketBooking/components/addServiceVariant/index.js +2 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +58 -8
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/timeBar/index.js +3 -1
- package/lib/components/ticketBooking/context/OsKeyContext.js +1 -1
- package/lib/components/ticketBooking/hooks/pisellos/bookingTicket.js +1 -1
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +83 -0
- package/lib/components/ticketBooking/hooks/pisellos/useShopDiscountModule.js +1 -1
- package/lib/components/ticketBooking/index.js +1 -1
- package/lib/components/ticketBooking/utils/index.js +48 -6
- package/lib/components/ticketBooking/utils/productCache.js +144 -0
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/lib/hooks/usePaymentLogger.d.ts +1 -0
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/lib/plus/saasCreateOrganization/index.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/lib/plus/saasRegister/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/package.json +1 -1
- package/es/components/booking/components/actionButtons/index.d.ts +0 -31
- package/es/components/booking/components/footer/amount.d.ts +0 -36
- package/es/components/booking/components/footer/index.d.ts +0 -11
- package/es/components/booking/components/footer/utils.d.ts +0 -41
- package/es/components/booking/components/voucher/index.d.ts +0 -3
- package/es/components/booking/forms/footer.d.ts +0 -6
- package/es/components/booking/info2/cartClientCard/index.d.ts +0 -6
- package/es/components/checkout/PaymentModal.d.ts +0 -31
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +0 -24
- package/es/components/checkout/components/ScrollableList/index.d.ts +0 -5
- package/es/components/checkout/hooks/useWalletPass.d.ts +0 -40
- package/es/components/list/List.d.ts +0 -5
- package/es/components/list/ResponsiveWrapper.d.ts +0 -16
- package/es/components/list/TestResponsiveWrapper.d.ts +0 -8
- package/es/components/list/components/EmptyState/EmptyState.d.ts +0 -20
- package/es/components/list/components/EmptyState/index.d.ts +0 -2
- package/es/components/list/components/ListItemSkeleton/ListItemSkeleton.d.ts +0 -13
- package/es/components/list/components/ListItemSkeleton/index.d.ts +0 -2
- package/es/components/list/components/Pagination/Pagination.d.ts +0 -30
- package/es/components/list/components/Pagination/index.d.ts +0 -1
- package/es/components/list/components/ScrollLoader/ScrollLoader.d.ts +0 -18
- package/es/components/list/components/ScrollLoader/index.d.ts +0 -2
- package/es/components/list/components/Tab/Tab.d.ts +0 -5
- package/es/components/list/components/Tab/index.d.ts +0 -2
- package/es/components/list/components/Tab/types.d.ts +0 -14
- package/es/components/list/components/TabSkeleton/TabSkeleton.d.ts +0 -11
- package/es/components/list/components/TabSkeleton/index.d.ts +0 -2
- package/es/components/list/components/WaterfallList/WaterfallList.d.ts +0 -33
- package/es/components/list/components/WaterfallList/index.d.ts +0 -2
- package/es/components/list/examples/GroupedListExample.d.ts +0 -3
- package/es/components/list/hooks/index.d.ts +0 -5
- package/es/components/list/hooks/useDevice.d.ts +0 -24
- package/es/components/list/hooks/useListState.d.ts +0 -43
- package/es/components/list/hooks/useWaterfall.d.ts +0 -34
- package/es/components/list/index.d.ts +0 -10
- package/es/components/list/locales.d.ts +0 -66
- package/es/components/list/types.d.ts +0 -177
- package/es/components/list/utils/getText.d.ts +0 -53
- package/es/components/list/utils/index.d.ts +0 -4
- package/es/components/pay/toB/components/MX51/index.d.ts +0 -3
- package/es/components/pay/toB/store/hooks.d.ts +0 -15
- package/es/components/pay/toB/types/index.d.ts +0 -72
- package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.d.ts +0 -27
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.d.ts +0 -7
- package/es/components/ticketBooking/components/ProductDisplayAdapter/types.d.ts +0 -115
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +0 -50
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -30
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -9
- package/es/components/ticketBooking/components/menuBar/index.d.ts +0 -7
- package/es/components/ticketBooking/context/IsActiveContext.d.ts +0 -26
- package/es/components/ticketBooking/context/OsKeyContext.d.ts +0 -26
- package/es/components/ticketBooking/context/index.d.ts +0 -2
- package/es/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +0 -6
- package/es/components/ticketBooking/hooks/pisellos/index.d.ts +0 -4
- package/es/components/ticketBooking/hooks/pisellos/useActiveExecute.d.ts +0 -21
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +0 -25
- package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -12
- package/es/components/ticketBooking/hooks/pisellos/useScanCustomer.d.ts +0 -5
- package/es/components/ticketBooking/hooks/pisellos/useScanGlobal.d.ts +0 -5
- package/es/components/ticketBooking/hooks/pisellos/useShopDiscountModule.d.ts +0 -6
- package/es/components/ticketBooking/index.d.ts +0 -15
- package/es/components/ticketBooking/utils/index.d.ts +0 -89
- package/es/hooks/printer.d.ts +0 -4
- package/es/index.d.ts +0 -65
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +0 -3
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +0 -3
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +0 -3
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +0 -3
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +0 -3
- package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +0 -7
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.d.ts +0 -7
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +0 -7
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.d.ts +0 -3
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +0 -4
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +0 -7
- package/es/plus/productSelect/ProductCard/SkuCard/components/Cover/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +0 -7
- package/es/plus/productSelect/ProductCard/SkuCard/components/Price/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/Title/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +0 -3
- package/es/plus/productSelect/ProductCard/SkuCard/hooks/useDynamicComponents.d.ts +0 -6
- package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +0 -8
- package/es/plus/productSelect/ProductCard/SkuCard/locales.d.ts +0 -42
- package/es/plus/productSelect/ProductCard/SkuCard/status.d.ts +0 -162
- package/es/plus/productSelect/ProductCard/SkuCard/type.d.ts +0 -298
- package/es/plus/productSelect/ProductCard/SkuCard/utils.d.ts +0 -9
- package/es/plus/productSelect/components/pisellPriceText/index.d.ts +0 -14
- package/lib/components/booking/components/actionButtons/index.d.ts +0 -31
- package/lib/components/booking/components/footer/amount.d.ts +0 -36
- package/lib/components/booking/components/footer/index.d.ts +0 -11
- package/lib/components/booking/components/footer/utils.d.ts +0 -41
- package/lib/components/booking/components/voucher/index.d.ts +0 -3
- package/lib/components/booking/forms/footer.d.ts +0 -6
- package/lib/components/booking/info2/cartClientCard/index.d.ts +0 -6
- package/lib/components/checkout/PaymentModal.d.ts +0 -31
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +0 -24
- package/lib/components/checkout/components/ScrollableList/index.d.ts +0 -5
- package/lib/components/checkout/hooks/useWalletPass.d.ts +0 -40
- package/lib/components/list/List.d.ts +0 -5
- package/lib/components/list/ResponsiveWrapper.d.ts +0 -16
- package/lib/components/list/TestResponsiveWrapper.d.ts +0 -8
- package/lib/components/list/components/EmptyState/EmptyState.d.ts +0 -20
- package/lib/components/list/components/EmptyState/index.d.ts +0 -2
- package/lib/components/list/components/ListItemSkeleton/ListItemSkeleton.d.ts +0 -13
- package/lib/components/list/components/ListItemSkeleton/index.d.ts +0 -2
- package/lib/components/list/components/Pagination/Pagination.d.ts +0 -30
- package/lib/components/list/components/Pagination/index.d.ts +0 -1
- package/lib/components/list/components/ScrollLoader/ScrollLoader.d.ts +0 -18
- package/lib/components/list/components/ScrollLoader/index.d.ts +0 -2
- package/lib/components/list/components/Tab/Tab.d.ts +0 -5
- package/lib/components/list/components/Tab/index.d.ts +0 -2
- package/lib/components/list/components/Tab/types.d.ts +0 -14
- package/lib/components/list/components/TabSkeleton/TabSkeleton.d.ts +0 -11
- package/lib/components/list/components/TabSkeleton/index.d.ts +0 -2
- package/lib/components/list/components/WaterfallList/WaterfallList.d.ts +0 -33
- package/lib/components/list/components/WaterfallList/index.d.ts +0 -2
- package/lib/components/list/examples/GroupedListExample.d.ts +0 -3
- package/lib/components/list/hooks/index.d.ts +0 -5
- package/lib/components/list/hooks/useDevice.d.ts +0 -24
- package/lib/components/list/hooks/useListState.d.ts +0 -43
- package/lib/components/list/hooks/useWaterfall.d.ts +0 -34
- package/lib/components/list/index.d.ts +0 -10
- package/lib/components/list/locales.d.ts +0 -66
- package/lib/components/list/types.d.ts +0 -177
- package/lib/components/list/utils/getText.d.ts +0 -53
- package/lib/components/list/utils/index.d.ts +0 -4
- package/lib/components/pay/toB/components/MX51/index.d.ts +0 -3
- package/lib/components/pay/toB/store/hooks.d.ts +0 -15
- package/lib/components/pay/toB/types/index.d.ts +0 -72
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.d.ts +0 -27
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.d.ts +0 -7
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/types.d.ts +0 -115
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +0 -50
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -30
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -9
- package/lib/components/ticketBooking/components/menuBar/index.d.ts +0 -7
- package/lib/components/ticketBooking/context/IsActiveContext.d.ts +0 -26
- package/lib/components/ticketBooking/context/OsKeyContext.d.ts +0 -26
- package/lib/components/ticketBooking/context/index.d.ts +0 -2
- package/lib/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +0 -6
- package/lib/components/ticketBooking/hooks/pisellos/index.d.ts +0 -4
- package/lib/components/ticketBooking/hooks/pisellos/useActiveExecute.d.ts +0 -21
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +0 -25
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -12
- package/lib/components/ticketBooking/hooks/pisellos/useScanCustomer.d.ts +0 -5
- package/lib/components/ticketBooking/hooks/pisellos/useScanGlobal.d.ts +0 -5
- package/lib/components/ticketBooking/hooks/pisellos/useShopDiscountModule.d.ts +0 -6
- package/lib/components/ticketBooking/index.d.ts +0 -15
- package/lib/components/ticketBooking/utils/index.d.ts +0 -89
- package/lib/hooks/printer.d.ts +0 -4
- package/lib/index.d.ts +0 -65
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +0 -3
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +0 -3
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +0 -3
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +0 -3
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +0 -3
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +0 -7
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.d.ts +0 -7
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +0 -7
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.d.ts +0 -3
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +0 -4
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +0 -7
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Cover/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +0 -7
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Price/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Title/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +0 -3
- package/lib/plus/productSelect/ProductCard/SkuCard/hooks/useDynamicComponents.d.ts +0 -6
- package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +0 -8
- package/lib/plus/productSelect/ProductCard/SkuCard/locales.d.ts +0 -42
- package/lib/plus/productSelect/ProductCard/SkuCard/status.d.ts +0 -162
- package/lib/plus/productSelect/ProductCard/SkuCard/type.d.ts +0 -298
- package/lib/plus/productSelect/ProductCard/SkuCard/utils.d.ts +0 -9
- package/lib/plus/productSelect/components/pisellPriceText/index.d.ts +0 -14
|
@@ -28,7 +28,7 @@ import { isBooking4Shop } from "../../../booking/info/utils";
|
|
|
28
28
|
import { useService } from "../../../booking/info/service/serviceManager";
|
|
29
29
|
import ProductDisplayAdapter, { resolveProductDisplayConfig } from "../ProductDisplayAdapter";
|
|
30
30
|
import "./index.less";
|
|
31
|
-
import { addService, addServiceScroll,
|
|
31
|
+
import { addService, addServiceScroll, genServiceKey, getIsShowNumber, isSameProduct } from "../../utils";
|
|
32
32
|
import NotAvailable from "../notAvailable";
|
|
33
33
|
import dayjs from 'dayjs';
|
|
34
34
|
import { useProducts } from "../../hooks/pisellos";
|
|
@@ -55,6 +55,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
55
55
|
_props$renderMode = props.renderMode,
|
|
56
56
|
renderMode = _props$renderMode === void 0 ? 'current' : _props$renderMode,
|
|
57
57
|
onPrerenderComplete = props.onPrerenderComplete,
|
|
58
|
+
onGetProductsReady = props.onGetProductsReady,
|
|
58
59
|
productDisplayConfig = props.productDisplayConfig;
|
|
59
60
|
var context = useEngineContext();
|
|
60
61
|
var notAvailableRef = useRef(null);
|
|
@@ -75,6 +76,10 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
75
76
|
_useState2 = _slicedToArray(_useState, 2),
|
|
76
77
|
currentProduct = _useState2[0],
|
|
77
78
|
setCurrentProduct = _useState2[1];
|
|
79
|
+
var _useState3 = useState(true),
|
|
80
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
81
|
+
firstLoading = _useState4[0],
|
|
82
|
+
setFirstLoading = _useState4[1];
|
|
78
83
|
var stateRef = useRef(state);
|
|
79
84
|
stateRef.current = state;
|
|
80
85
|
var prerenderCompletedRef = useRef(false);
|
|
@@ -105,7 +110,22 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
105
110
|
var _useProducts = useProducts(),
|
|
106
111
|
getProducts = _useProducts.getProducts,
|
|
107
112
|
products = _useProducts.products,
|
|
108
|
-
loading = _useProducts.loading
|
|
113
|
+
loading = _useProducts.loading,
|
|
114
|
+
getScheduleTimePoints = _useProducts.getScheduleTimePoints;
|
|
115
|
+
useEffect(function () {
|
|
116
|
+
if (onGetProductsReady && getProducts) {
|
|
117
|
+
onGetProductsReady(getProducts);
|
|
118
|
+
}
|
|
119
|
+
}, []);
|
|
120
|
+
useEffect(function () {
|
|
121
|
+
var timer = setTimeout(function () {
|
|
122
|
+
setFirstLoading(false);
|
|
123
|
+
}, 300);
|
|
124
|
+
return function () {
|
|
125
|
+
clearTimeout(timer);
|
|
126
|
+
};
|
|
127
|
+
}, []);
|
|
128
|
+
|
|
109
129
|
// 组件卸载时清理所有定时器
|
|
110
130
|
useEffect(function () {
|
|
111
131
|
return function () {
|
|
@@ -150,22 +170,30 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
150
170
|
return ((_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id) || undefined;
|
|
151
171
|
}, [(_state$client2 = state.client) === null || _state$client2 === void 0 || (_state$client2 = _state$client2.value) === null || _state$client2 === void 0 ? void 0 : _state$client2.id]);
|
|
152
172
|
var scanAddService = useMemoizedFn(function (list, code) {
|
|
153
|
-
|
|
173
|
+
// 使用 stateRef 获取最新状态
|
|
174
|
+
var newService = _toConsumableArray(stateRef.current.service.value || []);
|
|
154
175
|
list.forEach(function (item) {
|
|
155
176
|
if (isBundle(item) || isOption(item)) {
|
|
156
177
|
handleSelectProduct(item);
|
|
157
178
|
return;
|
|
158
179
|
}
|
|
159
180
|
var values = genValues(item, code);
|
|
160
|
-
var cacheItem = createCacheItem(item, values,
|
|
181
|
+
var cacheItem = createCacheItem(item, values, stateRef.current);
|
|
161
182
|
cacheItem._serviceKey = genServiceKey(cacheItem);
|
|
162
183
|
cacheItem.autoClose = false;
|
|
163
|
-
var _addService = addService(_toConsumableArray(newService), cacheItem,
|
|
184
|
+
var _addService = addService(_toConsumableArray(newService), cacheItem, stateRef.current),
|
|
164
185
|
_list = _addService.list,
|
|
165
186
|
quantity = _addService.quantity;
|
|
166
187
|
handleAddToast(cacheItem.title, quantity);
|
|
167
188
|
newService = _list;
|
|
168
189
|
});
|
|
190
|
+
|
|
191
|
+
// 立即更新 stateRef
|
|
192
|
+
stateRef.current = _objectSpread(_objectSpread({}, stateRef.current), {}, {
|
|
193
|
+
service: _objectSpread(_objectSpread({}, stateRef.current.service), {}, {
|
|
194
|
+
value: newService
|
|
195
|
+
})
|
|
196
|
+
});
|
|
169
197
|
dispatch({
|
|
170
198
|
type: 'setService',
|
|
171
199
|
payload: {
|
|
@@ -303,9 +331,9 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
303
331
|
executeCacheValues(productId, cacheValues, item, callback);
|
|
304
332
|
}, 0);
|
|
305
333
|
});
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
334
|
+
|
|
335
|
+
// 检查资源可用性
|
|
336
|
+
var checkResourceAvailability = useMemoizedFn(function (item) {
|
|
309
337
|
if (!isNormalProductByDurationSchedule(item)) {
|
|
310
338
|
var _state$service3;
|
|
311
339
|
if (!Array.isArray((_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.resourcesOrigin) || !state.service.resourcesOrigin.length) {
|
|
@@ -315,225 +343,331 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
315
343
|
reloadResourceModal: true
|
|
316
344
|
})
|
|
317
345
|
});
|
|
318
|
-
return;
|
|
346
|
+
return false;
|
|
319
347
|
}
|
|
320
348
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
var
|
|
328
|
-
|
|
329
|
-
|
|
349
|
+
return true;
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
// 创建缓存项
|
|
353
|
+
var createCacheItemFromParams = useMemoizedFn(function (item, params, detail) {
|
|
354
|
+
var _detail = detail || item;
|
|
355
|
+
var other = JSON.parse(JSON.stringify(params));
|
|
356
|
+
other.session = params.session;
|
|
357
|
+
var cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
|
|
358
|
+
product_id: item.id,
|
|
359
|
+
_id: getUniqueId(),
|
|
360
|
+
_key: params.key,
|
|
361
|
+
_extend: {
|
|
362
|
+
start_date: state.date.value,
|
|
363
|
+
quantity: (params === null || params === void 0 ? void 0 : params.quantity) || 1,
|
|
364
|
+
price: _detail.price,
|
|
365
|
+
product_name: item.title,
|
|
366
|
+
other: other
|
|
367
|
+
},
|
|
368
|
+
new: 1
|
|
369
|
+
});
|
|
370
|
+
var _total = getProductTotalPrice(cacheItem);
|
|
371
|
+
cacheItem._extend.total = _total;
|
|
372
|
+
cacheItem._extend.origin_total = _total;
|
|
373
|
+
var _isEdit = !!state.service.cacheItem;
|
|
374
|
+
if (_isEdit) {
|
|
375
|
+
var _state$service$cacheI;
|
|
376
|
+
cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
|
377
|
+
cacheItem.new = 0;
|
|
378
|
+
}
|
|
379
|
+
if (renderMode === 'current') {
|
|
380
|
+
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
|
381
|
+
}
|
|
382
|
+
cacheItem = getProductExtend({
|
|
383
|
+
cacheItem: cacheItem,
|
|
384
|
+
state: state,
|
|
385
|
+
isDisabledTime: true
|
|
386
|
+
});
|
|
387
|
+
if (state.renderType === 'eventBooking') {
|
|
388
|
+
cacheItem.autoClose = false;
|
|
389
|
+
}
|
|
390
|
+
return cacheItem;
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
// 生成商品唯一标识
|
|
394
|
+
var getProductKey = useMemoizedFn(function (item, cacheItem) {
|
|
395
|
+
// 使用 _serviceKey 来区分同一商品的不同规格/选项
|
|
396
|
+
return cacheItem._serviceKey || "".concat(item.id, "_").concat(cacheItem._key);
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
// 获取当前服务列表中的商品数量
|
|
400
|
+
var getServiceQuantity = useMemoizedFn(function (cacheItem) {
|
|
401
|
+
var _stateRef$current$ser, _existingService$_ext;
|
|
402
|
+
// 使用 stateRef 获取最新的 service.value
|
|
403
|
+
var existingService = (_stateRef$current$ser = stateRef.current.service.value) === null || _stateRef$current$ser === void 0 ? void 0 : _stateRef$current$ser.find(function (val) {
|
|
404
|
+
return isSameProduct(val, cacheItem);
|
|
405
|
+
});
|
|
406
|
+
return (existingService === null || existingService === void 0 || (_existingService$_ext = existingService._extend) === null || _existingService$_ext === void 0 ? void 0 : _existingService$_ext.quantity) || 0;
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
// 处理自动关闭的服务添加(带防抖)
|
|
410
|
+
var processAutoCloseService = useMemoizedFn(function (cacheItem, item, detail, notShowToast) {
|
|
411
|
+
cacheItem.autoClose = false;
|
|
412
|
+
cacheItem._serviceKey = genServiceKey(cacheItem);
|
|
413
|
+
var productKey = getProductKey(item, cacheItem);
|
|
414
|
+
|
|
415
|
+
// 如果已经有待处理的同商品,增加点击次数
|
|
416
|
+
if (pendingCacheValuesRef.current[productKey]) {
|
|
417
|
+
clickCountRef.current[productKey] = (clickCountRef.current[productKey] || 1) + 1;
|
|
330
418
|
} else {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
419
|
+
// 第一次点击,初始化数据
|
|
420
|
+
pendingCacheValuesRef.current[productKey] = {
|
|
421
|
+
cacheItem: cacheItem,
|
|
422
|
+
item: item,
|
|
423
|
+
detail: detail,
|
|
424
|
+
notShowToast: notShowToast
|
|
425
|
+
};
|
|
426
|
+
clickCountRef.current[productKey] = 1;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// 立即显示 toast
|
|
430
|
+
// 显示:购物车中已有数量 + 当前累积点击次数
|
|
431
|
+
if (!notShowToast) {
|
|
432
|
+
var originalQuantity = getServiceQuantity(cacheItem);
|
|
433
|
+
var currentClickCount = clickCountRef.current[productKey] || 1;
|
|
434
|
+
var totalQuantity = originalQuantity + currentClickCount;
|
|
435
|
+
handleAddToast(cacheItem.title, totalQuantity);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// 清除旧的防抖定时器
|
|
439
|
+
if (debounceTimersRef.current[productKey]) {
|
|
440
|
+
clearTimeout(debounceTimersRef.current[productKey]);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// 创建新的防抖定时器
|
|
444
|
+
debounceTimersRef.current[productKey] = setTimeout(function () {
|
|
445
|
+
executeServiceDispatch(productKey);
|
|
446
|
+
}, 300); // 300ms 防抖时间
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
// 执行实际的 dispatch 操作
|
|
450
|
+
var executeServiceDispatch = useMemoizedFn(function (productKey) {
|
|
451
|
+
var pendingData = pendingCacheValuesRef.current[productKey];
|
|
452
|
+
if (!pendingData) return;
|
|
453
|
+
var cacheItem = pendingData.cacheItem,
|
|
454
|
+
item = pendingData.item,
|
|
455
|
+
detail = pendingData.detail;
|
|
456
|
+
var clickCount = clickCountRef.current[productKey] || 1;
|
|
457
|
+
|
|
458
|
+
// 更新 quantity 为累积的点击次数
|
|
459
|
+
var finalCacheItem = _objectSpread(_objectSpread({}, cacheItem), {}, {
|
|
460
|
+
_extend: _objectSpread(_objectSpread({}, cacheItem._extend), {}, {
|
|
461
|
+
quantity: clickCount
|
|
462
|
+
})
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
// 使用 stateRef 获取最新的 service.value,避免竞态条件
|
|
466
|
+
var _addService2 = addService(_toConsumableArray(stateRef.current.service.value || []), finalCacheItem, stateRef.current),
|
|
467
|
+
_list = _addService2.list,
|
|
468
|
+
quantity = _addService2.quantity;
|
|
469
|
+
window.dispatchEvent(new CustomEvent('onAddNewService', {
|
|
470
|
+
detail: {
|
|
471
|
+
cacheItem: finalCacheItem
|
|
472
|
+
}
|
|
473
|
+
}));
|
|
474
|
+
|
|
475
|
+
// 2155 日志记录
|
|
476
|
+
logServiceForSpecificShop(item, detail, _list);
|
|
477
|
+
|
|
478
|
+
// 立即更新 stateRef,减少竞态窗口
|
|
479
|
+
stateRef.current = _objectSpread(_objectSpread({}, stateRef.current), {}, {
|
|
480
|
+
service: _objectSpread(_objectSpread({}, stateRef.current.service), {}, {
|
|
481
|
+
value: _list
|
|
482
|
+
})
|
|
483
|
+
});
|
|
484
|
+
dispatch({
|
|
485
|
+
type: 'setService',
|
|
486
|
+
payload: {
|
|
487
|
+
addModal: false,
|
|
488
|
+
value: _list,
|
|
489
|
+
edit: true,
|
|
490
|
+
changeService: false
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
// 清理缓存数据
|
|
495
|
+
delete pendingCacheValuesRef.current[productKey];
|
|
496
|
+
delete clickCountRef.current[productKey];
|
|
497
|
+
delete debounceTimersRef.current[productKey];
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
// 处理手动编辑的服务
|
|
501
|
+
var processManualEditService = useMemoizedFn(function (cacheItem) {
|
|
502
|
+
var _window$openBookingEd, _window;
|
|
503
|
+
(_window$openBookingEd = (_window = window).openBookingEditModal) === null || _window$openBookingEd === void 0 || _window$openBookingEd.call(_window);
|
|
504
|
+
dispatch({
|
|
505
|
+
type: 'setService',
|
|
506
|
+
payload: {
|
|
507
|
+
editModal: true,
|
|
508
|
+
cacheItem: cacheItem,
|
|
509
|
+
addModal: !cacheItem.autoClose,
|
|
510
|
+
changeService: false
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
onEdit === null || onEdit === void 0 || onEdit(cacheItem);
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
// 特定商店的日志记录
|
|
517
|
+
var logServiceForSpecificShop = useMemoizedFn(function (item, detail, _list) {
|
|
518
|
+
try {
|
|
519
|
+
var _context$appHelper$ut4, _context$appHelper$ut5;
|
|
520
|
+
if (((_context$appHelper$ut4 = context.appHelper.utils.store) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.call(_context$appHelper$ut4)) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.global) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) === 2155) {
|
|
521
|
+
var val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
|
|
522
|
+
return {
|
|
523
|
+
product_id: s === null || s === void 0 ? void 0 : s.product_id,
|
|
524
|
+
detailId: s === null || s === void 0 ? void 0 : s.id,
|
|
525
|
+
detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
|
|
526
|
+
product_name: s === null || s === void 0 ? void 0 : s.title,
|
|
527
|
+
price: s === null || s === void 0 ? void 0 : s.price,
|
|
528
|
+
_id: s === null || s === void 0 ? void 0 : s._id,
|
|
529
|
+
_key: s === null || s === void 0 ? void 0 : s._key,
|
|
530
|
+
_serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
|
|
531
|
+
};
|
|
532
|
+
});
|
|
533
|
+
var sendData = {
|
|
534
|
+
product_id: item === null || item === void 0 ? void 0 : item.id,
|
|
535
|
+
detailId: detail === null || detail === void 0 ? void 0 : detail.id,
|
|
536
|
+
detailProductId: detail === null || detail === void 0 ? void 0 : detail.product_id,
|
|
537
|
+
product_name: item === null || item === void 0 ? void 0 : item.title,
|
|
538
|
+
price: detail === null || detail === void 0 ? void 0 : detail.price,
|
|
539
|
+
serviceVal: val
|
|
344
540
|
};
|
|
541
|
+
sendWarningLog({
|
|
542
|
+
title: 'addService',
|
|
543
|
+
content: [{
|
|
544
|
+
key: '添加数据',
|
|
545
|
+
value: JSON.stringify(sendData)
|
|
546
|
+
}, {
|
|
547
|
+
key: '日期',
|
|
548
|
+
value: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
549
|
+
}]
|
|
550
|
+
});
|
|
345
551
|
}
|
|
552
|
+
} catch (error) {}
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
// 处理非 booking4 的预约创建
|
|
556
|
+
var handleBookingCreation = useMemoizedFn( /*#__PURE__*/function () {
|
|
557
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(item, params, detail) {
|
|
558
|
+
var data;
|
|
559
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
560
|
+
while (1) switch (_context.prev = _context.next) {
|
|
561
|
+
case 0:
|
|
562
|
+
_context.next = 2;
|
|
563
|
+
return createBookingData({
|
|
564
|
+
product: _objectSpread(_objectSpread({}, detail || item), {}, {
|
|
565
|
+
_params: params
|
|
566
|
+
})
|
|
567
|
+
});
|
|
568
|
+
case 2:
|
|
569
|
+
data = _context.sent;
|
|
570
|
+
createBooking({
|
|
571
|
+
booking: data
|
|
572
|
+
});
|
|
573
|
+
case 4:
|
|
574
|
+
case "end":
|
|
575
|
+
return _context.stop();
|
|
576
|
+
}
|
|
577
|
+
}, _callee);
|
|
578
|
+
}));
|
|
579
|
+
return function (_x, _x2, _x3) {
|
|
580
|
+
return _ref.apply(this, arguments);
|
|
581
|
+
};
|
|
582
|
+
}());
|
|
583
|
+
|
|
584
|
+
// 处理 booking4 的服务添加
|
|
585
|
+
var handleBooking4Service = useMemoizedFn(function (item, params, detail, notShowToast) {
|
|
586
|
+
var cacheItem = createCacheItemFromParams(item, params, detail);
|
|
587
|
+
if (cacheItem.autoClose) {
|
|
588
|
+
processAutoCloseService(cacheItem, item, detail, notShowToast);
|
|
589
|
+
} else {
|
|
590
|
+
processManualEditService(cacheItem);
|
|
346
591
|
}
|
|
347
|
-
|
|
348
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, extension_type, detail, notShowToast) {
|
|
349
|
-
var data, _currentItem, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, val, _addService2, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5, _val, sendData, _window$openBookingEd, _window;
|
|
350
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
351
|
-
while (1) switch (_context.prev = _context.next) {
|
|
352
|
-
case 0:
|
|
353
|
-
setCurrentProduct(null);
|
|
354
|
-
// 防止选择商品弹窗多次触发callback
|
|
355
|
-
// if (lock) {
|
|
356
|
-
// return;
|
|
357
|
-
// }
|
|
592
|
+
});
|
|
358
593
|
|
|
359
|
-
|
|
594
|
+
// 直接添加商品(不打开弹窗)
|
|
595
|
+
var handleDirectAddService = useMemoizedFn( /*#__PURE__*/function () {
|
|
596
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item) {
|
|
597
|
+
var cacheItem;
|
|
598
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
599
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
600
|
+
case 0:
|
|
601
|
+
console.log(item, 'handleSelectProduct33', '_list_list');
|
|
602
|
+
if (isBooking4) {
|
|
603
|
+
_context2.next = 5;
|
|
604
|
+
break;
|
|
605
|
+
}
|
|
606
|
+
_context2.next = 4;
|
|
607
|
+
return handleBookingCreation(item, item.cartDetailValue);
|
|
608
|
+
case 4:
|
|
609
|
+
return _context2.abrupt("return");
|
|
610
|
+
case 5:
|
|
611
|
+
cacheItem = createCacheItemFromParams(item, item.cartDetailValue);
|
|
612
|
+
if (cacheItem.autoClose) {
|
|
613
|
+
// 使用带防抖的处理函数
|
|
614
|
+
processAutoCloseService(cacheItem, item, item, false);
|
|
615
|
+
} else {
|
|
616
|
+
processManualEditService(cacheItem);
|
|
617
|
+
}
|
|
618
|
+
case 7:
|
|
619
|
+
case "end":
|
|
620
|
+
return _context2.stop();
|
|
621
|
+
}
|
|
622
|
+
}, _callee2);
|
|
623
|
+
}));
|
|
624
|
+
return function (_x4) {
|
|
625
|
+
return _ref2.apply(this, arguments);
|
|
626
|
+
};
|
|
627
|
+
}());
|
|
360
628
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
629
|
+
// 创建产品弹窗回调
|
|
630
|
+
var createProductModalCallback = useMemoizedFn(function (item) {
|
|
631
|
+
return /*#__PURE__*/function () {
|
|
632
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e, extension_type, detail, notShowToast) {
|
|
633
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
634
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
635
|
+
case 0:
|
|
636
|
+
setCurrentProduct(null);
|
|
365
637
|
if (isBooking4) {
|
|
366
|
-
|
|
638
|
+
_context3.next = 5;
|
|
367
639
|
break;
|
|
368
640
|
}
|
|
369
|
-
|
|
370
|
-
return
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
641
|
+
_context3.next = 4;
|
|
642
|
+
return handleBookingCreation(item, e, detail);
|
|
643
|
+
case 4:
|
|
644
|
+
return _context3.abrupt("return");
|
|
645
|
+
case 5:
|
|
646
|
+
handleBooking4Service(item, e, detail, notShowToast);
|
|
375
647
|
case 6:
|
|
376
|
-
data = _context.sent;
|
|
377
|
-
// 创建预约
|
|
378
|
-
createBooking({
|
|
379
|
-
booking: data
|
|
380
|
-
});
|
|
381
|
-
return _context.abrupt("return");
|
|
382
|
-
case 9:
|
|
383
|
-
_currentItem = detail || item; // info2 addService 逻辑
|
|
384
|
-
_detail = _currentItem;
|
|
385
|
-
other = JSON.parse(JSON.stringify(e));
|
|
386
|
-
other.session = e.session;
|
|
387
|
-
cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
|
|
388
|
-
product_id: _currentItem.id,
|
|
389
|
-
_id: getUniqueId(),
|
|
390
|
-
_key: e.key,
|
|
391
|
-
_extend: {
|
|
392
|
-
start_date: state.date.value,
|
|
393
|
-
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
|
|
394
|
-
price: _detail.price,
|
|
395
|
-
product_name: _currentItem.title,
|
|
396
|
-
other: other
|
|
397
|
-
},
|
|
398
|
-
new: 1
|
|
399
|
-
});
|
|
400
|
-
_total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
|
|
401
|
-
cacheItem._extend.total = _total;
|
|
402
|
-
// 用于储存原价
|
|
403
|
-
cacheItem._extend.origin_total = _total;
|
|
404
|
-
_isEdit = !!state.service.cacheItem;
|
|
405
|
-
if (_isEdit) {
|
|
406
|
-
cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
|
407
|
-
cacheItem.new = 0;
|
|
408
|
-
}
|
|
409
|
-
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
|
410
|
-
if (renderMode === 'current') {
|
|
411
|
-
// cacheItem._extend.resource = 0;
|
|
412
|
-
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
|
413
|
-
}
|
|
414
|
-
cacheItem = getProductExtend({
|
|
415
|
-
cacheItem: cacheItem,
|
|
416
|
-
state: state,
|
|
417
|
-
isDisabledTime: true
|
|
418
|
-
});
|
|
419
|
-
if (state.renderType === 'eventBooking') {
|
|
420
|
-
cacheItem.autoClose = false;
|
|
421
|
-
}
|
|
422
|
-
if (cacheItem.autoClose) {
|
|
423
|
-
cacheItem.autoClose = false;
|
|
424
|
-
cacheItem._serviceKey = genServiceKey(cacheItem);
|
|
425
|
-
val = getCurrentServiceValue();
|
|
426
|
-
_addService2 = addService(_toConsumableArray(val), cacheItem, state), _list = _addService2.list, quantity = _addService2.quantity; // 更新ref以确保后续快速操作时使用最新值
|
|
427
|
-
latestServiceValueRef.current = _list;
|
|
428
|
-
lastOperationTimeRef.current = Date.now();
|
|
429
|
-
if (!notShowToast) {
|
|
430
|
-
handleAddToast(cacheItem.title, quantity || 1);
|
|
431
|
-
}
|
|
432
|
-
window.dispatchEvent(new CustomEvent('onAddNewService', {
|
|
433
|
-
detail: {
|
|
434
|
-
cacheItem: cacheItem
|
|
435
|
-
}
|
|
436
|
-
}));
|
|
437
|
-
try {
|
|
438
|
-
if (((_context$appHelper$ut4 = context.appHelper.utils.store) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.call(_context$appHelper$ut4)) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.global) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) === 2155) {
|
|
439
|
-
_val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
|
|
440
|
-
return {
|
|
441
|
-
product_id: s === null || s === void 0 ? void 0 : s.product_id,
|
|
442
|
-
detailId: s === null || s === void 0 ? void 0 : s.id,
|
|
443
|
-
detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
|
|
444
|
-
product_name: s === null || s === void 0 ? void 0 : s.title,
|
|
445
|
-
price: s === null || s === void 0 ? void 0 : s.price,
|
|
446
|
-
_id: s === null || s === void 0 ? void 0 : s._id,
|
|
447
|
-
_key: s === null || s === void 0 ? void 0 : s._key,
|
|
448
|
-
_serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
|
|
449
|
-
};
|
|
450
|
-
});
|
|
451
|
-
sendData = {
|
|
452
|
-
product_id: _currentItem === null || _currentItem === void 0 ? void 0 : _currentItem.id,
|
|
453
|
-
detailId: _detail === null || _detail === void 0 ? void 0 : _detail.id,
|
|
454
|
-
detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
|
|
455
|
-
product_name: _currentItem === null || _currentItem === void 0 ? void 0 : _currentItem.title,
|
|
456
|
-
price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
|
|
457
|
-
serviceVal: _val
|
|
458
|
-
};
|
|
459
|
-
sendWarningLog({
|
|
460
|
-
title: 'addService',
|
|
461
|
-
content: [{
|
|
462
|
-
key: '添加数据',
|
|
463
|
-
value: JSON.stringify(sendData)
|
|
464
|
-
}, {
|
|
465
|
-
key: '日期',
|
|
466
|
-
value: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
467
|
-
}]
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
} catch (error) {}
|
|
471
|
-
dispatch({
|
|
472
|
-
type: 'setService',
|
|
473
|
-
payload: {
|
|
474
|
-
addModal: false,
|
|
475
|
-
value: _list,
|
|
476
|
-
edit: true,
|
|
477
|
-
changeService: false
|
|
478
|
-
}
|
|
479
|
-
});
|
|
480
|
-
} else {
|
|
481
|
-
(_window$openBookingEd = (_window = window).openBookingEditModal) === null || _window$openBookingEd === void 0 || _window$openBookingEd.call(_window);
|
|
482
|
-
dispatch({
|
|
483
|
-
type: 'setService',
|
|
484
|
-
payload: {
|
|
485
|
-
editModal: true,
|
|
486
|
-
cacheItem: cacheItem,
|
|
487
|
-
addModal: !cacheItem.autoClose,
|
|
488
|
-
changeService: false
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
onEdit === null || onEdit === void 0 || onEdit(cacheItem);
|
|
492
|
-
}
|
|
493
|
-
case 23:
|
|
494
648
|
case "end":
|
|
495
|
-
return
|
|
649
|
+
return _context3.stop();
|
|
496
650
|
}
|
|
497
|
-
},
|
|
651
|
+
}, _callee3);
|
|
498
652
|
}));
|
|
499
|
-
return function
|
|
500
|
-
return
|
|
653
|
+
return function (_x5, _x6, _x7, _x8) {
|
|
654
|
+
return _ref3.apply(this, arguments);
|
|
501
655
|
};
|
|
502
656
|
}();
|
|
657
|
+
});
|
|
503
658
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
if (pendingCacheValuesRef.current[productId]) {
|
|
511
|
-
clickCountRef.current[productId] = (clickCountRef.current[productId] || 1) + 1;
|
|
512
|
-
} else {
|
|
513
|
-
// 第一次点击,初始化数据
|
|
514
|
-
pendingCacheValuesRef.current[productId] = cacheValues;
|
|
515
|
-
clickCountRef.current[productId] = 1;
|
|
516
|
-
}
|
|
517
|
-
var cacheItem = createSimpleCacheItem(item, cacheValues, state);
|
|
518
|
-
var detail = (_state$service$value = state.service.value) === null || _state$service$value === void 0 ? void 0 : _state$service$value.find(function (val) {
|
|
519
|
-
return isSameProduct(val, cacheItem);
|
|
520
|
-
});
|
|
521
|
-
var originalQuantity = (detail === null || detail === void 0 || (_detail$_extend = detail._extend) === null || _detail$_extend === void 0 ? void 0 : _detail$_extend.quantity) || 0;
|
|
522
|
-
Toast === null || Toast === void 0 || (_Toast$success2 = Toast.success) === null || _Toast$success2 === void 0 || _Toast$success2.call(Toast, /*#__PURE__*/React.createElement("div", {
|
|
523
|
-
className: "add-toast-wrap"
|
|
524
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
525
|
-
className: "add-toast-title"
|
|
526
|
-
}, item.title), /*#__PURE__*/React.createElement("div", {
|
|
527
|
-
className: "add-toast-quantity"
|
|
528
|
-
}, locales.getText('pisell2.ticket-booking.in-cart')((clickCountRef.current[productId] || 1) + originalQuantity))));
|
|
529
|
-
debouncedExecuteCacheValues(productId, cacheValues, item, callback);
|
|
530
|
-
return;
|
|
531
|
-
}
|
|
659
|
+
// 打开产品选择弹窗
|
|
660
|
+
var openProductModal = useMemoizedFn(function (item) {
|
|
661
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'select';
|
|
662
|
+
var isSession = isSessionProduct(item);
|
|
663
|
+
var isOnlySession = getIsOnlySession(item);
|
|
664
|
+
var isEject = getIsEject(item, type);
|
|
532
665
|
state.action({
|
|
533
666
|
type: 'pisell1.handleOpenProductModal',
|
|
534
667
|
data: {
|
|
535
668
|
id: item.id,
|
|
536
669
|
date: state.date.value.format('YYYY-MM-DD'),
|
|
670
|
+
productDetail: item,
|
|
537
671
|
showConfig: {
|
|
538
672
|
option: true,
|
|
539
673
|
session: isSession,
|
|
@@ -549,9 +683,298 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
549
683
|
onCancel: function onCancel() {
|
|
550
684
|
setCurrentProduct(null);
|
|
551
685
|
},
|
|
552
|
-
callback:
|
|
686
|
+
callback: createProductModalCallback(item)
|
|
553
687
|
});
|
|
554
688
|
});
|
|
689
|
+
|
|
690
|
+
// 处理产品选择
|
|
691
|
+
var handleSelectProduct = useMemoizedFn( /*#__PURE__*/function () {
|
|
692
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(item) {
|
|
693
|
+
var type,
|
|
694
|
+
_args4 = arguments;
|
|
695
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
696
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
697
|
+
case 0:
|
|
698
|
+
type = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : 'select';
|
|
699
|
+
console.log(item, 'handleSelectProduct');
|
|
700
|
+
// 检查资源可用性
|
|
701
|
+
if (checkResourceAvailability(item)) {
|
|
702
|
+
_context4.next = 4;
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
return _context4.abrupt("return");
|
|
706
|
+
case 4:
|
|
707
|
+
if (item.isOpenDetailModal) {
|
|
708
|
+
_context4.next = 8;
|
|
709
|
+
break;
|
|
710
|
+
}
|
|
711
|
+
_context4.next = 7;
|
|
712
|
+
return handleDirectAddService(item);
|
|
713
|
+
case 7:
|
|
714
|
+
return _context4.abrupt("return");
|
|
715
|
+
case 8:
|
|
716
|
+
// 打开产品选择弹窗
|
|
717
|
+
openProductModal(item, type);
|
|
718
|
+
case 9:
|
|
719
|
+
case "end":
|
|
720
|
+
return _context4.stop();
|
|
721
|
+
}
|
|
722
|
+
}, _callee4);
|
|
723
|
+
}));
|
|
724
|
+
return function (_x9) {
|
|
725
|
+
return _ref4.apply(this, arguments);
|
|
726
|
+
};
|
|
727
|
+
}());
|
|
728
|
+
/**
|
|
729
|
+
const handleSelectProduct = useMemoizedFn(
|
|
730
|
+
(item: any, type: 'select' | 'detail' = 'select') => {
|
|
731
|
+
console.log(item, 'handleSelectProduct');
|
|
732
|
+
if (!isNormalProductByDurationSchedule(item)) {
|
|
733
|
+
if (
|
|
734
|
+
!Array.isArray(state.service?.resourcesOrigin) ||
|
|
735
|
+
!state.service.resourcesOrigin.length
|
|
736
|
+
) {
|
|
737
|
+
dispatch({
|
|
738
|
+
type: 'setService',
|
|
739
|
+
payload: {
|
|
740
|
+
...stateRef.current.service,
|
|
741
|
+
reloadResourceModal: true,
|
|
742
|
+
},
|
|
743
|
+
});
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
const isSession = isSessionProduct(item);
|
|
748
|
+
// 是否有单规格 组合规格 套餐, 或者session商品 如果没有不需要打开弹窗
|
|
749
|
+
const isEject = getIsEject(item, type);
|
|
750
|
+
const isOnlySession = getIsOnlySession(item);
|
|
751
|
+
let lock = false;
|
|
752
|
+
// 对于不需要打开弹窗的商品, 直接模拟数据, 不走弹窗
|
|
753
|
+
let cacheValues = null;
|
|
754
|
+
if (isEject) {
|
|
755
|
+
setCurrentProduct(item);
|
|
756
|
+
} else {
|
|
757
|
+
setCurrentProduct(null);
|
|
758
|
+
if (item?.extension_type === 'normal') {
|
|
759
|
+
cacheValues = {
|
|
760
|
+
bundle: [],
|
|
761
|
+
key: item.id,
|
|
762
|
+
option: [],
|
|
763
|
+
product_id: item.id,
|
|
764
|
+
product_variant_id: 0,
|
|
765
|
+
quantity: 1,
|
|
766
|
+
rowKey: item.id,
|
|
767
|
+
session: null,
|
|
768
|
+
unique: '08974625397',
|
|
769
|
+
_originalItem: item, // 保存原始商品信息
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
const callback = async (
|
|
774
|
+
e: any,
|
|
775
|
+
extension_type: any,
|
|
776
|
+
detail: any,
|
|
777
|
+
notShowToast: boolean
|
|
778
|
+
) => {
|
|
779
|
+
setCurrentProduct(null);
|
|
780
|
+
// 防止选择商品弹窗多次触发callback
|
|
781
|
+
// if (lock) {
|
|
782
|
+
// return;
|
|
783
|
+
// }
|
|
784
|
+
lock = true;
|
|
785
|
+
// 2秒后解除
|
|
786
|
+
setTimeout(() => {
|
|
787
|
+
lock = false;
|
|
788
|
+
}, 2000);
|
|
789
|
+
if (!isBooking4) {
|
|
790
|
+
// info1 addService 逻辑
|
|
791
|
+
// 预生成预约数据
|
|
792
|
+
const data = await createBookingData({
|
|
793
|
+
product: { ...(detail || item), _params: e },
|
|
794
|
+
});
|
|
795
|
+
// 创建预约
|
|
796
|
+
createBooking({ booking: data });
|
|
797
|
+
return;
|
|
798
|
+
}
|
|
799
|
+
const _currentItem = detail || item;
|
|
800
|
+
// info2 addService 逻辑
|
|
801
|
+
const _detail = _currentItem;
|
|
802
|
+
const other = JSON.parse(JSON.stringify(e));
|
|
803
|
+
other.session = e.session;
|
|
804
|
+
let cacheItem: any = {
|
|
805
|
+
..._detail,
|
|
806
|
+
product_id: _currentItem.id,
|
|
807
|
+
_id: getUniqueId(),
|
|
808
|
+
_key: e.key,
|
|
809
|
+
_extend: {
|
|
810
|
+
start_date: state.date.value,
|
|
811
|
+
quantity: e?.quantity || 1,
|
|
812
|
+
price: _detail.price,
|
|
813
|
+
product_name: _currentItem.title,
|
|
814
|
+
other,
|
|
815
|
+
},
|
|
816
|
+
new: 1,
|
|
817
|
+
};
|
|
818
|
+
let _total = getProductTotalPrice(cacheItem);
|
|
819
|
+
// 用于折扣 可修改
|
|
820
|
+
cacheItem._extend.total = _total;
|
|
821
|
+
// 用于储存原价
|
|
822
|
+
cacheItem._extend.origin_total = _total;
|
|
823
|
+
const _isEdit = !!state.service.cacheItem;
|
|
824
|
+
if (_isEdit) {
|
|
825
|
+
cacheItem._id = state.service.cacheItem?._id;
|
|
826
|
+
cacheItem.new = 0;
|
|
827
|
+
}
|
|
828
|
+
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
|
829
|
+
if (renderMode === 'current') {
|
|
830
|
+
// cacheItem._extend.resource = 0;
|
|
831
|
+
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
|
832
|
+
}
|
|
833
|
+
cacheItem = getProductExtend({
|
|
834
|
+
cacheItem,
|
|
835
|
+
state,
|
|
836
|
+
isDisabledTime: true,
|
|
837
|
+
});
|
|
838
|
+
if (state.renderType === 'eventBooking') {
|
|
839
|
+
cacheItem.autoClose = false;
|
|
840
|
+
}
|
|
841
|
+
if (cacheItem.autoClose) {
|
|
842
|
+
cacheItem.autoClose = false;
|
|
843
|
+
cacheItem._serviceKey = genServiceKey(cacheItem);
|
|
844
|
+
const val = getCurrentServiceValue();
|
|
845
|
+
let { list: _list, quantity } = addService(
|
|
846
|
+
[...val],
|
|
847
|
+
cacheItem,
|
|
848
|
+
stateRef.current
|
|
849
|
+
);
|
|
850
|
+
// 更新ref以确保后续快速操作时使用最新值
|
|
851
|
+
latestServiceValueRef.current = _list;
|
|
852
|
+
lastOperationTimeRef.current = Date.now();
|
|
853
|
+
if (!notShowToast) {
|
|
854
|
+
handleAddToast(cacheItem.title, quantity || 1);
|
|
855
|
+
}
|
|
856
|
+
window.dispatchEvent(
|
|
857
|
+
new CustomEvent('onAddNewService', {
|
|
858
|
+
detail: {
|
|
859
|
+
cacheItem,
|
|
860
|
+
},
|
|
861
|
+
})
|
|
862
|
+
);
|
|
863
|
+
try {
|
|
864
|
+
if (
|
|
865
|
+
context.appHelper.utils.store?.getState?.()?.global?.globalConfig
|
|
866
|
+
?.id === 2155
|
|
867
|
+
) {
|
|
868
|
+
const val = _list?.map((s) => {
|
|
869
|
+
return {
|
|
870
|
+
product_id: s?.product_id,
|
|
871
|
+
detailId: s?.id,
|
|
872
|
+
detailProductId: s?.product_id,
|
|
873
|
+
product_name: s?.title,
|
|
874
|
+
price: s?.price,
|
|
875
|
+
_id: s?._id,
|
|
876
|
+
_key: s?._key,
|
|
877
|
+
_serviceKey: s?._serviceKey,
|
|
878
|
+
};
|
|
879
|
+
});
|
|
880
|
+
const sendData = {
|
|
881
|
+
product_id: _currentItem?.id,
|
|
882
|
+
detailId: _detail?.id,
|
|
883
|
+
detailProductId: _detail?.product_id,
|
|
884
|
+
product_name: _currentItem?.title,
|
|
885
|
+
price: _detail?.price,
|
|
886
|
+
serviceVal: val,
|
|
887
|
+
};
|
|
888
|
+
sendWarningLog({
|
|
889
|
+
title: 'addService',
|
|
890
|
+
content: [
|
|
891
|
+
{ key: '添加数据', value: JSON.stringify(sendData) },
|
|
892
|
+
{
|
|
893
|
+
key: '日期',
|
|
894
|
+
value: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
|
895
|
+
},
|
|
896
|
+
],
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
} catch (error) {}
|
|
900
|
+
dispatch({
|
|
901
|
+
type: 'setService',
|
|
902
|
+
payload: {
|
|
903
|
+
addModal: false,
|
|
904
|
+
value: _list,
|
|
905
|
+
edit: true,
|
|
906
|
+
changeService: false,
|
|
907
|
+
},
|
|
908
|
+
});
|
|
909
|
+
} else {
|
|
910
|
+
window.openBookingEditModal?.();
|
|
911
|
+
dispatch({
|
|
912
|
+
type: 'setService',
|
|
913
|
+
payload: {
|
|
914
|
+
editModal: true,
|
|
915
|
+
cacheItem: cacheItem,
|
|
916
|
+
addModal: !cacheItem.autoClose,
|
|
917
|
+
changeService: false,
|
|
918
|
+
},
|
|
919
|
+
});
|
|
920
|
+
onEdit?.(cacheItem);
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
// 如果不需要打开弹窗, 直接添加数据
|
|
924
|
+
if (cacheValues) {
|
|
925
|
+
const productId = item.id.toString();
|
|
926
|
+
// 如果已经有pending的同商品,增加点击次数
|
|
927
|
+
if (pendingCacheValuesRef.current[productId]) {
|
|
928
|
+
clickCountRef.current[productId] =
|
|
929
|
+
(clickCountRef.current[productId] || 1) + 1;
|
|
930
|
+
} else {
|
|
931
|
+
// 第一次点击,初始化数据
|
|
932
|
+
pendingCacheValuesRef.current[productId] = cacheValues;
|
|
933
|
+
clickCountRef.current[productId] = 1;
|
|
934
|
+
}
|
|
935
|
+
const cacheItem = createSimpleCacheItem(item, cacheValues, stateRef.current);
|
|
936
|
+
const detail = stateRef.current.service.value?.find((val: any) =>
|
|
937
|
+
isSameProduct(val, cacheItem)
|
|
938
|
+
);
|
|
939
|
+
const originalQuantity = detail?._extend?.quantity || 0;
|
|
940
|
+
Toast?.success?.(
|
|
941
|
+
<div className="add-toast-wrap">
|
|
942
|
+
<div className="add-toast-title">{item.title}</div>
|
|
943
|
+
<div className="add-toast-quantity">
|
|
944
|
+
{locales.getText('pisell2.ticket-booking.in-cart')(
|
|
945
|
+
(clickCountRef.current[productId] || 1) + originalQuantity
|
|
946
|
+
)}
|
|
947
|
+
</div>
|
|
948
|
+
</div>
|
|
949
|
+
);
|
|
950
|
+
debouncedExecuteCacheValues(productId, cacheValues, item, callback);
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
953
|
+
state.action({
|
|
954
|
+
type: 'pisell1.handleOpenProductModal',
|
|
955
|
+
data: {
|
|
956
|
+
id: item.id,
|
|
957
|
+
date: state.date.value.format('YYYY-MM-DD'),
|
|
958
|
+
showConfig: {
|
|
959
|
+
option: true,
|
|
960
|
+
session: isSession,
|
|
961
|
+
variant: true,
|
|
962
|
+
package: true,
|
|
963
|
+
number: getIsShowNumber(item, state),
|
|
964
|
+
},
|
|
965
|
+
isOnlySession,
|
|
966
|
+
is_eject: isEject ? 1 : 0,
|
|
967
|
+
customer_id: customerId,
|
|
968
|
+
isOS: isSession,
|
|
969
|
+
},
|
|
970
|
+
onCancel: () => {
|
|
971
|
+
setCurrentProduct(null);
|
|
972
|
+
},
|
|
973
|
+
callback,
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
);
|
|
977
|
+
*/
|
|
555
978
|
var renderList = useMemo(function () {
|
|
556
979
|
var _list = products || [];
|
|
557
980
|
|
|
@@ -580,8 +1003,11 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
580
1003
|
menu_list_ids: menuList,
|
|
581
1004
|
schedule_datetime: currentDatetime
|
|
582
1005
|
});
|
|
1006
|
+
getScheduleTimePoints({
|
|
1007
|
+
menu_list_ids: menuList
|
|
1008
|
+
});
|
|
583
1009
|
}
|
|
584
|
-
}, [renderMode,
|
|
1010
|
+
}, [renderMode, customerId, menuList]);
|
|
585
1011
|
|
|
586
1012
|
// 产品展示配置,支持字符串预设或完整配置对象
|
|
587
1013
|
var finalDisplayConfig = useMemo(function () {
|
|
@@ -605,7 +1031,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
605
1031
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProductDisplayAdapter, {
|
|
606
1032
|
config: finalDisplayConfig,
|
|
607
1033
|
dataSource: renderList,
|
|
608
|
-
loading: !renderList.length && loading,
|
|
1034
|
+
loading: !renderList.length && loading || firstLoading,
|
|
609
1035
|
currentProductId: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.id,
|
|
610
1036
|
onSelectProduct: handleSelectProduct
|
|
611
1037
|
}), /*#__PURE__*/React.createElement(NotAvailable, {
|
|
@@ -613,6 +1039,6 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
613
1039
|
}));
|
|
614
1040
|
}
|
|
615
1041
|
return null;
|
|
616
|
-
}, [state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4, finalDisplayConfig]);
|
|
1042
|
+
}, [firstLoading, state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4, finalDisplayConfig]);
|
|
617
1043
|
};
|
|
618
1044
|
export default AddSerivce;
|