@pisell/private-materials 6.5.26 → 6.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +146 -165
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +4 -2
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +273 -76
- package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/es/components/appointmentBooking/hooks.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +30 -30
- package/es/components/appointmentBooking/locales.d.ts +3 -0
- package/es/components/appointmentBooking/locales.js +9 -6
- package/es/components/booking/components/actionButtons/index.js +34 -20
- package/es/components/booking/components/customSelect/index.js +1 -1
- package/es/components/booking/components/footer/amount.js +25 -8
- package/es/components/booking/components/footer/index.js +66 -33
- package/es/components/booking/components/footer/utils.d.ts +7 -0
- package/es/components/booking/components/footer/utils.js +126 -99
- package/es/components/booking/components/voucher/index.js +25 -9
- package/es/components/booking/dashboard/serve.js +1 -6
- package/es/components/booking/forms/footer.js +24 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/forms/serve.js +2 -12
- package/es/components/booking/hooks/useQuotation.js +69 -21
- package/es/components/booking/info/client/index.js +28 -13
- package/es/components/booking/info/client/serve.js +2 -11
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +16 -10
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
- package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
- package/es/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
- package/es/components/booking/info/hooks/useHolderConfig.js +9 -2
- package/es/components/booking/info/main.js +3 -2
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/pet/serve.js +1 -6
- package/es/components/booking/info/service/Lists.d.ts +1 -1
- package/es/components/booking/info/service/Lists.js +10 -4
- package/es/components/booking/info/service/addTimeModal/serve.js +1 -11
- package/es/components/booking/info/service/serve.d.ts +14 -0
- package/es/components/booking/info/service/serve.js +25 -18
- package/es/components/booking/info/service2/Group/utils.js +2 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -33
- package/es/components/booking/info/service2/utils.js +92 -56
- package/es/components/booking/info/utils.js +5 -0
- package/es/components/booking/info2/cartClientCard/index.js +49 -9
- package/es/components/booking/info2/index.js +3 -2
- package/es/components/booking/info2/serve.js +1 -6
- package/es/components/booking/info2/service/addService/index.js +146 -89
- package/es/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/es/components/booking/info2/service/addService/utils.js +83 -14
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
- package/es/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
- package/es/components/booking/info2/service/editService/Holder/index.js +193 -0
- package/es/components/booking/info2/service/editService/Holder/index.less +63 -0
- package/es/components/booking/info2/service/editService/index.js +313 -57
- package/es/components/booking/info2/utilsByBooking.js +19 -14
- package/es/components/booking/locales.d.ts +36 -0
- package/es/components/booking/locales.js +48 -3
- package/es/components/booking/model.d.ts +4 -0
- package/es/components/booking/model.js +3 -0
- package/es/components/booking/utils/confirmHolderModal.d.ts +13 -0
- package/es/components/booking/utils/confirmHolderModal.js +318 -0
- package/es/components/booking/utils/confirmHolderModal.less +40 -0
- package/es/components/booking/utils/selectHolderModal.d.ts +24 -0
- package/es/components/booking/utils/selectHolderModal.js +407 -0
- package/es/components/booking/utils.d.ts +16 -7
- package/es/components/booking/utils.js +26 -37
- package/es/components/checkout/PaymentModal.js +61 -30
- package/es/components/checkout/components/CashPaymentModule/index.js +1 -7
- package/es/components/checkout/components/ScrollableList/index.js +0 -1
- package/es/components/checkout/locales.d.ts +3 -0
- package/es/components/checkout/locales.js +3 -0
- package/es/components/eftposPay/linkly/index.js +64 -2
- package/es/components/eftposPay/tyro/index.js +12 -0
- package/es/components/list/List.js +3 -0
- package/es/components/pay/toB/components/MX51/index.js +14 -44
- package/es/components/pay/toB/types/index.d.ts +0 -12
- package/es/components/pay/toB/types/index.js +0 -4
- package/es/components/shoppingCart/components/Cart/Product.js +6 -3
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +119 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +419 -794
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
- package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -4
- package/es/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
- package/es/components/ticketBooking/components/menuBar/index.js +109 -12
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
- package/es/components/ticketBooking/components/ticketBooking/index.js +32 -61
- package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/ticketBooking/components/timeBar/index.js +1 -4
- package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +122 -170
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/index.js +0 -2
- package/es/components/ticketBooking/serve.js +17 -119
- package/es/components/ticketBooking/utils/index.d.ts +7 -1
- package/es/components/ticketBooking/utils/index.js +44 -28
- package/es/hooks/useEngineContext.d.ts +0 -1
- package/es/hooks/useEngineContext.js +0 -7
- package/es/index.d.ts +4 -0
- package/es/index.js +5 -1
- package/es/plus/clientCard/locales.js +3 -3
- package/es/plus/clinetSearch/index.js +28 -30
- package/es/plus/clinetSearch/locales.d.ts +3 -0
- package/es/plus/clinetSearch/locales.js +7 -4
- package/es/plus/clinetSearch/types.d.ts +12 -0
- package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/es/plus/contactInfo/components/Avatar/index.js +30 -0
- package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
- package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/es/plus/contactInfo/index.d.ts +6 -0
- package/es/plus/contactInfo/index.js +198 -0
- package/es/plus/contactInfo/index.less +621 -0
- package/es/plus/contactInfo/locales.d.ts +15 -0
- package/es/plus/contactInfo/locales.js +14 -0
- package/es/plus/contactInfo/types.d.ts +91 -0
- package/es/plus/contactInfo/types.js +1 -0
- package/es/plus/contactInfo/utils.d.ts +7 -0
- package/es/plus/contactInfo/utils.js +50 -0
- package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
- package/es/plus/contactInfoModal/index.d.ts +41 -0
- package/es/plus/contactInfoModal/index.js +155 -0
- package/es/plus/contactInfoModal/index.less +19 -0
- package/es/plus/contactInfoModal/locales.d.ts +66 -0
- package/es/plus/contactInfoModal/locales.js +65 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
- package/es/plus/productSelect/ProductCard/index.js +1 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
- package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
- package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/es/plus/selectHolder/components/HolderList/index.js +43 -0
- package/es/plus/selectHolder/index.d.ts +7 -0
- package/es/plus/selectHolder/index.js +273 -0
- package/es/plus/selectHolder/index.less +137 -0
- package/es/plus/selectHolder/locales.d.ts +24 -0
- package/es/plus/selectHolder/locales.js +29 -0
- package/es/plus/selectHolder/types.d.ts +104 -0
- package/es/plus/selectHolder/types.js +1 -0
- package/es/plus/selectHolder/utils.d.ts +9 -0
- package/es/plus/selectHolder/utils.js +16 -0
- package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/es/pro/comprehensiveSearch/locales.js +1 -1
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +357 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/es/pro/multiDayTimeSelect/index.js +1 -0
- package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/es/pro/multiDayTimeSelect/types.js +1 -0
- package/es/pro/skuDetailModal/types.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +6 -3
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +156 -13
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/lib/components/appointmentBooking/hooks.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +73 -35
- package/lib/components/appointmentBooking/locales.d.ts +3 -0
- package/lib/components/appointmentBooking/locales.js +6 -3
- package/lib/components/booking/components/actionButtons/index.js +11 -2
- package/lib/components/booking/components/customSelect/index.js +1 -1
- package/lib/components/booking/components/footer/amount.js +23 -6
- package/lib/components/booking/components/footer/index.js +26 -5
- package/lib/components/booking/components/footer/utils.d.ts +7 -0
- package/lib/components/booking/components/footer/utils.js +120 -82
- package/lib/components/booking/components/voucher/index.js +10 -1
- package/lib/components/booking/dashboard/serve.js +1 -6
- package/lib/components/booking/forms/footer.js +29 -11
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/forms/serve.js +2 -12
- package/lib/components/booking/hooks/useQuotation.js +45 -13
- package/lib/components/booking/info/client/index.js +14 -1
- package/lib/components/booking/info/client/serve.js +2 -13
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +7 -2
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -4
- package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
- package/lib/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
- package/lib/components/booking/info/hooks/useHolderConfig.js +8 -3
- package/lib/components/booking/info/main.js +5 -4
- package/lib/components/booking/info/model.js +5 -0
- package/lib/components/booking/info/pet/serve.js +1 -6
- package/lib/components/booking/info/service/Lists.d.ts +1 -1
- package/lib/components/booking/info/service/Lists.js +5 -3
- package/lib/components/booking/info/service/addTimeModal/serve.js +1 -7
- package/lib/components/booking/info/service/serve.d.ts +14 -0
- package/lib/components/booking/info/service/serve.js +8 -17
- package/lib/components/booking/info/service2/Group/utils.js +2 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -33
- package/lib/components/booking/info/service2/utils.js +38 -29
- package/lib/components/booking/info/utils.js +4 -0
- package/lib/components/booking/info2/cartClientCard/index.js +34 -5
- package/lib/components/booking/info2/index.js +11 -5
- package/lib/components/booking/info2/serve.js +1 -6
- package/lib/components/booking/info2/service/addService/index.js +22 -3
- package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/lib/components/booking/info2/service/addService/utils.js +48 -11
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
- package/lib/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
- package/lib/components/booking/info2/service/editService/Holder/index.js +199 -0
- package/lib/components/booking/info2/service/editService/Holder/index.less +63 -0
- package/lib/components/booking/info2/service/editService/index.js +254 -32
- package/lib/components/booking/info2/utilsByBooking.js +26 -19
- package/lib/components/booking/locales.d.ts +36 -0
- package/lib/components/booking/locales.js +42 -3
- package/lib/components/booking/model.d.ts +4 -0
- package/lib/components/booking/model.js +3 -0
- package/lib/components/booking/utils/confirmHolderModal.d.ts +13 -0
- package/lib/components/booking/utils/confirmHolderModal.js +253 -0
- package/lib/components/booking/utils/confirmHolderModal.less +40 -0
- package/lib/components/booking/utils/selectHolderModal.d.ts +24 -0
- package/lib/components/booking/utils/selectHolderModal.js +319 -0
- package/lib/components/booking/utils.d.ts +16 -7
- package/lib/components/booking/utils.js +18 -21
- package/lib/components/checkout/PaymentModal.js +41 -18
- package/lib/components/checkout/components/CashPaymentModule/index.js +1 -7
- package/lib/components/checkout/components/ScrollableList/index.js +0 -1
- package/lib/components/checkout/locales.d.ts +3 -0
- package/lib/components/checkout/locales.js +3 -0
- package/lib/components/eftposPay/linkly/index.js +31 -1
- package/lib/components/eftposPay/tyro/index.js +12 -0
- package/lib/components/list/List.js +3 -0
- package/lib/components/pay/toB/components/MX51/index.js +12 -37
- package/lib/components/pay/toB/types/index.d.ts +0 -12
- package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +279 -313
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
- package/lib/components/ticketBooking/components/addServiceVariant/index.js +5 -3
- package/lib/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
- package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
- package/lib/components/ticketBooking/components/ticketBooking/index.js +12 -49
- package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +1 -3
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +69 -98
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/index.js +0 -2
- package/lib/components/ticketBooking/serve.js +15 -117
- package/lib/components/ticketBooking/utils/index.d.ts +7 -1
- package/lib/components/ticketBooking/utils/index.js +29 -23
- package/lib/hooks/useEngineContext.d.ts +0 -1
- package/lib/hooks/useEngineContext.js +2 -10
- package/lib/index.d.ts +4 -0
- package/lib/index.js +12 -0
- package/lib/plus/clientCard/locales.js +3 -3
- package/lib/plus/clinetSearch/index.js +17 -8
- package/lib/plus/clinetSearch/locales.d.ts +3 -0
- package/lib/plus/clinetSearch/locales.js +7 -4
- package/lib/plus/clinetSearch/types.d.ts +12 -0
- package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/lib/plus/contactInfo/index.d.ts +6 -0
- package/lib/plus/contactInfo/index.js +226 -0
- package/lib/plus/contactInfo/index.less +621 -0
- package/lib/plus/contactInfo/locales.d.ts +15 -0
- package/lib/plus/contactInfo/locales.js +38 -0
- package/lib/plus/contactInfo/types.d.ts +91 -0
- package/lib/plus/contactInfo/types.js +17 -0
- package/lib/plus/contactInfo/utils.d.ts +7 -0
- package/lib/plus/contactInfo/utils.js +64 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
- package/lib/plus/contactInfoModal/index.d.ts +41 -0
- package/lib/plus/contactInfoModal/index.js +139 -0
- package/lib/plus/contactInfoModal/index.less +19 -0
- package/lib/plus/contactInfoModal/locales.d.ts +66 -0
- package/lib/plus/contactInfoModal/locales.js +89 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
- package/lib/plus/productSelect/ProductCard/index.js +1 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.js +30 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
- package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/lib/plus/selectHolder/components/HolderList/index.js +63 -0
- package/lib/plus/selectHolder/index.d.ts +7 -0
- package/lib/plus/selectHolder/index.js +223 -0
- package/lib/plus/selectHolder/index.less +137 -0
- package/lib/plus/selectHolder/locales.d.ts +24 -0
- package/lib/plus/selectHolder/locales.js +47 -0
- package/lib/plus/selectHolder/types.d.ts +104 -0
- package/lib/plus/selectHolder/types.js +17 -0
- package/lib/plus/selectHolder/utils.d.ts +9 -0
- package/lib/plus/selectHolder/utils.js +34 -0
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/lib/pro/comprehensiveSearch/locales.js +1 -1
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +304 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/lib/{hooks/printer.js → pro/multiDayTimeSelect/index.js} +6 -31
- package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/lib/pro/multiDayTimeSelect/types.js +17 -0
- package/lib/pro/skuDetailModal/types.d.ts +1 -0
- package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
- package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
- package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
- package/lowcode/contact-info/fragments/textStyle.ts +33 -0
- package/lowcode/contact-info/meta.ts +199 -0
- package/lowcode/contact-info-modal/meta.ts +98 -0
- package/lowcode/event-select-holder/meta.ts +2 -2
- package/lowcode/select-holder/meta.ts +220 -0
- package/lowcode/select-holder/snippets.ts +41 -0
- package/package.json +13 -11
- package/es/hooks/printer.d.ts +0 -4
- package/es/hooks/printer.js +0 -35
- package/lib/hooks/printer.d.ts +0 -4
|
@@ -2,8 +2,6 @@ import { ProductDisplayConfig, ProductDisplayPresetKey } from '../ProductDisplay
|
|
|
2
2
|
interface AddServiceVariantProps {
|
|
3
3
|
globalState: any;
|
|
4
4
|
setGlobalState: any;
|
|
5
|
-
onPrerenderComplete?: () => void;
|
|
6
|
-
onGetProductsReady?: (getProducts: any) => void;
|
|
7
5
|
productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
|
|
8
6
|
}
|
|
9
7
|
declare const AddServiceVariant: (props: AddServiceVariantProps) => JSX.Element;
|
|
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(addServiceVariant_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_addService = __toESM(require("./addService"));
|
|
37
37
|
var AddServiceVariant = (props) => {
|
|
38
|
-
const { globalState, setGlobalState,
|
|
38
|
+
const { globalState, setGlobalState, productDisplayConfig } = props;
|
|
39
39
|
const stateRef = (0, import_react.useRef)(globalState);
|
|
40
40
|
stateRef.current = globalState;
|
|
41
41
|
const dispatch = ({ type, payload }) => {
|
|
@@ -43,6 +43,10 @@ var AddServiceVariant = (props) => {
|
|
|
43
43
|
setGlobalState({
|
|
44
44
|
service: { ...stateRef.current.service, ...payload }
|
|
45
45
|
});
|
|
46
|
+
} else if (type === "setPet") {
|
|
47
|
+
setGlobalState({
|
|
48
|
+
pet: { ...stateRef.current.pet, ...payload }
|
|
49
|
+
});
|
|
46
50
|
}
|
|
47
51
|
};
|
|
48
52
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -50,8 +54,6 @@ var AddServiceVariant = (props) => {
|
|
|
50
54
|
{
|
|
51
55
|
state: globalState,
|
|
52
56
|
dispatch,
|
|
53
|
-
onPrerenderComplete,
|
|
54
|
-
onGetProductsReady,
|
|
55
57
|
productDisplayConfig
|
|
56
58
|
}
|
|
57
59
|
);
|
|
@@ -32,7 +32,6 @@ module.exports = __toCommonJS(utils_exports);
|
|
|
32
32
|
var import_utils = require("@pisell/utils");
|
|
33
33
|
var import_utils2 = require("../../../booking/utils");
|
|
34
34
|
var import_utils3 = require("../../../booking/info2/service/addService/utils");
|
|
35
|
-
var import_utils4 = require("../../../booking/info/service2/utils");
|
|
36
35
|
var formatVariantGroupTitle = (title, variant_group = []) => {
|
|
37
36
|
try {
|
|
38
37
|
const formattedTitle = variant_group == null ? void 0 : variant_group.map((item) => {
|
|
@@ -66,7 +65,7 @@ var createCacheItem = (detail, values, state) => {
|
|
|
66
65
|
cacheItem._extend.total = _total;
|
|
67
66
|
cacheItem._extend.origin_total = _total;
|
|
68
67
|
cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
|
|
69
|
-
cacheItem = (0,
|
|
68
|
+
cacheItem = (0, import_utils3.getProductExtend)({
|
|
70
69
|
cacheItem,
|
|
71
70
|
state,
|
|
72
71
|
isDisabledTime: true
|
|
@@ -39,20 +39,43 @@ var import_antd = require("antd");
|
|
|
39
39
|
var import_icons = require("@ant-design/icons");
|
|
40
40
|
var import_utils = require("@pisell/utils");
|
|
41
41
|
var import_materials = require("@pisell/materials");
|
|
42
|
+
var import_serve = require("../../serve");
|
|
43
|
+
var import_hooks = require("../../../../hooks");
|
|
42
44
|
var index = (props) => {
|
|
43
45
|
const { activeNavKey = "ticket", onNavChange } = props;
|
|
44
46
|
const status = (0, import_useNetworkStatus.useNetworkStatus)();
|
|
47
|
+
const [showFoodMenu, setShowFoodMenu] = (0, import_react.useState)(false);
|
|
48
|
+
const context = (0, import_hooks.useEngineContext)();
|
|
49
|
+
(0, import_react.useEffect)(() => {
|
|
50
|
+
const checkFoodConfig = async () => {
|
|
51
|
+
try {
|
|
52
|
+
const data = await (0, import_serve.getBookingConfig)({
|
|
53
|
+
item_type: "appointment_booking",
|
|
54
|
+
sub_type: "food",
|
|
55
|
+
source_type: "pos"
|
|
56
|
+
});
|
|
57
|
+
if (data) {
|
|
58
|
+
setShowFoodMenu(true);
|
|
59
|
+
}
|
|
60
|
+
} catch (error) {
|
|
61
|
+
console.error("获取 food 配置失败:", error);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
checkFoodConfig();
|
|
65
|
+
}, []);
|
|
45
66
|
const navItems = [
|
|
46
67
|
{
|
|
47
68
|
key: "ticket",
|
|
48
69
|
icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-ticket", style: { fontSize: 32 } }),
|
|
49
70
|
label: ""
|
|
50
71
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
...showFoodMenu ? [
|
|
73
|
+
{
|
|
74
|
+
key: "food",
|
|
75
|
+
label: "",
|
|
76
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-food", style: { fontSize: 32 } })
|
|
77
|
+
}
|
|
78
|
+
] : []
|
|
56
79
|
];
|
|
57
80
|
const items = [
|
|
58
81
|
{
|
|
@@ -87,8 +110,21 @@ var index = (props) => {
|
|
|
87
110
|
return "Offline";
|
|
88
111
|
}
|
|
89
112
|
};
|
|
90
|
-
const handleClick = ({ key }) => {
|
|
113
|
+
const handleClick = async ({ key }) => {
|
|
114
|
+
var _a, _b;
|
|
91
115
|
if (key === "reload") {
|
|
116
|
+
try {
|
|
117
|
+
const { getApp } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
118
|
+
const app = getApp();
|
|
119
|
+
if (app) {
|
|
120
|
+
app.logger.addLog({
|
|
121
|
+
type: "info",
|
|
122
|
+
title: "Reload App"
|
|
123
|
+
});
|
|
124
|
+
await ((_b = app == null ? void 0 : app.logger) == null ? void 0 : _b.storeLog());
|
|
125
|
+
}
|
|
126
|
+
} catch (err) {
|
|
127
|
+
}
|
|
92
128
|
window.location.reload();
|
|
93
129
|
}
|
|
94
130
|
if (key === "logout") {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import './index.less';
|
|
2
2
|
import { ProductDisplayConfig, ProductDisplayPresetKey } from '../ProductDisplayAdapter/types';
|
|
3
3
|
export declare const _formatBookingDetail: (data: any, modalState: any) => any;
|
|
4
|
-
|
|
5
|
-
onPrerenderComplete?: () => void;
|
|
4
|
+
declare const TicketBooking: (props: {
|
|
6
5
|
productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
|
|
7
6
|
isShowTimeBar?: boolean;
|
|
8
7
|
isShowFloatButtons?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare const TicketBooking: (props: TicketBookingProps) => JSX.Element;
|
|
8
|
+
}) => JSX.Element;
|
|
11
9
|
export default TicketBooking;
|
|
@@ -243,12 +243,8 @@ var formatProductValues = (data) => {
|
|
|
243
243
|
};
|
|
244
244
|
var TicketBooking = (props) => {
|
|
245
245
|
var _a, _b, _c, _d, _e;
|
|
246
|
-
const {
|
|
246
|
+
const { productDisplayConfig, isShowTimeBar = true, isShowFloatButtons = true } = props;
|
|
247
247
|
const [state, setState] = (0, import_miniRedux.useStore)();
|
|
248
|
-
const getProductsRef = (0, import_react.useRef)(null);
|
|
249
|
-
const handleGetProductsReady = (0, import_ahooks.useMemoizedFn)((getProducts) => {
|
|
250
|
-
getProductsRef.current = getProducts;
|
|
251
|
-
});
|
|
252
248
|
const engineContext = (0, import_useEngineContext.default)();
|
|
253
249
|
const { props: engineProps } = engineContext.engine;
|
|
254
250
|
const {
|
|
@@ -426,14 +422,15 @@ var TicketBooking = (props) => {
|
|
|
426
422
|
"bookingTicket",
|
|
427
423
|
"clearAllCart",
|
|
428
424
|
(type, orderId) => {
|
|
429
|
-
var _a3;
|
|
430
425
|
console.log("bookingTicket.clearAllCart");
|
|
431
426
|
_initFn(() => {
|
|
432
427
|
});
|
|
433
428
|
_setIntervalTime(true);
|
|
434
429
|
selectCustomer(null);
|
|
435
430
|
enableAllScanListeners();
|
|
436
|
-
(
|
|
431
|
+
setState({
|
|
432
|
+
createCount: state.createCount + 1
|
|
433
|
+
});
|
|
437
434
|
}
|
|
438
435
|
);
|
|
439
436
|
(_e2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _e2.mountFunction(
|
|
@@ -447,28 +444,12 @@ var TicketBooking = (props) => {
|
|
|
447
444
|
if (_listTimerRef.current) clearInterval(_listTimerRef.current);
|
|
448
445
|
};
|
|
449
446
|
}, []);
|
|
450
|
-
const _getProducts = (date) => {
|
|
451
|
-
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
452
|
-
const currentDate2 = date.format("YYYY-MM-DD");
|
|
453
|
-
const currentDatetime = date.format("YYYY-MM-DD HH:mm:ss");
|
|
454
|
-
const customerId = (_c2 = (_b2 = (_a2 = state.modalState) == null ? void 0 : _a2.client) == null ? void 0 : _b2.value) == null ? void 0 : _c2.id;
|
|
455
|
-
const menuList = ((_f = (_e2 = (_d2 = state.bookingConfig) == null ? void 0 : _d2.config) == null ? void 0 : _e2.menu_list_tab) == null ? void 0 : _f.menu_list) || [];
|
|
456
|
-
getProductsRef.current({
|
|
457
|
-
schedule_date: currentDate2,
|
|
458
|
-
customer_id: customerId,
|
|
459
|
-
menu_list_ids: menuList,
|
|
460
|
-
schedule_datetime: currentDatetime
|
|
461
|
-
});
|
|
462
|
-
};
|
|
463
447
|
const _onDateChange = (date, dateString) => {
|
|
464
448
|
_setIntervalTime(false);
|
|
465
449
|
setState({
|
|
466
450
|
isDateChange: true
|
|
467
451
|
});
|
|
468
452
|
_setDataChange(date, dateString);
|
|
469
|
-
if (getProductsRef.current) {
|
|
470
|
-
_getProducts(date);
|
|
471
|
-
}
|
|
472
453
|
};
|
|
473
454
|
const _setIntervalTime = (isInterval) => {
|
|
474
455
|
clearInterval(_timerRef.current);
|
|
@@ -489,6 +470,8 @@ var TicketBooking = (props) => {
|
|
|
489
470
|
intervalSetTime: isInterval
|
|
490
471
|
});
|
|
491
472
|
};
|
|
473
|
+
(0, import_react.useEffect)(() => {
|
|
474
|
+
}, []);
|
|
492
475
|
const getDataFromHost = () => {
|
|
493
476
|
try {
|
|
494
477
|
const is_price_include_tax = getData("is_price_include_tax");
|
|
@@ -658,26 +641,7 @@ var TicketBooking = (props) => {
|
|
|
658
641
|
edit: true
|
|
659
642
|
}
|
|
660
643
|
});
|
|
661
|
-
if (isTimeChange && getProductsRef.current) {
|
|
662
|
-
_getProducts(date);
|
|
663
|
-
}
|
|
664
644
|
setTimeout(() => {
|
|
665
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
666
|
-
if ((_b2 = (_a2 = state.modalState.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) {
|
|
667
|
-
let _list = (_e2 = (_c2 = state.bookingFunctions) == null ? void 0 : _c2.updateServiceDate) == null ? void 0 : _e2.call(
|
|
668
|
-
_c2,
|
|
669
|
-
(_d2 = state.modalState.service) == null ? void 0 : _d2.value,
|
|
670
|
-
date,
|
|
671
|
-
false
|
|
672
|
-
);
|
|
673
|
-
_setModalState({
|
|
674
|
-
service: {
|
|
675
|
-
...state.modalState.service,
|
|
676
|
-
value: _list,
|
|
677
|
-
edit: true
|
|
678
|
-
}
|
|
679
|
-
});
|
|
680
|
-
}
|
|
681
645
|
}, 100);
|
|
682
646
|
};
|
|
683
647
|
const _setShopOpeningHours = () => {
|
|
@@ -1029,11 +993,13 @@ var TicketBooking = (props) => {
|
|
|
1029
993
|
);
|
|
1030
994
|
};
|
|
1031
995
|
const _callback = (0, import_ahooks.useMemoizedFn)((data, type) => {
|
|
1032
|
-
var _a2, _b2
|
|
996
|
+
var _a2, _b2;
|
|
1033
997
|
if (isTerminal() && type === "checkout") {
|
|
1034
998
|
return;
|
|
1035
999
|
}
|
|
1036
|
-
(
|
|
1000
|
+
setState({
|
|
1001
|
+
createCount: state.createCount + 1
|
|
1002
|
+
});
|
|
1037
1003
|
if (data == null ? void 0 : data.afterCloseUpdate) {
|
|
1038
1004
|
return _callbackFnRef.current = () => {
|
|
1039
1005
|
lowcodeRef == null ? void 0 : lowcodeRef.onChange({ type: "refresh", ...data });
|
|
@@ -1051,8 +1017,8 @@ var TicketBooking = (props) => {
|
|
|
1051
1017
|
if (!bookingId) {
|
|
1052
1018
|
_setIntervalTime(true);
|
|
1053
1019
|
}
|
|
1054
|
-
if ((
|
|
1055
|
-
(
|
|
1020
|
+
if ((_a2 = pisellFloatingPanelRef.current) == null ? void 0 : _a2.getIsOpen()) {
|
|
1021
|
+
(_b2 = pisellFloatingPanelRef.current) == null ? void 0 : _b2.refresh();
|
|
1056
1022
|
}
|
|
1057
1023
|
_initFn(cb);
|
|
1058
1024
|
});
|
|
@@ -1186,7 +1152,6 @@ var TicketBooking = (props) => {
|
|
|
1186
1152
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "ticket-booking-left-panel" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "ticket-booking-left-panel-content" }, /* @__PURE__ */ import_react.default.createElement(
|
|
1187
1153
|
import_addServiceVariant.default,
|
|
1188
1154
|
{
|
|
1189
|
-
onPrerenderComplete,
|
|
1190
1155
|
globalState: {
|
|
1191
1156
|
...state.modalState,
|
|
1192
1157
|
amountSymbol: state.amountSymbol,
|
|
@@ -1209,13 +1174,11 @@ var TicketBooking = (props) => {
|
|
|
1209
1174
|
isBookingTicket2: true
|
|
1210
1175
|
},
|
|
1211
1176
|
setGlobalState: _setModalState,
|
|
1212
|
-
onGetProductsReady: handleGetProductsReady,
|
|
1213
1177
|
productDisplayConfig
|
|
1214
1178
|
}
|
|
1215
1179
|
), isShowFloatButtons && /* @__PURE__ */ import_react.default.createElement(import_floatButtons.default, { items: floatButtons })), isShowTimeBar && /* @__PURE__ */ import_react.default.createElement(
|
|
1216
1180
|
import_timeBar.default,
|
|
1217
1181
|
{
|
|
1218
|
-
setNowTime: _getProducts,
|
|
1219
1182
|
onCreateClick: handleCreateClick,
|
|
1220
1183
|
setGlobalState: setState,
|
|
1221
1184
|
globalState: state,
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
.booking-info-create-new,
|
|
37
37
|
.pisell-lowcode__booking-field-title,
|
|
38
38
|
.pisell-lowcode__shopping-cart-empty,
|
|
39
|
-
.pisell-lowcode__booking-service-clear-btn
|
|
39
|
+
.pisell-lowcode__booking-service-clear-btn,
|
|
40
|
+
.pisell-lowcode__booking-contact-info-title {
|
|
40
41
|
color: #ffffff;
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -43,7 +43,7 @@ var import_utils = require("@pisell/utils");
|
|
|
43
43
|
var import_index = require("./index.less");
|
|
44
44
|
var TimeBar = (props) => {
|
|
45
45
|
var _a, _b;
|
|
46
|
-
const { globalState: state, setGlobalState, locale, onCreateClick
|
|
46
|
+
const { globalState: state, setGlobalState, locale, onCreateClick } = props;
|
|
47
47
|
const _onClickNext = (0, import_ahooks.useMemoizedFn)(() => {
|
|
48
48
|
var _a2, _b2, _c, _d;
|
|
49
49
|
const currentTime = (_b2 = (_a2 = state.modalState) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value;
|
|
@@ -60,12 +60,10 @@ var TimeBar = (props) => {
|
|
|
60
60
|
});
|
|
61
61
|
const _onClickToday = (0, import_ahooks.useMemoizedFn)(() => {
|
|
62
62
|
var _a2;
|
|
63
|
-
setNowTime == null ? void 0 : setNowTime((0, import_dayjs.default)());
|
|
64
63
|
(_a2 = props.setIntervalTime) == null ? void 0 : _a2.call(props, true);
|
|
65
64
|
});
|
|
66
65
|
const _onClickNow = (0, import_ahooks.useMemoizedFn)(() => {
|
|
67
66
|
var _a2;
|
|
68
|
-
setNowTime == null ? void 0 : setNowTime((0, import_dayjs.default)());
|
|
69
67
|
(_a2 = props.setIntervalTime) == null ? void 0 : _a2.call(props, true);
|
|
70
68
|
});
|
|
71
69
|
const _onDateTimeChange = (0, import_ahooks.useMemoizedFn)((timeString) => {
|
|
@@ -4,11 +4,7 @@ interface IGetProductsParams {
|
|
|
4
4
|
menu_list_ids?: number[];
|
|
5
5
|
schedule_datetime?: string;
|
|
6
6
|
}
|
|
7
|
-
interface IGetScheduleTimePointsParams {
|
|
8
|
-
menu_list_ids?: number[];
|
|
9
|
-
}
|
|
10
7
|
export declare const useProducts: (notAvailableRef: any) => {
|
|
11
|
-
getScheduleTimePoints: (params?: IGetScheduleTimePointsParams) => Promise<void>;
|
|
12
8
|
getProducts: (params?: IGetProductsParams) => Promise<void>;
|
|
13
9
|
products: any[];
|
|
14
10
|
loading: boolean;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
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
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
|
|
29
19
|
// src/components/ticketBooking/hooks/pisellos/useProducts.ts
|
|
@@ -35,111 +25,92 @@ module.exports = __toCommonJS(useProducts_exports);
|
|
|
35
25
|
var import_ahooks = require("ahooks");
|
|
36
26
|
var import_bookingTicket = require("./bookingTicket");
|
|
37
27
|
var import_react = require("react");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
28
|
+
var import_OsKeyContext = require("../../context/OsKeyContext");
|
|
29
|
+
var import_productCache = require("../../utils/productCache");
|
|
30
|
+
var import_hooks = require("../../../../hooks");
|
|
31
|
+
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
40
32
|
var useProducts = (notAvailableRef) => {
|
|
33
|
+
var _a;
|
|
41
34
|
const bookingTicket = (0, import_bookingTicket.useBookingTicket)();
|
|
42
|
-
const
|
|
43
|
-
const platform = (0, import_useEngineContext.usePlatform)();
|
|
35
|
+
const osKey = (0, import_OsKeyContext.useOsKey)();
|
|
44
36
|
const [products, setProducts] = (0, import_react.useState)([]);
|
|
45
37
|
const [loading, setLoading] = (0, import_react.useState)(true);
|
|
46
38
|
const isFirstLoadRef = (0, import_react.useRef)(true);
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
39
|
+
const isFirstLoadDataRef = (0, import_react.useRef)(true);
|
|
40
|
+
const context = (0, import_hooks.useEngineContext)();
|
|
41
|
+
const { getApp } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
42
|
+
const app = getApp();
|
|
50
43
|
const getProducts = (0, import_ahooks.useMemoizedFn)(async (params) => {
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
setLoading(false);
|
|
58
|
-
isFirstLoadRef.current = false;
|
|
59
|
-
} catch (error) {
|
|
60
|
-
if ((error == null ? void 0 : error.code) === 607100 && (isFirstLoadRef.current || products.length > 0)) {
|
|
61
|
-
(_a = notAvailableRef.current) == null ? void 0 : _a.open();
|
|
44
|
+
var _a2, _b, _c, _d, _e;
|
|
45
|
+
if (isFirstLoadRef.current && osKey) {
|
|
46
|
+
const cachedProducts = (0, import_productCache.getProductCache)(osKey);
|
|
47
|
+
if (cachedProducts && cachedProducts.length > 0) {
|
|
48
|
+
setProducts(cachedProducts);
|
|
49
|
+
setLoading(false);
|
|
62
50
|
}
|
|
63
|
-
setLoading(false);
|
|
64
51
|
isFirstLoadRef.current = false;
|
|
52
|
+
} else {
|
|
53
|
+
setLoading(true);
|
|
65
54
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const schedule_date = executeDayjs.format("YYYY-MM-DD");
|
|
93
|
-
return {
|
|
94
|
-
action: "getProducts",
|
|
95
|
-
payload: {
|
|
96
|
-
...paramsRef.current,
|
|
97
|
-
schedule_date,
|
|
98
|
-
schedule_datetime: executeAt
|
|
99
|
-
},
|
|
100
|
-
scheduled: {
|
|
101
|
-
executeAt
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
});
|
|
105
|
-
app.tasksManager.addTask({
|
|
106
|
-
module: "scheduledTasks",
|
|
107
|
-
queueId: scheduledTaskQueueIdRef.current,
|
|
108
|
-
tasks
|
|
109
|
-
});
|
|
110
|
-
app.tasksManager.run({
|
|
111
|
-
module: "scheduledTasks",
|
|
112
|
-
queueId: scheduledTaskQueueIdRef.current
|
|
55
|
+
const maxRetries = 3;
|
|
56
|
+
let lastError = null;
|
|
57
|
+
let freshProducts = [];
|
|
58
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
59
|
+
try {
|
|
60
|
+
console.log(`[ProductCache] 尝试加载数据,第 ${attempt}/${maxRetries} 次`);
|
|
61
|
+
freshProducts = await bookingTicket.loadProducts(params);
|
|
62
|
+
if (freshProducts && freshProducts.length > 0) {
|
|
63
|
+
console.log(`[ProductCache] 第 ${attempt} 次尝试成功,获取到 ${freshProducts.length} 条数据`);
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
console.log(`[ProductCache] 第 ${attempt} 次尝试返回空数据`);
|
|
67
|
+
if (attempt < maxRetries) {
|
|
68
|
+
console.log(`[ProductCache] 等待 1 秒后重试...`);
|
|
69
|
+
await sleep(1e3);
|
|
70
|
+
}
|
|
71
|
+
} catch (error) {
|
|
72
|
+
lastError = error;
|
|
73
|
+
console.log(`[ProductCache] 第 ${attempt} 次尝试失败:`, error);
|
|
74
|
+
(_b = (_a2 = app == null ? void 0 : app.logger) == null ? void 0 : _a2.addLog) == null ? void 0 : _b.call(_a2, {
|
|
75
|
+
type: "info",
|
|
76
|
+
title: `[getProduct] bookingTicket.loadProducts error (attempt ${attempt}/${maxRetries})`,
|
|
77
|
+
metadata: {
|
|
78
|
+
error,
|
|
79
|
+
attempt
|
|
80
|
+
}
|
|
113
81
|
});
|
|
114
|
-
|
|
82
|
+
if (attempt < maxRetries) {
|
|
83
|
+
console.log(`[ProductCache] 等待 1 秒后重试...`);
|
|
84
|
+
await sleep(1e3);
|
|
85
|
+
}
|
|
115
86
|
}
|
|
116
|
-
} catch (error) {
|
|
117
|
-
console.error("创建定时任务失败:", error);
|
|
118
87
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
88
|
+
if (freshProducts && freshProducts.length > 0) {
|
|
89
|
+
isFirstLoadDataRef.current = false;
|
|
90
|
+
setProducts(freshProducts);
|
|
91
|
+
if (osKey) {
|
|
92
|
+
(0, import_productCache.setProductCache)(osKey, freshProducts);
|
|
93
|
+
console.log("[ProductCache] 已更新缓存");
|
|
94
|
+
}
|
|
95
|
+
setLoading(false);
|
|
96
|
+
} else {
|
|
97
|
+
console.log("[ProductCache] 3次尝试后仍未获取到数据");
|
|
98
|
+
(_d = (_c = app == null ? void 0 : app.logger) == null ? void 0 : _c.addLog) == null ? void 0 : _d.call(_c, {
|
|
99
|
+
type: "error",
|
|
100
|
+
title: "[getProduct] 3次尝试后仍未获取到数据",
|
|
101
|
+
metadata: {
|
|
102
|
+
error: lastError
|
|
128
103
|
}
|
|
129
|
-
}
|
|
130
|
-
|
|
104
|
+
});
|
|
105
|
+
if ((lastError == null ? void 0 : lastError.code) === 607100 && (isFirstLoadDataRef.current || products.length > 0)) {
|
|
106
|
+
(_e = notAvailableRef.current) == null ? void 0 : _e.open();
|
|
131
107
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (platform === "shop") {
|
|
136
|
-
return;
|
|
108
|
+
setLoading(false);
|
|
109
|
+
setProducts([]);
|
|
110
|
+
isFirstLoadDataRef.current = false;
|
|
137
111
|
}
|
|
138
|
-
const scheduleTimePoints2 = await bookingTicket.getScheduleTimePoints(params);
|
|
139
|
-
setScheduleTimePoints(scheduleTimePoints2);
|
|
140
112
|
});
|
|
141
113
|
return {
|
|
142
|
-
getScheduleTimePoints,
|
|
143
114
|
getProducts,
|
|
144
115
|
products,
|
|
145
116
|
loading
|
|
@@ -4,7 +4,6 @@ interface TicketBookingProps {
|
|
|
4
4
|
productExtensionType: string[];
|
|
5
5
|
bookingConfigParams: Record<string, any>;
|
|
6
6
|
isShowMenuBar?: boolean;
|
|
7
|
-
onPrerenderComplete?: () => void;
|
|
8
7
|
isShowTimeBar?: boolean;
|
|
9
8
|
isShowFloatButtons?: boolean;
|
|
10
9
|
productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
|
|
@@ -194,7 +194,6 @@ var ticketBooking_default = (props) => {
|
|
|
194
194
|
productExtensionType,
|
|
195
195
|
bookingConfigParams: propsBookingConfigParams,
|
|
196
196
|
isShowMenuBar = true,
|
|
197
|
-
onPrerenderComplete,
|
|
198
197
|
isShowTimeBar: propsIsShowTimeBar = true,
|
|
199
198
|
isShowFloatButtons: propsIsShowFloatButtons = true,
|
|
200
199
|
productDisplayConfig: propsProductDisplayConfig,
|
|
@@ -275,7 +274,6 @@ var ticketBooking_default = (props) => {
|
|
|
275
274
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-ticket-booking-wrapper" }, isShowMenuBar && /* @__PURE__ */ import_react.default.createElement(import_menuBar.default, { activeNavKey, onNavChange: setActiveNavKey }), /* @__PURE__ */ import_react.default.createElement(import_IsActiveContext.IsActiveProvider, { isActive }, /* @__PURE__ */ import_react.default.createElement(import_OsKeyContext.OsKeyProvider, { osKey }, /* @__PURE__ */ import_react.default.createElement(import_miniRedux.Provider, { store: storeRef.current, key: activeNavKey }, /* @__PURE__ */ import_react.default.createElement(
|
|
276
275
|
import_ticketBooking.default,
|
|
277
276
|
{
|
|
278
|
-
onPrerenderComplete,
|
|
279
277
|
productDisplayConfig,
|
|
280
278
|
isShowTimeBar,
|
|
281
279
|
isShowFloatButtons
|