@pisell/private-materials 6.7.9 → 6.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/appointmentBooking/components/Voucher/index.js +2 -1
- package/es/components/booking/addons/index.js +25 -17
- package/es/components/booking/components/footer/amount.d.ts +1 -0
- package/es/components/booking/components/footer/amount.js +548 -84
- package/es/components/booking/components/footer/index.js +77 -56
- package/es/components/booking/components/footer/utils.d.ts +19 -0
- package/es/components/booking/components/footer/utils.js +194 -73
- package/es/components/booking/components/voucher/index.js +23 -7
- package/es/components/booking/hooks/useQuotation.js +4 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +1 -0
- package/es/components/booking/info2/cartClientCard/index.js +30 -6
- package/es/components/booking/info2/index.js +1 -1
- package/es/components/booking/info2/service/addService/index.js +2 -3
- package/es/components/booking/info2/service/editNormalService/index.js +6 -0
- package/es/components/booking/info2/service/editService/index.js +16 -6
- package/es/components/booking/info2/service/editService/utils.d.ts +15 -0
- package/es/components/booking/info2/service/editService/utils.js +66 -0
- package/es/components/booking/utils.d.ts +1 -0
- package/es/components/booking/utils.js +16 -3
- package/es/components/checkout/PaymentModal.d.ts +13 -5
- package/es/components/checkout/PaymentModal.js +304 -252
- package/es/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/es/components/checkout/components/AdditionalModule/index.js +52 -12
- package/es/components/checkout/components/AmountSummary/index.js +9 -76
- package/es/components/checkout/components/AmountSummary/index.less +5 -6
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/es/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +6 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.js +2 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +31 -8
- package/es/components/checkout/components/PaymentResultToast/index.js +6 -6
- package/es/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/es/components/checkout/components/SearchAndClientModule/index.js +39 -40
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +6 -0
- package/es/components/checkout/locales.js +6 -0
- package/es/components/checkout/plugin.d.ts +2 -0
- package/es/components/checkout/plugin.js +303 -0
- package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/es/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +14 -6
- package/es/components/eftposPay/payo/config.js +70 -32
- package/es/components/eftposPay/payo/payment.d.ts +66 -0
- package/es/components/eftposPay/payo/payment.js +579 -0
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eftposPay/tyro/index.js +12 -0
- package/es/components/eftposPay/utils/log/index.d.ts +110 -0
- package/es/components/eftposPay/utils/log/index.js +371 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/list/List.js +99 -56
- package/es/components/list/hooks/useListState.d.ts +5 -3
- package/es/components/list/hooks/useListState.js +10 -2
- package/es/components/list/styles/base.less +4 -0
- package/es/components/list/styles/content.less +1 -1
- package/es/components/list/styles/header.less +4 -4
- package/es/components/list/types.d.ts +1 -0
- package/es/components/list/utils/index.d.ts +13 -1
- package/es/components/list/utils/index.js +43 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +14 -12
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +2 -0
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
- package/es/components/pay/toC/index.js +7 -4
- package/es/components/pay/toC/locales.d.ts +3 -0
- package/es/components/pay/toC/locales.js +6 -3
- package/es/components/pay/toC/status.d.ts +1 -0
- package/es/components/pay/toC/status.js +3 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/subTotal/index.js +1 -1
- package/es/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
- package/es/components/{checkout/PaymentPlugin.js → systemSettings/registry/components/GroupModal.js} +132 -171
- package/es/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
- package/es/components/systemSettings/registry/components/ItemModal.js +547 -0
- package/es/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
- package/es/components/systemSettings/registry/components/ModuleList.js +54 -0
- package/es/components/systemSettings/registry/components/SectionList.d.ts +4 -0
- package/es/components/systemSettings/registry/components/SectionList.js +174 -0
- package/es/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
- package/es/components/systemSettings/registry/components/SettingsTable.js +765 -0
- package/es/components/systemSettings/registry/components/index.d.ts +4 -0
- package/es/components/systemSettings/registry/components/index.js +4 -0
- package/es/components/systemSettings/registry/index.d.ts +5 -0
- package/es/components/systemSettings/registry/index.js +1059 -0
- package/es/components/systemSettings/registry/index.less +410 -0
- package/es/components/systemSettings/registry/locales.d.ts +272 -0
- package/es/components/systemSettings/registry/locales.js +300 -0
- package/es/components/systemSettings/registry/services.d.ts +77 -0
- package/es/components/systemSettings/registry/services.js +472 -0
- package/es/components/systemSettings/registry/types.d.ts +126 -0
- package/es/components/systemSettings/registry/types.js +1 -0
- package/es/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
- package/es/components/systemSettings/registry/utils/typeValidation.js +284 -0
- package/es/components/systemSettings/registry/utils/validators.d.ts +8 -0
- package/es/components/systemSettings/registry/utils/validators.js +44 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +58 -11
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +28 -1
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +35 -2
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.js +149 -36
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -86
- package/es/components/ticketBooking/components/menuBar/index.js +109 -12
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/es/components/ticketBooking/components/timeBar/index.js +112 -7
- package/es/components/ticketBooking/components/timeBar/index.less +59 -0
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +29 -18
- package/es/components/ticketBooking/locales.d.ts +9 -0
- package/es/components/ticketBooking/locales.js +12 -3
- package/es/components/ticketBooking/utils/index.d.ts +3 -0
- package/es/components/ticketBooking/utils/index.js +36 -13
- package/es/components/wallet/Detail/index.js +34 -2
- package/es/components/wallet/Detail/index.less +11 -0
- package/es/components/wallet/Detail/locales.d.ts +6 -0
- package/es/components/wallet/Detail/locales.js +14 -2
- package/es/components/wallet/Voucher/index.js +11 -10
- package/es/components/wallet/components/WalletCard.js +5 -1
- package/es/components/wallet/index.js +4 -2
- package/es/components/wallet/serve.d.ts +7 -0
- package/es/components/wallet/utils.d.ts +48 -0
- package/es/components/wallet/utils.js +342 -0
- package/es/index.d.ts +5 -0
- package/es/index.js +6 -1
- package/es/plus/clientCard/locales.js +3 -3
- package/es/plus/clinetSearch/index.js +28 -30
- package/es/plus/clinetSearch/locales.d.ts +3 -0
- package/es/plus/clinetSearch/locales.js +7 -4
- package/es/plus/clinetSearch/types.d.ts +12 -0
- package/es/plus/productSelect/CategoryTabs/index.d.ts +1 -0
- package/es/plus/productSelect/CategoryTabs/index.js +2 -1
- package/es/plus/walletPassGallery/components/footerButton/index.js +2 -4
- package/es/plus/walletPassGallery/components/footerButton/index.less +14 -59
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passDetail/index.js +84 -31
- package/es/plus/walletPassGallery/components/passDetail/index.less +4 -0
- package/es/plus/walletPassGallery/components/recharge/index.js +19 -8
- package/es/plus/walletPassGallery/index.js +7 -3
- package/es/plus/walletPassGallery/serve.d.ts +3 -0
- package/es/plus/walletPassGallery/serve.js +4 -2
- package/es/pro/Login2.0/index.less +15 -8
- package/es/pro/Selector/BatchSelectorDemo.d.ts +3 -0
- package/es/pro/Selector/BatchSelectorDemo.js +470 -0
- package/es/pro/Selector/Selector.d.ts +5 -0
- package/es/pro/Selector/Selector.js +283 -0
- package/es/pro/Selector/SelectorGroup.d.ts +11 -0
- package/es/pro/Selector/SelectorGroup.js +537 -0
- package/es/pro/Selector/components/Card/index.d.ts +27 -0
- package/es/pro/Selector/components/Card/index.js +96 -0
- package/es/pro/Selector/components/Card/index.less +132 -0
- package/es/pro/Selector/components/IntersectionObserver.d.ts +105 -0
- package/es/pro/Selector/components/IntersectionObserver.js +384 -0
- package/es/pro/Selector/components/NumericStepper/index.d.ts +41 -0
- package/es/pro/Selector/components/NumericStepper/index.js +198 -0
- package/es/pro/Selector/components/NumericStepper/index.less +221 -0
- package/es/pro/Selector/components/index.d.ts +2 -0
- package/es/pro/Selector/components/index.js +2 -0
- package/es/pro/Selector/demo.d.ts +3 -0
- package/es/pro/Selector/demo.js +158 -0
- package/es/pro/Selector/hooks/useSelectionController.d.ts +42 -0
- package/es/pro/Selector/hooks/useSelectionController.js +414 -0
- package/es/pro/Selector/index.d.ts +8 -0
- package/es/pro/Selector/index.js +5 -0
- package/es/pro/Selector/locales.d.ts +42 -0
- package/es/pro/Selector/locales.js +80 -0
- package/es/pro/Selector/selector.less +3 -0
- package/es/pro/Selector/selectorGroup.less +8 -0
- package/es/pro/Selector/types.d.ts +114 -0
- package/es/pro/Selector/types.js +1 -0
- package/es/pro/Selector/utils/index.d.ts +49 -0
- package/es/pro/Selector/utils/index.js +229 -0
- package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/es/pro/comprehensiveSearch/locales.js +1 -1
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +45 -36
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +4 -2
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +10 -1
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +5 -2
- package/es/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
- package/lib/components/booking/addons/index.js +15 -7
- package/lib/components/booking/components/footer/amount.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.js +293 -41
- package/lib/components/booking/components/footer/index.js +30 -11
- package/lib/components/booking/components/footer/utils.d.ts +19 -0
- package/lib/components/booking/components/footer/utils.js +138 -41
- package/lib/components/booking/components/voucher/index.js +25 -9
- package/lib/components/booking/hooks/useQuotation.js +2 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +1 -0
- package/lib/components/booking/info2/cartClientCard/index.js +25 -5
- package/lib/components/booking/info2/index.js +7 -2
- package/lib/components/booking/info2/service/addService/index.js +1 -2
- package/lib/components/booking/info2/service/editNormalService/index.js +6 -0
- package/lib/components/booking/info2/service/editService/index.js +12 -3
- package/lib/components/booking/info2/service/editService/utils.d.ts +15 -0
- package/lib/components/booking/info2/service/editService/utils.js +40 -3
- package/lib/components/booking/utils.d.ts +1 -0
- package/lib/components/booking/utils.js +11 -0
- package/lib/components/checkout/PaymentModal.d.ts +13 -5
- package/lib/components/checkout/PaymentModal.js +190 -147
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/lib/components/checkout/components/AdditionalModule/index.js +52 -11
- package/lib/components/checkout/components/AmountSummary/index.js +5 -46
- package/lib/components/checkout/components/AmountSummary/index.less +5 -6
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/lib/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +5 -1
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +6 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +23 -5
- package/lib/components/checkout/components/PaymentResultToast/index.js +4 -4
- package/lib/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/lib/components/checkout/components/SearchAndClientModule/index.js +29 -3
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +6 -0
- package/lib/components/checkout/locales.js +6 -0
- package/lib/components/checkout/plugin.d.ts +2 -0
- package/lib/components/checkout/plugin.js +263 -0
- package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +12 -6
- package/lib/components/eftposPay/payo/config.js +98 -73
- package/lib/components/eftposPay/payo/payment.d.ts +66 -0
- package/lib/components/eftposPay/payo/payment.js +357 -0
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eftposPay/tyro/index.js +12 -0
- package/lib/components/eftposPay/utils/log/index.d.ts +110 -0
- package/lib/components/eftposPay/utils/log/index.js +294 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/list/List.js +58 -36
- package/lib/components/list/hooks/useListState.d.ts +5 -3
- package/lib/components/list/hooks/useListState.js +9 -1
- package/lib/components/list/styles/base.less +4 -0
- package/lib/components/list/styles/content.less +1 -1
- package/lib/components/list/styles/header.less +4 -4
- package/lib/components/list/types.d.ts +1 -0
- package/lib/components/list/utils/index.d.ts +13 -1
- package/lib/components/list/utils/index.js +27 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +14 -12
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
- package/lib/components/pay/toC/index.js +4 -1
- package/lib/components/pay/toC/locales.d.ts +3 -0
- package/lib/components/pay/toC/locales.js +6 -3
- package/lib/components/pay/toC/status.d.ts +1 -0
- package/lib/components/pay/toC/status.js +5 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/subTotal/index.js +1 -1
- package/lib/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/GroupModal.js +177 -0
- package/lib/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/ItemModal.js +508 -0
- package/lib/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/ModuleList.js +71 -0
- package/lib/components/systemSettings/registry/components/SectionList.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/SectionList.js +181 -0
- package/lib/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/SettingsTable.js +575 -0
- package/lib/components/systemSettings/registry/components/index.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/index.js +48 -0
- package/lib/components/systemSettings/registry/index.d.ts +5 -0
- package/lib/components/systemSettings/registry/index.js +529 -0
- package/lib/components/systemSettings/registry/index.less +410 -0
- package/lib/components/systemSettings/registry/locales.d.ts +272 -0
- package/lib/components/systemSettings/registry/locales.js +324 -0
- package/lib/components/systemSettings/registry/services.d.ts +77 -0
- package/lib/components/systemSettings/registry/services.js +290 -0
- package/lib/components/systemSettings/registry/types.d.ts +126 -0
- package/lib/components/systemSettings/registry/types.js +17 -0
- package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
- package/lib/components/systemSettings/registry/utils/typeValidation.js +228 -0
- package/lib/components/systemSettings/registry/utils/validators.d.ts +8 -0
- package/lib/components/systemSettings/registry/utils/validators.js +54 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +40 -5
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +28 -1
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +35 -2
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.js +93 -24
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
- package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
- package/lib/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/lib/components/ticketBooking/components/timeBar/index.js +105 -4
- package/lib/components/ticketBooking/components/timeBar/index.less +59 -0
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +17 -13
- package/lib/components/ticketBooking/locales.d.ts +9 -0
- package/lib/components/ticketBooking/locales.js +12 -3
- package/lib/components/ticketBooking/utils/index.d.ts +3 -0
- package/lib/components/ticketBooking/utils/index.js +20 -6
- package/lib/components/wallet/Detail/index.js +31 -3
- package/lib/components/wallet/Detail/index.less +11 -0
- package/lib/components/wallet/Detail/locales.d.ts +6 -0
- package/lib/components/wallet/Detail/locales.js +14 -2
- package/lib/components/wallet/Voucher/index.js +8 -8
- package/lib/components/wallet/components/WalletCard.js +4 -0
- package/lib/components/wallet/index.js +2 -2
- package/lib/components/wallet/serve.d.ts +7 -0
- package/lib/components/wallet/utils.d.ts +48 -0
- package/lib/components/wallet/utils.js +287 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +15 -0
- package/lib/plus/clientCard/locales.js +3 -3
- package/lib/plus/clinetSearch/index.js +17 -8
- package/lib/plus/clinetSearch/locales.d.ts +3 -0
- package/lib/plus/clinetSearch/locales.js +7 -4
- package/lib/plus/clinetSearch/types.d.ts +12 -0
- package/lib/plus/productSelect/CategoryTabs/index.d.ts +1 -0
- package/lib/plus/productSelect/CategoryTabs/index.js +2 -1
- package/lib/plus/walletPassGallery/components/footerButton/index.js +2 -2
- package/lib/plus/walletPassGallery/components/footerButton/index.less +14 -59
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.js +54 -15
- package/lib/plus/walletPassGallery/components/passDetail/index.less +4 -0
- package/lib/plus/walletPassGallery/components/recharge/index.js +7 -1
- package/lib/plus/walletPassGallery/index.js +7 -3
- package/lib/plus/walletPassGallery/serve.d.ts +3 -0
- package/lib/plus/walletPassGallery/serve.js +3 -2
- package/lib/pro/Login2.0/index.less +15 -8
- package/lib/pro/Selector/BatchSelectorDemo.d.ts +3 -0
- package/lib/pro/Selector/BatchSelectorDemo.js +376 -0
- package/lib/pro/Selector/Selector.d.ts +5 -0
- package/lib/pro/Selector/Selector.js +264 -0
- package/lib/pro/Selector/SelectorGroup.d.ts +11 -0
- package/lib/pro/Selector/SelectorGroup.js +463 -0
- package/lib/pro/Selector/components/Card/index.d.ts +27 -0
- package/lib/pro/Selector/components/Card/index.js +114 -0
- package/lib/pro/Selector/components/Card/index.less +132 -0
- package/lib/pro/Selector/components/IntersectionObserver.d.ts +105 -0
- package/lib/pro/Selector/components/IntersectionObserver.js +281 -0
- package/lib/pro/Selector/components/NumericStepper/index.d.ts +41 -0
- package/lib/pro/Selector/components/NumericStepper/index.js +221 -0
- package/lib/pro/Selector/components/NumericStepper/index.less +221 -0
- package/lib/pro/Selector/components/index.d.ts +2 -0
- package/lib/pro/Selector/components/index.js +42 -0
- package/lib/pro/Selector/demo.d.ts +3 -0
- package/lib/pro/Selector/demo.js +102 -0
- package/lib/pro/Selector/hooks/useSelectionController.d.ts +42 -0
- package/lib/pro/Selector/hooks/useSelectionController.js +338 -0
- package/lib/pro/Selector/index.d.ts +8 -0
- package/lib/pro/Selector/index.js +39 -0
- package/lib/pro/Selector/locales.d.ts +42 -0
- package/lib/pro/Selector/locales.js +80 -0
- package/lib/pro/Selector/selector.less +3 -0
- package/lib/pro/Selector/selectorGroup.less +8 -0
- package/lib/pro/Selector/types.d.ts +114 -0
- package/lib/pro/Selector/types.js +17 -0
- package/lib/pro/Selector/utils/index.d.ts +49 -0
- package/lib/pro/Selector/utils/index.js +221 -0
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/lib/pro/comprehensiveSearch/locales.js +1 -1
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +42 -43
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +3 -2
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +8 -1
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +3 -2
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lowcode/payment-modal/meta.ts +135 -0
- package/lowcode/selector/meta.ts +352 -0
- package/lowcode/selector.group/meta.ts +200 -0
- package/lowcode/settings-registry/meta.ts +29 -0
- package/lowcode/wallet-pass-detail/meta.ts +89 -0
- package/package.json +4 -4
- package/es/components/checkout/PaymentPlugin.d.ts +0 -3
- package/lib/components/checkout/PaymentPlugin.d.ts +0 -3
- package/lib/components/checkout/PaymentPlugin.js +0 -181
|
@@ -4,7 +4,9 @@ import "./index.less";
|
|
|
4
4
|
var Shortcuts = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
5
5
|
var presets = props.presets,
|
|
6
6
|
onChange = props.onChange,
|
|
7
|
-
disabled = props.disabled
|
|
7
|
+
disabled = props.disabled,
|
|
8
|
+
_props$size = props.size,
|
|
9
|
+
size = _props$size === void 0 ? 'default' : _props$size;
|
|
8
10
|
var handleItemClick = function handleItemClick(item) {
|
|
9
11
|
if (disabled || item.disabled) {
|
|
10
12
|
return;
|
|
@@ -32,7 +34,8 @@ var Shortcuts = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
32
34
|
var itemProps = {
|
|
33
35
|
key: index,
|
|
34
36
|
className: classNames('pisell-virtual-keyboard-shortcut', {
|
|
35
|
-
disabled: item.disabled
|
|
37
|
+
disabled: item.disabled,
|
|
38
|
+
large: size === 'large'
|
|
36
39
|
}),
|
|
37
40
|
style: item.style,
|
|
38
41
|
onClick: function onClick() {
|
|
@@ -96,7 +96,7 @@ var VoucherCard = (props) => {
|
|
|
96
96
|
return {
|
|
97
97
|
_id: item._id,
|
|
98
98
|
quantity: item.num,
|
|
99
|
-
bundle: item.
|
|
99
|
+
bundle: item.bundle,
|
|
100
100
|
options: item._optionsOrigin,
|
|
101
101
|
product: {
|
|
102
102
|
...item._productOrigin
|
|
@@ -122,6 +122,7 @@ var VoucherCard = (props) => {
|
|
|
122
122
|
);
|
|
123
123
|
pisellos.effects.on("appointmentBooking_cart:onAddItem", onCartChange);
|
|
124
124
|
pisellos.effects.on("appointmentBooking_cart:onUpdateQuotationPrice", onCartChange);
|
|
125
|
+
pisellos.effects.on("appointmentBooking_cart:onUpdateBookingDate", onCartChange);
|
|
125
126
|
pisellos.effects.on("appointmentBooking_cart:onUpdateCartItemNums", onCartChange);
|
|
126
127
|
pisellos.effects.on("appointmentBooking_cart:onRemoveItem", onCartChange);
|
|
127
128
|
pisellos.effects.on(
|
|
@@ -51,23 +51,31 @@ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext")
|
|
|
51
51
|
var formatProducts = (values) => {
|
|
52
52
|
let arr = [];
|
|
53
53
|
arr = values.map((item) => {
|
|
54
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
54
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
55
|
+
const bundleDiscountList = (0, import_utils.getBundleDiscountList)(((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle) || []);
|
|
56
|
+
const discount_list = [...(item == null ? void 0 : item.discount_list) || []];
|
|
57
|
+
discount_list.push(...bundleDiscountList);
|
|
55
58
|
return {
|
|
56
59
|
order_detail_id: item.order_detail_id || 0,
|
|
57
60
|
num: item._extend.quantity,
|
|
58
61
|
price: (0, import_utils.formatProductPrice)(item),
|
|
59
62
|
product_id: item.id,
|
|
60
|
-
discount_list:
|
|
63
|
+
discount_list: discount_list || [],
|
|
61
64
|
discount_amount: 0,
|
|
62
65
|
product_discount_reason: "",
|
|
63
66
|
is_charge_tax: item.is_charge_tax,
|
|
64
67
|
note: "",
|
|
65
68
|
discountway: "num",
|
|
66
69
|
discount_type: "discount",
|
|
67
|
-
bundle_edit: (
|
|
68
|
-
product_bundle: (0, import_utils.formatProductBundle)((
|
|
69
|
-
"product_option_item": (0, import_utils.formatProductOption)((
|
|
70
|
-
"product_variant_id": ((
|
|
70
|
+
bundle_edit: (_c = item._extend) == null ? void 0 : _c.bundle_edit,
|
|
71
|
+
product_bundle: (0, import_utils.formatProductBundle)((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle),
|
|
72
|
+
"product_option_item": (0, import_utils.formatProductOption)((_g = (_f = item._extend) == null ? void 0 : _f.other) == null ? void 0 : _g.option),
|
|
73
|
+
"product_variant_id": ((_i = (_h = item._extend) == null ? void 0 : _h.other) == null ? void 0 : _i.product_variant_id) || 0,
|
|
74
|
+
"source_product_price": (0, import_utils.getSourceProductPrice)(item),
|
|
75
|
+
"main_product_selling_price": (0, import_utils.getMainProductSellingPrice)(item) ?? (0, import_utils.formatProductPrice)(item),
|
|
76
|
+
"calculated_original_price": (0, import_utils.formatOriginalPrice)(item),
|
|
77
|
+
"calculated_selling_price": (0, import_utils.formatSellingPrice)(item),
|
|
78
|
+
"tax_fee": item._extend.tax_fee
|
|
71
79
|
};
|
|
72
80
|
});
|
|
73
81
|
return arr;
|
|
@@ -241,12 +249,12 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
241
249
|
isAddons: true,
|
|
242
250
|
_key: e.key,
|
|
243
251
|
_extend: {
|
|
244
|
-
price: _detail.price,
|
|
245
252
|
other: e,
|
|
246
253
|
quantity: (e == null ? void 0 : e.quantity) || 1
|
|
247
254
|
},
|
|
248
255
|
quantity: (e == null ? void 0 : e.quantity) || 1
|
|
249
256
|
};
|
|
257
|
+
product._extend.price = (0, import_utils2.getMainPrice)(product, _detail.price);
|
|
250
258
|
let _total = (0, import_utils2.getProductTotalPrice)(product);
|
|
251
259
|
product._extend.total = _total;
|
|
252
260
|
product._extend.origin_total = _total;
|
|
@@ -47,7 +47,7 @@ var getRelationDetailsTotal = (relation_details) => {
|
|
|
47
47
|
}
|
|
48
48
|
return total.toNumber();
|
|
49
49
|
};
|
|
50
|
-
var getProductExpectAmount = (state, isEdit) => {
|
|
50
|
+
var getProductExpectAmount = (state, isEdit, isOriginTotal) => {
|
|
51
51
|
var _a, _b, _c, _d;
|
|
52
52
|
let price = new import_decimal.default(0);
|
|
53
53
|
let duration = new import_decimal.default(0);
|
|
@@ -59,13 +59,15 @@ var getProductExpectAmount = (state, isEdit) => {
|
|
|
59
59
|
if (isDay || (0, import_utils3.isNormalProductByDurationSchedule)(item)) {
|
|
60
60
|
const quantity = new import_decimal.default(item._extend.quantity || 1);
|
|
61
61
|
const itemTotal = new import_decimal.default(item._extend.total || 0);
|
|
62
|
-
|
|
62
|
+
const itemOriginTotal = new import_decimal.default(item._extend.origin_total || 0);
|
|
63
|
+
price = price.add((isOriginTotal ? itemOriginTotal : itemTotal).mul(quantity));
|
|
63
64
|
const _duration = (0, import_utils3.isDayBookingProduct)(item, state) ? new import_decimal.default(item._extend.duration || 0) : new import_decimal.default(0);
|
|
64
65
|
duration = duration.add(_duration);
|
|
65
66
|
} else {
|
|
66
67
|
const quantity = new import_decimal.default(item._extend.quantity || 1);
|
|
67
68
|
const itemTotal = new import_decimal.default(item._extend.total || 0);
|
|
68
|
-
|
|
69
|
+
const itemOriginTotal = new import_decimal.default(item._extend.origin_total || 0);
|
|
70
|
+
price = price.add((isOriginTotal ? itemOriginTotal : itemTotal).mul(quantity));
|
|
69
71
|
const relationTotal = new import_decimal.default(getRelationDetailsTotal(
|
|
70
72
|
item._extend.relation_details || []
|
|
71
73
|
));
|
|
@@ -79,7 +81,8 @@ var getProductExpectAmount = (state, isEdit) => {
|
|
|
79
81
|
for (let item of state.addons.value) {
|
|
80
82
|
const quantity = new import_decimal.default(item._extend.quantity || 1);
|
|
81
83
|
const itemTotal = new import_decimal.default(item._extend.total || 0);
|
|
82
|
-
|
|
84
|
+
const itemOriginTotal = new import_decimal.default(item._extend.origin_total || 0);
|
|
85
|
+
price = price.add((isOriginTotal ? itemOriginTotal : itemTotal).mul(quantity));
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
}
|
|
@@ -130,9 +133,10 @@ var getProductItemTax = (item, state, options) => {
|
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
|
-
return singleItemTax.times(quantity);
|
|
136
|
+
return singleItemTax.times(quantity).toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
|
|
134
137
|
};
|
|
135
138
|
var processItemsTax = (items, state, options) => {
|
|
139
|
+
var _a, _b, _c;
|
|
136
140
|
const { tax_rate, is_price_include_tax, computed } = options;
|
|
137
141
|
const { shopDiscount, productExpectAmount } = computed;
|
|
138
142
|
let originTax = new import_decimal.default(0);
|
|
@@ -140,10 +144,11 @@ var processItemsTax = (items, state, options) => {
|
|
|
140
144
|
for (let item of items) {
|
|
141
145
|
const quantity = new import_decimal.default(item._extend.quantity || 1);
|
|
142
146
|
const unitPrice = new import_decimal.default(item._extend.total || 0);
|
|
143
|
-
const
|
|
147
|
+
const mainProductPrice = new import_decimal.default(getMainProductTotal(item) || 0);
|
|
148
|
+
let originalTaxPerItem = getProductItemTax(
|
|
144
149
|
{
|
|
145
150
|
...item,
|
|
146
|
-
total:
|
|
151
|
+
total: mainProductPrice.add(((_a = item._extend) == null ? void 0 : _a.surcharge_fee) || 0).toNumber(),
|
|
147
152
|
quantity: 1
|
|
148
153
|
},
|
|
149
154
|
state,
|
|
@@ -153,19 +158,22 @@ var processItemsTax = (items, state, options) => {
|
|
|
153
158
|
if (productExpectAmount > 0) {
|
|
154
159
|
itemDiscount = unitPrice.dividedBy(productExpectAmount).times(shopDiscount);
|
|
155
160
|
}
|
|
156
|
-
|
|
157
|
-
|
|
161
|
+
let mainItemDiscount = new import_decimal.default(0);
|
|
162
|
+
if (unitPrice.greaterThan(0)) {
|
|
163
|
+
mainItemDiscount = mainProductPrice.dividedBy(productExpectAmount).times(shopDiscount);
|
|
164
|
+
}
|
|
165
|
+
const mainItemDiscountedUnitPrice = mainProductPrice.minus(mainItemDiscount).add(((_b = item._extend) == null ? void 0 : _b.surcharge_fee) || 0);
|
|
166
|
+
const maxDiscountedTaxPerItem = getProductItemTax(
|
|
158
167
|
{
|
|
159
168
|
...item,
|
|
160
|
-
total:
|
|
169
|
+
total: mainItemDiscountedUnitPrice.toNumber(),
|
|
161
170
|
price: item._extend.total,
|
|
162
171
|
quantity: 1
|
|
163
172
|
},
|
|
164
173
|
state,
|
|
165
174
|
{ tax_rate, is_price_include_tax }
|
|
166
175
|
);
|
|
167
|
-
item._extend.
|
|
168
|
-
item._extend.tax_fee = discountedTaxPerItem.toNumber();
|
|
176
|
+
item._extend.main_product_attached_bundle_tax_fee = maxDiscountedTaxPerItem.toNumber();
|
|
169
177
|
let addTimeTotalTax = new import_decimal.default(0);
|
|
170
178
|
if (Array.isArray(item._extend.relation_details)) {
|
|
171
179
|
for (let atItem of item._extend.relation_details) {
|
|
@@ -181,8 +189,7 @@ var processItemsTax = (items, state, options) => {
|
|
|
181
189
|
const addTimeTaxPerItem = getProductItemTax(
|
|
182
190
|
{
|
|
183
191
|
...atItem,
|
|
184
|
-
total: _discountedTotal,
|
|
185
|
-
// 可能包含原有数据,或前端临时数据
|
|
192
|
+
total: _discountedTotal.add((atItem == null ? void 0 : atItem.surcharge_fee) || 0).toNumber(),
|
|
186
193
|
quantity: atItem.product_quantity || atItem.num || 1
|
|
187
194
|
},
|
|
188
195
|
state,
|
|
@@ -191,8 +198,51 @@ var processItemsTax = (items, state, options) => {
|
|
|
191
198
|
addTimeTotalTax = addTimeTotalTax.plus(addTimeTaxPerItem);
|
|
192
199
|
}
|
|
193
200
|
}
|
|
194
|
-
|
|
195
|
-
|
|
201
|
+
let bundleTotalOriginTax = new import_decimal.default(0);
|
|
202
|
+
let bundleTotalTax = new import_decimal.default(0);
|
|
203
|
+
if (Array.isArray((_c = item._extend.other) == null ? void 0 : _c.bundle)) {
|
|
204
|
+
for (let bundleItem of item._extend.other.bundle) {
|
|
205
|
+
if (getBundleItemIsOriginalPrice(bundleItem)) {
|
|
206
|
+
const bundleQuantity = new import_decimal.default(bundleItem.quantity || 1);
|
|
207
|
+
const bundleUnitPrice = new import_decimal.default(
|
|
208
|
+
bundleItem.bundle_selling_price ?? bundleItem.price ?? 0
|
|
209
|
+
);
|
|
210
|
+
const bundleOriginalTaxPerItem = getProductItemTax(
|
|
211
|
+
{
|
|
212
|
+
...bundleItem,
|
|
213
|
+
total: bundleUnitPrice.add((bundleItem == null ? void 0 : bundleItem.surcharge_fee) || 0).toNumber(),
|
|
214
|
+
quantity: 1
|
|
215
|
+
},
|
|
216
|
+
state,
|
|
217
|
+
{ tax_rate, is_price_include_tax }
|
|
218
|
+
);
|
|
219
|
+
let bundleItemDiscount = new import_decimal.default(0);
|
|
220
|
+
if (productExpectAmount > 0) {
|
|
221
|
+
bundleItemDiscount = bundleUnitPrice.dividedBy(productExpectAmount).times(shopDiscount);
|
|
222
|
+
}
|
|
223
|
+
const bundleDiscountedUnitPrice = bundleUnitPrice.minus(bundleItemDiscount).add((bundleItem == null ? void 0 : bundleItem.surcharge_fee) || 0);
|
|
224
|
+
const bundleDiscountedTaxPerItem = getProductItemTax(
|
|
225
|
+
{
|
|
226
|
+
...bundleItem,
|
|
227
|
+
total: bundleDiscountedUnitPrice.toNumber(),
|
|
228
|
+
quantity: 1
|
|
229
|
+
},
|
|
230
|
+
state,
|
|
231
|
+
{ tax_rate, is_price_include_tax }
|
|
232
|
+
);
|
|
233
|
+
bundleItem.original_tax_fee = new import_decimal.default(bundleOriginalTaxPerItem).toNumber();
|
|
234
|
+
bundleItem.tax_fee = new import_decimal.default(bundleDiscountedTaxPerItem).toNumber();
|
|
235
|
+
bundleTotalOriginTax = bundleTotalOriginTax.plus(bundleOriginalTaxPerItem.times(bundleQuantity));
|
|
236
|
+
bundleTotalTax = bundleTotalTax.plus(bundleDiscountedTaxPerItem.times(bundleQuantity));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
const original_tax_fee = originalTaxPerItem.add(bundleTotalOriginTax);
|
|
241
|
+
const tax_fee = maxDiscountedTaxPerItem.add(bundleTotalTax);
|
|
242
|
+
item._extend.original_tax_fee = original_tax_fee.toNumber();
|
|
243
|
+
item._extend.tax_fee = tax_fee.toNumber();
|
|
244
|
+
originTax = originTax.plus(original_tax_fee.times(quantity)).plus(addTimeTotalTax);
|
|
245
|
+
tax = tax.plus(tax_fee.times(quantity)).plus(addTimeTotalTax);
|
|
196
246
|
}
|
|
197
247
|
return { originTax, tax };
|
|
198
248
|
};
|
|
@@ -253,7 +303,7 @@ var isProductMatchSurchargeCondition = (item, options) => {
|
|
|
253
303
|
}
|
|
254
304
|
const isInScheduleByDate = (_a = options.ScheduleModule) == null ? void 0 : _a.isInScheduleByDate;
|
|
255
305
|
const { surchargeConfig, scheduleById = {} } = options;
|
|
256
|
-
const { startDate,
|
|
306
|
+
const { startDate, product_id, isCustomItem } = item;
|
|
257
307
|
const {
|
|
258
308
|
open_product = 0,
|
|
259
309
|
// 1 | 0
|
|
@@ -277,7 +327,6 @@ var isProductMatchSurchargeCondition = (item, options) => {
|
|
|
277
327
|
if (isCustomItem) {
|
|
278
328
|
isProductMatch = false;
|
|
279
329
|
} else {
|
|
280
|
-
const product_id = other == null ? void 0 : other.product_id;
|
|
281
330
|
isProductMatch = available_product_ids.includes(product_id);
|
|
282
331
|
}
|
|
283
332
|
}
|
|
@@ -307,8 +356,71 @@ var isProductMatchSurchargeCondition = (item, options) => {
|
|
|
307
356
|
}
|
|
308
357
|
return isProductMatch && isScheduleMatch;
|
|
309
358
|
};
|
|
359
|
+
var getBundleItemIsOriginalPrice = (item) => {
|
|
360
|
+
return (item == null ? void 0 : item.price_type) === "markup" && (item == null ? void 0 : item.price_type_ext) === "product_price";
|
|
361
|
+
};
|
|
362
|
+
var getBundleItemIsMarkupPrice = (item) => {
|
|
363
|
+
return (item == null ? void 0 : item.price_type) === "markup" && ((item == null ? void 0 : item.price_type_ext) === "" || !(item == null ? void 0 : item.price_type_ext));
|
|
364
|
+
};
|
|
365
|
+
var getBundleItemIsDiscountPrice = (item) => {
|
|
366
|
+
return (item == null ? void 0 : item.price_type) === "markdown" && ((item == null ? void 0 : item.price_type_ext) === "" || !(item == null ? void 0 : item.price_type_ext));
|
|
367
|
+
};
|
|
368
|
+
var getBundleItemIsMarkupOrDiscountPrice = (item) => {
|
|
369
|
+
return getBundleItemIsMarkupPrice(item) || getBundleItemIsDiscountPrice(item);
|
|
370
|
+
};
|
|
371
|
+
var getDiscountAmount = (discounts) => {
|
|
372
|
+
return (discounts || []).reduce((total, discount) => {
|
|
373
|
+
return total.add(new import_decimal.default(discount.amount || 0));
|
|
374
|
+
}, new import_decimal.default(0)).toNumber();
|
|
375
|
+
};
|
|
376
|
+
var getMainProductTotal = (item) => {
|
|
377
|
+
var _a, _b, _c, _d, _e, _f;
|
|
378
|
+
let total = new import_decimal.default(((_a = item._extend) == null ? void 0 : _a.main_product_selling_price) ?? ((_b = item == null ? void 0 : item.metadata) == null ? void 0 : _b.main_product_selling_price) ?? item._extend.price ?? 0);
|
|
379
|
+
if (((_c = item._extend.other) == null ? void 0 : _c.option) && Array.isArray((_d = item._extend.other) == null ? void 0 : _d.option)) {
|
|
380
|
+
total = total.add((_e = item._extend.other) == null ? void 0 : _e.option.reduce((t, option) => {
|
|
381
|
+
return t.add(new import_decimal.default(option.price || 0).mul(option.num || 1));
|
|
382
|
+
}, new import_decimal.default(0)));
|
|
383
|
+
}
|
|
384
|
+
for (let bundleItem of ((_f = item._extend.other) == null ? void 0 : _f.bundle) || []) {
|
|
385
|
+
if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
|
|
386
|
+
const discountAmount = getDiscountAmount(bundleItem.discount_list);
|
|
387
|
+
const bundleItemPrice = new import_decimal.default(bundleItem.bundle_selling_price ?? bundleItem.price ?? 0);
|
|
388
|
+
const bundleItemTotal = bundleItemPrice.minus(discountAmount);
|
|
389
|
+
total = total.add(bundleItemTotal);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return total.toNumber();
|
|
393
|
+
};
|
|
394
|
+
var clearSurchargeFee = (state) => {
|
|
395
|
+
var _a, _b;
|
|
396
|
+
const { service, addons } = state;
|
|
397
|
+
if (Array.isArray(service == null ? void 0 : service.value)) {
|
|
398
|
+
for (let item of service.value) {
|
|
399
|
+
item._extend.surcharge_fee = 0;
|
|
400
|
+
item._extend.relation_surcharge_ids = [];
|
|
401
|
+
for (let bundleItem of ((_a = item._extend.other) == null ? void 0 : _a.bundle) || []) {
|
|
402
|
+
bundleItem.surcharge_fee = 0;
|
|
403
|
+
bundleItem.relation_surcharge_ids = [];
|
|
404
|
+
}
|
|
405
|
+
for (let relationDetail of item._extend.relation_details || []) {
|
|
406
|
+
relationDetail.surcharge_fee = 0;
|
|
407
|
+
relationDetail.relation_surcharge_ids = [];
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
if (Array.isArray(addons == null ? void 0 : addons.value)) {
|
|
412
|
+
for (let item of addons.value) {
|
|
413
|
+
item._extend.surcharge_fee = 0;
|
|
414
|
+
item._extend.relation_surcharge_ids = [];
|
|
415
|
+
for (let bundleItem of ((_b = item._extend.other) == null ? void 0 : _b.bundle) || []) {
|
|
416
|
+
bundleItem.surcharge_fee = 0;
|
|
417
|
+
bundleItem.relation_surcharge_ids = [];
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
};
|
|
310
422
|
var getSurcharge = (state, options) => {
|
|
311
|
-
var _a;
|
|
423
|
+
var _a, _b, _c, _d, _e;
|
|
312
424
|
const { isEdit, ScheduleModule, surcharge_list, scheduleById } = options;
|
|
313
425
|
const { bookingDetail, bookingId } = state;
|
|
314
426
|
if (!isEdit && bookingId) {
|
|
@@ -333,6 +445,7 @@ var getSurcharge = (state, options) => {
|
|
|
333
445
|
}
|
|
334
446
|
return [];
|
|
335
447
|
}
|
|
448
|
+
clearSurchargeFee(state);
|
|
336
449
|
const { service, addons } = state;
|
|
337
450
|
if (!Array.isArray(surcharge_list) || !(surcharge_list == null ? void 0 : surcharge_list.length)) return [];
|
|
338
451
|
const surchargeWithAmount = [];
|
|
@@ -343,24 +456,89 @@ var getSurcharge = (state, options) => {
|
|
|
343
456
|
fixed = "0",
|
|
344
457
|
id,
|
|
345
458
|
type,
|
|
346
|
-
description
|
|
459
|
+
description,
|
|
460
|
+
open_product
|
|
347
461
|
} = surchargeConfig;
|
|
348
462
|
const matchedItems = [];
|
|
349
463
|
if (Array.isArray(service == null ? void 0 : service.value)) {
|
|
350
464
|
for (let item of service.value) {
|
|
351
|
-
if (isProductMatchSurchargeCondition(
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
465
|
+
if (isProductMatchSurchargeCondition(
|
|
466
|
+
{
|
|
467
|
+
isCustomItem: item.isCustomItem,
|
|
468
|
+
startDate: item._extend.startDate,
|
|
469
|
+
product_id: item.product_id
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
surchargeConfig,
|
|
473
|
+
scheduleById: scheduleById || {},
|
|
474
|
+
ScheduleModule
|
|
475
|
+
}
|
|
476
|
+
)) {
|
|
477
|
+
const total = getMainProductTotal(item);
|
|
478
|
+
const mainQuantity = item._extend.quantity || 1;
|
|
356
479
|
matchedItems.push({
|
|
357
|
-
total
|
|
358
|
-
addTimeTotal: getRelationDetailsTotal(
|
|
359
|
-
|
|
360
|
-
),
|
|
361
|
-
|
|
480
|
+
total,
|
|
481
|
+
// addTimeTotal: getRelationDetailsTotal(
|
|
482
|
+
// item._extend.relation_details || []
|
|
483
|
+
// ),
|
|
484
|
+
isMain: true,
|
|
485
|
+
quantity: mainQuantity,
|
|
486
|
+
item,
|
|
487
|
+
mainQuantity
|
|
488
|
+
// 主商品的mainQuantity等于自己的quantity
|
|
362
489
|
});
|
|
363
490
|
}
|
|
491
|
+
for (let bundleItem of ((_b = item._extend.other) == null ? void 0 : _b.bundle) || []) {
|
|
492
|
+
if (getBundleItemIsOriginalPrice(bundleItem) && isProductMatchSurchargeCondition(
|
|
493
|
+
{
|
|
494
|
+
isCustomItem: false,
|
|
495
|
+
startDate: item._extend.startDate,
|
|
496
|
+
product_id: bundleItem._bundle_product_id
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
surchargeConfig,
|
|
500
|
+
scheduleById: scheduleById || {},
|
|
501
|
+
ScheduleModule
|
|
502
|
+
}
|
|
503
|
+
)) {
|
|
504
|
+
const mainQuantity = item._extend.quantity || 1;
|
|
505
|
+
matchedItems.push({
|
|
506
|
+
isMain: false,
|
|
507
|
+
total: Number(
|
|
508
|
+
bundleItem.bundle_selling_price ?? bundleItem.price ?? 0
|
|
509
|
+
),
|
|
510
|
+
quantity: bundleItem.num || bundleItem.quantity || 1,
|
|
511
|
+
item: bundleItem,
|
|
512
|
+
mainQuantity
|
|
513
|
+
// 子商品的mainQuantity是所属主商品的quantity
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
for (let relationDetail of item._extend.relation_details || []) {
|
|
518
|
+
if (isProductMatchSurchargeCondition(
|
|
519
|
+
{
|
|
520
|
+
isCustomItem: false,
|
|
521
|
+
startDate: item._extend.startDate,
|
|
522
|
+
product_id: relationDetail.product_id
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
surchargeConfig,
|
|
526
|
+
scheduleById: scheduleById || {},
|
|
527
|
+
ScheduleModule
|
|
528
|
+
}
|
|
529
|
+
)) {
|
|
530
|
+
matchedItems.push({
|
|
531
|
+
isMain: false,
|
|
532
|
+
total: Number(
|
|
533
|
+
(relationDetail == null ? void 0 : relationDetail.price) || ((_c = relationDetail == null ? void 0 : relationDetail.metadata) == null ? void 0 : _c.main_product_attached_bundle_selling_price)
|
|
534
|
+
),
|
|
535
|
+
quantity: relationDetail.num || relationDetail.quantity || 1,
|
|
536
|
+
item: relationDetail,
|
|
537
|
+
mainQuantity: 1
|
|
538
|
+
// 加时商品不受主商品数量影响
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
}
|
|
364
542
|
}
|
|
365
543
|
}
|
|
366
544
|
if (Array.isArray(addons == null ? void 0 : addons.value)) {
|
|
@@ -371,28 +549,84 @@ var getSurcharge = (state, options) => {
|
|
|
371
549
|
ScheduleModule
|
|
372
550
|
})) {
|
|
373
551
|
matchedItems.push({
|
|
552
|
+
isMain: true,
|
|
374
553
|
total: Number(item._extend.total),
|
|
375
|
-
quantity: item._extend.quantity || 1
|
|
554
|
+
quantity: item._extend.quantity || 1,
|
|
555
|
+
item,
|
|
556
|
+
mainQuantity: 1
|
|
557
|
+
// addons独立商品,mainQuantity为1
|
|
376
558
|
});
|
|
377
559
|
}
|
|
378
560
|
}
|
|
379
561
|
}
|
|
380
562
|
let finalAmount = 0;
|
|
563
|
+
const productCount = matchedItems.reduce((total, item) => {
|
|
564
|
+
if (item.isMain) {
|
|
565
|
+
return total + (item.quantity || 1);
|
|
566
|
+
} else {
|
|
567
|
+
return total + (item.quantity || 1) * (item.mainQuantity || 1);
|
|
568
|
+
}
|
|
569
|
+
}, 0);
|
|
570
|
+
let fixedTotal = new import_decimal.default(0);
|
|
571
|
+
let productTotalSurcharge = new import_decimal.default(0);
|
|
381
572
|
if (matchedItems.length > 0) {
|
|
382
573
|
let configTotal = new import_decimal.default(0);
|
|
383
|
-
if (
|
|
574
|
+
if (fixed && new import_decimal.default(fixed).gt(0)) {
|
|
575
|
+
configTotal = configTotal.plus(fixed);
|
|
576
|
+
}
|
|
577
|
+
if (percentage && new import_decimal.default(percentage).gt(0) || fixed) {
|
|
384
578
|
const percentageRate = new import_decimal.default(percentage);
|
|
385
|
-
for (let item of matchedItems) {
|
|
579
|
+
for (let [index, item] of matchedItems.entries()) {
|
|
580
|
+
const isLast = index === matchedItems.length - 1;
|
|
386
581
|
const itemPrice = new import_decimal.default(Math.max(0, item.total || 0));
|
|
387
|
-
const itemQuantity = new import_decimal.default(item.quantity || 1);
|
|
582
|
+
const itemQuantity = new import_decimal.default(item.isMain ? item.quantity || 1 : item.quantity * item.mainQuantity || 1);
|
|
388
583
|
const addTimeTotal = new import_decimal.default(item.addTimeTotal || 0);
|
|
389
|
-
const
|
|
390
|
-
configTotal = configTotal.plus(
|
|
584
|
+
const itemTotalSurcharge = itemPrice.times(itemQuantity).plus(addTimeTotal).times(percentageRate);
|
|
585
|
+
configTotal = configTotal.plus(itemTotalSurcharge);
|
|
586
|
+
const itemSurcharge = itemPrice.times(percentageRate);
|
|
587
|
+
const fixedSurcharge = new import_decimal.default(1).div(productCount).times(fixed).times(100).floor().div(100).toFixed(2);
|
|
588
|
+
const quantity = item.isMain ? item.quantity : item.quantity * item.mainQuantity;
|
|
589
|
+
fixedTotal = fixedTotal.plus(new import_decimal.default(fixedSurcharge).times(quantity).toNumber());
|
|
590
|
+
if (isLast && fixedTotal.gt(0)) {
|
|
591
|
+
const remaining = new import_decimal.default(fixed).minus(fixedTotal).toNumber();
|
|
592
|
+
if (remaining > 0) {
|
|
593
|
+
productTotalSurcharge = productTotalSurcharge.plus(remaining);
|
|
594
|
+
if (item.isMain) {
|
|
595
|
+
item.item._extend.surcharge_rounding_remainder = remaining;
|
|
596
|
+
} else {
|
|
597
|
+
item.item.surcharge_rounding_remainder = remaining;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
if (open_product !== 0) {
|
|
602
|
+
if (item.isMain) {
|
|
603
|
+
const originSurchargeFee = new import_decimal.default(item.item._extend.surcharge_fee || 0);
|
|
604
|
+
const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
|
|
605
|
+
productTotalSurcharge = productTotalSurcharge.plus(new import_decimal.default(surchargeFee).times(itemQuantity).toNumber());
|
|
606
|
+
item.item._extend.surcharge_fee = surchargeFee;
|
|
607
|
+
item.item._extend.relation_surcharge_ids = [...((_d = item.item._extend) == null ? void 0 : _d.relation_surcharge_ids) || [], id];
|
|
608
|
+
} else {
|
|
609
|
+
const originSurchargeFee = new import_decimal.default(item.item.surcharge_fee || 0);
|
|
610
|
+
const surchargeFee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
|
|
611
|
+
productTotalSurcharge = productTotalSurcharge.plus(new import_decimal.default(surchargeFee).times(itemQuantity).toNumber());
|
|
612
|
+
item.item.surcharge_fee = surchargeFee;
|
|
613
|
+
item.item.relation_surcharge_ids = [...((_e = item.item) == null ? void 0 : _e.relation_surcharge_ids) || [], id];
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
if (isLast && configTotal.minus(productTotalSurcharge).gt(0)) {
|
|
617
|
+
const configTotalRounded = configTotal.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP);
|
|
618
|
+
if (item.isMain) {
|
|
619
|
+
let newRoundingRemainder = new import_decimal.default(item.item._extend.surcharge_rounding_remainder || 0);
|
|
620
|
+
newRoundingRemainder = newRoundingRemainder.plus(configTotalRounded.minus(productTotalSurcharge));
|
|
621
|
+
item.item._extend.surcharge_rounding_remainder = newRoundingRemainder.toNumber();
|
|
622
|
+
} else {
|
|
623
|
+
let newRoundingRemainder = new import_decimal.default(item.item.surcharge_rounding_remainder || 0);
|
|
624
|
+
newRoundingRemainder = newRoundingRemainder.plus(configTotalRounded.minus(productTotalSurcharge));
|
|
625
|
+
item.item.surcharge_rounding_remainder = newRoundingRemainder.toNumber();
|
|
626
|
+
}
|
|
627
|
+
}
|
|
391
628
|
}
|
|
392
629
|
}
|
|
393
|
-
if (fixed && new import_decimal.default(fixed).gt(0)) {
|
|
394
|
-
configTotal = configTotal.plus(fixed);
|
|
395
|
-
}
|
|
396
630
|
finalAmount = configTotal.toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber();
|
|
397
631
|
}
|
|
398
632
|
const name = surchargeConfig.name || {};
|
|
@@ -410,7 +644,10 @@ var getSurcharge = (state, options) => {
|
|
|
410
644
|
type: "default",
|
|
411
645
|
fixed,
|
|
412
646
|
amount: finalAmount,
|
|
413
|
-
percentage
|
|
647
|
+
percentage,
|
|
648
|
+
metadata: {
|
|
649
|
+
open_product
|
|
650
|
+
}
|
|
414
651
|
});
|
|
415
652
|
}
|
|
416
653
|
return surchargeWithAmount;
|
|
@@ -520,6 +757,19 @@ var getSumTotal = (state, options) => {
|
|
|
520
757
|
state,
|
|
521
758
|
options
|
|
522
759
|
});
|
|
760
|
+
const { productExpectAmount: productExpectAmountWithoutDiscount } = getProductExpectAmount(
|
|
761
|
+
state,
|
|
762
|
+
options.isEdit,
|
|
763
|
+
true
|
|
764
|
+
);
|
|
765
|
+
const originExpectAmountWithoutDiscount = getExpectAmount({
|
|
766
|
+
price: productExpectAmountWithoutDiscount,
|
|
767
|
+
tax: originTax,
|
|
768
|
+
surchargeAmount,
|
|
769
|
+
shopDiscount: 0,
|
|
770
|
+
state,
|
|
771
|
+
options
|
|
772
|
+
});
|
|
523
773
|
const sumTotalAmount = getSumTotalAmount({ expectAmount, roundingAmount });
|
|
524
774
|
const sumTotalAmountDecimal = new import_decimal.default((0, import_utils2.formatAmount)(sumTotalAmount, 2, "") || 0);
|
|
525
775
|
const orderPaidAmountDecimal = new import_decimal.default(orderPaidAmount || 0);
|
|
@@ -546,7 +796,9 @@ var getSumTotal = (state, options) => {
|
|
|
546
796
|
totalRefundAmount,
|
|
547
797
|
dueAmount,
|
|
548
798
|
roundingAmount,
|
|
549
|
-
originExpectAmount
|
|
799
|
+
originExpectAmount,
|
|
800
|
+
// 订单原价 不包含整单折扣 不包含商品券折扣卡抵扣
|
|
801
|
+
originExpectAmountWithoutDiscount
|
|
550
802
|
};
|
|
551
803
|
};
|
|
552
804
|
// Annotate the CommonJS export names for ESM import in node:
|