@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SelectHolderModalOptions {
|
|
3
|
+
/** 状态对象 */
|
|
4
|
+
state: any;
|
|
5
|
+
/** dispatch 函数 */
|
|
6
|
+
dispatch: any;
|
|
7
|
+
/** 初始选中的值 */
|
|
8
|
+
initialValue?: string | number | (string | number)[];
|
|
9
|
+
/** 最大可选数量,用于决定单选或多选模式 */
|
|
10
|
+
maxSelectedCount?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare type SelectHolderResult = number[] | null;
|
|
13
|
+
/**
|
|
14
|
+
* SelectHolderModal 组件(单例模式)
|
|
15
|
+
* 使用 Portal 在 body 上渲染,确保全局只有一个实例
|
|
16
|
+
* 可以在多个地方挂载,但实际只会渲染一个实例
|
|
17
|
+
*/
|
|
18
|
+
export declare const SelectHolderModal: React.FC;
|
|
19
|
+
/**
|
|
20
|
+
* 通过 await 调用的 Holder 选择弹窗
|
|
21
|
+
* @param options 配置选项
|
|
22
|
+
* @returns Promise,resolve 时返回选中的 holder ID 数组,或 null(用户取消时)
|
|
23
|
+
*/
|
|
24
|
+
export declare function selectHolderModal(options: SelectHolderModalOptions): Promise<SelectHolderResult>;
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/booking/utils/selectHolderModal.tsx
|
|
30
|
+
var selectHolderModal_exports = {};
|
|
31
|
+
__export(selectHolderModal_exports, {
|
|
32
|
+
SelectHolderModal: () => SelectHolderModal,
|
|
33
|
+
selectHolderModal: () => selectHolderModal
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(selectHolderModal_exports);
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_react_dom = require("react-dom");
|
|
38
|
+
var import_utils = require("@pisell/utils");
|
|
39
|
+
var import_utils2 = require("../utils");
|
|
40
|
+
var import_selectHolder = __toESM(require("../../../plus/selectHolder"));
|
|
41
|
+
var modalState = null;
|
|
42
|
+
var allSetStateCallbacks = /* @__PURE__ */ new Set();
|
|
43
|
+
var renderingInstanceId = null;
|
|
44
|
+
function notifyAllInstances(newState) {
|
|
45
|
+
modalState = newState;
|
|
46
|
+
allSetStateCallbacks.forEach((setState) => {
|
|
47
|
+
setState(newState);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function getFormDataConfig(state) {
|
|
51
|
+
var _a, _b, _c, _d, _e;
|
|
52
|
+
let _holder = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.holder;
|
|
53
|
+
if (!_holder) {
|
|
54
|
+
return { formDataConfig: null, isMinorAndWaiver: false };
|
|
55
|
+
}
|
|
56
|
+
const formDataConfig = {
|
|
57
|
+
..._holder,
|
|
58
|
+
..._holder == null ? void 0 : _holder.form,
|
|
59
|
+
options: [],
|
|
60
|
+
form_id: (_b = _holder == null ? void 0 : _holder.form) == null ? void 0 : _b.id,
|
|
61
|
+
field: (_c = _holder == null ? void 0 : _holder.form) == null ? void 0 : _c.form_field,
|
|
62
|
+
relation_type: "appointment_booking",
|
|
63
|
+
form_record: []
|
|
64
|
+
};
|
|
65
|
+
let isMinorAndWaiver = false;
|
|
66
|
+
if ((formDataConfig == null ? void 0 : formDataConfig.form_type) === "minors") {
|
|
67
|
+
const detail = (_d = formDataConfig == null ? void 0 : formDataConfig.form_field) == null ? void 0 : _d.find(
|
|
68
|
+
(item) => item.filed_type === "form_to_form" && item.status === "hide"
|
|
69
|
+
);
|
|
70
|
+
if (detail) {
|
|
71
|
+
isMinorAndWaiver = (_e = detail == null ? void 0 : detail.setting) == null ? void 0 : _e.linkedTable;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return { formDataConfig, isMinorAndWaiver };
|
|
75
|
+
}
|
|
76
|
+
function getHolderOptions(state) {
|
|
77
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
78
|
+
const holdersFromState = Array.isArray((_a = state == null ? void 0 : state.pet) == null ? void 0 : _a.holders) ? state.pet.holders : [];
|
|
79
|
+
const formId = ((_e = (_d = (_c = (_b = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.appointment_subject) == null ? void 0 : _e.form_id) || 0;
|
|
80
|
+
const holdersFromValue = Array.isArray((_g = (_f = state == null ? void 0 : state.pet) == null ? void 0 : _f.value) == null ? void 0 : _g[formId]) ? (_i = (_h = state == null ? void 0 : state.pet) == null ? void 0 : _h.value) == null ? void 0 : _i[formId] : [];
|
|
81
|
+
const rawList = holdersFromState.length > 0 ? holdersFromState : holdersFromValue;
|
|
82
|
+
return rawList.map((item) => {
|
|
83
|
+
const id = (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id) || (item == null ? void 0 : item.value);
|
|
84
|
+
if (id === void 0 || id === null) return null;
|
|
85
|
+
return {
|
|
86
|
+
label: (item == null ? void 0 : item.main_field) || (item == null ? void 0 : item.label) || (item == null ? void 0 : item.name) || import_utils.locales.getText("pisell-select-holder-please-select"),
|
|
87
|
+
value: id,
|
|
88
|
+
avatar: item == null ? void 0 : item.avatar,
|
|
89
|
+
subtitle: (item == null ? void 0 : item.subtitle) || (item == null ? void 0 : item.second_field) || (item == null ? void 0 : item.sub_field)
|
|
90
|
+
};
|
|
91
|
+
}).filter(Boolean);
|
|
92
|
+
}
|
|
93
|
+
function buildDisplayConfig(state, holderOptions, maxSelectedCount = 1) {
|
|
94
|
+
var _a, _b, _c;
|
|
95
|
+
const selectType = maxSelectedCount > 1 ? "multiple" : "single";
|
|
96
|
+
return {
|
|
97
|
+
direction: "vertical",
|
|
98
|
+
selectType,
|
|
99
|
+
showAvatar: true,
|
|
100
|
+
showTitle: true,
|
|
101
|
+
showSubtitle: Boolean(holderOptions.some((option) => option.subtitle)),
|
|
102
|
+
isSkipable: ((_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.subject_require) === "optional"
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
var SelectHolderModal = () => {
|
|
106
|
+
const [localState, setLocalState] = (0, import_react.useState)(modalState);
|
|
107
|
+
const [container, setContainer] = (0, import_react.useState)(null);
|
|
108
|
+
const instanceIdRef = (0, import_react.useRef)(Symbol("SelectHolderModal"));
|
|
109
|
+
const isRenderingInstanceRef = (0, import_react.useRef)(false);
|
|
110
|
+
(0, import_react.useEffect)(() => {
|
|
111
|
+
let containerElement = document.getElementById("select-holder-modal-container");
|
|
112
|
+
if (!containerElement) {
|
|
113
|
+
containerElement = document.createElement("div");
|
|
114
|
+
containerElement.id = "select-holder-modal-container";
|
|
115
|
+
document.body.appendChild(containerElement);
|
|
116
|
+
}
|
|
117
|
+
setContainer(containerElement);
|
|
118
|
+
if (renderingInstanceId === null) {
|
|
119
|
+
renderingInstanceId = instanceIdRef.current;
|
|
120
|
+
isRenderingInstanceRef.current = true;
|
|
121
|
+
} else {
|
|
122
|
+
isRenderingInstanceRef.current = renderingInstanceId === instanceIdRef.current;
|
|
123
|
+
}
|
|
124
|
+
allSetStateCallbacks.add(setLocalState);
|
|
125
|
+
if (modalState && modalState !== localState) {
|
|
126
|
+
setLocalState(modalState);
|
|
127
|
+
}
|
|
128
|
+
return () => {
|
|
129
|
+
allSetStateCallbacks.delete(setLocalState);
|
|
130
|
+
if (isRenderingInstanceRef.current) {
|
|
131
|
+
renderingInstanceId = null;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}, []);
|
|
135
|
+
if (!localState || !localState.open || !container) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
if (!isRenderingInstanceRef.current) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
const { state, dispatch, initialValue, maxSelectedCount, resolve } = localState;
|
|
142
|
+
return (0, import_react_dom.createPortal)(
|
|
143
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
144
|
+
SelectHolderModalContent,
|
|
145
|
+
{
|
|
146
|
+
state,
|
|
147
|
+
dispatch,
|
|
148
|
+
initialValue,
|
|
149
|
+
maxSelectedCount,
|
|
150
|
+
resolve,
|
|
151
|
+
onClose: () => {
|
|
152
|
+
setTimeout(() => {
|
|
153
|
+
notifyAllInstances(null);
|
|
154
|
+
}, 350);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
container
|
|
159
|
+
);
|
|
160
|
+
};
|
|
161
|
+
var SelectHolderModalContent = ({ state, dispatch, initialValue, maxSelectedCount, resolve, onClose }) => {
|
|
162
|
+
var _a, _b, _c, _d, _e;
|
|
163
|
+
const [open, setOpen] = (0, import_react.useState)(true);
|
|
164
|
+
const [holderOptions, setHolderOptions] = (0, import_react.useState)(
|
|
165
|
+
() => getHolderOptions(state)
|
|
166
|
+
);
|
|
167
|
+
const [selectedValues, setSelectedValues] = (0, import_react.useState)(() => {
|
|
168
|
+
if (Array.isArray(initialValue)) {
|
|
169
|
+
return initialValue.filter(
|
|
170
|
+
(item) => item !== void 0 && item !== null
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
if (initialValue === void 0 || initialValue === null || initialValue === "") {
|
|
174
|
+
return [];
|
|
175
|
+
}
|
|
176
|
+
return [initialValue];
|
|
177
|
+
});
|
|
178
|
+
const stateRef = { current: state };
|
|
179
|
+
(0, import_react.useEffect)(() => {
|
|
180
|
+
stateRef.current = state;
|
|
181
|
+
const newOptions = getHolderOptions(state);
|
|
182
|
+
setHolderOptions(newOptions);
|
|
183
|
+
}, [state]);
|
|
184
|
+
const displayConfig = (0, import_react.useMemo)(
|
|
185
|
+
() => {
|
|
186
|
+
var _a2, _b2, _c2;
|
|
187
|
+
return buildDisplayConfig(
|
|
188
|
+
stateRef.current,
|
|
189
|
+
holderOptions,
|
|
190
|
+
maxSelectedCount || ((_c2 = (_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.bookingConfig) == null ? void 0 : _b2.holder) == null ? void 0 : _c2.maxSelectedCount) || 1
|
|
191
|
+
);
|
|
192
|
+
},
|
|
193
|
+
[holderOptions, maxSelectedCount, state]
|
|
194
|
+
);
|
|
195
|
+
const { formDataConfig, isMinorAndWaiver } = (0, import_react.useMemo)(
|
|
196
|
+
() => getFormDataConfig(stateRef.current),
|
|
197
|
+
[(_b = (_a = stateRef.current) == null ? void 0 : _a.bookingConfig) == null ? void 0 : _b.holder]
|
|
198
|
+
);
|
|
199
|
+
const holderConfig = ((_d = (_c = stateRef.current) == null ? void 0 : _c.bookingConfig) == null ? void 0 : _d.holder) || {};
|
|
200
|
+
const title = ((_e = holderConfig == null ? void 0 : holderConfig.form) == null ? void 0 : _e.title) || (holderConfig == null ? void 0 : holderConfig.title) || import_utils.locales.getText("pisell2.text.holder");
|
|
201
|
+
const updateStateHolders = (holders) => {
|
|
202
|
+
dispatch({
|
|
203
|
+
type: "setPet",
|
|
204
|
+
payload: {
|
|
205
|
+
holders
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
const handleClose = () => {
|
|
210
|
+
setOpen(false);
|
|
211
|
+
if (resolve) {
|
|
212
|
+
resolve(null);
|
|
213
|
+
}
|
|
214
|
+
setTimeout(() => {
|
|
215
|
+
onClose();
|
|
216
|
+
}, 300);
|
|
217
|
+
};
|
|
218
|
+
const handleConfirm = (nextValues) => {
|
|
219
|
+
setOpen(false);
|
|
220
|
+
if (resolve) {
|
|
221
|
+
if (nextValues && nextValues.length > 0) {
|
|
222
|
+
const selectedIds = nextValues.map((val) => Number(val));
|
|
223
|
+
resolve(selectedIds);
|
|
224
|
+
} else {
|
|
225
|
+
resolve(null);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
setTimeout(() => {
|
|
229
|
+
onClose();
|
|
230
|
+
}, 300);
|
|
231
|
+
};
|
|
232
|
+
const handleAdd = () => {
|
|
233
|
+
var _a2, _b2, _c2, _d2, _e2, _f, _g, _h;
|
|
234
|
+
const currentState = stateRef.current;
|
|
235
|
+
const waiverForm = (_a2 = currentState == null ? void 0 : currentState.pet) == null ? void 0 : _a2.waiverForm;
|
|
236
|
+
currentState.action({
|
|
237
|
+
type: "pisell1.goCustomFormAddData",
|
|
238
|
+
data: {
|
|
239
|
+
zIndex: 1101,
|
|
240
|
+
customerId: (_c2 = (_b2 = currentState.client) == null ? void 0 : _b2.value) == null ? void 0 : _c2.id,
|
|
241
|
+
formDataConfig: isMinorAndWaiver ? {
|
|
242
|
+
...waiverForm,
|
|
243
|
+
customer_id: (_e2 = (_d2 = currentState.client) == null ? void 0 : _d2.value) == null ? void 0 : _e2.id,
|
|
244
|
+
is_franchisor: (_g = (_f = currentState.pet.formData) == null ? void 0 : _f[0]) == null ? void 0 : _g.is_franchisor
|
|
245
|
+
} : { ...((_h = currentState.pet.formData) == null ? void 0 : _h[0]) || {} }
|
|
246
|
+
},
|
|
247
|
+
callback: (res) => {
|
|
248
|
+
var _a3, _b3;
|
|
249
|
+
let obj = {};
|
|
250
|
+
for (let item of res) {
|
|
251
|
+
obj[item.key] = item.value;
|
|
252
|
+
}
|
|
253
|
+
const isWalkInBol = (0, import_utils2.isWalkIn)((_b3 = (_a3 = currentState.client) == null ? void 0 : _a3.value) == null ? void 0 : _b3.id);
|
|
254
|
+
const newHolders = !isWalkInBol ? [obj, ...currentState.pet.holders || []] : currentState.pet.holders || [];
|
|
255
|
+
updateStateHolders(newHolders);
|
|
256
|
+
const updatedState = {
|
|
257
|
+
...currentState,
|
|
258
|
+
pet: {
|
|
259
|
+
...currentState.pet,
|
|
260
|
+
holders: newHolders
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
stateRef.current = updatedState;
|
|
264
|
+
const newOptions = getHolderOptions(updatedState);
|
|
265
|
+
setHolderOptions(newOptions);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
const handleSkip = () => {
|
|
270
|
+
setOpen(false);
|
|
271
|
+
if (resolve) {
|
|
272
|
+
resolve(null);
|
|
273
|
+
}
|
|
274
|
+
setTimeout(() => {
|
|
275
|
+
onClose();
|
|
276
|
+
}, 300);
|
|
277
|
+
};
|
|
278
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
279
|
+
import_selectHolder.default,
|
|
280
|
+
{
|
|
281
|
+
open,
|
|
282
|
+
modalConfig: {
|
|
283
|
+
title: `${import_utils.locales.getText("pisell-select-holder-please-select")} ${maxSelectedCount || 1} ${title}`,
|
|
284
|
+
confirmText: import_utils.locales.getText("pisell2.text.confirm")
|
|
285
|
+
},
|
|
286
|
+
dataSource: holderOptions,
|
|
287
|
+
value: selectedValues,
|
|
288
|
+
displayConfig,
|
|
289
|
+
maxSelectedCount,
|
|
290
|
+
allowAdd: true,
|
|
291
|
+
onClose: handleClose,
|
|
292
|
+
onConfirm: handleConfirm,
|
|
293
|
+
onAdd: handleAdd,
|
|
294
|
+
onSkip: handleSkip
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
};
|
|
298
|
+
function selectHolderModal(options) {
|
|
299
|
+
const { state, dispatch, initialValue, maxSelectedCount } = options;
|
|
300
|
+
return new Promise((resolve) => {
|
|
301
|
+
if (modalState && modalState.resolve) {
|
|
302
|
+
modalState.resolve(null);
|
|
303
|
+
}
|
|
304
|
+
const newState = {
|
|
305
|
+
open: true,
|
|
306
|
+
state,
|
|
307
|
+
dispatch,
|
|
308
|
+
initialValue,
|
|
309
|
+
maxSelectedCount,
|
|
310
|
+
resolve
|
|
311
|
+
};
|
|
312
|
+
notifyAllInstances(newState);
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
316
|
+
0 && (module.exports = {
|
|
317
|
+
SelectHolderModal,
|
|
318
|
+
selectHolderModal
|
|
319
|
+
});
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
|
-
/**
|
|
3
|
-
* @title: 高阶函数结果缓存(Memoization)
|
|
4
|
-
*/
|
|
5
|
-
export declare function memoize<T extends (...args: any[]) => any>(fn: T): T;
|
|
6
2
|
declare type RType = (url: string, data?: {} | undefined, config?: {} | undefined) => Promise<any>;
|
|
7
3
|
declare class Request {
|
|
8
4
|
private request;
|
|
@@ -27,8 +23,21 @@ export declare const request: Request;
|
|
|
27
23
|
*/
|
|
28
24
|
export declare const getDiscountTime: (service_times: number, isDay?: boolean) => string;
|
|
29
25
|
/**
|
|
30
|
-
* @title:
|
|
31
|
-
* @description:
|
|
26
|
+
* @title: 格式化跨日预约的时长用于展示
|
|
27
|
+
* @description:
|
|
28
|
+
* @param {number} days
|
|
29
|
+
* @param {number} minutes
|
|
30
|
+
* @return {*}
|
|
31
|
+
*/
|
|
32
|
+
export declare const getDiscountTimeByDayMinutes: (days: number, minutes: number) => string;
|
|
33
|
+
/**
|
|
34
|
+
* @title: 时间切片
|
|
35
|
+
* @description:
|
|
36
|
+
* @param {any} config
|
|
37
|
+
* @param {string} locale
|
|
38
|
+
* @return {*}
|
|
39
|
+
* @Author: zhiwei.Wang
|
|
40
|
+
* @Date: 2024-04-26 13:59
|
|
32
41
|
*/
|
|
33
42
|
export declare const sliceDayIntoFiveMinutes: (config: any, locale: string, isDay?: boolean) => {
|
|
34
43
|
timeSlices: {
|
|
@@ -112,7 +121,7 @@ export declare const flexibleObj: {
|
|
|
112
121
|
export declare const getEndDate: (startDate: any, duration: string | number, endDate: any) => any;
|
|
113
122
|
export declare const getServiceTimes: (service: any) => {
|
|
114
123
|
startDate: dayjs.Dayjs;
|
|
115
|
-
endDate:
|
|
124
|
+
endDate: any;
|
|
116
125
|
};
|
|
117
126
|
export declare const getErrorList: (resource: any, cacheItem: any, isDay?: boolean) => {
|
|
118
127
|
label: any;
|
|
@@ -39,6 +39,7 @@ __export(utils_exports, {
|
|
|
39
39
|
getCacheParams: () => getCacheParams,
|
|
40
40
|
getDays: () => getDays,
|
|
41
41
|
getDiscountTime: () => getDiscountTime,
|
|
42
|
+
getDiscountTimeByDayMinutes: () => getDiscountTimeByDayMinutes,
|
|
42
43
|
getDuration: () => getDuration,
|
|
43
44
|
getEndDate: () => getEndDate,
|
|
44
45
|
getErrorList: () => getErrorList,
|
|
@@ -57,7 +58,6 @@ __export(utils_exports, {
|
|
|
57
58
|
isNowTime: () => isNowTime,
|
|
58
59
|
isSessionProduct: () => isSessionProduct,
|
|
59
60
|
isWalkIn: () => isWalkIn,
|
|
60
|
-
memoize: () => memoize,
|
|
61
61
|
request: () => request,
|
|
62
62
|
sliceDayIntoFiveMinutes: () => sliceDayIntoFiveMinutes
|
|
63
63
|
});
|
|
@@ -68,18 +68,7 @@ var import_utils2 = require("./info/service2/utils");
|
|
|
68
68
|
var import_lodash = require("lodash");
|
|
69
69
|
var import_utilsByBooking = require("./info2/utilsByBooking");
|
|
70
70
|
var import_decimal = __toESM(require("decimal.js"));
|
|
71
|
-
|
|
72
|
-
const cache = /* @__PURE__ */ new Map();
|
|
73
|
-
return function(...args) {
|
|
74
|
-
const key = JSON.stringify(args);
|
|
75
|
-
if (cache.has(key)) {
|
|
76
|
-
return cache.get(key);
|
|
77
|
-
}
|
|
78
|
-
const result = fn.apply(this, args);
|
|
79
|
-
cache.set(key, result);
|
|
80
|
-
return result;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
71
|
+
var import_utils3 = require("./info2/service/addService/utils");
|
|
83
72
|
var Request = class {
|
|
84
73
|
request = {};
|
|
85
74
|
constructor() {
|
|
@@ -112,7 +101,13 @@ var getDiscountTime = (service_times, isDay) => {
|
|
|
112
101
|
return str;
|
|
113
102
|
}
|
|
114
103
|
};
|
|
115
|
-
var
|
|
104
|
+
var getDiscountTimeByDayMinutes = (days, minutes) => {
|
|
105
|
+
if (days === 0) {
|
|
106
|
+
return getDiscountTime(minutes);
|
|
107
|
+
}
|
|
108
|
+
return `${days} ${import_utils.locales.getText("pisell2.text.day")(days)} ${getDiscountTime(minutes)}`;
|
|
109
|
+
};
|
|
110
|
+
var sliceDayIntoFiveMinutes = (config, locale, isDay) => {
|
|
116
111
|
let _locale = locale;
|
|
117
112
|
let dayjsLocale = _locale === "en-US" || _locale === "en" ? "en" : "zh-cn";
|
|
118
113
|
import_dayjs.default.locale(dayjsLocale);
|
|
@@ -161,7 +156,6 @@ var _sliceDayIntoFiveMinutes = (config, locale, isDay) => {
|
|
|
161
156
|
}
|
|
162
157
|
return { timeSlices, durationSlicesBasedOnTime };
|
|
163
158
|
};
|
|
164
|
-
var sliceDayIntoFiveMinutes = memoize(_sliceDayIntoFiveMinutes);
|
|
165
159
|
var getNowTime = () => {
|
|
166
160
|
return (0, import_dayjs.default)().format("HH:mm");
|
|
167
161
|
};
|
|
@@ -199,15 +193,12 @@ var findNextSlice = ({
|
|
|
199
193
|
return timeSlices[index].value;
|
|
200
194
|
};
|
|
201
195
|
var findNextDuration = (current, array, defaultValue) => {
|
|
202
|
-
if (defaultValue) {
|
|
203
|
-
return defaultValue;
|
|
204
|
-
}
|
|
205
196
|
for (let i = 0; i < array.length; i++) {
|
|
206
197
|
if (array[i].value == (current == null ? void 0 : current.value)) {
|
|
207
198
|
return array[i].value;
|
|
208
199
|
}
|
|
209
200
|
}
|
|
210
|
-
return array[0].value;
|
|
201
|
+
return defaultValue || array[0].value;
|
|
211
202
|
};
|
|
212
203
|
var formatProductListByCategory = (list, filterItem) => {
|
|
213
204
|
let _list = list || [];
|
|
@@ -425,6 +416,12 @@ var getServiceTimes = (service) => {
|
|
|
425
416
|
const startDate = (0, import_dayjs.default)(
|
|
426
417
|
(0, import_dayjs.default)(service._extend.start_date).format("YYYY-MM-DD ") + getServeStartTime(service._extend.start_time)
|
|
427
418
|
);
|
|
419
|
+
if ((0, import_utils3.isMultiDayProduct)(service)) {
|
|
420
|
+
return {
|
|
421
|
+
startDate,
|
|
422
|
+
endDate: service._extend.end_date
|
|
423
|
+
};
|
|
424
|
+
}
|
|
428
425
|
const endDate = startDate.add(
|
|
429
426
|
flexibleObj.getValue(service._extend.duration),
|
|
430
427
|
"minute"
|
|
@@ -520,7 +517,7 @@ var formatResource = (resourceItem, cacheItem, formatLabel) => {
|
|
|
520
517
|
return _resourceItem;
|
|
521
518
|
};
|
|
522
519
|
var getLastServer = (list) => {
|
|
523
|
-
return list
|
|
520
|
+
return list[list.length - 1];
|
|
524
521
|
};
|
|
525
522
|
var getCacheParams = () => {
|
|
526
523
|
const sessionData = sessionStorage.getItem("pisell2.booking.serviceParams");
|
|
@@ -713,6 +710,7 @@ var getIsEdit = (state) => {
|
|
|
713
710
|
getCacheParams,
|
|
714
711
|
getDays,
|
|
715
712
|
getDiscountTime,
|
|
713
|
+
getDiscountTimeByDayMinutes,
|
|
716
714
|
getDuration,
|
|
717
715
|
getEndDate,
|
|
718
716
|
getErrorList,
|
|
@@ -731,7 +729,6 @@ var getIsEdit = (state) => {
|
|
|
731
729
|
isNowTime,
|
|
732
730
|
isSessionProduct,
|
|
733
731
|
isWalkIn,
|
|
734
|
-
memoize,
|
|
735
732
|
request,
|
|
736
733
|
sliceDayIntoFiveMinutes
|
|
737
734
|
});
|
|
@@ -63,7 +63,6 @@ var import_lodash = require("lodash");
|
|
|
63
63
|
var import_utils2 = require("./utils");
|
|
64
64
|
var import_usePaymentLogger = __toESM(require("./hooks/usePaymentLogger"));
|
|
65
65
|
var import_antd = require("antd");
|
|
66
|
-
var import_printer = __toESM(require("../../hooks/printer"));
|
|
67
66
|
var import_priceKeyboard = require("../../pro/priceKeyboard");
|
|
68
67
|
var import_pisellos = require("../ticketBooking/hooks/pisellos");
|
|
69
68
|
var CheckoutHooks = {
|
|
@@ -123,7 +122,6 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
123
122
|
const walletPassRef = (0, import_react.useRef)(null);
|
|
124
123
|
const [paymentItems, setPaymentItems] = (0, import_react.useState)([]);
|
|
125
124
|
const [walletPassData, setWalletPassData] = (0, import_react.useState)({});
|
|
126
|
-
const { nativePrint } = (0, import_printer.default)();
|
|
127
125
|
const [syncingLock, setSyncingLock] = (0, import_react.useState)(false);
|
|
128
126
|
const isOrderFree = (0, import_react.useMemo)(() => {
|
|
129
127
|
if (!customAmount) return false;
|
|
@@ -420,13 +418,11 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
420
418
|
);
|
|
421
419
|
const orderSubmitStartUnsubscribe = core.effects.on(
|
|
422
420
|
CheckoutHooks.OnOrderSubmitStart,
|
|
423
|
-
executeIfActive(
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
}
|
|
429
|
-
)
|
|
421
|
+
executeIfActive(() => {
|
|
422
|
+
var _a2;
|
|
423
|
+
setSyncingLock(true);
|
|
424
|
+
(_a2 = Toast == null ? void 0 : Toast.loading) == null ? void 0 : _a2.call(Toast, "", 0);
|
|
425
|
+
})
|
|
430
426
|
);
|
|
431
427
|
const orderSubmitEndUnsubscribe = core.effects.on(
|
|
432
428
|
CheckoutHooks.OnOrderSubmitEnd,
|
|
@@ -594,12 +590,11 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
594
590
|
data: {
|
|
595
591
|
order_id: responseData.order_id,
|
|
596
592
|
machine_code_print_info: responseData == null ? void 0 : responseData.machine_code_print_info,
|
|
597
|
-
small_ticket_data: (_b2 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _b2.small_ticket_data
|
|
598
|
-
machine_code_print_info_v2: responseData == null ? void 0 : responseData.machine_code_print_info_v2
|
|
593
|
+
small_ticket_data: (_b2 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _b2.small_ticket_data
|
|
599
594
|
}
|
|
600
595
|
};
|
|
601
596
|
console.log("print_order_onOrderSynced_params>>>>", params);
|
|
602
|
-
|
|
597
|
+
(0, import_utils.webPrint)(params, (res) => {
|
|
603
598
|
console.log("print_order_onOrderSynced_res>>>>", res);
|
|
604
599
|
});
|
|
605
600
|
} catch (error) {
|
|
@@ -765,7 +760,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
765
760
|
data: { order_id: data.orderId }
|
|
766
761
|
};
|
|
767
762
|
try {
|
|
768
|
-
|
|
763
|
+
(0, import_utils.webPrint)(params, (res) => {
|
|
769
764
|
console.log("handleButtonClick_print-receipt_res>>>>", res);
|
|
770
765
|
if (!(res == null ? void 0 : res.result)) {
|
|
771
766
|
Toast == null ? void 0 : Toast.error((res == null ? void 0 : res.msg) || "");
|
|
@@ -1068,10 +1063,10 @@ var PaymentModal = ({
|
|
|
1068
1063
|
const [actualShowCashPayment, setActualShowCashPayment] = (0, import_react.useState)(true);
|
|
1069
1064
|
const [windowHeight, setWindowHeight] = (0, import_react.useState)(0);
|
|
1070
1065
|
const [showRetryModal, setShowRetryModal] = (0, import_react.useState)(false);
|
|
1066
|
+
const [showCreateErrorModal, setShowCreateErrorModal] = (0, import_react.useState)(false);
|
|
1071
1067
|
const [currentEditOrderId, setCurrentEditOrderId] = (0, import_react.useState)(editOrderId || 0);
|
|
1072
1068
|
const { executeIfActive } = (0, import_pisellos.useActiveExecute)();
|
|
1073
1069
|
const Toast = (0, import_materials.useToast)();
|
|
1074
|
-
const { nativePrint } = (0, import_printer.default)();
|
|
1075
1070
|
const handleRetry = async () => {
|
|
1076
1071
|
const checkoutModule = pisellos == null ? void 0 : pisellos.getModule("checkout");
|
|
1077
1072
|
const res = await (checkoutModule == null ? void 0 : checkoutModule.manualSyncOrderAsync());
|
|
@@ -1506,8 +1501,7 @@ var PaymentModal = ({
|
|
|
1506
1501
|
data: {
|
|
1507
1502
|
order_id: responseData.order_id,
|
|
1508
1503
|
machine_code_print_info: responseData == null ? void 0 : responseData.machine_code_print_info,
|
|
1509
|
-
small_ticket_data: (_c3 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _c3.small_ticket_data
|
|
1510
|
-
machine_code_print_info_v2: responseData == null ? void 0 : responseData.machine_code_print_info_v2
|
|
1504
|
+
small_ticket_data: (_c3 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _c3.small_ticket_data
|
|
1511
1505
|
}
|
|
1512
1506
|
};
|
|
1513
1507
|
console.log("print_order_onOrderSynced_params>>>>", params);
|
|
@@ -1518,7 +1512,7 @@ var PaymentModal = ({
|
|
|
1518
1512
|
params
|
|
1519
1513
|
}
|
|
1520
1514
|
});
|
|
1521
|
-
|
|
1515
|
+
(0, import_utils.webPrint)(params, (res) => {
|
|
1522
1516
|
console.log("print_order_onOrderSynced_res>>>>", res);
|
|
1523
1517
|
logger == null ? void 0 : logger.addLog({
|
|
1524
1518
|
type: "info",
|
|
@@ -1627,6 +1621,7 @@ var PaymentModal = ({
|
|
|
1627
1621
|
error
|
|
1628
1622
|
}
|
|
1629
1623
|
});
|
|
1624
|
+
setShowCreateErrorModal(true);
|
|
1630
1625
|
}
|
|
1631
1626
|
};
|
|
1632
1627
|
if (data) {
|
|
@@ -1694,7 +1689,7 @@ var PaymentModal = ({
|
|
|
1694
1689
|
data: { order_id: data2.orderId }
|
|
1695
1690
|
};
|
|
1696
1691
|
try {
|
|
1697
|
-
|
|
1692
|
+
(0, import_utils.webPrint)(params, (res) => {
|
|
1698
1693
|
console.log("handleButtonClick_print-receipt_res>>>>", res);
|
|
1699
1694
|
if (!(res == null ? void 0 : res.result)) {
|
|
1700
1695
|
Toast == null ? void 0 : Toast.error((res == null ? void 0 : res.msg) || "");
|
|
@@ -2059,6 +2054,34 @@ var PaymentModal = ({
|
|
|
2059
2054
|
},
|
|
2060
2055
|
import_utils.locales.getText("retry") || "重试"
|
|
2061
2056
|
))
|
|
2057
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
2058
|
+
import_materials.PisellContainer,
|
|
2059
|
+
{
|
|
2060
|
+
renderType: "modal",
|
|
2061
|
+
props: {
|
|
2062
|
+
open: showCreateErrorModal,
|
|
2063
|
+
title: import_utils.locales.getText("pisell2.checkout.tips"),
|
|
2064
|
+
footer: null,
|
|
2065
|
+
keyboard: false,
|
|
2066
|
+
onCancel: () => {
|
|
2067
|
+
setShowCreateErrorModal(false);
|
|
2068
|
+
}
|
|
2069
|
+
// 禁用关闭
|
|
2070
|
+
}
|
|
2071
|
+
},
|
|
2072
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: { textAlign: "center", padding: "20px" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: "16px", fontSize: "16px" } }, import_utils.locales.getText("pisell2.checkout.order-create-failed")), /* @__PURE__ */ import_react.default.createElement(
|
|
2073
|
+
import_antd.Button,
|
|
2074
|
+
{
|
|
2075
|
+
type: "primary",
|
|
2076
|
+
size: "large",
|
|
2077
|
+
onClick: () => {
|
|
2078
|
+
setShowCreateErrorModal(false);
|
|
2079
|
+
window.location.reload();
|
|
2080
|
+
},
|
|
2081
|
+
style: { width: "100%", marginTop: "80px" }
|
|
2082
|
+
},
|
|
2083
|
+
import_utils.locales.getText("confirm") || "确认"
|
|
2084
|
+
))
|
|
2062
2085
|
));
|
|
2063
2086
|
};
|
|
2064
2087
|
var PaymentModal_default = PaymentModal;
|
|
@@ -38,8 +38,8 @@ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContex
|
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
39
|
var import_locales = __toESM(require("../../locales"));
|
|
40
40
|
var import_useToast = __toESM(require("../../../../hooks/useToast"));
|
|
41
|
-
var import_ahooks = require("ahooks");
|
|
42
41
|
var import_priceKeyboard = require("../../../../pro/priceKeyboard");
|
|
42
|
+
var import_ahooks = require("ahooks");
|
|
43
43
|
var import_index = require("./index.less");
|
|
44
44
|
function CashPaymentModule({
|
|
45
45
|
amountSymbol,
|
|
@@ -76,12 +76,6 @@ function CashPaymentModule({
|
|
|
76
76
|
}, [customAmount, balanceDueAmount, orderInfo == null ? void 0 : orderInfo.isDeposit]);
|
|
77
77
|
const isAmountButtonsDisabled = disabled || Number(customAmount || 0) === 0;
|
|
78
78
|
const isInputDisabled = disabled || Number(customAmount || 0) === 0;
|
|
79
|
-
const handleAmountClick = (clickedAmount) => {
|
|
80
|
-
if (isAmountButtonsDisabled) return;
|
|
81
|
-
const amountStr = clickedAmount.toString();
|
|
82
|
-
setAmount(amountStr);
|
|
83
|
-
setRoundingAmount(0);
|
|
84
|
-
};
|
|
85
79
|
const handleCashPayInternal = () => {
|
|
86
80
|
if (isAmountButtonsDisabled) return;
|
|
87
81
|
if (onPaymentComplete) {
|
|
@@ -17,7 +17,7 @@ export declare const useWalletPass: (props: {
|
|
|
17
17
|
cardData: any;
|
|
18
18
|
handleSelectWallet: (value: number[]) => void;
|
|
19
19
|
selectedWalletIds: any[];
|
|
20
|
-
expiredWalletIds: any;
|
|
20
|
+
expiredWalletIds: any[];
|
|
21
21
|
expiredWalletData: any;
|
|
22
22
|
disabledWalletData: any[];
|
|
23
23
|
clearAllSelectedWallet: () => void;
|