@pisell/private-materials 6.4.56 → 6.4.57
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 +7 -12
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/es/components/booking/components/actionButtons/index.js +15 -7
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/footer/amount.js +1 -1
- package/es/components/booking/components/footer/index.js +2 -2
- package/es/components/booking/components/footer/utils.js +7 -2
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/components/voucher/index.js +23 -19
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/cartClientCard/index.js +7 -3
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +17 -12
- package/es/components/checkout/hooks/useWalletPass.js +36 -21
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/payo/config.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/eftposPay/tip.d.ts +1 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/es/components/list/List.js +957 -0
- package/es/components/list/List.less +2 -0
- package/es/components/list/ResponsiveWrapper.js +130 -0
- package/es/components/list/TestResponsiveWrapper.js +816 -0
- package/es/components/list/TestResponsiveWrapper.less +968 -0
- package/es/components/list/components/EmptyState/EmptyState.js +75 -0
- package/es/components/list/components/EmptyState/EmptyState.less +121 -0
- package/es/components/list/components/EmptyState/index.js +1 -0
- package/es/components/list/components/ListItemSkeleton/ListItemSkeleton.js +39 -0
- package/es/components/list/components/ListItemSkeleton/ListItemSkeleton.less +29 -0
- package/es/components/list/components/ListItemSkeleton/index.js +2 -0
- package/es/components/list/components/Pagination/Pagination.js +240 -0
- package/es/components/list/components/Pagination/Pagination.less +439 -0
- package/es/components/list/components/Pagination/index.js +1 -0
- package/es/components/list/components/ScrollLoader/ScrollLoader.js +18 -0
- package/es/components/list/components/ScrollLoader/ScrollLoader.less +3 -0
- package/es/components/list/components/ScrollLoader/index.js +1 -0
- package/es/components/list/components/Tab/Tab.js +43 -0
- package/es/components/list/components/Tab/Tab.less +139 -0
- package/es/components/list/components/Tab/index.js +1 -0
- package/es/components/list/components/Tab/types.js +1 -0
- package/es/components/list/components/TabSkeleton/TabSkeleton.js +28 -0
- package/es/components/list/components/TabSkeleton/TabSkeleton.less +38 -0
- package/es/components/list/components/TabSkeleton/index.js +2 -0
- package/es/components/list/components/WaterfallList/WaterfallList.js +191 -0
- package/es/components/list/components/WaterfallList/WaterfallList.less +201 -0
- package/es/components/list/components/WaterfallList/index.js +1 -0
- package/es/components/list/examples/GroupedListExample.js +207 -0
- package/es/components/list/hooks/index.js +3 -0
- package/es/components/list/hooks/useDevice.js +102 -0
- package/es/components/list/hooks/useListState.js +176 -0
- package/es/components/list/hooks/useWaterfall.js +161 -0
- package/es/components/list/index.js +7 -0
- package/es/components/list/locales.js +107 -0
- package/es/components/list/styles/base.less +39 -0
- package/es/components/list/styles/content.less +416 -0
- package/es/components/list/styles/floatButton.less +107 -0
- package/es/components/list/styles/footer.less +49 -0
- package/es/components/list/styles/header.less +69 -0
- package/es/components/list/styles/responsive.less +166 -0
- package/es/components/list/types.js +1 -0
- package/es/components/list/utils/getText.js +150 -0
- package/es/components/list/utils/index.js +5 -0
- package/es/components/login/index.d.ts +1 -0
- package/es/components/pay/toB/store/hooks.js +19 -5
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/es/components/schedules/products/list/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +143 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.js +7 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +41 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/types.js +273 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.js +130 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +20 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +46 -11
- package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -2
- package/es/components/ticketBooking/components/menuBar/index.js +40 -17
- package/es/components/ticketBooking/components/menuBar/index.less +27 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +6 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +66 -23
- package/es/components/ticketBooking/components/timeBar/index.less +1 -0
- package/es/components/ticketBooking/context/IsActiveContext.js +37 -0
- package/es/components/ticketBooking/context/OsKeyContext.js +37 -0
- package/es/components/ticketBooking/context/index.js +2 -0
- package/es/components/ticketBooking/hooks/pisellos/bookingTicket.js +13 -1
- package/es/components/ticketBooking/hooks/pisellos/index.js +2 -1
- package/es/components/ticketBooking/hooks/pisellos/useActiveExecute.js +50 -0
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +12 -4
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +43 -9
- package/es/components/ticketBooking/hooks/pisellos/useScanCustomer.js +5 -2
- package/es/components/ticketBooking/hooks/pisellos/useScanGlobal.js +7 -2
- package/es/components/ticketBooking/hooks/pisellos/useShopDiscountModule.js +17 -0
- package/es/components/ticketBooking/index.d.ts +6 -0
- package/es/components/ticketBooking/index.js +86 -11
- package/es/components/ticketBooking/utils/index.js +50 -1
- package/es/components/ticketBooking/utils/productCache.js +184 -0
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/hooks/usePaymentLogger.d.ts +1 -0
- package/es/index.js +3 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.js +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.less +8 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.js +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.less +17 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.js +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.less +17 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.js +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.less +17 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.js +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.less +2 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.js +100 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.less +8 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.js +32 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.less +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.js +239 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.less +44 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.js +34 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.less +14 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.js +33 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.less +30 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +75 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.less +46 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.js +39 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.less +9 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Cover/index.js +53 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Cover/index.less +31 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.js +31 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.less +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.js +58 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.less +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.js +85 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.less +24 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Price/index.js +121 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Price/index.less +57 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.js +95 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.less +18 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.js +31 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.less +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.js +47 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.less +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.js +34 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.less +13 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.js +95 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.less +18 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.js +31 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.less +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Title/index.js +34 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Title/index.less +13 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.js +39 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.less +22 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.js +20 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.less +20 -0
- package/es/plus/productSelect/ProductCard/SkuCard/hooks/useDynamicComponents.js +55 -0
- package/es/plus/productSelect/ProductCard/SkuCard/index.js +38 -0
- package/es/plus/productSelect/ProductCard/SkuCard/locales.js +41 -0
- package/es/plus/productSelect/ProductCard/SkuCard/status.js +481 -0
- package/es/plus/productSelect/ProductCard/SkuCard/type.js +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/utils.js +21 -0
- package/es/plus/productSelect/components/pisellPriceText/index.js +7 -5
- package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/es/plus/saasRegister/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/lib/components/booking/components/actionButtons/index.js +22 -15
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.js +1 -1
- package/lib/components/booking/components/footer/index.js +2 -2
- package/lib/components/booking/components/footer/utils.js +7 -2
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/components/voucher/index.js +33 -40
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/cartClientCard/index.js +7 -3
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +15 -12
- package/lib/components/checkout/hooks/useWalletPass.js +57 -45
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/payo/config.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/eftposPay/tip.d.ts +1 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/lib/components/list/List.js +771 -0
- package/lib/components/list/List.less +2 -0
- package/lib/components/list/ResponsiveWrapper.js +145 -0
- package/lib/components/list/TestResponsiveWrapper.js +493 -0
- package/lib/components/list/TestResponsiveWrapper.less +968 -0
- package/lib/components/list/components/EmptyState/EmptyState.js +75 -0
- package/lib/components/list/components/EmptyState/EmptyState.less +121 -0
- package/lib/components/list/components/EmptyState/index.js +35 -0
- package/lib/components/list/components/ListItemSkeleton/ListItemSkeleton.js +75 -0
- package/lib/components/list/components/ListItemSkeleton/ListItemSkeleton.less +29 -0
- package/lib/components/list/components/ListItemSkeleton/index.js +41 -0
- package/lib/components/list/components/Pagination/Pagination.js +205 -0
- package/lib/components/list/components/Pagination/Pagination.less +439 -0
- package/lib/components/list/components/Pagination/index.js +35 -0
- package/lib/components/list/components/ScrollLoader/ScrollLoader.js +37 -0
- package/lib/components/list/components/ScrollLoader/ScrollLoader.less +3 -0
- package/lib/components/list/components/ScrollLoader/index.js +35 -0
- package/lib/components/list/components/Tab/Tab.js +72 -0
- package/lib/components/list/components/Tab/Tab.less +139 -0
- package/lib/components/list/components/Tab/index.js +35 -0
- package/lib/components/list/components/Tab/types.js +17 -0
- package/lib/components/list/components/TabSkeleton/TabSkeleton.js +61 -0
- package/lib/components/list/components/TabSkeleton/TabSkeleton.less +38 -0
- package/lib/components/list/components/TabSkeleton/index.js +41 -0
- package/lib/components/list/components/WaterfallList/WaterfallList.js +178 -0
- package/lib/components/list/components/WaterfallList/WaterfallList.less +201 -0
- package/lib/components/list/components/WaterfallList/index.js +35 -0
- package/lib/components/list/examples/GroupedListExample.js +210 -0
- package/lib/components/list/hooks/index.js +47 -0
- package/lib/components/list/hooks/useDevice.js +96 -0
- package/lib/components/list/hooks/useListState.js +149 -0
- package/lib/components/list/hooks/useWaterfall.js +124 -0
- package/lib/components/list/index.js +60 -0
- package/lib/components/list/locales.js +113 -0
- package/lib/components/list/styles/base.less +39 -0
- package/lib/components/list/styles/content.less +416 -0
- package/lib/components/list/styles/floatButton.less +107 -0
- package/lib/components/list/styles/footer.less +49 -0
- package/lib/components/list/styles/header.less +69 -0
- package/lib/components/list/styles/responsive.less +166 -0
- package/lib/components/list/types.js +17 -0
- package/lib/components/list/utils/getText.js +95 -0
- package/lib/components/list/utils/index.js +43 -0
- package/lib/components/login/index.d.ts +1 -0
- package/lib/components/pay/toB/store/hooks.js +16 -8
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/calendar/index.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/lib/components/schedules/products/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/list/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +165 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.js +45 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +41 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/types.js +247 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.js +100 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +20 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +45 -11
- package/lib/components/ticketBooking/components/addServiceVariant/index.js +3 -2
- package/lib/components/ticketBooking/components/menuBar/index.js +24 -18
- package/lib/components/ticketBooking/components/menuBar/index.less +27 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +6 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +56 -25
- package/lib/components/ticketBooking/components/timeBar/index.less +1 -0
- package/lib/components/ticketBooking/context/IsActiveContext.js +56 -0
- package/lib/components/ticketBooking/context/OsKeyContext.js +56 -0
- package/lib/components/ticketBooking/context/index.js +44 -0
- package/lib/components/ticketBooking/hooks/pisellos/bookingTicket.js +5 -1
- package/lib/components/ticketBooking/hooks/pisellos/index.js +3 -1
- package/lib/components/ticketBooking/hooks/pisellos/useActiveExecute.js +47 -0
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +17 -10
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +26 -4
- package/lib/components/ticketBooking/hooks/pisellos/useScanCustomer.js +4 -2
- package/lib/components/ticketBooking/hooks/pisellos/useScanGlobal.js +6 -2
- package/lib/components/ticketBooking/hooks/pisellos/useShopDiscountModule.js +37 -0
- package/lib/components/ticketBooking/index.d.ts +6 -0
- package/lib/components/ticketBooking/index.js +64 -8
- package/lib/components/ticketBooking/utils/index.js +70 -2
- package/lib/components/ticketBooking/utils/productCache.js +144 -0
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/hooks/usePaymentLogger.d.ts +1 -0
- package/lib/index.js +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.js +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.less +8 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.js +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.less +17 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.js +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.less +17 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.js +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.less +17 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.js +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.less +2 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.js +129 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.less +8 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.js +52 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.less +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.js +178 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.less +44 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.js +52 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.less +14 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.js +63 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.less +30 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +131 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.less +46 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.js +62 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.less +9 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Cover/index.js +78 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Cover/index.less +31 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.js +51 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.less +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.js +94 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.less +11 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.js +115 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.less +24 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Price/index.js +139 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Price/index.less +57 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.js +97 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.less +18 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.js +51 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.less +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.js +58 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.less +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.js +56 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.less +13 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.js +97 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.less +18 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.js +51 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.less +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Title/index.js +56 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Title/index.less +13 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.js +58 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.less +22 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.js +49 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.less +20 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/hooks/useDynamicComponents.js +83 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/index.js +68 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/locales.js +65 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/status.js +501 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/type.js +17 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/utils.js +37 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.js +6 -5
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/lib/plus/saasRegister/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/lowcode/sku-card/meta.ts +1812 -0
- package/lowcode/sku-card/snippets.ts +372 -0
- package/lowcode/sku-list/meta.ts +410 -0
- package/package.json +12 -12
- package/es/components/booking/components/actionButtons/index.d.ts +0 -31
- package/es/components/booking/components/footer/index.d.ts +0 -11
- package/es/components/booking/components/voucher/index.d.ts +0 -3
- package/es/components/booking/info2/cartClientCard/index.d.ts +0 -6
- package/es/components/checkout/hooks/useWalletPass.d.ts +0 -40
- package/es/components/pay/toB/store/hooks.d.ts +0 -15
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -6
- package/es/components/ticketBooking/components/menuBar/index.d.ts +0 -3
- package/es/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +0 -1
- package/es/components/ticketBooking/hooks/pisellos/index.d.ts +0 -3
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +0 -25
- package/es/components/ticketBooking/hooks/pisellos/useScanCustomer.d.ts +0 -5
- package/es/components/ticketBooking/hooks/pisellos/useScanGlobal.d.ts +0 -5
- package/es/components/ticketBooking/utils/index.d.ts +0 -62
- package/es/index.d.ts +0 -63
- package/es/plus/productSelect/components/pisellPriceText/index.d.ts +0 -12
- package/lib/components/booking/components/actionButtons/index.d.ts +0 -31
- package/lib/components/booking/components/footer/index.d.ts +0 -11
- package/lib/components/booking/components/voucher/index.d.ts +0 -3
- package/lib/components/booking/info2/cartClientCard/index.d.ts +0 -6
- package/lib/components/checkout/hooks/useWalletPass.d.ts +0 -40
- package/lib/components/pay/toB/store/hooks.d.ts +0 -15
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -6
- package/lib/components/ticketBooking/components/menuBar/index.d.ts +0 -3
- package/lib/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +0 -1
- package/lib/components/ticketBooking/hooks/pisellos/index.d.ts +0 -3
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +0 -25
- package/lib/components/ticketBooking/hooks/pisellos/useScanCustomer.d.ts +0 -5
- package/lib/components/ticketBooking/hooks/pisellos/useScanGlobal.d.ts +0 -5
- package/lib/components/ticketBooking/utils/index.d.ts +0 -62
- package/lib/index.d.ts +0 -63
- package/lib/plus/productSelect/components/pisellPriceText/index.d.ts +0 -12
|
@@ -10,9 +10,12 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import { useMemoizedFn } from 'ahooks';
|
|
12
12
|
import { useBookingTicket } from "./bookingTicket";
|
|
13
|
-
import { useState } from 'react';
|
|
13
|
+
import { useState, useRef } from 'react';
|
|
14
|
+
import { useOsKey } from "../../context/OsKeyContext";
|
|
15
|
+
import { getProductCache, setProductCache } from "../../utils/productCache";
|
|
14
16
|
export var useProducts = function useProducts() {
|
|
15
17
|
var bookingTicket = useBookingTicket();
|
|
18
|
+
var osKey = useOsKey();
|
|
16
19
|
var _useState = useState([]),
|
|
17
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18
21
|
products = _useState2[0],
|
|
@@ -21,24 +24,55 @@ export var useProducts = function useProducts() {
|
|
|
21
24
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
22
25
|
loading = _useState4[0],
|
|
23
26
|
setLoading = _useState4[1];
|
|
27
|
+
var isFirstLoadRef = useRef(true);
|
|
24
28
|
var getProducts = useMemoizedFn( /*#__PURE__*/function () {
|
|
25
29
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
26
|
-
var
|
|
30
|
+
var cachedProducts, freshProducts;
|
|
27
31
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
28
32
|
while (1) switch (_context.prev = _context.next) {
|
|
29
33
|
case 0:
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
// 1. 如果是首次加载,尝试从缓存中获取数据
|
|
35
|
+
if (isFirstLoadRef.current && osKey) {
|
|
36
|
+
cachedProducts = getProductCache(osKey);
|
|
37
|
+
if (cachedProducts) {
|
|
38
|
+
// 先展示缓存数据
|
|
39
|
+
setProducts(cachedProducts);
|
|
40
|
+
setLoading(false);
|
|
41
|
+
}
|
|
42
|
+
isFirstLoadRef.current = false;
|
|
43
|
+
} else {
|
|
44
|
+
setLoading(true);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 2. 无论是否有缓存,都调用接口获取最新数据
|
|
48
|
+
_context.prev = 1;
|
|
49
|
+
_context.next = 4;
|
|
32
50
|
return bookingTicket.loadProducts(params);
|
|
33
|
-
case
|
|
34
|
-
|
|
35
|
-
|
|
51
|
+
case 4:
|
|
52
|
+
freshProducts = _context.sent;
|
|
53
|
+
// 3. 更新展示数据
|
|
54
|
+
setProducts(freshProducts);
|
|
55
|
+
|
|
56
|
+
// 4. 将新数据缓存到 storage
|
|
57
|
+
if (osKey) {
|
|
58
|
+
setProductCache(osKey, freshProducts);
|
|
59
|
+
console.log('[ProductCache] 已更新缓存');
|
|
60
|
+
}
|
|
61
|
+
_context.next = 12;
|
|
62
|
+
break;
|
|
63
|
+
case 9:
|
|
64
|
+
_context.prev = 9;
|
|
65
|
+
_context.t0 = _context["catch"](1);
|
|
66
|
+
console.error('[ProductCache] 获取产品失败:', _context.t0);
|
|
67
|
+
case 12:
|
|
68
|
+
_context.prev = 12;
|
|
36
69
|
setLoading(false);
|
|
37
|
-
|
|
70
|
+
return _context.finish(12);
|
|
71
|
+
case 15:
|
|
38
72
|
case "end":
|
|
39
73
|
return _context.stop();
|
|
40
74
|
}
|
|
41
|
-
}, _callee);
|
|
75
|
+
}, _callee, null, [[1, 9, 12, 15]]);
|
|
42
76
|
}));
|
|
43
77
|
return function (_x) {
|
|
44
78
|
return _ref.apply(this, arguments);
|
|
@@ -3,13 +3,16 @@ import { locales } from "@pisell/utils";
|
|
|
3
3
|
import { useBookingTicket } from "./bookingTicket";
|
|
4
4
|
import { formatScanCustomer } from "../../utils";
|
|
5
5
|
import { useToast } from '@pisell/materials';
|
|
6
|
+
import { useActiveExecute } from "./useActiveExecute";
|
|
6
7
|
var useScanCustomer = function useScanCustomer() {
|
|
7
8
|
var bookingTicket = useBookingTicket();
|
|
8
9
|
var scanRef = useRef(null);
|
|
9
10
|
var Toast = useToast();
|
|
11
|
+
var _useActiveExecute = useActiveExecute(),
|
|
12
|
+
executeIfActive = _useActiveExecute.executeIfActive;
|
|
10
13
|
var handleScanCustomer = function handleScanCustomer(callback) {
|
|
11
14
|
console.log('handleScanCustomer>>>>>>>', callback);
|
|
12
|
-
scanRef.current = bookingTicket === null || bookingTicket === void 0 ? void 0 : bookingTicket.scanCustomerListener(function (data) {
|
|
15
|
+
scanRef.current = bookingTicket === null || bookingTicket === void 0 ? void 0 : bookingTicket.scanCustomerListener(executeIfActive(function (data) {
|
|
13
16
|
console.log('scanCustomerListener>>>>>>>', data);
|
|
14
17
|
if (data.status === 'failed') {
|
|
15
18
|
Toast.fail(locales.getText('pisell2.text.scan-global-failed'));
|
|
@@ -17,7 +20,7 @@ var useScanCustomer = function useScanCustomer() {
|
|
|
17
20
|
}
|
|
18
21
|
var customer = formatScanCustomer(data);
|
|
19
22
|
callback(customer);
|
|
20
|
-
});
|
|
23
|
+
}));
|
|
21
24
|
};
|
|
22
25
|
return {
|
|
23
26
|
openScan: handleScanCustomer,
|
|
@@ -3,12 +3,17 @@ import { useBookingTicket } from "./bookingTicket";
|
|
|
3
3
|
import { formatScanGlobal } from "../../utils";
|
|
4
4
|
import { useToast } from '@pisell/materials';
|
|
5
5
|
import { locales } from '@pisell/utils';
|
|
6
|
+
import { useActiveExecute } from "./useActiveExecute";
|
|
6
7
|
var useScanGlobal = function useScanGlobal() {
|
|
7
8
|
var bookingTicket = useBookingTicket();
|
|
8
9
|
var scanRef = useRef(null);
|
|
9
10
|
var Toast = useToast();
|
|
11
|
+
var _useActiveExecute = useActiveExecute(),
|
|
12
|
+
executeIfActive = _useActiveExecute.executeIfActive;
|
|
10
13
|
var handleScanGlobal = function handleScanGlobal(callback) {
|
|
11
|
-
|
|
14
|
+
var _bookingTicket$initPe;
|
|
15
|
+
bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$initPe = bookingTicket.initPeripheralsListener) === null || _bookingTicket$initPe === void 0 || _bookingTicket$initPe.call(bookingTicket);
|
|
16
|
+
scanRef.current = bookingTicket === null || bookingTicket === void 0 ? void 0 : bookingTicket.scanGlobalListener(executeIfActive(function (data) {
|
|
12
17
|
console.log('scanGlobalListener>>>>>>>', data);
|
|
13
18
|
if (data.status === 'failed') {
|
|
14
19
|
Toast.fail(locales.getText('pisell2.text.scan-global-failed'));
|
|
@@ -16,7 +21,7 @@ var useScanGlobal = function useScanGlobal() {
|
|
|
16
21
|
}
|
|
17
22
|
var result = formatScanGlobal(data);
|
|
18
23
|
callback(result);
|
|
19
|
-
});
|
|
24
|
+
}));
|
|
20
25
|
};
|
|
21
26
|
return {
|
|
22
27
|
openScan: handleScanGlobal,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { usePisellOS } from "../../../../hooks/useEngineContext";
|
|
2
|
+
import { useOsKey } from "../../context/OsKeyContext";
|
|
3
|
+
import { getShopDiscountKey } from "../../utils";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* useShopDiscountModule Hook
|
|
7
|
+
* 获取当前 ShopDiscount 模块
|
|
8
|
+
* 通过 osKey 区分不同页面的模块实例
|
|
9
|
+
*/
|
|
10
|
+
export var useShopDiscountModule = function useShopDiscountModule() {
|
|
11
|
+
var pisellOS = usePisellOS();
|
|
12
|
+
var osKey = useOsKey();
|
|
13
|
+
|
|
14
|
+
// 根据 osKey 生成模块名称
|
|
15
|
+
var moduleKey = getShopDiscountKey(osKey || 'ticket');
|
|
16
|
+
return pisellOS.getModule(moduleKey);
|
|
17
|
+
};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { ProductDisplayConfig, ProductDisplayPresetKey } from './components/ProductDisplayAdapter/types';
|
|
1
2
|
import './index.less';
|
|
2
3
|
interface TicketBookingProps {
|
|
3
4
|
productExtensionType: string[];
|
|
4
5
|
bookingConfigParams: Record<string, any>;
|
|
5
6
|
isShowMenuBar?: boolean;
|
|
7
|
+
isShowTimeBar?: boolean;
|
|
8
|
+
isShowFloatButtons?: boolean;
|
|
9
|
+
productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
rulesHooks?: any;
|
|
6
12
|
}
|
|
7
13
|
declare const _default: (props: TicketBookingProps) => JSX.Element;
|
|
8
14
|
export default _default;
|
|
@@ -1,6 +1,12 @@
|
|
|
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
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
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
4
10
|
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
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
12
|
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); }
|
|
@@ -12,9 +18,12 @@ import { cloneDeep } from 'lodash';
|
|
|
12
18
|
import TicketBooking from "./components/ticketBooking/index";
|
|
13
19
|
import { request } from "../../utils";
|
|
14
20
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
15
|
-
import { getDefaultStartParam } from "./utils";
|
|
21
|
+
import { getBookingTicketKey, getDefaultStartParam, getShopDiscountKey, rulesHooks } from "./utils";
|
|
16
22
|
import localeTexts from "./locales";
|
|
17
23
|
import MenuBar from "./components/menuBar";
|
|
24
|
+
import { useLocalStorageState } from 'ahooks';
|
|
25
|
+
import { OsKeyProvider } from "./context/OsKeyContext";
|
|
26
|
+
import { IsActiveProvider } from "./context/IsActiveContext";
|
|
18
27
|
import "./index.less";
|
|
19
28
|
var initialState = {
|
|
20
29
|
amountSymbol: '$',
|
|
@@ -137,16 +146,60 @@ var initialState = {
|
|
|
137
146
|
export default (function (props) {
|
|
138
147
|
var _context$appHelper, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5;
|
|
139
148
|
var productExtensionType = props.productExtensionType,
|
|
140
|
-
|
|
149
|
+
propsBookingConfigParams = props.bookingConfigParams,
|
|
141
150
|
_props$isShowMenuBar = props.isShowMenuBar,
|
|
142
|
-
isShowMenuBar = _props$isShowMenuBar === void 0 ? true : _props$isShowMenuBar
|
|
151
|
+
isShowMenuBar = _props$isShowMenuBar === void 0 ? true : _props$isShowMenuBar,
|
|
152
|
+
_props$isShowTimeBar = props.isShowTimeBar,
|
|
153
|
+
propsIsShowTimeBar = _props$isShowTimeBar === void 0 ? true : _props$isShowTimeBar,
|
|
154
|
+
_props$isShowFloatBut = props.isShowFloatButtons,
|
|
155
|
+
propsIsShowFloatButtons = _props$isShowFloatBut === void 0 ? true : _props$isShowFloatBut,
|
|
156
|
+
propsProductDisplayConfig = props.productDisplayConfig,
|
|
157
|
+
_props$isActive = props.isActive,
|
|
158
|
+
isActive = _props$isActive === void 0 ? true : _props$isActive,
|
|
159
|
+
propsRulesHooks = props.rulesHooks;
|
|
160
|
+
var _useLocalStorageState = useLocalStorageState('pisell-ticket-booking-nav-key', {
|
|
161
|
+
defaultValue: 'ticket'
|
|
162
|
+
}),
|
|
163
|
+
_useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 2),
|
|
164
|
+
activeNavKey = _useLocalStorageState2[0],
|
|
165
|
+
setActiveNavKey = _useLocalStorageState2[1];
|
|
166
|
+
|
|
167
|
+
// 根据 activeNavKey 动态配置(仅在显示菜单栏时生效)
|
|
168
|
+
var bookingConfigParams = useMemo(function () {
|
|
169
|
+
if (isShowMenuBar && activeNavKey === 'food') {
|
|
170
|
+
return _objectSpread(_objectSpread({}, propsBookingConfigParams), {}, {
|
|
171
|
+
sub_type: 'food',
|
|
172
|
+
source_type: 'pos'
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
return propsBookingConfigParams;
|
|
176
|
+
}, [isShowMenuBar, activeNavKey, propsBookingConfigParams]);
|
|
177
|
+
var isShowTimeBar = useMemo(function () {
|
|
178
|
+
return isShowMenuBar && activeNavKey === 'food' ? false : propsIsShowTimeBar;
|
|
179
|
+
}, [isShowMenuBar, activeNavKey, propsIsShowTimeBar]);
|
|
180
|
+
var isShowFloatButtons = useMemo(function () {
|
|
181
|
+
return isShowMenuBar && activeNavKey === 'food' ? false : propsIsShowFloatButtons;
|
|
182
|
+
}, [isShowMenuBar, activeNavKey, propsIsShowFloatButtons]);
|
|
183
|
+
|
|
184
|
+
// 根据bookingConfigParams?.sub_type 动态配置osKey
|
|
185
|
+
// 多页面使用同一个组件时,需要根据不同的osKey来区分不同的页面
|
|
186
|
+
var osKey = useMemo(function () {
|
|
187
|
+
return bookingConfigParams === null || bookingConfigParams === void 0 ? void 0 : bookingConfigParams.sub_type;
|
|
188
|
+
}, [bookingConfigParams]);
|
|
189
|
+
var productDisplayConfig = useMemo(function () {
|
|
190
|
+
if (isShowMenuBar && activeNavKey === 'food') {
|
|
191
|
+
return 'sku-list-a5';
|
|
192
|
+
}
|
|
193
|
+
return propsProductDisplayConfig;
|
|
194
|
+
}, [isShowMenuBar, activeNavKey, propsProductDisplayConfig]);
|
|
143
195
|
var storeRef = useRef(null);
|
|
144
196
|
var context = useEngineContext();
|
|
145
197
|
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
|
146
198
|
pisellos = _context$appHelper$ut.pisellos,
|
|
147
199
|
pisellosAllModule = _context$appHelper$ut.pisellosAllModule;
|
|
148
200
|
var _ref = pisellosAllModule || {},
|
|
149
|
-
BookingTicket = _ref.BookingTicket
|
|
201
|
+
BookingTicket = _ref.BookingTicket,
|
|
202
|
+
ShopDiscountImpl = _ref.ShopDiscountImpl;
|
|
150
203
|
locales.init(localeTexts, ((_context$appHelper$ut2 = context.appHelper.utils) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut3 = _context$appHelper$ut2.getApp) === null || _context$appHelper$ut3 === void 0 || (_context$appHelper$ut3 = _context$appHelper$ut3.call(_context$appHelper$ut2)) === null || _context$appHelper$ut3 === void 0 || (_context$appHelper$ut3 = _context$appHelper$ut3.locales) === null || _context$appHelper$ut3 === void 0 || (_context$appHelper$ut4 = _context$appHelper$ut3.getLocale) === null || _context$appHelper$ut4 === void 0 ? void 0 : _context$appHelper$ut4.call(_context$appHelper$ut3)) || ((_context$appHelper$ut5 = context.appHelper.utils) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.storage) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.get('umi_locale')) || 'en');
|
|
151
204
|
useLayoutEffect(function () {
|
|
152
205
|
request.setRequest(context.appHelper.utils.request);
|
|
@@ -157,21 +210,43 @@ export default (function (props) {
|
|
|
157
210
|
productExtensionType: productExtensionType
|
|
158
211
|
}));
|
|
159
212
|
storeRef.current = store;
|
|
160
|
-
}, []);
|
|
213
|
+
}, [bookingConfigParams, productExtensionType]);
|
|
161
214
|
useMemo(function () {
|
|
162
215
|
if (BookingTicket) {
|
|
163
|
-
pisellos === null || pisellos === void 0 || pisellos.registerModule(new BookingTicket(
|
|
216
|
+
pisellos === null || pisellos === void 0 || pisellos.registerModule(new BookingTicket(getBookingTicketKey(osKey)), {
|
|
164
217
|
initialState: {},
|
|
165
218
|
otherParams: {
|
|
166
|
-
cacheId:
|
|
219
|
+
cacheId: getBookingTicketKey(osKey),
|
|
167
220
|
platform: 'shop'
|
|
168
221
|
}
|
|
169
222
|
});
|
|
170
223
|
}
|
|
171
|
-
|
|
224
|
+
if (ShopDiscountImpl) {
|
|
225
|
+
pisellos === null || pisellos === void 0 || pisellos.registerModule(new ShopDiscountImpl(getShopDiscountKey(osKey)), {
|
|
226
|
+
otherParams: {
|
|
227
|
+
platform: "shop",
|
|
228
|
+
rules: {
|
|
229
|
+
hooks: propsRulesHooks || rulesHooks
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}, [osKey]);
|
|
172
235
|
return /*#__PURE__*/React.createElement("div", {
|
|
173
236
|
className: "pisell-ticket-booking-wrapper"
|
|
174
|
-
}, isShowMenuBar && /*#__PURE__*/React.createElement(MenuBar,
|
|
175
|
-
|
|
176
|
-
|
|
237
|
+
}, isShowMenuBar && /*#__PURE__*/React.createElement(MenuBar, {
|
|
238
|
+
activeNavKey: activeNavKey,
|
|
239
|
+
onNavChange: setActiveNavKey
|
|
240
|
+
}), /*#__PURE__*/React.createElement(IsActiveProvider, {
|
|
241
|
+
isActive: isActive
|
|
242
|
+
}, /*#__PURE__*/React.createElement(OsKeyProvider, {
|
|
243
|
+
osKey: osKey
|
|
244
|
+
}, /*#__PURE__*/React.createElement(Provider, {
|
|
245
|
+
store: storeRef.current,
|
|
246
|
+
key: activeNavKey
|
|
247
|
+
}, /*#__PURE__*/React.createElement(TicketBooking, {
|
|
248
|
+
productDisplayConfig: productDisplayConfig,
|
|
249
|
+
isShowTimeBar: isShowTimeBar,
|
|
250
|
+
isShowFloatButtons: isShowFloatButtons
|
|
251
|
+
})))));
|
|
177
252
|
});
|
|
@@ -332,4 +332,53 @@ export var createSimpleCacheItem = function createSimpleCacheItem(item, e, state
|
|
|
332
332
|
new: 1
|
|
333
333
|
});
|
|
334
334
|
return cacheItem;
|
|
335
|
-
};
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
// 获取bookingTicket的key
|
|
338
|
+
export var getBookingTicketKey = function getBookingTicketKey(osKey) {
|
|
339
|
+
return "bookingTicket-".concat(osKey);
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
// 获取shopDiscount的key
|
|
343
|
+
export var getShopDiscountKey = function getShopDiscountKey(osKey) {
|
|
344
|
+
return "shopDiscount-".concat(osKey);
|
|
345
|
+
};
|
|
346
|
+
export var rulesHooks = {
|
|
347
|
+
// 获取商品关键信息
|
|
348
|
+
getProduct: function getProduct(product) {
|
|
349
|
+
var detail = {
|
|
350
|
+
booking_id: product.booking_id,
|
|
351
|
+
id: product.id,
|
|
352
|
+
_id: product._id,
|
|
353
|
+
price: product.price,
|
|
354
|
+
total: product._extend.total,
|
|
355
|
+
discount_list: product.discount_list,
|
|
356
|
+
origin_total: product._extend.origin_total,
|
|
357
|
+
num: product._extend.quantity,
|
|
358
|
+
quantity: product._extend.quantity || 1,
|
|
359
|
+
vouchersApplicable: product.vouchersApplicable
|
|
360
|
+
};
|
|
361
|
+
return detail;
|
|
362
|
+
},
|
|
363
|
+
setProduct: function setProduct(product, values) {
|
|
364
|
+
var detail = _objectSpread(_objectSpread({}, product), {}, {
|
|
365
|
+
_id: values._id || product._id,
|
|
366
|
+
discount_list: values.discount_list,
|
|
367
|
+
_extend: _objectSpread(_objectSpread(_objectSpread({}, product._extend), 'total' in values ? {
|
|
368
|
+
total: values.total
|
|
369
|
+
} : {}), 'quantity' in values ? {
|
|
370
|
+
quantity: values.quantity
|
|
371
|
+
} : {})
|
|
372
|
+
});
|
|
373
|
+
return detail;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
// 导出缓存工具函数
|
|
378
|
+
export {
|
|
379
|
+
// 通用缓存函数
|
|
380
|
+
getCache, setCache, clearCache, clearAllCache, clearAllCacheByOsKey,
|
|
381
|
+
// 产品缓存
|
|
382
|
+
getProductCache, setProductCache, clearProductCache, clearAllProductCache,
|
|
383
|
+
// BoardConfig 缓存
|
|
384
|
+
getBoardConfigCache, setBoardConfigCache, clearBoardConfigCache } from "./productCache";
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 产品数据缓存工具
|
|
3
|
+
* 使用 localStorage 实现类似 SWR 的缓存功能
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 缓存类型
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 生成缓存键
|
|
12
|
+
* @param osKey - OS 实例的唯一标识
|
|
13
|
+
* @param cacheType - 缓存类型
|
|
14
|
+
*/
|
|
15
|
+
var generateCacheKey = function generateCacheKey(osKey) {
|
|
16
|
+
var cacheType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'product';
|
|
17
|
+
return "".concat(cacheType, "_cache_").concat(osKey);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 通用缓存获取函数
|
|
22
|
+
* @param osKey - OS 实例的唯一标识
|
|
23
|
+
* @param cacheType - 缓存类型
|
|
24
|
+
* @param maxAge - 缓存最大有效期(毫秒),默认不限制
|
|
25
|
+
*/
|
|
26
|
+
export var getCache = function getCache(osKey) {
|
|
27
|
+
var cacheType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'product';
|
|
28
|
+
var maxAge = arguments.length > 2 ? arguments[2] : undefined;
|
|
29
|
+
try {
|
|
30
|
+
var cacheKey = generateCacheKey(osKey, cacheType);
|
|
31
|
+
var cacheStr = localStorage.getItem(cacheKey);
|
|
32
|
+
if (!cacheStr) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
var cache = JSON.parse(cacheStr);
|
|
36
|
+
|
|
37
|
+
// 检查缓存是否过期
|
|
38
|
+
if (maxAge && Date.now() - cache.timestamp > maxAge) {
|
|
39
|
+
localStorage.removeItem(cacheKey);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return cache.data;
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error("Failed to get ".concat(cacheType, " cache:"), error);
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 从缓存中获取产品数据(兼容旧接口)
|
|
51
|
+
* @param osKey - OS 实例的唯一标识
|
|
52
|
+
* @param maxAge - 缓存最大有效期(毫秒),默认不限制
|
|
53
|
+
*/
|
|
54
|
+
export var getProductCache = function getProductCache(osKey, maxAge) {
|
|
55
|
+
return getCache(osKey, 'product', maxAge);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 通用缓存设置函数
|
|
60
|
+
* @param osKey - OS 实例的唯一标识
|
|
61
|
+
* @param data - 要缓存的数据
|
|
62
|
+
* @param cacheType - 缓存类型
|
|
63
|
+
*/
|
|
64
|
+
export var setCache = function setCache(osKey, data) {
|
|
65
|
+
var cacheType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'product';
|
|
66
|
+
try {
|
|
67
|
+
var cacheKey = generateCacheKey(osKey, cacheType);
|
|
68
|
+
var cache = {
|
|
69
|
+
data: data,
|
|
70
|
+
timestamp: Date.now()
|
|
71
|
+
};
|
|
72
|
+
localStorage.setItem(cacheKey, JSON.stringify(cache));
|
|
73
|
+
} catch (error) {
|
|
74
|
+
console.error("Failed to set ".concat(cacheType, " cache:"), error);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 设置产品缓存数据(兼容旧接口)
|
|
80
|
+
* @param osKey - OS 实例的唯一标识
|
|
81
|
+
* @param data - 要缓存的数据
|
|
82
|
+
*/
|
|
83
|
+
export var setProductCache = function setProductCache(osKey, data) {
|
|
84
|
+
setCache(osKey, data, 'product');
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 清除指定类型的缓存
|
|
89
|
+
* @param osKey - OS 实例的唯一标识
|
|
90
|
+
* @param cacheType - 缓存类型
|
|
91
|
+
*/
|
|
92
|
+
export var clearCache = function clearCache(osKey) {
|
|
93
|
+
var cacheType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'product';
|
|
94
|
+
try {
|
|
95
|
+
var keys = Object.keys(localStorage);
|
|
96
|
+
var prefix = "".concat(cacheType, "_cache_").concat(osKey);
|
|
97
|
+
keys.forEach(function (key) {
|
|
98
|
+
if (key.startsWith(prefix)) {
|
|
99
|
+
localStorage.removeItem(key);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
} catch (error) {
|
|
103
|
+
console.error("Failed to clear ".concat(cacheType, " cache:"), error);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 清除指定 osKey 的产品缓存(兼容旧接口)
|
|
109
|
+
* @param osKey - OS 实例的唯一标识
|
|
110
|
+
*/
|
|
111
|
+
export var clearProductCache = function clearProductCache(osKey) {
|
|
112
|
+
clearCache(osKey, 'product');
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* 清除指定 osKey 的 BoardConfig 缓存
|
|
117
|
+
* @param osKey - OS 实例的唯一标识
|
|
118
|
+
*/
|
|
119
|
+
export var clearBoardConfigCache = function clearBoardConfigCache(osKey) {
|
|
120
|
+
clearCache(osKey, 'boardConfig');
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 清除指定 osKey 的所有类型缓存
|
|
125
|
+
* @param osKey - OS 实例的唯一标识
|
|
126
|
+
*/
|
|
127
|
+
export var clearAllCacheByOsKey = function clearAllCacheByOsKey(osKey) {
|
|
128
|
+
clearCache(osKey, 'product');
|
|
129
|
+
clearCache(osKey, 'boardConfig');
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* 清除所有产品缓存
|
|
134
|
+
*/
|
|
135
|
+
export var clearAllProductCache = function clearAllProductCache() {
|
|
136
|
+
try {
|
|
137
|
+
var keys = Object.keys(localStorage);
|
|
138
|
+
var prefix = 'product_cache_';
|
|
139
|
+
keys.forEach(function (key) {
|
|
140
|
+
if (key.startsWith(prefix)) {
|
|
141
|
+
localStorage.removeItem(key);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
} catch (error) {
|
|
145
|
+
console.error('Failed to clear all product cache:', error);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* 清除所有类型的缓存
|
|
151
|
+
*/
|
|
152
|
+
export var clearAllCache = function clearAllCache() {
|
|
153
|
+
try {
|
|
154
|
+
var keys = Object.keys(localStorage);
|
|
155
|
+
var prefixes = ['product_cache_', 'boardConfig_cache_'];
|
|
156
|
+
keys.forEach(function (key) {
|
|
157
|
+
if (prefixes.some(function (prefix) {
|
|
158
|
+
return key.startsWith(prefix);
|
|
159
|
+
})) {
|
|
160
|
+
localStorage.removeItem(key);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
} catch (error) {
|
|
164
|
+
console.error('Failed to clear all cache:', error);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* 获取 BoardConfig 缓存
|
|
170
|
+
* @param osKey - OS 实例的唯一标识
|
|
171
|
+
* @param maxAge - 缓存最大有效期(毫秒),默认不限制
|
|
172
|
+
*/
|
|
173
|
+
export var getBoardConfigCache = function getBoardConfigCache(osKey, maxAge) {
|
|
174
|
+
return getCache(osKey, 'boardConfig', maxAge);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* 设置 BoardConfig 缓存
|
|
179
|
+
* @param osKey - OS 实例的唯一标识
|
|
180
|
+
* @param data - 要缓存的数据
|
|
181
|
+
*/
|
|
182
|
+
export var setBoardConfigCache = function setBoardConfigCache(osKey, data) {
|
|
183
|
+
setCache(osKey, data, 'boardConfig');
|
|
184
|
+
};
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
addWalletCard: any;
|
|
4
|
+
}
|
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
6
|
+
walletDetailState: RechargeState;
|
|
7
|
+
} & {
|
|
8
|
+
dispatch: (params: {
|
|
9
|
+
type: string;
|
|
10
|
+
payload: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
total: number;
|
|
4
|
+
setup?: 'menu' | 'list' | 'detail' | string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
7
|
+
state: RechargeState;
|
|
8
|
+
} & {
|
|
9
|
+
dispatch: (params: {
|
|
10
|
+
type: string;
|
|
11
|
+
payload: any;
|
|
12
|
+
}) => void;
|
|
13
|
+
}>;
|
|
14
|
+
export {};
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
total: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
6
|
+
state: RechargeState;
|
|
7
|
+
} & {
|
|
8
|
+
dispatch: (params: {
|
|
9
|
+
type: string;
|
|
10
|
+
payload: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
selectedGiftOptionId: string | null;
|
|
4
|
+
cardList: Array<{
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
price: number;
|
|
8
|
+
}>;
|
|
9
|
+
selectedItem: {
|
|
10
|
+
id?: string;
|
|
11
|
+
gift_price?: number;
|
|
12
|
+
price?: number;
|
|
13
|
+
name?: string;
|
|
14
|
+
variant_id?: string;
|
|
15
|
+
};
|
|
16
|
+
productId?: string;
|
|
17
|
+
detailId?: string;
|
|
18
|
+
total: string | number;
|
|
19
|
+
rechargeModalOpen: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
22
|
+
state: RechargeState;
|
|
23
|
+
} & {
|
|
24
|
+
dispatch: (params: {
|
|
25
|
+
type: string;
|
|
26
|
+
payload: any;
|
|
27
|
+
}) => void;
|
|
28
|
+
}>;
|
|
29
|
+
export {};
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
total: 0;
|
|
4
|
+
}
|
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
6
|
+
state: RechargeState;
|
|
7
|
+
} & {
|
|
8
|
+
dispatch: (params: {
|
|
9
|
+
type: string;
|
|
10
|
+
payload: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { IWalletListItemProps } from './serve';
|
|
2
3
|
export interface WalletCardItemProps {
|
|
3
4
|
id: string;
|
|
@@ -26,4 +27,11 @@ export interface WalletListProps {
|
|
|
26
27
|
currentSearchListItemCode?: string;
|
|
27
28
|
[key: string]: any;
|
|
28
29
|
}
|
|
29
|
-
export declare const Provider: any, Context:
|
|
30
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
31
|
+
global_wallet: WalletListProps;
|
|
32
|
+
} & {
|
|
33
|
+
dispatch: (params: {
|
|
34
|
+
type: string;
|
|
35
|
+
payload: any;
|
|
36
|
+
}) => void;
|
|
37
|
+
}>;
|