@pisell/private-materials 6.5.27 → 6.6.2
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/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/addService/utils.d.ts +1 -1
- 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 +9 -1
- 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/hooks/useWalletPass.d.ts +1 -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/pisellSelectCustomerModal/RightPanel/serve.js +1 -5
- 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 +421 -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/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/addService/utils.d.ts +1 -1
- 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 +9 -1
- 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/hooks/useWalletPass.d.ts +1 -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/pisellSelectCustomerModal/RightPanel/serve.js +1 -8
- 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 +281 -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
|
@@ -14,7 +14,7 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
14
14
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
15
15
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
16
16
|
import { useState, useEffect, useMemo } from 'react';
|
|
17
|
-
import { locales } from
|
|
17
|
+
import { locales } from '@pisell/utils';
|
|
18
18
|
import { usePisellOS } from "../../hooks/useEngineContext";
|
|
19
19
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
20
20
|
import { sortResources, getCustomer, currentAppointmentBoard, currentRenderLists, getFormInsertBeforeKey, checkAndGoNext, checkAndMarkCartRenderError, formatHolder, Toast } from "./utils";
|
|
@@ -37,7 +37,7 @@ export var contextUtils = function contextUtils() {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* @title: 监听步骤发生变化
|
|
40
|
-
* @description:
|
|
40
|
+
* @description:
|
|
41
41
|
* @return {*}
|
|
42
42
|
* @Author: WangHan
|
|
43
43
|
* @Date: 2025-04-15 11:11
|
|
@@ -143,56 +143,56 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
143
143
|
var currentSelectedResources = appointmentBooking.getOtherData('current_selected_resources');
|
|
144
144
|
|
|
145
145
|
// 先确定点击时的步骤,如果当前步骤是选择服务
|
|
146
|
-
if (!isRetailTemplate && currentKey ===
|
|
146
|
+
if (!isRetailTemplate && currentKey === 'select-service') {
|
|
147
147
|
var _appointmentBooking$o, _stepList, _stepList2;
|
|
148
148
|
var _ref3 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.productModuleParams) || {},
|
|
149
149
|
bookingProcess = _ref3.bookingProcess;
|
|
150
|
-
var isDateSelectedFirst = bookingProcess ===
|
|
150
|
+
var isDateSelectedFirst = bookingProcess === 'date_first';
|
|
151
151
|
var hasResourceStep = (_stepList = stepList) === null || _stepList === void 0 ? void 0 : _stepList.find(function (item) {
|
|
152
|
-
return (item === null || item === void 0 ? void 0 : item.key) ===
|
|
152
|
+
return (item === null || item === void 0 ? void 0 : item.key) === 'select-resource';
|
|
153
153
|
});
|
|
154
154
|
var hasSelectGuestStep = (_stepList2 = stepList) === null || _stepList2 === void 0 || (_stepList2 = _stepList2.find(function (item) {
|
|
155
|
-
return (item === null || item === void 0 ? void 0 : item.key) ===
|
|
155
|
+
return (item === null || item === void 0 ? void 0 : item.key) === 'select-guest';
|
|
156
156
|
})) === null || _stepList2 === void 0 ? void 0 : _stepList2.key;
|
|
157
157
|
// 判断购物车里是否全是是普通商品
|
|
158
158
|
var isAllNormalProduct = appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.isCartAllNormalProducts();
|
|
159
159
|
if (isAllNormalProduct) {
|
|
160
|
-
removeStep(
|
|
161
|
-
removeStep(
|
|
160
|
+
removeStep('select-resource');
|
|
161
|
+
removeStep('select-time');
|
|
162
162
|
removeStep('fill-form');
|
|
163
163
|
if (!isDateSelectedFirst) {
|
|
164
|
-
removeStep(
|
|
164
|
+
removeStep('select-date');
|
|
165
165
|
}
|
|
166
166
|
} else if (!hasResourceStep) {
|
|
167
167
|
// 如果不全是普通商品,并且还没有选择资源步骤,证明之前被删除过,要给她加回来
|
|
168
168
|
// 判断当前步骤里有没有添加预约人,如果有的话则应该是在添加预约人之后添加步骤
|
|
169
|
-
var targetKey = hasSelectGuestStep ? hasSelectGuestStep :
|
|
169
|
+
var targetKey = hasSelectGuestStep ? hasSelectGuestStep : 'select-service';
|
|
170
170
|
var isHasDurationProduct = appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.isCartHasDurationProduct();
|
|
171
171
|
// 如果购物车里有 duration 商品(目前来说,只能是纯 duration 商品)
|
|
172
172
|
if (isHasDurationProduct) {
|
|
173
173
|
// 如果是先选商品,则添加日期、资源、时间步骤
|
|
174
174
|
if (!isDateSelectedFirst) {
|
|
175
175
|
appointmentBooking.addStep({
|
|
176
|
-
key:
|
|
177
|
-
description: locales.getText(
|
|
176
|
+
key: 'select-date',
|
|
177
|
+
description: locales.getText('pisell2.appointment.select.date')
|
|
178
178
|
}, targetKey);
|
|
179
|
-
targetKey =
|
|
179
|
+
targetKey = 'select-date';
|
|
180
180
|
}
|
|
181
181
|
// 如果是先选日期,则添加资源、时间
|
|
182
182
|
appointmentBooking.addStep({
|
|
183
|
-
key:
|
|
184
|
-
description: locales.getText(
|
|
183
|
+
key: 'select-resource',
|
|
184
|
+
description: locales.getText('pisell2.appointment.select.resource')
|
|
185
185
|
}, targetKey);
|
|
186
|
-
targetKey =
|
|
186
|
+
targetKey = 'select-resource';
|
|
187
187
|
appointmentBooking.addStep({
|
|
188
|
-
key:
|
|
189
|
-
description: locales.getText(
|
|
188
|
+
key: 'select-time',
|
|
189
|
+
description: locales.getText('pisell2.appointment.select.time')
|
|
190
190
|
}, targetKey);
|
|
191
191
|
} else {
|
|
192
192
|
// 如果购物车里是session 商品,则只添加选择资源步骤
|
|
193
193
|
appointmentBooking.addStep({
|
|
194
|
-
key:
|
|
195
|
-
description: locales.getText(
|
|
194
|
+
key: 'select-resource',
|
|
195
|
+
description: locales.getText('pisell2.appointment.select.resource')
|
|
196
196
|
}, targetKey);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
@@ -381,7 +381,6 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
381
381
|
// // getHolders();
|
|
382
382
|
// // }
|
|
383
383
|
// // }
|
|
384
|
-
|
|
385
384
|
// // 继续后续流程
|
|
386
385
|
// checkHolder()
|
|
387
386
|
// }
|
|
@@ -434,7 +433,7 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
434
433
|
|
|
435
434
|
/**
|
|
436
435
|
* @title: 获取商品数据
|
|
437
|
-
* @description:
|
|
436
|
+
* @description:
|
|
438
437
|
* @return {*}
|
|
439
438
|
* @Author: WangHan
|
|
440
439
|
* @Date: 2025-04-15 11:12
|
|
@@ -525,7 +524,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
525
524
|
|
|
526
525
|
/**
|
|
527
526
|
* @title: 更新购物车数据
|
|
528
|
-
* @description:
|
|
527
|
+
* @description:
|
|
529
528
|
* @return {*}
|
|
530
529
|
* @Author: WangHan
|
|
531
530
|
* @Date: 2025-04-15 11:12
|
|
@@ -612,7 +611,7 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
612
611
|
|
|
613
612
|
/**
|
|
614
613
|
* @title: 获取登录状态
|
|
615
|
-
* @description:
|
|
614
|
+
* @description:
|
|
616
615
|
* @return {*}
|
|
617
616
|
* @Author: WangHan
|
|
618
617
|
* @Date: 2025-04-15 11:14
|
|
@@ -640,7 +639,7 @@ export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
|
|
|
640
639
|
|
|
641
640
|
/**
|
|
642
641
|
* @title: 获取账户
|
|
643
|
-
* @description:
|
|
642
|
+
* @description:
|
|
644
643
|
* @return {*}
|
|
645
644
|
* @Author: WangHan
|
|
646
645
|
* @Date: 2025-04-15 11:15
|
|
@@ -790,7 +789,7 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
790
789
|
|
|
791
790
|
/**
|
|
792
791
|
* @title: 获取资源数据
|
|
793
|
-
* @description:
|
|
792
|
+
* @description:
|
|
794
793
|
* @return {*}
|
|
795
794
|
* @Author: WangHan
|
|
796
795
|
* @Date: 2025-04-15 11:29
|
|
@@ -855,7 +854,7 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
855
854
|
|
|
856
855
|
/**
|
|
857
856
|
* @title: 是否跳过资源选择步骤
|
|
858
|
-
* @description:
|
|
857
|
+
* @description:
|
|
859
858
|
* @return {*}
|
|
860
859
|
* @Author: WangHan
|
|
861
860
|
* @Date: 2025-04-21 11:47
|
|
@@ -937,13 +936,13 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
937
936
|
|
|
938
937
|
/**
|
|
939
938
|
* @title: 获取预约配置
|
|
940
|
-
* @description:
|
|
939
|
+
* @description:
|
|
941
940
|
* @return {*}
|
|
942
941
|
* @Author: WangHan
|
|
943
942
|
* @Date: 2025-04-24 18:15
|
|
944
943
|
*/
|
|
945
944
|
export var useAppointmentBookingSetting = function useAppointmentBookingSetting() {
|
|
946
|
-
var _appointmentBooking$o4, _appointmentBooking$o5;
|
|
945
|
+
var _appointmentBooking$o4, _appointmentBooking$o5, _appointmentBooking$o6;
|
|
947
946
|
var utils = contextUtils();
|
|
948
947
|
var _ref28 = useAppointmentBookingContext(),
|
|
949
948
|
appointmentBooking = _ref28.appointmentBooking;
|
|
@@ -977,6 +976,7 @@ export var useAppointmentBookingSetting = function useAppointmentBookingSetting(
|
|
|
977
976
|
bookingSubject: bookingSubject,
|
|
978
977
|
setOtherData: setOtherData,
|
|
979
978
|
getOtherData: getOtherData,
|
|
980
|
-
formName: formName
|
|
979
|
+
formName: formName,
|
|
980
|
+
bookingSetting: (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o6 = appointmentBooking.otherParams) === null || _appointmentBooking$o6 === void 0 ? void 0 : _appointmentBooking$o6.bookingSetting) || {}
|
|
981
981
|
};
|
|
982
982
|
};
|
|
@@ -117,6 +117,7 @@ declare const _default: {
|
|
|
117
117
|
'pisell2.text.goodpass.code-invalid-cart': string;
|
|
118
118
|
'pisell2.text.goodpass.login': string;
|
|
119
119
|
'pisell2.text.goodpass.login-tip': string;
|
|
120
|
+
'pisell2.text.contact-info.title': string;
|
|
120
121
|
};
|
|
121
122
|
'zh-CN': {
|
|
122
123
|
'pisell2.event.calendar.limit.unavailable': string;
|
|
@@ -236,6 +237,7 @@ declare const _default: {
|
|
|
236
237
|
'pisell2.text.goodpass.code-invalid-cart': string;
|
|
237
238
|
'pisell2.text.goodpass.login': string;
|
|
238
239
|
'pisell2.text.goodpass.login-tip': string;
|
|
240
|
+
'pisell2.text.contact-info.title': string;
|
|
239
241
|
};
|
|
240
242
|
'zh-HK': {
|
|
241
243
|
'pisell2.event.calendar.limit.unavailable': string;
|
|
@@ -355,6 +357,7 @@ declare const _default: {
|
|
|
355
357
|
'pisell2.text.goodpass.code-invalid-cart': string;
|
|
356
358
|
'pisell2.text.goodpass.login': string;
|
|
357
359
|
'pisell2.text.goodpass.login-tip': string;
|
|
360
|
+
'pisell2.text.contact-info.title': string;
|
|
358
361
|
};
|
|
359
362
|
};
|
|
360
363
|
export default _default;
|
|
@@ -132,9 +132,10 @@ export default {
|
|
|
132
132
|
'pisell2.text.goodpass.code': 'Code',
|
|
133
133
|
'pisell2.text.goodpass.enter-code': 'Enter Code',
|
|
134
134
|
'pisell2.text.goodpass.code-invalid': 'Current code is invalid',
|
|
135
|
-
'pisell2.text.goodpass.code-invalid-cart':
|
|
135
|
+
'pisell2.text.goodpass.code-invalid-cart': 'No eligible items in the cart',
|
|
136
136
|
'pisell2.text.goodpass.login': 'Login',
|
|
137
|
-
'pisell2.text.goodpass.login-tip': ' for member benefit Or use account credit'
|
|
137
|
+
'pisell2.text.goodpass.login-tip': ' for member benefit Or use account credit',
|
|
138
|
+
'pisell2.text.contact-info.title': 'Contact info'
|
|
138
139
|
},
|
|
139
140
|
'zh-CN': {
|
|
140
141
|
'pisell2.event.calendar.limit.unavailable': '不可预约',
|
|
@@ -269,9 +270,10 @@ export default {
|
|
|
269
270
|
'pisell2.text.goodpass.code': '券码',
|
|
270
271
|
'pisell2.text.goodpass.enter-code': '请输入券码',
|
|
271
272
|
'pisell2.text.goodpass.code-invalid': '当前券码不可用',
|
|
272
|
-
'pisell2.text.goodpass.code-invalid-cart':
|
|
273
|
+
'pisell2.text.goodpass.code-invalid-cart': '当前购物车中无可用商品',
|
|
273
274
|
'pisell2.text.goodpass.login': '登录',
|
|
274
|
-
'pisell2.text.goodpass.login-tip': '以获取会员福利或使用账户积分'
|
|
275
|
+
'pisell2.text.goodpass.login-tip': '以获取会员福利或使用账户积分',
|
|
276
|
+
'pisell2.text.contact-info.title': '联系信息'
|
|
275
277
|
},
|
|
276
278
|
'zh-HK': {
|
|
277
279
|
'pisell2.event.calendar.limit.unavailable': '不可預約',
|
|
@@ -406,8 +408,9 @@ export default {
|
|
|
406
408
|
'pisell2.text.goodpass.code': '券碼',
|
|
407
409
|
'pisell2.text.goodpass.enter-code': '請輸入券碼',
|
|
408
410
|
'pisell2.text.goodpass.code-invalid': '當前券碼不可用',
|
|
409
|
-
'pisell2.text.goodpass.code-invalid-cart':
|
|
411
|
+
'pisell2.text.goodpass.code-invalid-cart': '當前購物車中無可用商品',
|
|
410
412
|
'pisell2.text.goodpass.login': '登錄',
|
|
411
|
-
'pisell2.text.goodpass.login-tip': '以獲取會員福利或使用賬戶積分'
|
|
413
|
+
'pisell2.text.goodpass.login-tip': '以獲取會員福利或使用賬戶積分',
|
|
414
|
+
'pisell2.text.contact-info.title': '聯繫信息'
|
|
412
415
|
}
|
|
413
416
|
};
|
|
@@ -3,12 +3,12 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
|
|
|
3
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
5
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
9
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
10
11
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
12
12
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
13
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
14
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -41,7 +41,7 @@ var createToastContent = function createToastContent(text) {
|
|
|
41
41
|
}, text);
|
|
42
42
|
};
|
|
43
43
|
var ActionButtons = function ActionButtons(_ref) {
|
|
44
|
-
var _context$appHelper, _state$
|
|
44
|
+
var _context$appHelper, _state$service3, _state$addons2, _state$service5, _state$service7, _context$appHelper3, _state$service9, _state$addons4, _context$appHelper4, _context$appHelper4$g;
|
|
45
45
|
var state = _ref.state,
|
|
46
46
|
dispatch = _ref.dispatch,
|
|
47
47
|
_ref$disabled = _ref.disabled,
|
|
@@ -77,6 +77,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
77
77
|
|
|
78
78
|
// 将选中的客户数据传递给状态管理
|
|
79
79
|
var changeCustomerToGlobalState = useMemoizedFn(function (value) {
|
|
80
|
+
var _state$service;
|
|
80
81
|
dispatch({
|
|
81
82
|
type: 'setClient',
|
|
82
83
|
payload: {
|
|
@@ -84,6 +85,21 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
84
85
|
edit: true
|
|
85
86
|
}
|
|
86
87
|
});
|
|
88
|
+
if (state !== null && state !== void 0 && (_state$service = state.service) !== null && _state$service !== void 0 && (_state$service = _state$service.value) !== null && _state$service !== void 0 && _state$service.length) {
|
|
89
|
+
// 还需要清空商品内的 holder 信息
|
|
90
|
+
dispatch({
|
|
91
|
+
type: 'setService',
|
|
92
|
+
payload: {
|
|
93
|
+
value: state.service.value.map(function (item) {
|
|
94
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
95
|
+
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
96
|
+
holder_id: []
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
87
103
|
});
|
|
88
104
|
var _useCustomer = useCustomer({
|
|
89
105
|
changeCustomerToGlobalState: changeCustomerToGlobalState
|
|
@@ -155,9 +171,9 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
155
171
|
|
|
156
172
|
// 检查是否有购物车内容
|
|
157
173
|
var hasCartItems = useMemo(function () {
|
|
158
|
-
var _state$
|
|
159
|
-
return ((state === null || state === void 0 || (_state$
|
|
160
|
-
}, [state === null || state === void 0 || (_state$
|
|
174
|
+
var _state$service2, _state$addons;
|
|
175
|
+
return ((state === null || state === void 0 || (_state$service2 = state.service) === null || _state$service2 === void 0 || (_state$service2 = _state$service2.value) === null || _state$service2 === void 0 ? void 0 : _state$service2.length) || 0) + ((state === null || state === void 0 || (_state$addons = state.addons) === null || _state$addons === void 0 || (_state$addons = _state$addons.value) === null || _state$addons === void 0 ? void 0 : _state$addons.length) || 0) > 0;
|
|
176
|
+
}, [state === null || state === void 0 || (_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.value, state === null || state === void 0 || (_state$addons2 = state.addons) === null || _state$addons2 === void 0 ? void 0 : _state$addons2.value]);
|
|
161
177
|
|
|
162
178
|
// 检查是否禁用编辑
|
|
163
179
|
var isDisabledEdit = useMemo(function () {
|
|
@@ -194,8 +210,8 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
194
210
|
// 计算已使用的券数量
|
|
195
211
|
var usedVouchersCount = useMemo(function () {
|
|
196
212
|
try {
|
|
197
|
-
var _state$
|
|
198
|
-
if (!((_state$
|
|
213
|
+
var _state$service4;
|
|
214
|
+
if (!((_state$service4 = state.service) !== null && _state$service4 !== void 0 && (_state$service4 = _state$service4.value) !== null && _state$service4 !== void 0 && _state$service4.length)) {
|
|
199
215
|
return 0;
|
|
200
216
|
}
|
|
201
217
|
// 直接从全局折扣券列表中计算被选中的数量,避免重复计数
|
|
@@ -206,14 +222,14 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
206
222
|
console.error('计算已使用券数量失败:', error);
|
|
207
223
|
return 0;
|
|
208
224
|
}
|
|
209
|
-
}, [discountList, (_state$
|
|
225
|
+
}, [discountList, (_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : _state$service5.value]);
|
|
210
226
|
|
|
211
227
|
// 判断是否有券可用但手动取消使用(显示红色感叹号)
|
|
212
228
|
var shouldShowWarning = useMemo(function () {
|
|
213
229
|
try {
|
|
214
|
-
var _state$
|
|
230
|
+
var _state$service6;
|
|
215
231
|
// 条件:购物车不为空 && discountList 长度大于 0,且没有 isSelected 的优惠券,且有 isManualSelect 的优惠券
|
|
216
|
-
return ((_state$
|
|
232
|
+
return ((_state$service6 = state.service) === null || _state$service6 === void 0 || (_state$service6 = _state$service6.value) === null || _state$service6 === void 0 ? void 0 : _state$service6.length) > 0 && discountList.length > 0 && !discountList.some(function (discount) {
|
|
217
233
|
return discount.isSelected;
|
|
218
234
|
}) && discountList.some(function (discount) {
|
|
219
235
|
return discount.isManualSelect;
|
|
@@ -222,7 +238,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
222
238
|
console.error('判断警告状态失败:', error);
|
|
223
239
|
return false;
|
|
224
240
|
}
|
|
225
|
-
}, [discountList, (_state$
|
|
241
|
+
}, [discountList, (_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : _state$service7.value]);
|
|
226
242
|
|
|
227
243
|
// 监听折扣券列表变化
|
|
228
244
|
useEffect(function () {
|
|
@@ -290,8 +306,8 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
290
306
|
|
|
291
307
|
// 清空所有内容并重置购物车
|
|
292
308
|
var handleClearAllAndReset = function handleClearAllAndReset() {
|
|
293
|
-
var
|
|
294
|
-
|
|
309
|
+
var _window;
|
|
310
|
+
(_window = window) === null || _window === void 0 || (_window = _window.shopApi) === null || _window === void 0 || (_window = _window.bookingTicket) === null || _window === void 0 || _window.clearAllCart();
|
|
295
311
|
clearAllScanListenersTaskQueue();
|
|
296
312
|
// 清空服务项目
|
|
297
313
|
dispatch({
|
|
@@ -358,8 +374,6 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
358
374
|
// TODO: 如果需要重置更多信息,可以在这里添加
|
|
359
375
|
// 比如重置优惠券、表单数据、宠物信息等
|
|
360
376
|
|
|
361
|
-
// 清空商品券
|
|
362
|
-
shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$clear = shopDiscount.clear) === null || _shopDiscount$clear === void 0 || _shopDiscount$clear.call(shopDiscount);
|
|
363
377
|
setShowClearModal(false);
|
|
364
378
|
Toast === null || Toast === void 0 || Toast.success(createToastContent(locales.getText('pisell2.action-buttons.clear-success')));
|
|
365
379
|
};
|
|
@@ -375,8 +389,8 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
375
389
|
|
|
376
390
|
// 商品清空后,重置折扣信息
|
|
377
391
|
useEffect(function () {
|
|
378
|
-
var _state$
|
|
379
|
-
if (((_state$
|
|
392
|
+
var _state$service8, _state$addons3;
|
|
393
|
+
if (((_state$service8 = state.service) === null || _state$service8 === void 0 || (_state$service8 = _state$service8.value) === null || _state$service8 === void 0 ? void 0 : _state$service8.length) === 0 && ((_state$addons3 = state.addons) === null || _state$addons3 === void 0 || (_state$addons3 = _state$addons3.value) === null || _state$addons3 === void 0 ? void 0 : _state$addons3.length) === 0) {
|
|
380
394
|
dispatch({
|
|
381
395
|
type: 'setState',
|
|
382
396
|
payload: {
|
|
@@ -384,7 +398,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
384
398
|
}
|
|
385
399
|
});
|
|
386
400
|
}
|
|
387
|
-
}, [(_state$
|
|
401
|
+
}, [(_state$service9 = state.service) === null || _state$service9 === void 0 ? void 0 : _state$service9.value, (_state$addons4 = state.addons) === null || _state$addons4 === void 0 ? void 0 : _state$addons4.value]);
|
|
388
402
|
|
|
389
403
|
// 处理价格调整完成
|
|
390
404
|
var handlePriceAdjustConfirm = function handlePriceAdjustConfirm(discountAmount) {
|
|
@@ -413,7 +427,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
413
427
|
|
|
414
428
|
// 处理自定义商品保存
|
|
415
429
|
var handleCustomiseItemSave = function handleCustomiseItemSave(data) {
|
|
416
|
-
var _state$
|
|
430
|
+
var _state$service10;
|
|
417
431
|
console.log('保存自定义商品:', data);
|
|
418
432
|
|
|
419
433
|
// 创建自定义商品项,按照标准商品结构
|
|
@@ -457,7 +471,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
457
471
|
};
|
|
458
472
|
|
|
459
473
|
// 添加到购物车(使用 service 来存储自定义商品)
|
|
460
|
-
var currentServices = (state === null || state === void 0 || (_state$
|
|
474
|
+
var currentServices = (state === null || state === void 0 || (_state$service10 = state.service) === null || _state$service10 === void 0 ? void 0 : _state$service10.value) || [];
|
|
461
475
|
|
|
462
476
|
// 直接添加自定义商品,不检查重复
|
|
463
477
|
var updatedServices = [customItem].concat(_toConsumableArray(currentServices));
|
|
@@ -424,7 +424,7 @@ var CustomSelect = function CustomSelect(props, ref) {
|
|
|
424
424
|
marginTop: 16,
|
|
425
425
|
height: 44
|
|
426
426
|
},
|
|
427
|
-
placeholder: locales.getText('pisell2.text.search'),
|
|
427
|
+
placeholder: locales.getText('pisell2.booking.text.search-placeholder'),
|
|
428
428
|
value: search,
|
|
429
429
|
allowClear: true,
|
|
430
430
|
onChange: function onChange(e) {
|
|
@@ -7,10 +7,11 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
8
8
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
9
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
|
-
import {
|
|
10
|
+
import { flexibleObj, getDiscountTimeByDayMinutes } from "../../utils";
|
|
11
11
|
import { formatAmount } from '@pisell/utils';
|
|
12
12
|
import Decimal from 'decimal.js';
|
|
13
|
-
import { isDayBooking,
|
|
13
|
+
import { isDayBooking, isNormalProductByDurationSchedule } from "../../info/service2/utils";
|
|
14
|
+
import { isMultiDayProduct } from "../../info2/service/addService/utils";
|
|
14
15
|
export var getRelationDetailsTotal = function getRelationDetailsTotal(relation_details) {
|
|
15
16
|
var total = new Decimal(0);
|
|
16
17
|
var _iterator = _createForOfIteratorHelper(relation_details),
|
|
@@ -39,6 +40,8 @@ var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
|
39
40
|
var duration = new Decimal(0);
|
|
40
41
|
// 是否是跨日预约
|
|
41
42
|
var isDay = isDayBooking(state);
|
|
43
|
+
var dayDuration = new Decimal(0);
|
|
44
|
+
var minuteDuration = new Decimal(0);
|
|
42
45
|
if (isEdit) {
|
|
43
46
|
// 计算总价 服务 和 附加商品
|
|
44
47
|
if (state !== null && state !== void 0 && state.service || state !== null && state !== void 0 && state.addons) {
|
|
@@ -51,14 +54,18 @@ var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
|
51
54
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
52
55
|
var item = _step2.value;
|
|
53
56
|
// 跨日预约
|
|
54
|
-
if (isDay || isNormalProductByDurationSchedule(item)) {
|
|
57
|
+
if (isDay || isNormalProductByDurationSchedule(item) || isMultiDayProduct(item)) {
|
|
55
58
|
var quantity = new Decimal(item._extend.quantity || 1);
|
|
56
59
|
var itemTotal = new Decimal(item._extend.total || 0);
|
|
57
60
|
price = price.add(itemTotal.mul(quantity));
|
|
58
61
|
|
|
59
62
|
// 普通商品不能加到时长上
|
|
60
|
-
var _duration =
|
|
61
|
-
|
|
63
|
+
var _duration = !isNormalProductByDurationSchedule(item) ? new Decimal(item._extend.duration || 0) : new Decimal(0);
|
|
64
|
+
if (isDay || isMultiDayProduct(item)) {
|
|
65
|
+
dayDuration = dayDuration.add(_duration);
|
|
66
|
+
} else {
|
|
67
|
+
minuteDuration = minuteDuration.add(_duration);
|
|
68
|
+
}
|
|
62
69
|
} else {
|
|
63
70
|
var _quantity = new Decimal(item._extend.quantity || 1);
|
|
64
71
|
var _itemTotal = new Decimal(item._extend.total || 0);
|
|
@@ -69,6 +76,11 @@ var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
|
69
76
|
price = price.add(relationTotal);
|
|
70
77
|
var itemDuration = new Decimal(flexibleObj.getValue(item._extend.duration) || 0);
|
|
71
78
|
duration = duration.add(itemDuration);
|
|
79
|
+
if (isMultiDayProduct(item)) {
|
|
80
|
+
dayDuration = dayDuration.add(itemDuration);
|
|
81
|
+
} else {
|
|
82
|
+
minuteDuration = minuteDuration.add(itemDuration);
|
|
83
|
+
}
|
|
72
84
|
}
|
|
73
85
|
}
|
|
74
86
|
} catch (err) {
|
|
@@ -102,20 +114,25 @@ var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
|
102
114
|
var services = (state === null || state === void 0 || (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.value) || [];
|
|
103
115
|
duration = services.reduce(function (pre, cur) {
|
|
104
116
|
var current = new Decimal(0);
|
|
105
|
-
if (isDay) {
|
|
117
|
+
if (isDay || isMultiDayProduct(cur)) {
|
|
106
118
|
// 普通商品不能加到时长上
|
|
107
|
-
var _duration2 =
|
|
119
|
+
var _duration2 = !isNormalProductByDurationSchedule(cur) ? new Decimal(cur._extend.duration || 0) : new Decimal(0);
|
|
108
120
|
current = _duration2;
|
|
109
121
|
} else {
|
|
110
122
|
var _cur$_extend;
|
|
111
123
|
current = new Decimal(flexibleObj.getValue(((_cur$_extend = cur._extend) === null || _cur$_extend === void 0 ? void 0 : _cur$_extend.duration) || 0) || 0);
|
|
112
124
|
}
|
|
125
|
+
if (isDay || isMultiDayProduct(cur)) {
|
|
126
|
+
dayDuration = dayDuration.add(current);
|
|
127
|
+
} else {
|
|
128
|
+
minuteDuration = minuteDuration.add(current);
|
|
129
|
+
}
|
|
113
130
|
return pre.add(current);
|
|
114
131
|
}, new Decimal(0));
|
|
115
132
|
}
|
|
116
133
|
return {
|
|
117
134
|
productExpectAmount: price.toNumber(),
|
|
118
|
-
duration:
|
|
135
|
+
duration: getDiscountTimeByDayMinutes(dayDuration.toNumber(), minuteDuration.toNumber())
|
|
119
136
|
};
|
|
120
137
|
};
|
|
121
138
|
var getProductItemTax = function getProductItemTax(item, state, options) {
|