@pisell/private-materials 6.5.27 → 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/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 +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/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 +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
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -15,13 +10,20 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
15
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
11
|
import { useMemoizedFn } from 'ahooks';
|
|
17
12
|
import { useBookingTicket } from "./bookingTicket";
|
|
18
|
-
import { useState,
|
|
19
|
-
import
|
|
20
|
-
import
|
|
13
|
+
import { useState, useRef } from 'react';
|
|
14
|
+
import { useOsKey } from "../../context/OsKeyContext";
|
|
15
|
+
import { getProductCache, setProductCache } from "../../utils/productCache";
|
|
16
|
+
import { useEngineContext } from "../../../../hooks";
|
|
17
|
+
// 等待函数
|
|
18
|
+
var sleep = function sleep(ms) {
|
|
19
|
+
return new Promise(function (resolve) {
|
|
20
|
+
return setTimeout(resolve, ms);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
21
23
|
export var useProducts = function useProducts(notAvailableRef) {
|
|
24
|
+
var _context$appHelper;
|
|
22
25
|
var bookingTicket = useBookingTicket();
|
|
23
|
-
var
|
|
24
|
-
var platform = usePlatform();
|
|
26
|
+
var osKey = useOsKey();
|
|
25
27
|
var _useState = useState([]),
|
|
26
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
29
|
products = _useState2[0],
|
|
@@ -31,184 +33,134 @@ export var useProducts = function useProducts(notAvailableRef) {
|
|
|
31
33
|
loading = _useState4[0],
|
|
32
34
|
setLoading = _useState4[1];
|
|
33
35
|
var isFirstLoadRef = useRef(true);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
setScheduleTimePoints = _useState6[1];
|
|
40
|
-
var scheduledTaskQueueIdRef = useRef('booking-schedule-products');
|
|
41
|
-
var paramsRef = useRef(undefined);
|
|
36
|
+
var isFirstLoadDataRef = useRef(true);
|
|
37
|
+
var context = useEngineContext();
|
|
38
|
+
var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
39
|
+
getApp = _ref.getApp;
|
|
40
|
+
var app = getApp();
|
|
42
41
|
var getProducts = useMemoizedFn( /*#__PURE__*/function () {
|
|
43
|
-
var
|
|
44
|
-
var
|
|
42
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
43
|
+
var cachedProducts, maxRetries, lastError, freshProducts, attempt, _app$logger, _app$logger$addLog, _app$logger2, _app$logger3, _app$logger3$addLog, _lastError, _notAvailableRef$curr;
|
|
45
44
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
46
45
|
while (1) switch (_context.prev = _context.next) {
|
|
47
46
|
case 0:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
break;
|
|
60
|
-
case 11:
|
|
61
|
-
_context.prev = 11;
|
|
62
|
-
_context.t0 = _context["catch"](1);
|
|
63
|
-
// 只有在第一次加载或之前有数据时才显示 notAvailable
|
|
64
|
-
if ((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.code) === 607100 && (isFirstLoadRef.current || products.length > 0)) {
|
|
65
|
-
(_notAvailableRef$curr = notAvailableRef.current) === null || _notAvailableRef$curr === void 0 || _notAvailableRef$curr.open();
|
|
47
|
+
// 1. 如果是首次加载,尝试从缓存中获取数据
|
|
48
|
+
if (isFirstLoadRef.current && osKey) {
|
|
49
|
+
cachedProducts = getProductCache(osKey);
|
|
50
|
+
if (cachedProducts && cachedProducts.length > 0) {
|
|
51
|
+
// 先展示缓存数据(只有非空时才展示)
|
|
52
|
+
setProducts(cachedProducts);
|
|
53
|
+
setLoading(false);
|
|
54
|
+
}
|
|
55
|
+
isFirstLoadRef.current = false;
|
|
56
|
+
} else {
|
|
57
|
+
setLoading(true);
|
|
66
58
|
}
|
|
67
|
-
setLoading(false);
|
|
68
|
-
isFirstLoadRef.current = false;
|
|
69
|
-
case 16:
|
|
70
|
-
case "end":
|
|
71
|
-
return _context.stop();
|
|
72
|
-
}
|
|
73
|
-
}, _callee, null, [[1, 11]]);
|
|
74
|
-
}));
|
|
75
|
-
return function (_x) {
|
|
76
|
-
return _ref.apply(this, arguments);
|
|
77
|
-
};
|
|
78
|
-
}());
|
|
79
|
-
|
|
80
|
-
// 注册任务函数并在 scheduleTimePoints 改变时添加定时任务
|
|
81
|
-
useEffect(function () {
|
|
82
|
-
if (platform === 'shop') {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
try {
|
|
86
|
-
var _context$appHelper, _context$appHelper$ge;
|
|
87
|
-
var app = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getApp) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper);
|
|
88
|
-
if (!app || !app.tasksManager) {
|
|
89
|
-
console.warn('App 或 tasksManager 不可用');
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
59
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
_context2.next = 4;
|
|
103
|
-
return getProducts(task.payload);
|
|
104
|
-
case 4:
|
|
105
|
-
return _context2.abrupt("return", {
|
|
106
|
-
status: 'success'
|
|
107
|
-
});
|
|
108
|
-
case 5:
|
|
109
|
-
case "end":
|
|
110
|
-
return _context2.stop();
|
|
60
|
+
// 2. 重试逻辑:最多尝试3次,每次等待1秒
|
|
61
|
+
maxRetries = 3;
|
|
62
|
+
lastError = null;
|
|
63
|
+
freshProducts = [];
|
|
64
|
+
attempt = 1;
|
|
65
|
+
case 5:
|
|
66
|
+
if (!(attempt <= maxRetries)) {
|
|
67
|
+
_context.next = 33;
|
|
68
|
+
break;
|
|
111
69
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// 先清除之前的定时任务
|
|
122
|
-
app.tasksManager.clearTasks({
|
|
123
|
-
module: 'scheduledTasks',
|
|
124
|
-
queueId: scheduledTaskQueueIdRef.current
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
// 为每个时间点创建定时任务
|
|
128
|
-
var tasks = scheduleTimePoints.map(function (timePoint) {
|
|
129
|
-
// 将 HH:mm 格式转换为今天的完整时间格式
|
|
130
|
-
var _timePoint$split = timePoint.split(':'),
|
|
131
|
-
_timePoint$split2 = _slicedToArray(_timePoint$split, 2),
|
|
132
|
-
hours = _timePoint$split2[0],
|
|
133
|
-
minutes = _timePoint$split2[1];
|
|
134
|
-
var executeDayjs = dayjs().hour(parseInt(hours, 10)).minute(parseInt(minutes, 10)).second(4);
|
|
135
|
-
var executeAt = executeDayjs.format('YYYY-MM-DD HH:mm:ss');
|
|
136
|
-
var schedule_date = executeDayjs.format('YYYY-MM-DD');
|
|
137
|
-
return {
|
|
138
|
-
action: 'getProducts',
|
|
139
|
-
payload: _objectSpread(_objectSpread({}, paramsRef.current), {}, {
|
|
140
|
-
schedule_date: schedule_date,
|
|
141
|
-
schedule_datetime: executeAt
|
|
142
|
-
}),
|
|
143
|
-
scheduled: {
|
|
144
|
-
executeAt: executeAt
|
|
70
|
+
_context.prev = 6;
|
|
71
|
+
console.log("[ProductCache] \u5C1D\u8BD5\u52A0\u8F7D\u6570\u636E\uFF0C\u7B2C ".concat(attempt, "/").concat(maxRetries, " \u6B21"));
|
|
72
|
+
_context.next = 10;
|
|
73
|
+
return bookingTicket.loadProducts(params);
|
|
74
|
+
case 10:
|
|
75
|
+
freshProducts = _context.sent;
|
|
76
|
+
if (!(freshProducts && freshProducts.length > 0)) {
|
|
77
|
+
_context.next = 14;
|
|
78
|
+
break;
|
|
145
79
|
}
|
|
146
|
-
|
|
147
|
-
|
|
80
|
+
console.log("[ProductCache] \u7B2C ".concat(attempt, " \u6B21\u5C1D\u8BD5\u6210\u529F\uFF0C\u83B7\u53D6\u5230 ").concat(freshProducts.length, " \u6761\u6570\u636E"));
|
|
81
|
+
return _context.abrupt("break", 33);
|
|
82
|
+
case 14:
|
|
83
|
+
// 数据为空,记录并准备重试
|
|
84
|
+
console.log("[ProductCache] \u7B2C ".concat(attempt, " \u6B21\u5C1D\u8BD5\u8FD4\u56DE\u7A7A\u6570\u636E"));
|
|
85
|
+
if (!(attempt < maxRetries)) {
|
|
86
|
+
_context.next = 19;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
console.log("[ProductCache] \u7B49\u5F85 1 \u79D2\u540E\u91CD\u8BD5...");
|
|
90
|
+
_context.next = 19;
|
|
91
|
+
return sleep(1000);
|
|
92
|
+
case 19:
|
|
93
|
+
_context.next = 30;
|
|
94
|
+
break;
|
|
95
|
+
case 21:
|
|
96
|
+
_context.prev = 21;
|
|
97
|
+
_context.t0 = _context["catch"](6);
|
|
98
|
+
lastError = _context.t0;
|
|
99
|
+
console.log("[ProductCache] \u7B2C ".concat(attempt, " \u6B21\u5C1D\u8BD5\u5931\u8D25:"), _context.t0);
|
|
100
|
+
app === null || app === void 0 || (_app$logger = app.logger) === null || _app$logger === void 0 || (_app$logger$addLog = (_app$logger2 = _app$logger).addLog) === null || _app$logger$addLog === void 0 || _app$logger$addLog.call(_app$logger2, {
|
|
101
|
+
type: 'info',
|
|
102
|
+
title: "[getProduct] bookingTicket.loadProducts error (attempt ".concat(attempt, "/").concat(maxRetries, ")"),
|
|
103
|
+
metadata: {
|
|
104
|
+
error: _context.t0,
|
|
105
|
+
attempt: attempt
|
|
106
|
+
}
|
|
107
|
+
});
|
|
148
108
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
109
|
+
// 如果还有重试机会,等待后继续
|
|
110
|
+
if (!(attempt < maxRetries)) {
|
|
111
|
+
_context.next = 30;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
console.log("[ProductCache] \u7B49\u5F85 1 \u79D2\u540E\u91CD\u8BD5...");
|
|
115
|
+
_context.next = 30;
|
|
116
|
+
return sleep(1000);
|
|
117
|
+
case 30:
|
|
118
|
+
attempt++;
|
|
119
|
+
_context.next = 5;
|
|
120
|
+
break;
|
|
121
|
+
case 33:
|
|
122
|
+
// 3. 处理最终结果
|
|
123
|
+
if (freshProducts && freshProducts.length > 0) {
|
|
124
|
+
// 成功获取到数据
|
|
125
|
+
isFirstLoadDataRef.current = false;
|
|
126
|
+
setProducts(freshProducts);
|
|
155
127
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
128
|
+
// 将新数据缓存到 storage
|
|
129
|
+
if (osKey) {
|
|
130
|
+
setProductCache(osKey, freshProducts);
|
|
131
|
+
console.log('[ProductCache] 已更新缓存');
|
|
132
|
+
}
|
|
133
|
+
setLoading(false);
|
|
134
|
+
} else {
|
|
135
|
+
// 3次尝试后仍然没有数据
|
|
136
|
+
console.log('[ProductCache] 3次尝试后仍未获取到数据');
|
|
137
|
+
app === null || app === void 0 || (_app$logger3 = app.logger) === null || _app$logger3 === void 0 || (_app$logger3$addLog = _app$logger3.addLog) === null || _app$logger3$addLog === void 0 || _app$logger3$addLog.call(_app$logger3, {
|
|
138
|
+
type: 'error',
|
|
139
|
+
title: '[getProduct] 3次尝试后仍未获取到数据',
|
|
140
|
+
metadata: {
|
|
141
|
+
error: lastError
|
|
142
|
+
}
|
|
143
|
+
});
|
|
166
144
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
module: 'scheduledTasks',
|
|
175
|
-
queueId: scheduledTaskQueueIdRef.current
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
} catch (error) {
|
|
179
|
-
console.error('清理定时任务失败:', error);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
}, [scheduleTimePoints]);
|
|
183
|
-
var getScheduleTimePoints = useMemoizedFn( /*#__PURE__*/function () {
|
|
184
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
185
|
-
var scheduleTimePoints;
|
|
186
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
187
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
188
|
-
case 0:
|
|
189
|
-
if (!(platform === 'shop')) {
|
|
190
|
-
_context3.next = 2;
|
|
191
|
-
break;
|
|
145
|
+
// 只有在第一次加载或之前有数据时才显示 notAvailable
|
|
146
|
+
if (((_lastError = lastError) === null || _lastError === void 0 ? void 0 : _lastError.code) === 607100 && (isFirstLoadDataRef.current || products.length > 0)) {
|
|
147
|
+
(_notAvailableRef$curr = notAvailableRef.current) === null || _notAvailableRef$curr === void 0 || _notAvailableRef$curr.open();
|
|
148
|
+
}
|
|
149
|
+
setLoading(false);
|
|
150
|
+
setProducts([]);
|
|
151
|
+
isFirstLoadDataRef.current = false;
|
|
192
152
|
}
|
|
193
|
-
|
|
194
|
-
case 2:
|
|
195
|
-
_context3.next = 4;
|
|
196
|
-
return bookingTicket.getScheduleTimePoints(params);
|
|
197
|
-
case 4:
|
|
198
|
-
scheduleTimePoints = _context3.sent;
|
|
199
|
-
setScheduleTimePoints(scheduleTimePoints);
|
|
200
|
-
case 6:
|
|
153
|
+
case 34:
|
|
201
154
|
case "end":
|
|
202
|
-
return
|
|
155
|
+
return _context.stop();
|
|
203
156
|
}
|
|
204
|
-
},
|
|
157
|
+
}, _callee, null, [[6, 21]]);
|
|
205
158
|
}));
|
|
206
|
-
return function (
|
|
207
|
-
return
|
|
159
|
+
return function (_x) {
|
|
160
|
+
return _ref2.apply(this, arguments);
|
|
208
161
|
};
|
|
209
162
|
}());
|
|
210
163
|
return {
|
|
211
|
-
getScheduleTimePoints: getScheduleTimePoints,
|
|
212
164
|
getProducts: getProducts,
|
|
213
165
|
products: products,
|
|
214
166
|
loading: 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;
|
|
@@ -149,7 +149,6 @@ export default (function (props) {
|
|
|
149
149
|
propsBookingConfigParams = props.bookingConfigParams,
|
|
150
150
|
_props$isShowMenuBar = props.isShowMenuBar,
|
|
151
151
|
isShowMenuBar = _props$isShowMenuBar === void 0 ? true : _props$isShowMenuBar,
|
|
152
|
-
onPrerenderComplete = props.onPrerenderComplete,
|
|
153
152
|
_props$isShowTimeBar = props.isShowTimeBar,
|
|
154
153
|
propsIsShowTimeBar = _props$isShowTimeBar === void 0 ? true : _props$isShowTimeBar,
|
|
155
154
|
_props$isShowFloatBut = props.isShowFloatButtons,
|
|
@@ -246,7 +245,6 @@ export default (function (props) {
|
|
|
246
245
|
store: storeRef.current,
|
|
247
246
|
key: activeNavKey
|
|
248
247
|
}, /*#__PURE__*/React.createElement(TicketBooking, {
|
|
249
|
-
onPrerenderComplete: onPrerenderComplete,
|
|
250
248
|
productDisplayConfig: productDisplayConfig,
|
|
251
249
|
isShowTimeBar: isShowTimeBar,
|
|
252
250
|
isShowFloatButtons: isShowFloatButtons
|
|
@@ -25,13 +25,7 @@ export var getClients = /*#__PURE__*/function () {
|
|
|
25
25
|
while (1) switch (_context.prev = _context.next) {
|
|
26
26
|
case 0:
|
|
27
27
|
_context.next = 2;
|
|
28
|
-
return request.getRequest().get(prefix + '/customer/select-list', params
|
|
29
|
-
cache: {
|
|
30
|
-
mode: 'remote_local',
|
|
31
|
-
updateCache: true,
|
|
32
|
-
type: "indexDB"
|
|
33
|
-
}
|
|
34
|
-
});
|
|
28
|
+
return request.getRequest().get(prefix + '/customer/select-list', params);
|
|
35
29
|
case 2:
|
|
36
30
|
_yield$request$getReq = _context.sent;
|
|
37
31
|
data = _yield$request$getReq.data;
|
|
@@ -99,13 +93,7 @@ export var getResources = /*#__PURE__*/function () {
|
|
|
99
93
|
while (1) switch (_context3.prev = _context3.next) {
|
|
100
94
|
case 0:
|
|
101
95
|
_context3.next = 2;
|
|
102
|
-
return request.getRequest().get(prefix + '/form/schedule', params
|
|
103
|
-
cache: {
|
|
104
|
-
mode: 'remote_local',
|
|
105
|
-
updateCache: true,
|
|
106
|
-
type: "indexDB"
|
|
107
|
-
}
|
|
108
|
-
});
|
|
96
|
+
return request.getRequest().get(prefix + '/form/schedule', params);
|
|
109
97
|
case 2:
|
|
110
98
|
_yield$request$getReq2 = _context3.sent;
|
|
111
99
|
data = _yield$request$getReq2.data;
|
|
@@ -167,13 +155,7 @@ export var getForms = /*#__PURE__*/function () {
|
|
|
167
155
|
while (1) switch (_context5.prev = _context5.next) {
|
|
168
156
|
case 0:
|
|
169
157
|
_context5.next = 2;
|
|
170
|
-
return request.getRequest().get(prefix + '/form/relation/record', params
|
|
171
|
-
cache: {
|
|
172
|
-
mode: 'remote_local',
|
|
173
|
-
updateCache: true,
|
|
174
|
-
type: "indexDB"
|
|
175
|
-
}
|
|
176
|
-
});
|
|
158
|
+
return request.getRequest().get(prefix + '/form/relation/record', params);
|
|
177
159
|
case 2:
|
|
178
160
|
_yield$request$getReq4 = _context5.sent;
|
|
179
161
|
data = _yield$request$getReq4.data;
|
|
@@ -206,13 +188,7 @@ export var getBookingConfig = /*#__PURE__*/function () {
|
|
|
206
188
|
_context6.next = 2;
|
|
207
189
|
return request.getRequest().get(prefix + '/core/board/management/config', _objectSpread({
|
|
208
190
|
item_type: 'appointment_booking'
|
|
209
|
-
}, params)
|
|
210
|
-
cache: {
|
|
211
|
-
mode: 'remote_local',
|
|
212
|
-
updateCache: true,
|
|
213
|
-
type: "indexDB"
|
|
214
|
-
}
|
|
215
|
-
});
|
|
191
|
+
}, params));
|
|
216
192
|
case 2:
|
|
217
193
|
_yield$request$getReq5 = _context6.sent;
|
|
218
194
|
data = _yield$request$getReq5.data;
|
|
@@ -244,13 +220,7 @@ export var getPets = /*#__PURE__*/function () {
|
|
|
244
220
|
while (1) switch (_context7.prev = _context7.next) {
|
|
245
221
|
case 0:
|
|
246
222
|
_context7.next = 2;
|
|
247
|
-
return request.getRequest().get("/form/".concat(formId), params
|
|
248
|
-
cache: {
|
|
249
|
-
mode: 'remote_local',
|
|
250
|
-
updateCache: true,
|
|
251
|
-
type: "indexDB"
|
|
252
|
-
}
|
|
253
|
-
});
|
|
223
|
+
return request.getRequest().get("/form/".concat(formId), params);
|
|
254
224
|
case 2:
|
|
255
225
|
_yield$request$getReq6 = _context7.sent;
|
|
256
226
|
data = _yield$request$getReq6.data;
|
|
@@ -281,13 +251,7 @@ export var getPetsData = /*#__PURE__*/function () {
|
|
|
281
251
|
while (1) switch (_context8.prev = _context8.next) {
|
|
282
252
|
case 0:
|
|
283
253
|
_context8.next = 2;
|
|
284
|
-
return request.getRequest().get(prefix + '/form/data/v1', params
|
|
285
|
-
cache: {
|
|
286
|
-
mode: 'remote_local',
|
|
287
|
-
updateCache: true,
|
|
288
|
-
type: "indexDB"
|
|
289
|
-
}
|
|
290
|
-
});
|
|
254
|
+
return request.getRequest().get(prefix + '/form/data/v1', params);
|
|
291
255
|
case 2:
|
|
292
256
|
_yield$request$getReq7 = _context8.sent;
|
|
293
257
|
data = _yield$request$getReq7.data;
|
|
@@ -350,13 +314,7 @@ export var getAddonsByOrderId = /*#__PURE__*/function () {
|
|
|
350
314
|
while (1) switch (_context10.prev = _context10.next) {
|
|
351
315
|
case 0:
|
|
352
316
|
_context10.next = 2;
|
|
353
|
-
return request.getRequest().get("".concat(prefix, "/order/appointment/addons/").concat(bookingId), params
|
|
354
|
-
cache: {
|
|
355
|
-
mode: 'remote_local',
|
|
356
|
-
updateCache: true,
|
|
357
|
-
type: "indexDB"
|
|
358
|
-
}
|
|
359
|
-
});
|
|
317
|
+
return request.getRequest().get("".concat(prefix, "/order/appointment/addons/").concat(bookingId), params);
|
|
360
318
|
case 2:
|
|
361
319
|
_yield$request$getReq9 = _context10.sent;
|
|
362
320
|
data = _yield$request$getReq9.data;
|
|
@@ -420,13 +378,7 @@ export var getBookingDetail = /*#__PURE__*/function () {
|
|
|
420
378
|
while (1) switch (_context12.prev = _context12.next) {
|
|
421
379
|
case 0:
|
|
422
380
|
_context12.next = 2;
|
|
423
|
-
return request.getRequest().get("".concat(prefix, "/order/appointment/").concat(bookingId), params
|
|
424
|
-
cache: {
|
|
425
|
-
mode: 'remote_local',
|
|
426
|
-
updateCache: true,
|
|
427
|
-
type: "indexDB"
|
|
428
|
-
}
|
|
429
|
-
});
|
|
381
|
+
return request.getRequest().get("".concat(prefix, "/order/appointment/").concat(bookingId), params);
|
|
430
382
|
case 2:
|
|
431
383
|
_yield$request$getReq11 = _context12.sent;
|
|
432
384
|
data = _yield$request$getReq11.data;
|
|
@@ -521,13 +473,7 @@ export var getNotesByOrder = /*#__PURE__*/function () {
|
|
|
521
473
|
while (1) switch (_context15.prev = _context15.next) {
|
|
522
474
|
case 0:
|
|
523
475
|
_context15.next = 2;
|
|
524
|
-
return request.getRequest().get(prefix + '/schedule/event-note', params
|
|
525
|
-
cache: {
|
|
526
|
-
mode: 'remote_local',
|
|
527
|
-
updateCache: true,
|
|
528
|
-
type: "indexDB"
|
|
529
|
-
}
|
|
530
|
-
});
|
|
476
|
+
return request.getRequest().get(prefix + '/schedule/event-note', params);
|
|
531
477
|
case 2:
|
|
532
478
|
_yield$request$getReq14 = _context15.sent;
|
|
533
479
|
data = _yield$request$getReq14.data;
|
|
@@ -684,13 +630,7 @@ export var getPaymentList = /*#__PURE__*/function () {
|
|
|
684
630
|
while (1) switch (_context20.prev = _context20.next) {
|
|
685
631
|
case 0:
|
|
686
632
|
_context20.next = 2;
|
|
687
|
-
return request.getRequest().get(prefix + '/order/payment', params
|
|
688
|
-
cache: {
|
|
689
|
-
mode: 'remote_local',
|
|
690
|
-
updateCache: true,
|
|
691
|
-
type: "indexDB"
|
|
692
|
-
}
|
|
693
|
-
});
|
|
633
|
+
return request.getRequest().get(prefix + '/order/payment', params);
|
|
694
634
|
case 2:
|
|
695
635
|
_yield$request$getReq19 = _context20.sent;
|
|
696
636
|
data = _yield$request$getReq19.data;
|
|
@@ -754,13 +694,7 @@ export var getRefundInfo = /*#__PURE__*/function () {
|
|
|
754
694
|
while (1) switch (_context22.prev = _context22.next) {
|
|
755
695
|
case 0:
|
|
756
696
|
_context22.next = 2;
|
|
757
|
-
return request.getRequest().get("".concat(prefix, "/order/refund-info/").concat(bookingId), params
|
|
758
|
-
cache: {
|
|
759
|
-
mode: 'remote_local',
|
|
760
|
-
updateCache: true,
|
|
761
|
-
type: "indexDB"
|
|
762
|
-
}
|
|
763
|
-
});
|
|
697
|
+
return request.getRequest().get("".concat(prefix, "/order/refund-info/").concat(bookingId), params);
|
|
764
698
|
case 2:
|
|
765
699
|
_yield$request$getReq21 = _context22.sent;
|
|
766
700
|
data = _yield$request$getReq21.data;
|
|
@@ -823,13 +757,7 @@ export var getEventBookingDetail = /*#__PURE__*/function () {
|
|
|
823
757
|
while (1) switch (_context24.prev = _context24.next) {
|
|
824
758
|
case 0:
|
|
825
759
|
_context24.next = 2;
|
|
826
|
-
return request.getRequest().get("".concat(prefix, "/eventbookingv2/order/").concat(bookingId), params
|
|
827
|
-
cache: {
|
|
828
|
-
mode: 'remote_local',
|
|
829
|
-
updateCache: true,
|
|
830
|
-
type: "indexDB"
|
|
831
|
-
}
|
|
832
|
-
});
|
|
760
|
+
return request.getRequest().get("".concat(prefix, "/eventbookingv2/order/").concat(bookingId), params);
|
|
833
761
|
case 2:
|
|
834
762
|
_yield$request$getReq23 = _context24.sent;
|
|
835
763
|
data = _yield$request$getReq23.data;
|
|
@@ -894,13 +822,7 @@ export var getDepositShow = /*#__PURE__*/function () {
|
|
|
894
822
|
_context26.next = 2;
|
|
895
823
|
return request.getRequest().get(prefix + '/metadata', _objectSpread({
|
|
896
824
|
key: 'bookingv2_deposit'
|
|
897
|
-
}, params)
|
|
898
|
-
cache: {
|
|
899
|
-
mode: 'remote_local',
|
|
900
|
-
updateCache: true,
|
|
901
|
-
type: "indexDB"
|
|
902
|
-
}
|
|
903
|
-
});
|
|
825
|
+
}, params));
|
|
904
826
|
case 2:
|
|
905
827
|
_yield$request$getReq25 = _context26.sent;
|
|
906
828
|
data = _yield$request$getReq25.data;
|
|
@@ -931,13 +853,7 @@ export var getFormRecords = /*#__PURE__*/function () {
|
|
|
931
853
|
while (1) switch (_context27.prev = _context27.next) {
|
|
932
854
|
case 0:
|
|
933
855
|
_context27.next = 2;
|
|
934
|
-
return request.getRequest().get(prefix + '/form/records', params
|
|
935
|
-
cache: {
|
|
936
|
-
mode: 'remote_local',
|
|
937
|
-
updateCache: true,
|
|
938
|
-
type: "indexDB"
|
|
939
|
-
}
|
|
940
|
-
});
|
|
856
|
+
return request.getRequest().get(prefix + '/form/records', params);
|
|
941
857
|
case 2:
|
|
942
858
|
_yield$request$getReq26 = _context27.sent;
|
|
943
859
|
data = _yield$request$getReq26.data;
|
|
@@ -968,13 +884,7 @@ export var getBookingList2 = /*#__PURE__*/function () {
|
|
|
968
884
|
while (1) switch (_context28.prev = _context28.next) {
|
|
969
885
|
case 0:
|
|
970
886
|
_context28.next = 2;
|
|
971
|
-
return request.getRequest().get(prefix + '/schedule/booking', params
|
|
972
|
-
cache: {
|
|
973
|
-
mode: 'remote_local',
|
|
974
|
-
updateCache: true,
|
|
975
|
-
type: "indexDB"
|
|
976
|
-
}
|
|
977
|
-
});
|
|
887
|
+
return request.getRequest().get(prefix + '/schedule/booking', params);
|
|
978
888
|
case 2:
|
|
979
889
|
_yield$request$getReq27 = _context28.sent;
|
|
980
890
|
data = _yield$request$getReq27.data;
|
|
@@ -1005,13 +915,7 @@ export var getOrderInfoByCode = /*#__PURE__*/function () {
|
|
|
1005
915
|
while (1) switch (_context29.prev = _context29.next) {
|
|
1006
916
|
case 0:
|
|
1007
917
|
_context29.next = 2;
|
|
1008
|
-
return request.getRequest().get(prefix + '/machinecode/order-info', params
|
|
1009
|
-
cache: {
|
|
1010
|
-
mode: 'remote_local',
|
|
1011
|
-
updateCache: true,
|
|
1012
|
-
type: "indexDB"
|
|
1013
|
-
}
|
|
1014
|
-
});
|
|
918
|
+
return request.getRequest().get(prefix + '/machinecode/order-info', params);
|
|
1015
919
|
case 2:
|
|
1016
920
|
_yield$request$getReq28 = _context29.sent;
|
|
1017
921
|
data = _yield$request$getReq28.data;
|
|
@@ -1042,13 +946,7 @@ export var getClientsEs = /*#__PURE__*/function () {
|
|
|
1042
946
|
while (1) switch (_context30.prev = _context30.next) {
|
|
1043
947
|
case 0:
|
|
1044
948
|
_context30.next = 2;
|
|
1045
|
-
return request.getRequest().get(prefix + '/customer/es/data', params
|
|
1046
|
-
cache: {
|
|
1047
|
-
mode: 'remote_local',
|
|
1048
|
-
updateCache: true,
|
|
1049
|
-
type: "indexDB"
|
|
1050
|
-
}
|
|
1051
|
-
});
|
|
949
|
+
return request.getRequest().get(prefix + '/customer/es/data', params);
|
|
1052
950
|
case 2:
|
|
1053
951
|
_yield$request$getReq29 = _context30.sent;
|
|
1054
952
|
data = _yield$request$getReq29.data;
|
|
@@ -15,15 +15,21 @@ export declare const restoreProductOtherData: (data: any) => {
|
|
|
15
15
|
quantity: number;
|
|
16
16
|
} | undefined;
|
|
17
17
|
export declare const isSameProduct: (a: any, b: any) => boolean;
|
|
18
|
-
export declare const addService: (list: any[], addItem: any, state: any) => {
|
|
18
|
+
export declare const addService: (list: any[], addItem: any, state: any, isMultiDay?: boolean) => {
|
|
19
|
+
list: any[];
|
|
20
|
+
count: number;
|
|
21
|
+
quantity?: undefined;
|
|
22
|
+
} | {
|
|
19
23
|
list: any[];
|
|
20
24
|
quantity: any;
|
|
25
|
+
count?: undefined;
|
|
21
26
|
};
|
|
22
27
|
export declare const addServiceScroll: (rowKey: string, cacheItem: any) => void;
|
|
23
28
|
export declare const getCartProductOverlay: (state: any) => any;
|
|
24
29
|
export declare const getIsOverlayProduct: (item: any, state: any) => any;
|
|
25
30
|
export declare const getIsShowNumber: (item: any, state: any) => any;
|
|
26
31
|
export declare const genServiceKey: (item: any) => string;
|
|
32
|
+
export declare const genHolderKey: (item: any) => string;
|
|
27
33
|
export declare const getIsParallelResourcesBooking: (record: any) => boolean;
|
|
28
34
|
declare type ScanData = {
|
|
29
35
|
type: string;
|