@pisell/private-materials 6.5.26 → 6.6.1
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 +2 -2
- package/build/lowcode/preview.js +146 -165
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +4 -2
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +273 -76
- package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/es/components/appointmentBooking/hooks.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +30 -30
- package/es/components/appointmentBooking/locales.d.ts +3 -0
- package/es/components/appointmentBooking/locales.js +9 -6
- package/es/components/booking/components/actionButtons/index.js +34 -20
- package/es/components/booking/components/customSelect/index.js +1 -1
- package/es/components/booking/components/footer/amount.js +25 -8
- package/es/components/booking/components/footer/index.js +66 -33
- package/es/components/booking/components/footer/utils.d.ts +7 -0
- package/es/components/booking/components/footer/utils.js +126 -99
- package/es/components/booking/components/voucher/index.js +25 -9
- package/es/components/booking/dashboard/serve.js +1 -6
- package/es/components/booking/forms/footer.js +24 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/forms/serve.js +2 -12
- package/es/components/booking/hooks/useQuotation.js +69 -21
- package/es/components/booking/info/client/index.js +28 -13
- package/es/components/booking/info/client/serve.js +2 -11
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +16 -10
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
- package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
- package/es/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
- package/es/components/booking/info/hooks/useHolderConfig.js +9 -2
- package/es/components/booking/info/main.js +3 -2
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/pet/serve.js +1 -6
- package/es/components/booking/info/service/Lists.d.ts +1 -1
- package/es/components/booking/info/service/Lists.js +10 -4
- package/es/components/booking/info/service/addTimeModal/serve.js +1 -11
- package/es/components/booking/info/service/serve.d.ts +14 -0
- package/es/components/booking/info/service/serve.js +25 -18
- package/es/components/booking/info/service2/Group/utils.js +2 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -33
- package/es/components/booking/info/service2/utils.js +92 -56
- package/es/components/booking/info/utils.js +5 -0
- package/es/components/booking/info2/cartClientCard/index.js +49 -9
- package/es/components/booking/info2/index.js +3 -2
- package/es/components/booking/info2/serve.js +1 -6
- package/es/components/booking/info2/service/addService/index.js +146 -89
- package/es/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/es/components/booking/info2/service/addService/utils.js +83 -14
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
- package/es/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
- package/es/components/booking/info2/service/editService/Holder/index.js +193 -0
- package/es/components/booking/info2/service/editService/Holder/index.less +63 -0
- package/es/components/booking/info2/service/editService/index.js +313 -57
- package/es/components/booking/info2/utilsByBooking.js +19 -14
- package/es/components/booking/locales.d.ts +36 -0
- package/es/components/booking/locales.js +48 -3
- package/es/components/booking/model.d.ts +4 -0
- package/es/components/booking/model.js +3 -0
- package/es/components/booking/utils/confirmHolderModal.d.ts +13 -0
- package/es/components/booking/utils/confirmHolderModal.js +318 -0
- package/es/components/booking/utils/confirmHolderModal.less +40 -0
- package/es/components/booking/utils/selectHolderModal.d.ts +24 -0
- package/es/components/booking/utils/selectHolderModal.js +407 -0
- package/es/components/booking/utils.d.ts +16 -7
- package/es/components/booking/utils.js +26 -37
- package/es/components/checkout/PaymentModal.js +61 -30
- package/es/components/checkout/components/CashPaymentModule/index.js +1 -7
- package/es/components/checkout/components/ScrollableList/index.js +0 -1
- package/es/components/checkout/locales.d.ts +3 -0
- package/es/components/checkout/locales.js +3 -0
- package/es/components/eftposPay/linkly/index.js +64 -2
- package/es/components/eftposPay/tyro/index.js +12 -0
- package/es/components/list/List.js +3 -0
- package/es/components/pay/toB/components/MX51/index.js +14 -44
- package/es/components/pay/toB/types/index.d.ts +0 -12
- package/es/components/pay/toB/types/index.js +0 -4
- package/es/components/shoppingCart/components/Cart/Product.js +6 -3
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +119 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +419 -794
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
- package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -4
- package/es/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
- package/es/components/ticketBooking/components/menuBar/index.js +109 -12
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
- package/es/components/ticketBooking/components/ticketBooking/index.js +32 -61
- package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/ticketBooking/components/timeBar/index.js +1 -4
- package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +122 -170
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/index.js +0 -2
- package/es/components/ticketBooking/serve.js +17 -119
- package/es/components/ticketBooking/utils/index.d.ts +7 -1
- package/es/components/ticketBooking/utils/index.js +44 -28
- package/es/hooks/useEngineContext.d.ts +0 -1
- package/es/hooks/useEngineContext.js +0 -7
- package/es/index.d.ts +4 -0
- package/es/index.js +5 -1
- package/es/plus/clientCard/locales.js +3 -3
- package/es/plus/clinetSearch/index.js +28 -30
- package/es/plus/clinetSearch/locales.d.ts +3 -0
- package/es/plus/clinetSearch/locales.js +7 -4
- package/es/plus/clinetSearch/types.d.ts +12 -0
- package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/es/plus/contactInfo/components/Avatar/index.js +30 -0
- package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
- package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/es/plus/contactInfo/index.d.ts +6 -0
- package/es/plus/contactInfo/index.js +198 -0
- package/es/plus/contactInfo/index.less +621 -0
- package/es/plus/contactInfo/locales.d.ts +15 -0
- package/es/plus/contactInfo/locales.js +14 -0
- package/es/plus/contactInfo/types.d.ts +91 -0
- package/es/plus/contactInfo/types.js +1 -0
- package/es/plus/contactInfo/utils.d.ts +7 -0
- package/es/plus/contactInfo/utils.js +50 -0
- package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
- package/es/plus/contactInfoModal/index.d.ts +41 -0
- package/es/plus/contactInfoModal/index.js +155 -0
- package/es/plus/contactInfoModal/index.less +19 -0
- package/es/plus/contactInfoModal/locales.d.ts +66 -0
- package/es/plus/contactInfoModal/locales.js +65 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
- package/es/plus/productSelect/ProductCard/index.js +1 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
- package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
- package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/es/plus/selectHolder/components/HolderList/index.js +43 -0
- package/es/plus/selectHolder/index.d.ts +7 -0
- package/es/plus/selectHolder/index.js +273 -0
- package/es/plus/selectHolder/index.less +137 -0
- package/es/plus/selectHolder/locales.d.ts +24 -0
- package/es/plus/selectHolder/locales.js +29 -0
- package/es/plus/selectHolder/types.d.ts +104 -0
- package/es/plus/selectHolder/types.js +1 -0
- package/es/plus/selectHolder/utils.d.ts +9 -0
- package/es/plus/selectHolder/utils.js +16 -0
- package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/es/pro/comprehensiveSearch/locales.js +1 -1
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +357 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/es/pro/multiDayTimeSelect/index.js +1 -0
- package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/es/pro/multiDayTimeSelect/types.js +1 -0
- package/es/pro/skuDetailModal/types.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +6 -3
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +156 -13
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/lib/components/appointmentBooking/hooks.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +73 -35
- package/lib/components/appointmentBooking/locales.d.ts +3 -0
- package/lib/components/appointmentBooking/locales.js +6 -3
- package/lib/components/booking/components/actionButtons/index.js +11 -2
- package/lib/components/booking/components/customSelect/index.js +1 -1
- package/lib/components/booking/components/footer/amount.js +23 -6
- package/lib/components/booking/components/footer/index.js +26 -5
- package/lib/components/booking/components/footer/utils.d.ts +7 -0
- package/lib/components/booking/components/footer/utils.js +120 -82
- package/lib/components/booking/components/voucher/index.js +10 -1
- package/lib/components/booking/dashboard/serve.js +1 -6
- package/lib/components/booking/forms/footer.js +29 -11
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/forms/serve.js +2 -12
- package/lib/components/booking/hooks/useQuotation.js +45 -13
- package/lib/components/booking/info/client/index.js +14 -1
- package/lib/components/booking/info/client/serve.js +2 -13
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +7 -2
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -4
- package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
- package/lib/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
- package/lib/components/booking/info/hooks/useHolderConfig.js +8 -3
- package/lib/components/booking/info/main.js +5 -4
- package/lib/components/booking/info/model.js +5 -0
- package/lib/components/booking/info/pet/serve.js +1 -6
- package/lib/components/booking/info/service/Lists.d.ts +1 -1
- package/lib/components/booking/info/service/Lists.js +5 -3
- package/lib/components/booking/info/service/addTimeModal/serve.js +1 -7
- package/lib/components/booking/info/service/serve.d.ts +14 -0
- package/lib/components/booking/info/service/serve.js +8 -17
- package/lib/components/booking/info/service2/Group/utils.js +2 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -33
- package/lib/components/booking/info/service2/utils.js +38 -29
- package/lib/components/booking/info/utils.js +4 -0
- package/lib/components/booking/info2/cartClientCard/index.js +34 -5
- package/lib/components/booking/info2/index.js +11 -5
- package/lib/components/booking/info2/serve.js +1 -6
- package/lib/components/booking/info2/service/addService/index.js +22 -3
- package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/lib/components/booking/info2/service/addService/utils.js +48 -11
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
- package/lib/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
- package/lib/components/booking/info2/service/editService/Holder/index.js +199 -0
- package/lib/components/booking/info2/service/editService/Holder/index.less +63 -0
- package/lib/components/booking/info2/service/editService/index.js +254 -32
- package/lib/components/booking/info2/utilsByBooking.js +26 -19
- package/lib/components/booking/locales.d.ts +36 -0
- package/lib/components/booking/locales.js +42 -3
- package/lib/components/booking/model.d.ts +4 -0
- package/lib/components/booking/model.js +3 -0
- package/lib/components/booking/utils/confirmHolderModal.d.ts +13 -0
- package/lib/components/booking/utils/confirmHolderModal.js +253 -0
- package/lib/components/booking/utils/confirmHolderModal.less +40 -0
- package/lib/components/booking/utils/selectHolderModal.d.ts +24 -0
- package/lib/components/booking/utils/selectHolderModal.js +319 -0
- package/lib/components/booking/utils.d.ts +16 -7
- package/lib/components/booking/utils.js +18 -21
- package/lib/components/checkout/PaymentModal.js +41 -18
- package/lib/components/checkout/components/CashPaymentModule/index.js +1 -7
- package/lib/components/checkout/components/ScrollableList/index.js +0 -1
- package/lib/components/checkout/locales.d.ts +3 -0
- package/lib/components/checkout/locales.js +3 -0
- package/lib/components/eftposPay/linkly/index.js +31 -1
- package/lib/components/eftposPay/tyro/index.js +12 -0
- package/lib/components/list/List.js +3 -0
- package/lib/components/pay/toB/components/MX51/index.js +12 -37
- package/lib/components/pay/toB/types/index.d.ts +0 -12
- package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +279 -313
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
- package/lib/components/ticketBooking/components/addServiceVariant/index.js +5 -3
- package/lib/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
- package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
- package/lib/components/ticketBooking/components/ticketBooking/index.js +12 -49
- package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +1 -3
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +69 -98
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/index.js +0 -2
- package/lib/components/ticketBooking/serve.js +15 -117
- package/lib/components/ticketBooking/utils/index.d.ts +7 -1
- package/lib/components/ticketBooking/utils/index.js +29 -23
- package/lib/hooks/useEngineContext.d.ts +0 -1
- package/lib/hooks/useEngineContext.js +2 -10
- package/lib/index.d.ts +4 -0
- package/lib/index.js +12 -0
- package/lib/plus/clientCard/locales.js +3 -3
- package/lib/plus/clinetSearch/index.js +17 -8
- package/lib/plus/clinetSearch/locales.d.ts +3 -0
- package/lib/plus/clinetSearch/locales.js +7 -4
- package/lib/plus/clinetSearch/types.d.ts +12 -0
- package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/lib/plus/contactInfo/index.d.ts +6 -0
- package/lib/plus/contactInfo/index.js +226 -0
- package/lib/plus/contactInfo/index.less +621 -0
- package/lib/plus/contactInfo/locales.d.ts +15 -0
- package/lib/plus/contactInfo/locales.js +38 -0
- package/lib/plus/contactInfo/types.d.ts +91 -0
- package/lib/plus/contactInfo/types.js +17 -0
- package/lib/plus/contactInfo/utils.d.ts +7 -0
- package/lib/plus/contactInfo/utils.js +64 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
- package/lib/plus/contactInfoModal/index.d.ts +41 -0
- package/lib/plus/contactInfoModal/index.js +139 -0
- package/lib/plus/contactInfoModal/index.less +19 -0
- package/lib/plus/contactInfoModal/locales.d.ts +66 -0
- package/lib/plus/contactInfoModal/locales.js +89 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
- package/lib/plus/productSelect/ProductCard/index.js +1 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.js +30 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
- package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/lib/plus/selectHolder/components/HolderList/index.js +63 -0
- package/lib/plus/selectHolder/index.d.ts +7 -0
- package/lib/plus/selectHolder/index.js +223 -0
- package/lib/plus/selectHolder/index.less +137 -0
- package/lib/plus/selectHolder/locales.d.ts +24 -0
- package/lib/plus/selectHolder/locales.js +47 -0
- package/lib/plus/selectHolder/types.d.ts +104 -0
- package/lib/plus/selectHolder/types.js +17 -0
- package/lib/plus/selectHolder/utils.d.ts +9 -0
- package/lib/plus/selectHolder/utils.js +34 -0
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/lib/pro/comprehensiveSearch/locales.js +1 -1
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +304 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/lib/{hooks/printer.js → pro/multiDayTimeSelect/index.js} +6 -31
- package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/lib/pro/multiDayTimeSelect/types.js +17 -0
- package/lib/pro/skuDetailModal/types.d.ts +1 -0
- package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
- package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
- package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
- package/lowcode/contact-info/fragments/textStyle.ts +33 -0
- package/lowcode/contact-info/meta.ts +199 -0
- package/lowcode/contact-info-modal/meta.ts +98 -0
- package/lowcode/event-select-holder/meta.ts +2 -2
- package/lowcode/select-holder/meta.ts +220 -0
- package/lowcode/select-holder/snippets.ts +41 -0
- package/package.json +13 -11
- package/es/hooks/printer.d.ts +0 -4
- package/es/hooks/printer.js +0 -35
- package/lib/hooks/printer.d.ts +0 -4
|
@@ -50,6 +50,9 @@ var import_pisellos = require("../../hooks/pisellos");
|
|
|
50
50
|
var import_utils7 = require("./utils");
|
|
51
51
|
var import_materials = require("@pisell/materials");
|
|
52
52
|
var import_IsActiveContext = require("../../context/IsActiveContext");
|
|
53
|
+
var import_utils8 = require("../../../booking/info/service2/Group/utils");
|
|
54
|
+
var import_MultiDayTimeSelectModal = __toESM(require("./MultiDayTimeSelectModal"));
|
|
55
|
+
var import_selectHolderModal = require("../../../booking/utils/selectHolderModal");
|
|
53
56
|
var productListLayout = {
|
|
54
57
|
grid: true,
|
|
55
58
|
config: "12:12"
|
|
@@ -63,20 +66,16 @@ var productListSetting = {
|
|
|
63
66
|
isStock: 0
|
|
64
67
|
};
|
|
65
68
|
var AddSerivce = (props) => {
|
|
66
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l
|
|
69
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
67
70
|
const {
|
|
68
71
|
onEdit,
|
|
69
72
|
state,
|
|
70
73
|
dispatch,
|
|
71
74
|
renderMode = "current",
|
|
72
|
-
onPrerenderComplete,
|
|
73
|
-
onGetProductsReady,
|
|
74
75
|
productDisplayConfig
|
|
75
76
|
} = props;
|
|
76
77
|
const context = (0, import_useEngineContext.default)();
|
|
77
|
-
const platform = (0, import_useEngineContext.usePlatform)();
|
|
78
78
|
const notAvailableRef = (0, import_react.useRef)(null);
|
|
79
|
-
const isLoadedServiceRef = (0, import_react.useRef)(false);
|
|
80
79
|
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
81
80
|
const isActive = (0, import_IsActiveContext.useIsActive)();
|
|
82
81
|
const Toast = (0, import_materials.useToast)();
|
|
@@ -93,31 +92,12 @@ var AddSerivce = (props) => {
|
|
|
93
92
|
);
|
|
94
93
|
const [currentProduct, setCurrentProduct] = (0, import_react.useState)(null);
|
|
95
94
|
const [firstLoading, setFirstLoading] = (0, import_react.useState)(true);
|
|
95
|
+
const [multiDayModalOpen, setMultiDayModalOpen] = (0, import_react.useState)(false);
|
|
96
|
+
const [multiDayModalLoading, setMultiDayModalLoading] = (0, import_react.useState)(false);
|
|
97
|
+
const [pendingMultiDayData, setPendingMultiDayData] = (0, import_react.useState)(null);
|
|
96
98
|
const stateRef = (0, import_react.useRef)(state);
|
|
97
99
|
stateRef.current = state;
|
|
98
|
-
const
|
|
99
|
-
const latestServiceValueRef = (0, import_react.useRef)(((_j = state == null ? void 0 : state.service) == null ? void 0 : _j.value) || []);
|
|
100
|
-
const lastOperationTimeRef = (0, import_react.useRef)(0);
|
|
101
|
-
const isInFastClickMode = () => {
|
|
102
|
-
const now = Date.now();
|
|
103
|
-
return now - lastOperationTimeRef.current < 2e3;
|
|
104
|
-
};
|
|
105
|
-
const getCurrentServiceValue = () => {
|
|
106
|
-
var _a2, _b2, _c2;
|
|
107
|
-
if (isInFastClickMode()) {
|
|
108
|
-
return latestServiceValueRef.current || ((_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.service) == null ? void 0 : _b2.value) || [];
|
|
109
|
-
} else {
|
|
110
|
-
const stateValue = ((_c2 = state == null ? void 0 : state.service) == null ? void 0 : _c2.value) || [];
|
|
111
|
-
latestServiceValueRef.current = null;
|
|
112
|
-
return stateValue;
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
const { getProducts, products, loading, getScheduleTimePoints } = (0, import_pisellos.useProducts)(notAvailableRef);
|
|
116
|
-
(0, import_react.useEffect)(() => {
|
|
117
|
-
if (onGetProductsReady && getProducts) {
|
|
118
|
-
onGetProductsReady(getProducts);
|
|
119
|
-
}
|
|
120
|
-
}, []);
|
|
100
|
+
const { getProducts, products, loading } = (0, import_pisellos.useProducts)(notAvailableRef);
|
|
121
101
|
(0, import_react.useEffect)(() => {
|
|
122
102
|
const timer = setTimeout(() => {
|
|
123
103
|
setFirstLoading(false);
|
|
@@ -134,12 +114,6 @@ var AddSerivce = (props) => {
|
|
|
134
114
|
debounceTimersRef.current = {};
|
|
135
115
|
};
|
|
136
116
|
}, []);
|
|
137
|
-
(0, import_react.useEffect)(() => {
|
|
138
|
-
if (!loading && !prerenderCompletedRef.current) {
|
|
139
|
-
onPrerenderComplete == null ? void 0 : onPrerenderComplete();
|
|
140
|
-
prerenderCompletedRef.current = true;
|
|
141
|
-
}
|
|
142
|
-
}, [loading]);
|
|
143
117
|
(0, import_react.useEffect)(() => {
|
|
144
118
|
const handler = (event) => {
|
|
145
119
|
var _a2;
|
|
@@ -159,37 +133,31 @@ var AddSerivce = (props) => {
|
|
|
159
133
|
const menuList = (0, import_react.useMemo)(() => {
|
|
160
134
|
var _a2, _b2, _c2;
|
|
161
135
|
return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.menu_list_tab) == null ? void 0 : _c2.menu_list) || [];
|
|
162
|
-
}, [(
|
|
136
|
+
}, [(_j = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _j.config]);
|
|
163
137
|
const customerId = (0, import_react.useMemo)(() => {
|
|
164
138
|
var _a2, _b2;
|
|
165
139
|
return ((_b2 = (_a2 = state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.id) || void 0;
|
|
166
|
-
}, [(
|
|
140
|
+
}, [(_l = (_k = state.client) == null ? void 0 : _k.value) == null ? void 0 : _l.id]);
|
|
167
141
|
const scanAddService = (0, import_ahooks.useMemoizedFn)((list, code) => {
|
|
168
|
-
let newService = [...
|
|
142
|
+
let newService = [...state.service.value];
|
|
169
143
|
list.forEach((item) => {
|
|
170
144
|
if ((0, import_utils7.isBundle)(item) || (0, import_utils7.isOption)(item)) {
|
|
171
145
|
handleSelectProduct(item);
|
|
172
146
|
return;
|
|
173
147
|
}
|
|
174
148
|
const values = (0, import_utils7.genValues)(item, code);
|
|
175
|
-
let cacheItem = (0, import_utils7.createCacheItem)(item, values,
|
|
149
|
+
let cacheItem = (0, import_utils7.createCacheItem)(item, values, state);
|
|
176
150
|
cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
|
|
151
|
+
cacheItem._holderKey = (0, import_utils6.genHolderKey)(cacheItem);
|
|
177
152
|
cacheItem.autoClose = false;
|
|
178
153
|
let { list: _list, quantity } = (0, import_utils6.addService)(
|
|
179
154
|
[...newService],
|
|
180
155
|
cacheItem,
|
|
181
|
-
|
|
156
|
+
state
|
|
182
157
|
);
|
|
183
158
|
handleAddToast(cacheItem.title, quantity);
|
|
184
159
|
newService = _list;
|
|
185
160
|
});
|
|
186
|
-
stateRef.current = {
|
|
187
|
-
...stateRef.current,
|
|
188
|
-
service: {
|
|
189
|
-
...stateRef.current.service,
|
|
190
|
-
value: newService
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
161
|
dispatch({
|
|
194
162
|
type: "setService",
|
|
195
163
|
payload: {
|
|
@@ -221,7 +189,6 @@ var AddSerivce = (props) => {
|
|
|
221
189
|
delete clickCountRef.current[productId];
|
|
222
190
|
delete debounceTimersRef.current[productId];
|
|
223
191
|
originalCallback(finalCacheValues, "", item, true);
|
|
224
|
-
lastOperationTimeRef.current = Date.now();
|
|
225
192
|
}
|
|
226
193
|
);
|
|
227
194
|
const debouncedExecuteCacheValues = (0, import_ahooks.useMemoizedFn)(
|
|
@@ -229,306 +196,303 @@ var AddSerivce = (props) => {
|
|
|
229
196
|
if (debounceTimersRef.current[productId]) {
|
|
230
197
|
clearTimeout(debounceTimersRef.current[productId]);
|
|
231
198
|
}
|
|
232
|
-
const debounceTime = Number(localStorage.getItem("pisell_service_add_debounce_time")) || 0;
|
|
233
199
|
debounceTimersRef.current[productId] = setTimeout(() => {
|
|
234
200
|
executeCacheValues(productId, cacheValues, item, callback);
|
|
235
|
-
},
|
|
201
|
+
}, 0);
|
|
236
202
|
}
|
|
237
203
|
);
|
|
238
|
-
const
|
|
239
|
-
var _a2;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
dispatch({
|
|
243
|
-
type: "setService",
|
|
244
|
-
payload: {
|
|
245
|
-
...stateRef.current.service,
|
|
246
|
-
reloadResourceModal: true
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
return false;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
return true;
|
|
253
|
-
});
|
|
254
|
-
const createCacheItemFromParams = (0, import_ahooks.useMemoizedFn)((item, params, detail) => {
|
|
255
|
-
var _a2;
|
|
256
|
-
const _detail = detail || item;
|
|
257
|
-
const other = JSON.parse(JSON.stringify(params));
|
|
258
|
-
other.session = params.session;
|
|
204
|
+
const processAddService = (0, import_ahooks.useMemoizedFn)(async (item, _detail, e, notShowToast, startDate, endDate) => {
|
|
205
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n, _o, _p;
|
|
206
|
+
const other = JSON.parse(JSON.stringify(e));
|
|
207
|
+
other.session = e.session;
|
|
259
208
|
let cacheItem = {
|
|
260
209
|
..._detail,
|
|
261
210
|
product_id: item.id,
|
|
262
211
|
_id: (0, import_utils.getUniqueId)(),
|
|
263
|
-
_key:
|
|
212
|
+
_key: e.key,
|
|
264
213
|
_extend: {
|
|
265
|
-
start_date:
|
|
266
|
-
quantity: (
|
|
214
|
+
start_date: startDate,
|
|
215
|
+
quantity: (e == null ? void 0 : e.quantity) || 1,
|
|
267
216
|
price: _detail.price,
|
|
268
217
|
product_name: item.title,
|
|
269
|
-
other
|
|
218
|
+
other,
|
|
219
|
+
end_date: endDate
|
|
270
220
|
},
|
|
271
221
|
new: 1
|
|
272
222
|
};
|
|
273
223
|
let _total = (0, import_utils2.getProductTotalPrice)(cacheItem);
|
|
274
224
|
cacheItem._extend.total = _total;
|
|
275
225
|
cacheItem._extend.origin_total = _total;
|
|
276
|
-
const _isEdit = !!
|
|
226
|
+
const _isEdit = !!stateRef.current.service.cacheItem;
|
|
277
227
|
if (_isEdit) {
|
|
278
|
-
cacheItem._id = (_a2 =
|
|
228
|
+
cacheItem._id = (_a2 = stateRef.current.service.cacheItem) == null ? void 0 : _a2._id;
|
|
279
229
|
cacheItem.new = 0;
|
|
280
230
|
}
|
|
281
231
|
if (renderMode === "current") {
|
|
282
|
-
cacheItem.currentDefaultTime =
|
|
232
|
+
cacheItem.currentDefaultTime = stateRef.current.date.value.format("HH:mm");
|
|
283
233
|
}
|
|
284
|
-
|
|
285
|
-
cacheItem = isNormalProduct ? { ...cacheItem, autoClose: true } : (0, import_utils3.getProductExtend)({
|
|
234
|
+
cacheItem = (0, import_utils3.getProductExtend)({
|
|
286
235
|
cacheItem,
|
|
287
|
-
state,
|
|
236
|
+
state: stateRef.current,
|
|
288
237
|
isDisabledTime: true
|
|
289
238
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
(val) => (0, import_utils6.isSameProduct)(val, cacheItem)
|
|
302
|
-
);
|
|
303
|
-
return ((_b2 = existingService == null ? void 0 : existingService._extend) == null ? void 0 : _b2.quantity) || 0;
|
|
304
|
-
});
|
|
305
|
-
const processAutoCloseService = (0, import_ahooks.useMemoizedFn)((cacheItem, item, detail, notShowToast) => {
|
|
306
|
-
console.time("processAutoCloseService2");
|
|
307
|
-
cacheItem.autoClose = false;
|
|
308
|
-
cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
|
|
309
|
-
const productKey = getProductKey(item, cacheItem);
|
|
310
|
-
if (pendingCacheValuesRef.current[productKey]) {
|
|
311
|
-
clickCountRef.current[productKey] = (clickCountRef.current[productKey] || 1) + 1;
|
|
312
|
-
} else {
|
|
313
|
-
pendingCacheValuesRef.current[productKey] = { cacheItem, item, detail, notShowToast };
|
|
314
|
-
clickCountRef.current[productKey] = 1;
|
|
315
|
-
}
|
|
316
|
-
if (!notShowToast) {
|
|
317
|
-
const originalQuantity = getServiceQuantity(cacheItem);
|
|
318
|
-
const currentClickCount = clickCountRef.current[productKey] || 1;
|
|
319
|
-
const totalQuantity = originalQuantity + currentClickCount;
|
|
320
|
-
handleAddToast(cacheItem.title, totalQuantity);
|
|
321
|
-
}
|
|
322
|
-
if (debounceTimersRef.current[productKey]) {
|
|
323
|
-
clearTimeout(debounceTimersRef.current[productKey]);
|
|
324
|
-
}
|
|
325
|
-
const debounceTime = Number(localStorage.getItem("pisell_service_add_debounce_time")) || 0;
|
|
326
|
-
debounceTimersRef.current[productKey] = setTimeout(() => {
|
|
327
|
-
executeServiceDispatch(productKey);
|
|
328
|
-
}, debounceTime);
|
|
329
|
-
console.timeEnd("processAutoCloseService2");
|
|
330
|
-
});
|
|
331
|
-
const executeServiceDispatch = (0, import_ahooks.useMemoizedFn)((productKey) => {
|
|
332
|
-
console.time("executeServiceDispatch");
|
|
333
|
-
console.time("executeServiceDispatch1");
|
|
334
|
-
const pendingData = pendingCacheValuesRef.current[productKey];
|
|
335
|
-
if (!pendingData) return;
|
|
336
|
-
const { cacheItem, item, detail } = pendingData;
|
|
337
|
-
const clickCount = clickCountRef.current[productKey] || 1;
|
|
338
|
-
const finalCacheItem = {
|
|
339
|
-
...cacheItem,
|
|
340
|
-
_extend: {
|
|
341
|
-
...cacheItem._extend,
|
|
342
|
-
quantity: clickCount
|
|
239
|
+
const isMultiDay = (0, import_utils3.isMultiDayProduct)(cacheItem);
|
|
240
|
+
const getMultiDayCacheItem = async (isConcatBookings) => {
|
|
241
|
+
cacheItem = await (0, import_utils3.getMultiDay)({
|
|
242
|
+
start_date: cacheItem._extend.start_date,
|
|
243
|
+
end_date: cacheItem._extend.end_date,
|
|
244
|
+
state: stateRef.current,
|
|
245
|
+
cacheItem
|
|
246
|
+
});
|
|
247
|
+
cacheItem = (0, import_utils8.createBookingItemsByGroup)(cacheItem);
|
|
248
|
+
if (isConcatBookings) {
|
|
249
|
+
cacheItem = (0, import_utils8.concatBookings)(cacheItem);
|
|
343
250
|
}
|
|
344
251
|
};
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
console.timeEnd("executeServiceDispatch addService");
|
|
353
|
-
console.time("executeServiceDispatch2");
|
|
354
|
-
window.dispatchEvent(
|
|
355
|
-
new CustomEvent("onAddNewService", {
|
|
356
|
-
detail: {
|
|
357
|
-
cacheItem: finalCacheItem
|
|
252
|
+
if (!(0, import_utils4.isNormalProductByDurationSchedule)(cacheItem) && (!cacheItem._extend.holder_id || !cacheItem._extend.holder_id.length) && !(0, import_utils2.isWalkIn)((_c2 = (_b2 = state.client) == null ? void 0 : _b2.value) == null ? void 0 : _c2.id) && ((_g2 = (_f2 = (_e2 = (_d2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _d2.config) == null ? void 0 : _e2.basic) == null ? void 0 : _f2.appointment_subject) == null ? void 0 : _g2.show_hold_on_add_cart) !== 0) {
|
|
253
|
+
const res = await handleAddHolder(cacheItem);
|
|
254
|
+
if (res && res.length > 0) {
|
|
255
|
+
cacheItem._extend.holder_id = res;
|
|
256
|
+
} else {
|
|
257
|
+
if (((_j2 = (_i2 = (_h2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _h2.config) == null ? void 0 : _i2.basic) == null ? void 0 : _j2.subject_require) === "require") {
|
|
258
|
+
return;
|
|
358
259
|
}
|
|
359
|
-
})
|
|
360
|
-
);
|
|
361
|
-
console.timeEnd("executeServiceDispatch2");
|
|
362
|
-
console.time("executeServiceDispatch3");
|
|
363
|
-
logServiceForSpecificShop(item, detail, _list);
|
|
364
|
-
stateRef.current = {
|
|
365
|
-
...stateRef.current,
|
|
366
|
-
service: {
|
|
367
|
-
...stateRef.current.service,
|
|
368
|
-
value: _list
|
|
369
260
|
}
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
261
|
+
}
|
|
262
|
+
if (stateRef.current.renderType === "eventBooking") {
|
|
263
|
+
cacheItem.autoClose = false;
|
|
264
|
+
}
|
|
265
|
+
if (cacheItem.autoClose) {
|
|
266
|
+
cacheItem.autoClose = false;
|
|
267
|
+
cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
|
|
268
|
+
if (isMultiDay) {
|
|
269
|
+
await getMultiDayCacheItem();
|
|
378
270
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
console.timeEnd("executeServiceDispatch");
|
|
382
|
-
delete pendingCacheValuesRef.current[productKey];
|
|
383
|
-
delete clickCountRef.current[productKey];
|
|
384
|
-
delete debounceTimersRef.current[productKey];
|
|
385
|
-
});
|
|
386
|
-
const processManualEditService = (0, import_ahooks.useMemoizedFn)((cacheItem) => {
|
|
387
|
-
var _a2;
|
|
388
|
-
(_a2 = window.openBookingEditModal) == null ? void 0 : _a2.call(window);
|
|
389
|
-
dispatch({
|
|
390
|
-
type: "setService",
|
|
391
|
-
payload: {
|
|
392
|
-
editModal: true,
|
|
271
|
+
let { list: _list, quantity } = (0, import_utils6.addService)(
|
|
272
|
+
[...stateRef.current.service.value],
|
|
393
273
|
cacheItem,
|
|
394
|
-
|
|
395
|
-
|
|
274
|
+
stateRef.current,
|
|
275
|
+
isMultiDay
|
|
276
|
+
);
|
|
277
|
+
if (!notShowToast) {
|
|
278
|
+
handleAddToast(cacheItem.title, quantity || 1);
|
|
396
279
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
280
|
+
window.dispatchEvent(
|
|
281
|
+
new CustomEvent("onAddNewService", {
|
|
282
|
+
detail: {
|
|
283
|
+
cacheItem
|
|
284
|
+
}
|
|
285
|
+
})
|
|
286
|
+
);
|
|
287
|
+
try {
|
|
288
|
+
if (((_o = (_n = (_m = (_l2 = (_k2 = context.appHelper.utils.store) == null ? void 0 : _k2.getState) == null ? void 0 : _l2.call(_k2)) == null ? void 0 : _m.global) == null ? void 0 : _n.globalConfig) == null ? void 0 : _o.id) === 2155) {
|
|
289
|
+
const val = _list == null ? void 0 : _list.map((s) => {
|
|
290
|
+
return {
|
|
291
|
+
product_id: s == null ? void 0 : s.product_id,
|
|
292
|
+
detailId: s == null ? void 0 : s.id,
|
|
293
|
+
detailProductId: s == null ? void 0 : s.product_id,
|
|
294
|
+
product_name: s == null ? void 0 : s.title,
|
|
295
|
+
price: s == null ? void 0 : s.price,
|
|
296
|
+
_id: s == null ? void 0 : s._id,
|
|
297
|
+
_key: s == null ? void 0 : s._key,
|
|
298
|
+
_serviceKey: s == null ? void 0 : s._serviceKey
|
|
299
|
+
};
|
|
300
|
+
});
|
|
301
|
+
const sendData = {
|
|
302
|
+
product_id: item == null ? void 0 : item.id,
|
|
303
|
+
detailId: _detail == null ? void 0 : _detail.id,
|
|
304
|
+
detailProductId: _detail == null ? void 0 : _detail.product_id,
|
|
305
|
+
product_name: item == null ? void 0 : item.title,
|
|
306
|
+
price: _detail == null ? void 0 : _detail.price,
|
|
307
|
+
serviceVal: val
|
|
414
308
|
};
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
{ key: "添加数据", value: JSON.stringify(sendData) },
|
|
428
|
-
{
|
|
429
|
-
key: "日期",
|
|
430
|
-
value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
|
|
431
|
-
}
|
|
432
|
-
]
|
|
433
|
-
});
|
|
309
|
+
(0, import_utils.sendWarningLog)({
|
|
310
|
+
title: "addService",
|
|
311
|
+
content: [
|
|
312
|
+
{ key: "添加数据", value: JSON.stringify(sendData) },
|
|
313
|
+
{
|
|
314
|
+
key: "日期",
|
|
315
|
+
value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
} catch (error) {
|
|
434
321
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
const handleBooking4Service = (0, import_ahooks.useMemoizedFn)((item, params, detail, notShowToast) => {
|
|
445
|
-
const cacheItem = createCacheItemFromParams(item, params, detail);
|
|
446
|
-
if (cacheItem.autoClose) {
|
|
447
|
-
processAutoCloseService(cacheItem, item, detail, notShowToast);
|
|
322
|
+
dispatch({
|
|
323
|
+
type: "setService",
|
|
324
|
+
payload: {
|
|
325
|
+
addModal: false,
|
|
326
|
+
value: _list,
|
|
327
|
+
edit: true,
|
|
328
|
+
changeService: false
|
|
329
|
+
}
|
|
330
|
+
});
|
|
448
331
|
} else {
|
|
449
|
-
|
|
332
|
+
(_p = window.openBookingEditModal) == null ? void 0 : _p.call(window);
|
|
333
|
+
if (isMultiDay) {
|
|
334
|
+
await getMultiDayCacheItem(true);
|
|
335
|
+
}
|
|
336
|
+
dispatch({
|
|
337
|
+
type: "setService",
|
|
338
|
+
payload: {
|
|
339
|
+
editModal: true,
|
|
340
|
+
cacheItem,
|
|
341
|
+
addModal: !cacheItem.autoClose,
|
|
342
|
+
changeService: false
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
onEdit == null ? void 0 : onEdit(cacheItem);
|
|
450
346
|
}
|
|
451
347
|
});
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
console.timeEnd("processAutoCloseService");
|
|
465
|
-
} else {
|
|
466
|
-
processManualEditService(cacheItem);
|
|
348
|
+
const handleMultiDayConfirm = (0, import_ahooks.useMemoizedFn)(async (startDate, endDate, duration) => {
|
|
349
|
+
if (!pendingMultiDayData) return;
|
|
350
|
+
setMultiDayModalLoading(true);
|
|
351
|
+
try {
|
|
352
|
+
const { item, detail, e, notShowToast } = pendingMultiDayData;
|
|
353
|
+
await processAddService(item, detail, e, notShowToast, startDate, endDate);
|
|
354
|
+
setPendingMultiDayData(null);
|
|
355
|
+
setMultiDayModalOpen(false);
|
|
356
|
+
} catch (error) {
|
|
357
|
+
console.error("添加跨日商品失败:", error);
|
|
358
|
+
} finally {
|
|
359
|
+
setMultiDayModalLoading(false);
|
|
467
360
|
}
|
|
468
361
|
});
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
if (!isBooking4) {
|
|
473
|
-
await handleBookingCreation(item, e, detail);
|
|
474
|
-
return;
|
|
475
|
-
}
|
|
476
|
-
handleBooking4Service(item, e, detail, notShowToast);
|
|
477
|
-
};
|
|
362
|
+
const handleMultiDayCancel = (0, import_ahooks.useMemoizedFn)(() => {
|
|
363
|
+
setMultiDayModalOpen(false);
|
|
364
|
+
setPendingMultiDayData(null);
|
|
478
365
|
});
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
date: state.date.value.format("YYYY-MM-DD"),
|
|
488
|
-
productDetail: item,
|
|
489
|
-
showConfig: {
|
|
490
|
-
option: true,
|
|
491
|
-
session: isSession,
|
|
492
|
-
variant: true,
|
|
493
|
-
package: true,
|
|
494
|
-
number: (0, import_utils6.getIsShowNumber)(item, state)
|
|
495
|
-
},
|
|
496
|
-
isOnlySession,
|
|
497
|
-
is_eject: isEject ? 1 : 0,
|
|
498
|
-
customer_id: customerId,
|
|
499
|
-
isOS: isSession
|
|
500
|
-
},
|
|
501
|
-
onCancel: () => {
|
|
502
|
-
setCurrentProduct(null);
|
|
503
|
-
},
|
|
504
|
-
callback: createProductModalCallback(item)
|
|
366
|
+
const handleAddHolder = (0, import_ahooks.useMemoizedFn)(async (cacheItem) => {
|
|
367
|
+
var _a2, _b2, _c2;
|
|
368
|
+
const holderConfig = ((_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.bookingConfig) == null ? void 0 : _b2.holder) || {};
|
|
369
|
+
const currentMaxSelectedCount = (holderConfig == null ? void 0 : holderConfig.maxSelectedCount) || ((_c2 = cacheItem == null ? void 0 : cacheItem._extend) == null ? void 0 : _c2.quantity) || 1;
|
|
370
|
+
const result = await (0, import_selectHolderModal.selectHolderModal)({
|
|
371
|
+
state: stateRef.current,
|
|
372
|
+
dispatch,
|
|
373
|
+
maxSelectedCount: currentMaxSelectedCount
|
|
505
374
|
});
|
|
375
|
+
return result;
|
|
506
376
|
});
|
|
507
377
|
const handleSelectProduct = (0, import_ahooks.useMemoizedFn)(
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
378
|
+
(item, type = "select") => {
|
|
379
|
+
var _a2, _b2, _c2, _d2;
|
|
380
|
+
if (!(0, import_utils4.isNormalProductByDurationSchedule)(item)) {
|
|
381
|
+
if (!Array.isArray((_a2 = state.service) == null ? void 0 : _a2.resourcesOrigin) || !state.service.resourcesOrigin.length) {
|
|
382
|
+
dispatch({
|
|
383
|
+
type: "setService",
|
|
384
|
+
payload: {
|
|
385
|
+
...stateRef.current.service,
|
|
386
|
+
reloadResourceModal: true
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
514
391
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
392
|
+
const isSession = (0, import_utils2.isSessionProduct)(item);
|
|
393
|
+
const isEject = (0, import_utils2.getIsEject)(item, type);
|
|
394
|
+
const isOnlySession = (0, import_utils2.getIsOnlySession)(item);
|
|
395
|
+
let lock = false;
|
|
396
|
+
let cacheValues = null;
|
|
397
|
+
if (isEject) {
|
|
398
|
+
setCurrentProduct(item);
|
|
399
|
+
} else {
|
|
400
|
+
setCurrentProduct(null);
|
|
401
|
+
if ((item == null ? void 0 : item.extension_type) === "normal") {
|
|
402
|
+
cacheValues = {
|
|
403
|
+
bundle: [],
|
|
404
|
+
key: item.id,
|
|
405
|
+
option: [],
|
|
406
|
+
product_id: item.id,
|
|
407
|
+
product_variant_id: 0,
|
|
408
|
+
quantity: 1,
|
|
409
|
+
rowKey: item.id,
|
|
410
|
+
session: null,
|
|
411
|
+
unique: "08974625397",
|
|
412
|
+
_originalItem: item
|
|
413
|
+
// 保存原始商品信息
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
const callback = async (e, extension_type, detail, notShowToast) => {
|
|
418
|
+
debugger;
|
|
419
|
+
setCurrentProduct(null);
|
|
420
|
+
if (lock) {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
lock = true;
|
|
424
|
+
setTimeout(() => {
|
|
425
|
+
lock = false;
|
|
426
|
+
}, 2e3);
|
|
427
|
+
if (!isBooking4) {
|
|
428
|
+
const data = await createBookingData({
|
|
429
|
+
product: { ...detail || item, _params: e }
|
|
430
|
+
});
|
|
431
|
+
createBooking({ booking: data });
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
const _detail = detail || item;
|
|
435
|
+
const isMultiDay = (0, import_utils3.isMultiDayProduct)(_detail || item);
|
|
436
|
+
if (isMultiDay) {
|
|
437
|
+
setPendingMultiDayData({
|
|
438
|
+
item,
|
|
439
|
+
detail: _detail,
|
|
440
|
+
e,
|
|
441
|
+
notShowToast
|
|
442
|
+
});
|
|
443
|
+
setMultiDayModalOpen(true);
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
await processAddService(item, _detail, e, notShowToast, state.date.value);
|
|
447
|
+
};
|
|
448
|
+
if (cacheValues) {
|
|
449
|
+
const productId = item.id.toString();
|
|
450
|
+
if (pendingCacheValuesRef.current[productId]) {
|
|
451
|
+
clickCountRef.current[productId] = (clickCountRef.current[productId] || 1) + 1;
|
|
452
|
+
} else {
|
|
453
|
+
pendingCacheValuesRef.current[productId] = cacheValues;
|
|
454
|
+
clickCountRef.current[productId] = 1;
|
|
455
|
+
}
|
|
456
|
+
const cacheItem = (0, import_utils6.createSimpleCacheItem)(item, cacheValues, state);
|
|
457
|
+
const detail = (_b2 = stateRef.current.service.value) == null ? void 0 : _b2.find(
|
|
458
|
+
(val) => (0, import_utils6.isSameProduct)(val, cacheItem)
|
|
459
|
+
);
|
|
460
|
+
const originalQuantity = ((_c2 = detail == null ? void 0 : detail._extend) == null ? void 0 : _c2.quantity) || 0;
|
|
461
|
+
(_d2 = Toast == null ? void 0 : Toast.success) == null ? void 0 : _d2.call(
|
|
462
|
+
Toast,
|
|
463
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-title" }, item.title), /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-quantity" }, import_utils.locales.getText("pisell2.ticket-booking.in-cart")(
|
|
464
|
+
(clickCountRef.current[productId] || 1) + originalQuantity
|
|
465
|
+
)))
|
|
466
|
+
);
|
|
467
|
+
debouncedExecuteCacheValues(productId, cacheValues, item, callback);
|
|
518
468
|
return;
|
|
519
469
|
}
|
|
520
|
-
|
|
470
|
+
state.action({
|
|
471
|
+
type: "pisell1.handleOpenProductModal",
|
|
472
|
+
data: {
|
|
473
|
+
id: item.id,
|
|
474
|
+
date: state.date.value.format("YYYY-MM-DD"),
|
|
475
|
+
showConfig: {
|
|
476
|
+
option: true,
|
|
477
|
+
session: isSession,
|
|
478
|
+
variant: true,
|
|
479
|
+
package: true,
|
|
480
|
+
number: (0, import_utils6.getIsShowNumber)(item, state)
|
|
481
|
+
},
|
|
482
|
+
isOnlySession,
|
|
483
|
+
is_eject: isEject ? 1 : 0,
|
|
484
|
+
customer_id: customerId,
|
|
485
|
+
isOS: isSession
|
|
486
|
+
},
|
|
487
|
+
onCancel: () => {
|
|
488
|
+
setCurrentProduct(null);
|
|
489
|
+
},
|
|
490
|
+
callback
|
|
491
|
+
});
|
|
521
492
|
}
|
|
522
493
|
);
|
|
523
494
|
const renderList = (0, import_react.useMemo)(() => {
|
|
524
495
|
let _list = products || [];
|
|
525
|
-
if ((0, import_utils4.isDaysBooking)(state)) {
|
|
526
|
-
if (!(0, import_utils4.holderId)(state)) {
|
|
527
|
-
_list = _list.filter(
|
|
528
|
-
(item) => (0, import_utils4.isNormalProductByDurationSchedule)(item)
|
|
529
|
-
);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
496
|
return _list;
|
|
533
497
|
}, [products, state == null ? void 0 : state.activeCartId]);
|
|
534
498
|
const currentDate = (0, import_react.useMemo)(() => {
|
|
@@ -538,20 +502,7 @@ var AddSerivce = (props) => {
|
|
|
538
502
|
return state.date.value.format("YYYY-MM-DD HH:mm:ss");
|
|
539
503
|
}, [state.date.value]);
|
|
540
504
|
(0, import_react.useEffect)(() => {
|
|
541
|
-
if (renderMode === "current" && state.bookingConfig
|
|
542
|
-
getProducts({
|
|
543
|
-
schedule_date: currentDate,
|
|
544
|
-
customer_id: customerId,
|
|
545
|
-
menu_list_ids: menuList,
|
|
546
|
-
schedule_datetime: currentDatetime
|
|
547
|
-
});
|
|
548
|
-
getScheduleTimePoints({
|
|
549
|
-
menu_list_ids: menuList
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
}, [renderMode, customerId, menuList]);
|
|
553
|
-
(0, import_react.useEffect)(() => {
|
|
554
|
-
if (renderMode === "current" && state.bookingConfig && platform === "shop") {
|
|
505
|
+
if (renderMode === "current" && state.bookingConfig) {
|
|
555
506
|
getProducts({
|
|
556
507
|
schedule_date: currentDate,
|
|
557
508
|
customer_id: customerId,
|
|
@@ -576,6 +527,7 @@ var AddSerivce = (props) => {
|
|
|
576
527
|
return resolvedConfig;
|
|
577
528
|
}, [productDisplayConfig]);
|
|
578
529
|
return (0, import_react.useMemo)(() => {
|
|
530
|
+
var _a2;
|
|
579
531
|
if (renderMode === "current") {
|
|
580
532
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
581
533
|
import_ProductDisplayAdapter.default,
|
|
@@ -586,7 +538,18 @@ var AddSerivce = (props) => {
|
|
|
586
538
|
currentProductId: currentProduct == null ? void 0 : currentProduct.id,
|
|
587
539
|
onSelectProduct: handleSelectProduct
|
|
588
540
|
}
|
|
589
|
-
), /* @__PURE__ */ import_react.default.createElement(import_notAvailable.default, { ref: notAvailableRef })
|
|
541
|
+
), /* @__PURE__ */ import_react.default.createElement(import_notAvailable.default, { ref: notAvailableRef }), /* @__PURE__ */ import_react.default.createElement(
|
|
542
|
+
import_MultiDayTimeSelectModal.default,
|
|
543
|
+
{
|
|
544
|
+
open: multiDayModalOpen,
|
|
545
|
+
productName: (_a2 = pendingMultiDayData == null ? void 0 : pendingMultiDayData.item) == null ? void 0 : _a2.title,
|
|
546
|
+
locale: state == null ? void 0 : state.locale,
|
|
547
|
+
defaultStartDate: state.date.value,
|
|
548
|
+
loading: multiDayModalLoading,
|
|
549
|
+
onConfirm: handleMultiDayConfirm,
|
|
550
|
+
onCancel: handleMultiDayCancel
|
|
551
|
+
}
|
|
552
|
+
), /* @__PURE__ */ import_react.default.createElement(import_selectHolderModal.SelectHolderModal, null));
|
|
590
553
|
}
|
|
591
554
|
return null;
|
|
592
555
|
}, [
|
|
@@ -601,7 +564,10 @@ var AddSerivce = (props) => {
|
|
|
601
564
|
loading,
|
|
602
565
|
currentProduct,
|
|
603
566
|
isBooking4,
|
|
604
|
-
finalDisplayConfig
|
|
567
|
+
finalDisplayConfig,
|
|
568
|
+
multiDayModalOpen,
|
|
569
|
+
pendingMultiDayData,
|
|
570
|
+
multiDayModalLoading
|
|
605
571
|
]);
|
|
606
572
|
};
|
|
607
573
|
var addService_default = AddSerivce;
|