@pisell/private-materials 6.3.69 → 6.3.71
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 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +3 -3
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/voucher/index.js +8 -7
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/hooks/useQuotation.js +2 -2
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/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/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/kioskSkuDetail/index.d.ts +39 -0
- package/es/components/kioskSkuDetail/index.js +531 -0
- package/es/components/kioskSkuDetail/index.less +196 -0
- package/es/components/kioskSkuDetail/locales.d.ts +27 -0
- package/es/components/kioskSkuDetail/locales.js +26 -0
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +5 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/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 +1 -9
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/walletList/index.js +7 -2
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/VariantCard/index.js +30 -1
- package/es/plus/skuOptionsSelection/components/VariantCard/index.less +10 -0
- package/es/plus/skuOptionsSelection/locales.d.ts +3 -0
- package/es/plus/skuOptionsSelection/locales.js +3 -0
- package/es/plus/skuOptionsSelection/store/actions.js +17 -2
- package/es/plus/skuOptionsSelection/types.d.ts +5 -0
- package/es/plus/skuOptionsSelection/types.js +2 -1
- package/es/plus/skuOptionsSelection/utils/transformVariantGroup.js +70 -3
- package/es/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
- package/es/plus/walletPassGallery/index.js +2 -2
- package/es/pro/numberKeyboard/index.d.ts +28 -0
- package/es/pro/numberKeyboard/index.js +155 -0
- package/es/pro/numberKeyboard/index.less +25 -0
- package/es/pro/numberKeyboard/locales.d.ts +12 -0
- package/es/pro/numberKeyboard/locales.js +11 -0
- package/es/pro/pisellNumberSelector/example.d.ts +3 -0
- package/es/pro/pisellNumberSelector/example.js +68 -0
- package/es/pro/pisellNumberSelector/index.d.ts +29 -0
- package/es/pro/pisellNumberSelector/index.js +257 -0
- package/es/pro/pisellNumberSelector/index.less +235 -0
- package/es/pro/skuDetailModal/index.d.ts +4 -0
- package/es/pro/skuDetailModal/index.js +1031 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/voucher/index.js +0 -1
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/hooks/useQuotation.js +3 -3
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/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/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/kioskSkuDetail/index.d.ts +39 -0
- package/lib/components/kioskSkuDetail/index.js +393 -0
- package/lib/components/kioskSkuDetail/index.less +196 -0
- package/lib/components/kioskSkuDetail/locales.d.ts +27 -0
- package/lib/components/kioskSkuDetail/locales.js +50 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +5 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/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 +1 -9
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/walletList/index.js +5 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.js +7 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/VariantCard/index.js +32 -3
- package/lib/plus/skuOptionsSelection/components/VariantCard/index.less +10 -0
- package/lib/plus/skuOptionsSelection/locales.d.ts +3 -0
- package/lib/plus/skuOptionsSelection/locales.js +3 -0
- package/lib/plus/skuOptionsSelection/store/actions.js +25 -1
- package/lib/plus/skuOptionsSelection/types.d.ts +5 -0
- package/lib/plus/skuOptionsSelection/types.js +2 -1
- package/lib/plus/skuOptionsSelection/utils/transformVariantGroup.js +51 -5
- package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
- package/lib/plus/walletPassGallery/index.js +2 -2
- package/lib/pro/numberKeyboard/index.d.ts +28 -0
- package/lib/pro/numberKeyboard/index.js +182 -0
- package/lib/pro/numberKeyboard/index.less +25 -0
- package/lib/pro/numberKeyboard/locales.d.ts +12 -0
- package/lib/pro/numberKeyboard/locales.js +35 -0
- package/lib/pro/pisellNumberSelector/example.d.ts +3 -0
- package/lib/pro/pisellNumberSelector/example.js +93 -0
- package/lib/pro/pisellNumberSelector/index.d.ts +29 -0
- package/lib/pro/pisellNumberSelector/index.js +275 -0
- package/lib/pro/pisellNumberSelector/index.less +235 -0
- package/lib/pro/skuDetailModal/index.d.ts +4 -0
- package/lib/pro/skuDetailModal/index.js +736 -0
- package/lowcode/kiosk-sku-detail/meta.ts +264 -0
- package/package.json +4 -4
- package/es/components/Sales/Cart/utils.d.ts +0 -63
- package/es/components/Sales/Summary/utils.d.ts +0 -51
- package/es/components/appointmentBooking/locales.d.ts +0 -363
- package/es/components/booking/components/tabPane/index.d.ts +0 -4
- package/es/components/booking/dashboard/serve.d.ts +0 -1
- package/es/components/booking/editBookingModal/utils.d.ts +0 -12
- package/es/components/booking/forms/serve.d.ts +0 -18
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +0 -1
- package/es/components/booking/info/client/serve.d.ts +0 -2
- package/es/components/booking/info/hooks/useHolderConfig.d.ts +0 -9
- package/es/components/booking/info/pet/serve.d.ts +0 -1
- package/es/components/booking/info/service/addTimeModal/serve.d.ts +0 -5
- package/es/components/booking/info/service/editService/constants.d.ts +0 -1
- package/es/components/booking/info/service/serve.d.ts +0 -20
- package/es/components/booking/info2/serve.d.ts +0 -6
- package/es/components/booking/locales.d.ts +0 -843
- package/es/components/eftposPay/const.d.ts +0 -184
- package/es/components/eftposPay/locales.d.ts +0 -330
- package/es/components/eftposPay/manufacturer.d.ts +0 -7
- package/es/components/eftposPay/payo/payment.d.ts +0 -66
- package/es/components/pay/toC/PaymentList/utils.d.ts +0 -36
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/Content.d.ts +0 -6
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -2
- package/es/components/pay/toC/locales.d.ts +0 -307
- package/es/components/pay/toC/status.d.ts +0 -13
- package/es/components/ruleSetting/locales.d.ts +0 -48
- package/es/components/shoppingCart/locales.d.ts +0 -33
- package/es/components/shoppingCart/type.d.ts +0 -48
- package/es/components/subTotal/locales.d.ts +0 -42
- package/es/components/systemSettings/registry/locales.d.ts +0 -272
- package/es/components/systemSettings/registry/services.d.ts +0 -77
- package/es/components/systemSettings/registry/types.d.ts +0 -126
- package/es/components/systemSettings/registry/utils/typeValidation.d.ts +0 -16
- package/es/components/systemSettings/registry/utils/validators.d.ts +0 -8
- package/es/components/ticketBooking/locales.d.ts +0 -174
- package/es/components/wallet/utils.d.ts +0 -48
- package/es/components/walletList/locales.d.ts +0 -27
- package/es/components/workSpaceList/components/AppearanceEdit/constants.d.ts +0 -8
- package/es/components/workSpaceList/components/Card/constants.d.ts +0 -2
- package/es/hooks/useEngineContext.d.ts +0 -10
- package/es/hooks/useWindowSize.d.ts +0 -5
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +0 -30
- package/es/plus/selectHolder/locales.d.ts +0 -21
- package/es/plus/selectHolder/types.d.ts +0 -104
- package/es/plus/selectHolder/utils.d.ts +0 -9
- package/es/plus/skuOptionsSelection/hooks/useLanguage.d.ts +0 -2
- package/es/plus/skuOptionsSelection/hooks/useSymbol.d.ts +0 -2
- package/es/plus/skuOptionsSelection/store/createStore.d.ts +0 -15
- package/es/plus/skuOptionsSelection/utils/calculateOption.d.ts +0 -6
- package/es/plus/skuOptionsSelection/utils/transformValueToSelectorValue.d.ts +0 -4
- package/es/plus/walletEditor/locales.d.ts +0 -135
- package/es/plus/walletPassGallery/locales.d.ts +0 -285
- package/es/plus/walletPassGallery/utils.d.ts +0 -48
- package/es/pro/Login2.0/shared/types.d.ts +0 -232
- package/es/pro/NumericStepper/index.d.ts +0 -43
- package/es/pro/Selector/BatchSelectorDemo.d.ts +0 -3
- package/es/pro/Selector/Item.d.ts +0 -14
- package/es/pro/Selector/Selector.stories.d.ts +0 -78
- package/es/pro/Selector/components/Card/index.d.ts +0 -57
- package/es/pro/Selector/components/Card/types.d.ts +0 -1
- package/es/pro/Selector/components/Indicator/index.d.ts +0 -19
- package/es/pro/Selector/components/IntersectionObserver.d.ts +0 -105
- package/es/pro/Selector/components/LayoutContainer/index.d.ts +0 -16
- package/es/pro/Selector/components/Media/index.d.ts +0 -6
- package/es/pro/Selector/components/Media/types.d.ts +0 -47
- package/es/pro/Selector/components/index.d.ts +0 -4
- package/es/pro/Selector/demo.d.ts +0 -2
- package/es/pro/Selector/hooks/usePresetItemProps.d.ts +0 -43
- package/es/pro/Selector/hooks/usePresetProps.d.ts +0 -24
- package/es/pro/Selector/index.d.ts +0 -11
- package/es/pro/Selector/locales.d.ts +0 -36
- package/es/pro/Selector/types.d.ts +0 -173
- package/es/pro/Selector/utils/index.d.ts +0 -49
- package/es/test/setup.d.ts +0 -1
- package/lib/components/Sales/Cart/utils.d.ts +0 -63
- package/lib/components/Sales/Summary/utils.d.ts +0 -51
- package/lib/components/appointmentBooking/locales.d.ts +0 -363
- package/lib/components/booking/components/tabPane/index.d.ts +0 -4
- package/lib/components/booking/dashboard/serve.d.ts +0 -1
- package/lib/components/booking/editBookingModal/utils.d.ts +0 -12
- package/lib/components/booking/forms/serve.d.ts +0 -18
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +0 -1
- package/lib/components/booking/info/client/serve.d.ts +0 -2
- package/lib/components/booking/info/hooks/useHolderConfig.d.ts +0 -9
- package/lib/components/booking/info/pet/serve.d.ts +0 -1
- package/lib/components/booking/info/service/addTimeModal/serve.d.ts +0 -5
- package/lib/components/booking/info/service/editService/constants.d.ts +0 -1
- package/lib/components/booking/info/service/serve.d.ts +0 -20
- package/lib/components/booking/info2/serve.d.ts +0 -6
- package/lib/components/booking/locales.d.ts +0 -843
- package/lib/components/eftposPay/const.d.ts +0 -184
- package/lib/components/eftposPay/locales.d.ts +0 -330
- package/lib/components/eftposPay/manufacturer.d.ts +0 -7
- package/lib/components/eftposPay/payo/payment.d.ts +0 -66
- package/lib/components/pay/toC/PaymentList/utils.d.ts +0 -36
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/Content.d.ts +0 -6
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -2
- package/lib/components/pay/toC/locales.d.ts +0 -307
- package/lib/components/pay/toC/status.d.ts +0 -13
- package/lib/components/ruleSetting/locales.d.ts +0 -48
- package/lib/components/shoppingCart/locales.d.ts +0 -33
- package/lib/components/shoppingCart/type.d.ts +0 -48
- package/lib/components/subTotal/locales.d.ts +0 -42
- package/lib/components/systemSettings/registry/locales.d.ts +0 -272
- package/lib/components/systemSettings/registry/services.d.ts +0 -77
- package/lib/components/systemSettings/registry/types.d.ts +0 -126
- package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +0 -16
- package/lib/components/systemSettings/registry/utils/validators.d.ts +0 -8
- package/lib/components/ticketBooking/locales.d.ts +0 -174
- package/lib/components/wallet/utils.d.ts +0 -48
- package/lib/components/walletList/locales.d.ts +0 -27
- package/lib/components/workSpaceList/components/AppearanceEdit/constants.d.ts +0 -8
- package/lib/components/workSpaceList/components/Card/constants.d.ts +0 -2
- package/lib/hooks/useEngineContext.d.ts +0 -10
- package/lib/hooks/useWindowSize.d.ts +0 -5
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +0 -30
- package/lib/plus/selectHolder/locales.d.ts +0 -21
- package/lib/plus/selectHolder/types.d.ts +0 -104
- package/lib/plus/selectHolder/utils.d.ts +0 -9
- package/lib/plus/skuOptionsSelection/hooks/useLanguage.d.ts +0 -2
- package/lib/plus/skuOptionsSelection/hooks/useSymbol.d.ts +0 -2
- package/lib/plus/skuOptionsSelection/store/createStore.d.ts +0 -15
- package/lib/plus/skuOptionsSelection/utils/calculateOption.d.ts +0 -6
- package/lib/plus/skuOptionsSelection/utils/transformValueToSelectorValue.d.ts +0 -4
- package/lib/plus/walletEditor/locales.d.ts +0 -135
- package/lib/plus/walletPassGallery/locales.d.ts +0 -285
- package/lib/plus/walletPassGallery/utils.d.ts +0 -48
- package/lib/pro/Login2.0/shared/types.d.ts +0 -232
- package/lib/pro/NumericStepper/index.d.ts +0 -43
- package/lib/pro/Selector/BatchSelectorDemo.d.ts +0 -3
- package/lib/pro/Selector/Item.d.ts +0 -14
- package/lib/pro/Selector/Selector.stories.d.ts +0 -78
- package/lib/pro/Selector/components/Card/index.d.ts +0 -57
- package/lib/pro/Selector/components/Card/types.d.ts +0 -1
- package/lib/pro/Selector/components/Indicator/index.d.ts +0 -19
- package/lib/pro/Selector/components/IntersectionObserver.d.ts +0 -105
- package/lib/pro/Selector/components/LayoutContainer/index.d.ts +0 -16
- package/lib/pro/Selector/components/Media/index.d.ts +0 -6
- package/lib/pro/Selector/components/Media/types.d.ts +0 -47
- package/lib/pro/Selector/components/index.d.ts +0 -4
- package/lib/pro/Selector/demo.d.ts +0 -2
- package/lib/pro/Selector/hooks/usePresetItemProps.d.ts +0 -43
- package/lib/pro/Selector/hooks/usePresetProps.d.ts +0 -24
- package/lib/pro/Selector/index.d.ts +0 -11
- package/lib/pro/Selector/locales.d.ts +0 -36
- package/lib/pro/Selector/types.d.ts +0 -173
- package/lib/pro/Selector/utils/index.d.ts +0 -49
- package/lib/test/setup.d.ts +0 -1
|
@@ -0,0 +1,531 @@
|
|
|
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 _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
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); }
|
|
8
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
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; }
|
|
13
|
+
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); } }
|
|
14
|
+
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
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."); }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
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; } }
|
|
20
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
22
|
+
import Decimal from 'decimal.js';
|
|
23
|
+
import classNames from 'classnames';
|
|
24
|
+
import { Button } from '@pisell/materials';
|
|
25
|
+
import dayjs from 'dayjs';
|
|
26
|
+
import { locales } from '@pisell/utils';
|
|
27
|
+
import SKUOptionsSelection from "../../plus/skuOptionsSelection";
|
|
28
|
+
// import PisellNumberSelector from '../../pro/pisellNumberSelector';
|
|
29
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
30
|
+
import { getProductDetail } from "../booking/info/service/serve";
|
|
31
|
+
import localeTexts from "./locales";
|
|
32
|
+
import "./index.less";
|
|
33
|
+
import { request } from "../booking/utils";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @description Kiosk 商品详情(参考 Figma: Kiosk / Launchpad screen)
|
|
37
|
+
* - 默认从 URL query 读取商品 id(productId / product_id / id),内部通过 getProductDetail 拉取详情
|
|
38
|
+
* - 中间区域用 SKUOptionsSelection 做 SKU 选择
|
|
39
|
+
* - 底部用 PisellNumberSelector 做数量编辑
|
|
40
|
+
*/
|
|
41
|
+
function KioskSkuDetail(props) {
|
|
42
|
+
var _ref, _context$appHelper, _context$engine, _context$appHelper2, _store$getState, _store$getState2, _store$getState3;
|
|
43
|
+
var className = props.className,
|
|
44
|
+
style = props.style,
|
|
45
|
+
onAddToCart = props.onAddToCart;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @description 从 URL 中读取 productId(兼容 search / hash query)
|
|
49
|
+
* - 支持 key: productId / product_id / id
|
|
50
|
+
*/
|
|
51
|
+
var productIdFromUrl = useMemo(function () {
|
|
52
|
+
return getQueryFirstMatch({
|
|
53
|
+
keys: ['productId', 'product_id', 'id']
|
|
54
|
+
});
|
|
55
|
+
}, []);
|
|
56
|
+
var initialProductId = (_ref = productIdFromUrl !== null && productIdFromUrl !== void 0 ? productIdFromUrl : props.productId) !== null && _ref !== void 0 ? _ref : null;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @description 目前 scheduleDate 暂时固定成“当天”
|
|
60
|
+
* - 按本地时区格式化为 YYYY-MM-DD
|
|
61
|
+
*/
|
|
62
|
+
var scheduleDate = useMemo(function () {
|
|
63
|
+
return dayjs().format('YYYY-MM-DD');
|
|
64
|
+
}, []);
|
|
65
|
+
var stageScale = useDesignStageScale({
|
|
66
|
+
designWidth: 1080,
|
|
67
|
+
designHeight: 1800
|
|
68
|
+
});
|
|
69
|
+
var context = useEngineContext();
|
|
70
|
+
var _ref2 = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
71
|
+
interaction = _ref2.interaction;
|
|
72
|
+
locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
|
|
73
|
+
request.setRequest(context.appHelper.utils.request);
|
|
74
|
+
var _ref3 = ((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.utils) || {},
|
|
75
|
+
store = _ref3.store,
|
|
76
|
+
getData = _ref3.getData,
|
|
77
|
+
Toast = _ref3.Toast;
|
|
78
|
+
var state = store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 ? void 0 : _store$getState.call(store);
|
|
79
|
+
var symbol = (store === null || store === void 0 || (_store$getState2 = store.getState) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.call(store)) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.global) === null || _store$getState2 === void 0 ? void 0 : _store$getState2.symbol) || '$';
|
|
80
|
+
var currency_code = (store === null || store === void 0 || (_store$getState3 = store.getState) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.call(store)) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.global) === null || _store$getState3 === void 0 ? void 0 : _store$getState3.currency_code) || 'AUD';
|
|
81
|
+
var _useState = useState(false),
|
|
82
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
83
|
+
isLoading = _useState2[0],
|
|
84
|
+
setIsLoading = _useState2[1];
|
|
85
|
+
var _useState3 = useState(null),
|
|
86
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
87
|
+
errorText = _useState4[0],
|
|
88
|
+
setErrorText = _useState4[1];
|
|
89
|
+
var _useState5 = useState(null),
|
|
90
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
91
|
+
productData = _useState6[0],
|
|
92
|
+
setProductData = _useState6[1];
|
|
93
|
+
var _useState7 = useState(1),
|
|
94
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
95
|
+
quantity = _useState8[0],
|
|
96
|
+
setQuantity = _useState8[1];
|
|
97
|
+
var _useState9 = useState({
|
|
98
|
+
product_id: 0,
|
|
99
|
+
product_variant_id: 0,
|
|
100
|
+
bundle: [],
|
|
101
|
+
option: []
|
|
102
|
+
}),
|
|
103
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
104
|
+
skuValue = _useState10[0],
|
|
105
|
+
setSkuValue = _useState10[1];
|
|
106
|
+
var _useState11 = useState({
|
|
107
|
+
product_id: 0,
|
|
108
|
+
product_variant_id: 0,
|
|
109
|
+
bundle: [],
|
|
110
|
+
option: []
|
|
111
|
+
}),
|
|
112
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
113
|
+
skuDefaultValue = _useState12[0],
|
|
114
|
+
setSkuDefaultValue = _useState12[1];
|
|
115
|
+
var _useState13 = useState(false),
|
|
116
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
117
|
+
isEdit = _useState14[0],
|
|
118
|
+
setIsEdit = _useState14[1];
|
|
119
|
+
var skuOptionsSelectionRef = useRef(null);
|
|
120
|
+
/**
|
|
121
|
+
* @description 防止“原生多次初始化/快速切换”导致请求乱序覆盖
|
|
122
|
+
*/
|
|
123
|
+
var requestSeqRef = useRef(0);
|
|
124
|
+
var resetForInit = useCallback(function () {
|
|
125
|
+
setProductData(null);
|
|
126
|
+
setErrorText(null);
|
|
127
|
+
setQuantity(1);
|
|
128
|
+
setSkuValue({
|
|
129
|
+
product_id: 0,
|
|
130
|
+
product_variant_id: 0,
|
|
131
|
+
bundle: [],
|
|
132
|
+
option: []
|
|
133
|
+
});
|
|
134
|
+
setSkuDefaultValue({
|
|
135
|
+
product_id: 0,
|
|
136
|
+
product_variant_id: 0,
|
|
137
|
+
bundle: [],
|
|
138
|
+
option: []
|
|
139
|
+
});
|
|
140
|
+
}, []);
|
|
141
|
+
var loadByProductId = useCallback( /*#__PURE__*/function () {
|
|
142
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(productId) {
|
|
143
|
+
var options,
|
|
144
|
+
reqId,
|
|
145
|
+
_context$engine2,
|
|
146
|
+
open_deposit,
|
|
147
|
+
_params,
|
|
148
|
+
res,
|
|
149
|
+
apiData,
|
|
150
|
+
normalizedProductId,
|
|
151
|
+
minNumUnit,
|
|
152
|
+
defaultVariantId,
|
|
153
|
+
initialSkuValue,
|
|
154
|
+
_args = arguments;
|
|
155
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
156
|
+
while (1) switch (_context.prev = _context.next) {
|
|
157
|
+
case 0:
|
|
158
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
159
|
+
console.log('准备 load', productId);
|
|
160
|
+
if (!(productId === null || typeof productId === 'undefined' || productId === '')) {
|
|
161
|
+
_context.next = 4;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
return _context.abrupt("return");
|
|
165
|
+
case 4:
|
|
166
|
+
reqId = ++requestSeqRef.current;
|
|
167
|
+
setIsLoading(true);
|
|
168
|
+
setErrorText(null);
|
|
169
|
+
_context.prev = 7;
|
|
170
|
+
open_deposit = (getData === null || getData === void 0 ? void 0 : getData('bookingv2_deposit')) || 0;
|
|
171
|
+
_params = {
|
|
172
|
+
open_deposit: open_deposit,
|
|
173
|
+
'translate-locale': (context === null || context === void 0 || (_context$engine2 = context.engine) === null || _context$engine2 === void 0 || (_context$engine2 = _context$engine2.props) === null || _context$engine2 === void 0 ? void 0 : _context$engine2.locale) || 'en'
|
|
174
|
+
};
|
|
175
|
+
_params.schedule_date = scheduleDate;
|
|
176
|
+
_context.next = 13;
|
|
177
|
+
return getProductDetail(String(productId), _params);
|
|
178
|
+
case 13:
|
|
179
|
+
res = _context.sent;
|
|
180
|
+
console.log('详情接口');
|
|
181
|
+
console.log(JSON.stringify(res));
|
|
182
|
+
apiData = (res !== null && res !== void 0 && res.id ? res : res === null || res === void 0 ? void 0 : res.data) || {};
|
|
183
|
+
if (!(reqId !== requestSeqRef.current)) {
|
|
184
|
+
_context.next = 19;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
return _context.abrupt("return");
|
|
188
|
+
case 19:
|
|
189
|
+
setProductData(apiData);
|
|
190
|
+
console.log('已设置 productData');
|
|
191
|
+
normalizedProductId = Number((apiData === null || apiData === void 0 ? void 0 : apiData.product_id) || (apiData === null || apiData === void 0 ? void 0 : apiData.id) || productId || 0);
|
|
192
|
+
minNumUnit = Number((apiData === null || apiData === void 0 ? void 0 : apiData.min_num_unit) || 1);
|
|
193
|
+
if (options.shouldInitQuantity !== false) {
|
|
194
|
+
setQuantity(minNumUnit > 0 ? minNumUnit : 1);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @description 默认选中第一个 variant(如果接口返回了 variant 且有数据)
|
|
199
|
+
* 注意:本组件内部用 variant 的 `id` 来匹配 `skuValue.product_variant_id`
|
|
200
|
+
*/
|
|
201
|
+
defaultVariantId = function (_apiData$variant) {
|
|
202
|
+
var firstVariantId = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.variant) ? Number((apiData === null || apiData === void 0 || (_apiData$variant = apiData.variant) === null || _apiData$variant === void 0 || (_apiData$variant = _apiData$variant[0]) === null || _apiData$variant === void 0 ? void 0 : _apiData$variant.id) || 0) : 0;
|
|
203
|
+
return Number.isFinite(firstVariantId) ? firstVariantId : 0;
|
|
204
|
+
}();
|
|
205
|
+
initialSkuValue = {
|
|
206
|
+
product_id: normalizedProductId,
|
|
207
|
+
product_variant_id: defaultVariantId,
|
|
208
|
+
bundle: [],
|
|
209
|
+
option: []
|
|
210
|
+
};
|
|
211
|
+
if (options.shouldInitSku !== false) {
|
|
212
|
+
setSkuValue(initialSkuValue);
|
|
213
|
+
setSkuDefaultValue(initialSkuValue);
|
|
214
|
+
setTimeout(function () {
|
|
215
|
+
if (initialSkuValue.product_variant_id) {
|
|
216
|
+
var _skuOptionsSelectionR;
|
|
217
|
+
(_skuOptionsSelectionR = skuOptionsSelectionRef.current) === null || _skuOptionsSelectionR === void 0 || _skuOptionsSelectionR.validate();
|
|
218
|
+
}
|
|
219
|
+
}, 0);
|
|
220
|
+
}
|
|
221
|
+
_context.next = 33;
|
|
222
|
+
break;
|
|
223
|
+
case 29:
|
|
224
|
+
_context.prev = 29;
|
|
225
|
+
_context.t0 = _context["catch"](7);
|
|
226
|
+
console.error(_context.t0);
|
|
227
|
+
setErrorText('Failed to load product detail');
|
|
228
|
+
case 33:
|
|
229
|
+
_context.prev = 33;
|
|
230
|
+
if (!(reqId !== requestSeqRef.current)) {
|
|
231
|
+
_context.next = 36;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
return _context.abrupt("return");
|
|
235
|
+
case 36:
|
|
236
|
+
setIsLoading(false);
|
|
237
|
+
return _context.finish(33);
|
|
238
|
+
case 38:
|
|
239
|
+
case "end":
|
|
240
|
+
return _context.stop();
|
|
241
|
+
}
|
|
242
|
+
}, _callee, null, [[7, 29, 33, 38]]);
|
|
243
|
+
}));
|
|
244
|
+
return function (_x) {
|
|
245
|
+
return _ref4.apply(this, arguments);
|
|
246
|
+
};
|
|
247
|
+
}(), [getData, scheduleDate]);
|
|
248
|
+
|
|
249
|
+
// 避免 mountFunction 回调捕获旧的 loadByProductId(不用额外 useEffect)
|
|
250
|
+
var loadRef = useRef(loadByProductId);
|
|
251
|
+
loadRef.current = loadByProductId;
|
|
252
|
+
useEffect(function () {
|
|
253
|
+
var _interaction$utils, _interaction$utils$po, _interaction$utils2, _interaction$utils2$m, _interaction$utils3, _interaction$utils3$m;
|
|
254
|
+
// 通知原生初始化
|
|
255
|
+
interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$po = _interaction$utils.postMessageToApp) === null || _interaction$utils$po === void 0 || _interaction$utils$po.call(_interaction$utils, {
|
|
256
|
+
module: 'wallet_pass',
|
|
257
|
+
key: 'page_load'
|
|
258
|
+
});
|
|
259
|
+
// 原生初始化调用-新购流程
|
|
260
|
+
interaction === null || interaction === void 0 || (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 || (_interaction$utils2$m = _interaction$utils2.mountFunction) === null || _interaction$utils2$m === void 0 || _interaction$utils2$m.call(_interaction$utils2, 'wallet_pass', 'restore_buy_wallet_pass', function (id) {
|
|
261
|
+
console.log('重置状态', id);
|
|
262
|
+
console.log('宽', window.innerWidth);
|
|
263
|
+
console.log('高', window.innerHeight);
|
|
264
|
+
console.log('设备像素比', window.devicePixelRatio);
|
|
265
|
+
// 原生会预渲染页面,真正展示时再调用这里;该方法可能被多次调用
|
|
266
|
+
resetForInit();
|
|
267
|
+
|
|
268
|
+
// 原生回调入参就是 productId:直接触发加载(不走“state→effect”链)
|
|
269
|
+
if (id || id === 0) loadRef.current(id);
|
|
270
|
+
setIsEdit(false);
|
|
271
|
+
});
|
|
272
|
+
// 原生初始化调用-购物车编辑
|
|
273
|
+
interaction === null || interaction === void 0 || (_interaction$utils3 = interaction.utils) === null || _interaction$utils3 === void 0 || (_interaction$utils3$m = _interaction$utils3.mountFunction) === null || _interaction$utils3$m === void 0 || _interaction$utils3$m.call(_interaction$utils3, 'wallet_pass', 'edit_buy_wallet_pass', function (data) {
|
|
274
|
+
console.log('编辑状态', data);
|
|
275
|
+
var productData = JSON.parse(data);
|
|
276
|
+
/**
|
|
277
|
+
* @description 编辑态原生只会触发 edit_buy_wallet_pass
|
|
278
|
+
* - 这里需要主动 load 一次拿到最新详情(尤其是 variant 列表/价格)
|
|
279
|
+
* - 但不能覆盖原生传入的 variantId / quantity
|
|
280
|
+
*/
|
|
281
|
+
// setProductData(productData.productDetail);
|
|
282
|
+
loadRef.current(productData.productId, {
|
|
283
|
+
shouldInitSku: false,
|
|
284
|
+
shouldInitQuantity: false
|
|
285
|
+
});
|
|
286
|
+
setSkuValue({
|
|
287
|
+
product_id: productData.productId,
|
|
288
|
+
product_variant_id: Number(productData.variantId),
|
|
289
|
+
bundle: [],
|
|
290
|
+
option: []
|
|
291
|
+
});
|
|
292
|
+
setSkuDefaultValue({
|
|
293
|
+
product_id: productData.productId,
|
|
294
|
+
product_variant_id: Number(productData.variantId),
|
|
295
|
+
bundle: [],
|
|
296
|
+
option: []
|
|
297
|
+
});
|
|
298
|
+
setIsEdit(true);
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// URL 有 productId:挂载时只加载一次
|
|
302
|
+
if (initialProductId || initialProductId === 0) loadRef.current(initialProductId);
|
|
303
|
+
}, []);
|
|
304
|
+
var coverUrl = useMemo(function () {
|
|
305
|
+
return (productData === null || productData === void 0 ? void 0 : productData.cover) || (productData === null || productData === void 0 ? void 0 : productData.image) || '';
|
|
306
|
+
}, [productData]);
|
|
307
|
+
var titleText = useMemo(function () {
|
|
308
|
+
var _productData$_extend;
|
|
309
|
+
return (productData === null || productData === void 0 ? void 0 : productData.title) || (productData === null || productData === void 0 || (_productData$_extend = productData._extend) === null || _productData$_extend === void 0 ? void 0 : _productData$_extend.product_name) || (productData === null || productData === void 0 ? void 0 : productData.product_name) || '';
|
|
310
|
+
}, [productData]);
|
|
311
|
+
var descriptionText = useMemo(function () {
|
|
312
|
+
var _productData$_extend2;
|
|
313
|
+
return (productData === null || productData === void 0 ? void 0 : productData.description) || (productData === null || productData === void 0 ? void 0 : productData.sub_title) || (productData === null || productData === void 0 || (_productData$_extend2 = productData._extend) === null || _productData$_extend2 === void 0 ? void 0 : _productData$_extend2.sub_title) || '';
|
|
314
|
+
}, [productData]);
|
|
315
|
+
var unitPrice = useMemo(function () {
|
|
316
|
+
// 优先取已选 variant 的价格
|
|
317
|
+
var selectedVariantId = Number((skuValue === null || skuValue === void 0 ? void 0 : skuValue.product_variant_id) || 0);
|
|
318
|
+
if (selectedVariantId && Array.isArray(productData === null || productData === void 0 ? void 0 : productData.variant)) {
|
|
319
|
+
var matched = productData.variant.find(function (item) {
|
|
320
|
+
return Number(item === null || item === void 0 ? void 0 : item.id) === selectedVariantId;
|
|
321
|
+
});
|
|
322
|
+
var vPrice = Number((matched === null || matched === void 0 ? void 0 : matched.price) || 0);
|
|
323
|
+
if (!Number.isNaN(vPrice) && vPrice !== 0) return vPrice;
|
|
324
|
+
}
|
|
325
|
+
return Number((productData === null || productData === void 0 ? void 0 : productData.price) || 0);
|
|
326
|
+
}, [productData, skuValue === null || skuValue === void 0 ? void 0 : skuValue.product_variant_id]);
|
|
327
|
+
var priceRangeText = useMemo(function () {
|
|
328
|
+
var variantPrices = Array.isArray(productData === null || productData === void 0 ? void 0 : productData.variant) ? productData.variant.map(function (v) {
|
|
329
|
+
return Number((v === null || v === void 0 ? void 0 : v.price) || 0);
|
|
330
|
+
}).filter(function (n) {
|
|
331
|
+
return !Number.isNaN(n) && n > 0;
|
|
332
|
+
}) : [];
|
|
333
|
+
var base = Number((productData === null || productData === void 0 ? void 0 : productData.price) || 0);
|
|
334
|
+
var all = [].concat(_toConsumableArray(variantPrices), _toConsumableArray(base > 0 ? [base] : []));
|
|
335
|
+
if (all.length === 0) return '';
|
|
336
|
+
var min = Math.min.apply(Math, _toConsumableArray(all));
|
|
337
|
+
var max = Math.max.apply(Math, _toConsumableArray(all));
|
|
338
|
+
if (min === max) return "".concat(symbol).concat(min.toFixed(2));
|
|
339
|
+
return "".concat(symbol).concat(min.toFixed(2), "-").concat(symbol).concat(max.toFixed(2));
|
|
340
|
+
}, [productData, symbol]);
|
|
341
|
+
var itemTotal = useMemo(function () {
|
|
342
|
+
var deUnit = new Decimal(unitPrice || 0);
|
|
343
|
+
var deQty = new Decimal(quantity || 0);
|
|
344
|
+
return deUnit.mul(deQty).toNumber();
|
|
345
|
+
}, [quantity, unitPrice]);
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @description 用于展示的总价文案(参考 SkuDetailModal 的 totalText 逻辑)
|
|
349
|
+
* - 统一处理负数符号
|
|
350
|
+
* - 统一保留两位小数
|
|
351
|
+
*/
|
|
352
|
+
var itemTotalText = useMemo(function () {
|
|
353
|
+
var deTotal = new Decimal(itemTotal || 0);
|
|
354
|
+
var priceSign = deTotal.toNumber() < 0 ? '-' : '';
|
|
355
|
+
return "".concat(priceSign).concat(symbol).concat(deTotal.abs().toNumber().toFixed(2));
|
|
356
|
+
}, [itemTotal, symbol]);
|
|
357
|
+
var handleAddToCart = function handleAddToCart() {
|
|
358
|
+
var _skuOptionsSelectionR2;
|
|
359
|
+
if (!productData) return;
|
|
360
|
+
(_skuOptionsSelectionR2 = skuOptionsSelectionRef.current) === null || _skuOptionsSelectionR2 === void 0 || _skuOptionsSelectionR2.validate();
|
|
361
|
+
if (!skuValue.product_variant_id) {
|
|
362
|
+
Toast.info(locales.getText('pisell2.text.kiosk.sku.detail.toast.select.variant'));
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
;
|
|
366
|
+
var obj = {
|
|
367
|
+
productDetail: productData,
|
|
368
|
+
quantity: quantity,
|
|
369
|
+
variantId: skuValue.product_variant_id,
|
|
370
|
+
pricePerUnit: unitPrice,
|
|
371
|
+
isWebBuyWalletPass: true
|
|
372
|
+
};
|
|
373
|
+
interaction.utils.postMessageToApp({
|
|
374
|
+
module: 'wallet_pass',
|
|
375
|
+
key: 'buy_wallet_pass',
|
|
376
|
+
data: {
|
|
377
|
+
// 把洗好的数据放这里
|
|
378
|
+
productData: obj,
|
|
379
|
+
isEdit: isEdit
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
};
|
|
383
|
+
var onBack = function onBack() {
|
|
384
|
+
interaction.utils.postMessageToApp({
|
|
385
|
+
module: "wallet_pass",
|
|
386
|
+
key: "back"
|
|
387
|
+
});
|
|
388
|
+
};
|
|
389
|
+
var stageStyle = useMemo(function () {
|
|
390
|
+
return _objectSpread(_objectSpread({}, style || {}), {}, {
|
|
391
|
+
width: 1080,
|
|
392
|
+
height: 1800,
|
|
393
|
+
transform: "translateX(-50%) scale(".concat(stageScale, ")"),
|
|
394
|
+
transformOrigin: 'top center'
|
|
395
|
+
});
|
|
396
|
+
}, [stageScale, style]);
|
|
397
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
398
|
+
className: "pisell-kiosk-sku-detail-viewport"
|
|
399
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
400
|
+
className: classNames('pisell-kiosk-sku-detail', className),
|
|
401
|
+
style: stageStyle
|
|
402
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
403
|
+
className: "pisell-kiosk-sku-detail__content"
|
|
404
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
405
|
+
className: "pisell-kiosk-sku-detail__hero"
|
|
406
|
+
}, coverUrl ? /*#__PURE__*/React.createElement("img", {
|
|
407
|
+
className: "pisell-kiosk-sku-detail__hero-img",
|
|
408
|
+
src: coverUrl,
|
|
409
|
+
alt: titleText || 'product'
|
|
410
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
411
|
+
className: "pisell-kiosk-sku-detail__hero-placeholder"
|
|
412
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
413
|
+
className: "pisell-kiosk-sku-detail__header"
|
|
414
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
415
|
+
className: "pisell-kiosk-sku-detail__title"
|
|
416
|
+
}, titleText || (isLoading ? 'Loading…' : '')), !!descriptionText && /*#__PURE__*/React.createElement("div", {
|
|
417
|
+
className: "pisell-kiosk-sku-detail__desc"
|
|
418
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
419
|
+
// descriptionText 为 HTML 字符串,需要按 HTML 渲染
|
|
420
|
+
dangerouslySetInnerHTML: {
|
|
421
|
+
__html: descriptionText
|
|
422
|
+
}
|
|
423
|
+
})), !!priceRangeText && /*#__PURE__*/React.createElement("div", {
|
|
424
|
+
className: "pisell-kiosk-sku-detail__price-range"
|
|
425
|
+
}, priceRangeText, " ", currency_code), !!errorText && /*#__PURE__*/React.createElement("div", {
|
|
426
|
+
className: "pisell-kiosk-sku-detail__error"
|
|
427
|
+
}, errorText)), /*#__PURE__*/React.createElement("div", {
|
|
428
|
+
className: "pisell-kiosk-sku-detail__options-card"
|
|
429
|
+
}, productData && Array.isArray(productData === null || productData === void 0 ? void 0 : productData.variant) && productData.variant.length > 0 ? /*#__PURE__*/React.createElement(SKUOptionsSelection, {
|
|
430
|
+
ref: skuOptionsSelectionRef,
|
|
431
|
+
dataSource: productData,
|
|
432
|
+
value: skuDefaultValue,
|
|
433
|
+
skuCardConfig: {
|
|
434
|
+
price: {
|
|
435
|
+
visible: true
|
|
436
|
+
},
|
|
437
|
+
variantPriceVisible: true
|
|
438
|
+
},
|
|
439
|
+
onChange: function onChange(v) {
|
|
440
|
+
setSkuValue(v);
|
|
441
|
+
},
|
|
442
|
+
customScrollParent: ".pisell-kiosk-sku-detail"
|
|
443
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
444
|
+
className: "pisell-kiosk-sku-detail__options-loading"
|
|
445
|
+
}, isLoading ? locales.getText('pisell2.text.kiosk.sku.detail.loading.options') : ''))), /*#__PURE__*/React.createElement("div", {
|
|
446
|
+
className: "pisell-kiosk-sku-detail__footer"
|
|
447
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
448
|
+
className: "pisell-kiosk-sku-detail__back-btn",
|
|
449
|
+
size: "large",
|
|
450
|
+
onClick: onBack
|
|
451
|
+
}, locales.getText('pisell2.text.kiosk.sku.detail.btn.back')), /*#__PURE__*/React.createElement("div", {
|
|
452
|
+
className: "pisell-kiosk-sku-detail__footer-center"
|
|
453
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
454
|
+
className: "pisell-kiosk-sku-detail__item-total"
|
|
455
|
+
}, locales.getText('pisell2.text.kiosk.sku.detail.item.total'), ":", ' ', itemTotalText)), /*#__PURE__*/React.createElement(Button, {
|
|
456
|
+
type: "primary",
|
|
457
|
+
className: "pisell-kiosk-sku-detail__add-btn",
|
|
458
|
+
size: "large",
|
|
459
|
+
onClick: handleAddToCart,
|
|
460
|
+
disabled: !productData || isLoading
|
|
461
|
+
}, locales.getText(isEdit ? 'pisell2.text.kiosk.sku.detail.btn.update' : 'pisell2.text.kiosk.sku.detail.btn.add.to.cart')))));
|
|
462
|
+
}
|
|
463
|
+
export default KioskSkuDetail;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* @description 从当前页面 URL 中读取 query 参数(兼容 hash router)
|
|
467
|
+
* - search: ?a=b
|
|
468
|
+
* - hash: #/path?a=b
|
|
469
|
+
*/
|
|
470
|
+
function getQueryFirstMatch(params) {
|
|
471
|
+
var _params$keys;
|
|
472
|
+
if (typeof window === 'undefined') return null;
|
|
473
|
+
if (!(params !== null && params !== void 0 && (_params$keys = params.keys) !== null && _params$keys !== void 0 && _params$keys.length)) return null;
|
|
474
|
+
var keys = params.keys;
|
|
475
|
+
var tryRead = function tryRead(raw) {
|
|
476
|
+
if (!raw) return null;
|
|
477
|
+
var normalized = raw.startsWith('?') ? raw.slice(1) : raw;
|
|
478
|
+
var searchParams = new URLSearchParams(normalized);
|
|
479
|
+
var _iterator = _createForOfIteratorHelper(keys),
|
|
480
|
+
_step;
|
|
481
|
+
try {
|
|
482
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
483
|
+
var key = _step.value;
|
|
484
|
+
var value = searchParams.get(key);
|
|
485
|
+
if (value) return value;
|
|
486
|
+
}
|
|
487
|
+
} catch (err) {
|
|
488
|
+
_iterator.e(err);
|
|
489
|
+
} finally {
|
|
490
|
+
_iterator.f();
|
|
491
|
+
}
|
|
492
|
+
return null;
|
|
493
|
+
};
|
|
494
|
+
var fromSearch = tryRead(window.location.search || '');
|
|
495
|
+
if (fromSearch) return fromSearch;
|
|
496
|
+
var hash = window.location.hash || '';
|
|
497
|
+
var queryIndex = hash.indexOf('?');
|
|
498
|
+
if (queryIndex === -1) return null;
|
|
499
|
+
return tryRead(hash.slice(queryIndex + 1));
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* @description 按设计稿基准尺寸(默认 1080x1800)计算页面缩放比例
|
|
504
|
+
* - scale = min(viewportW/designW, viewportH/designH, 1)
|
|
505
|
+
*/
|
|
506
|
+
function useDesignStageScale(params) {
|
|
507
|
+
var designWidth = params.designWidth;
|
|
508
|
+
var designHeight = params.designHeight;
|
|
509
|
+
var _useState15 = useState(1),
|
|
510
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
511
|
+
scale = _useState16[0],
|
|
512
|
+
setScale = _useState16[1];
|
|
513
|
+
useEffect(function () {
|
|
514
|
+
var update = function update() {
|
|
515
|
+
var viewportWidth = window.innerWidth || designWidth;
|
|
516
|
+
var viewportHeight = window.innerHeight || designHeight;
|
|
517
|
+
var nextScale = Math.min(viewportWidth / designWidth, viewportHeight / designHeight, 1);
|
|
518
|
+
setScale(nextScale);
|
|
519
|
+
};
|
|
520
|
+
update();
|
|
521
|
+
window.addEventListener('resize', update);
|
|
522
|
+
return function () {
|
|
523
|
+
return window.removeEventListener('resize', update);
|
|
524
|
+
};
|
|
525
|
+
}, [designHeight, designWidth]);
|
|
526
|
+
return scale;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* @description 从原生回调 payload 中提取 productId
|
|
531
|
+
*/
|