@pisell/private-materials 6.5.30 → 6.5.32
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 +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/appointmentBooking/components/Voucher/index.js +2 -1
- package/es/components/booking/addons/index.js +25 -17
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/footer/amount.d.ts +1 -0
- package/es/components/booking/components/footer/amount.js +529 -79
- package/es/components/booking/components/footer/index.js +15 -3
- package/es/components/booking/components/footer/utils.d.ts +19 -0
- package/es/components/booking/components/footer/utils.js +160 -61
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/es/components/booking/components/voucher/index.js +20 -6
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.js +1 -0
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/index.js +2 -3
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/materiels/contacts/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/booking/notes/addNote/index.d.ts +1 -0
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +1 -0
- package/es/components/booking/utils.js +16 -3
- package/es/components/checkout/PaymentModal.d.ts +7 -5
- package/es/components/checkout/PaymentModal.js +44 -108
- package/es/components/checkout/components/AdditionalModule/index.js +6 -0
- package/es/components/checkout/components/AmountSummary/index.less +4 -5
- package/es/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/index.d.ts +1 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +2 -1
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/component/fail/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/network.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/manual/index.d.ts +1 -0
- package/es/components/eftposPay/component/signature/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +14 -6
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/payo/config.d.ts +1 -0
- 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/tip.d.ts +1 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -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/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/login/index.d.ts +1 -0
- package/es/components/pay/toB/components/Cache/index.d.ts +1 -0
- package/es/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/es/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +13 -11
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- 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/model.d.ts +1 -9
- package/es/components/pay/toC/status.d.ts +1 -0
- package/es/components/pay/toC/status.js +3 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- 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/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/es/components/schedules/products/list/index.d.ts +1 -0
- package/es/components/schedules/resources/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/schedules/index.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/shoppingCart/index.d.ts +1 -0
- 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/addServiceVariant/addService.js +1 -0
- 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/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/index.js +11 -10
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/components/WalletCard.js +5 -1
- package/es/components/wallet/index.js +4 -2
- package/es/components/wallet/model.d.ts +1 -9
- 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/hooks/usePaymentLogger.d.ts +1 -0
- package/es/index.d.ts +4 -0
- package/es/index.js +5 -1
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Cover/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Price/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +1 -0
- package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/es/plus/saasRegister/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/es/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
- 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/pisellPaymentList/example.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +35 -30
- package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
- package/lib/components/booking/addons/index.js +15 -7
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.js +276 -38
- package/lib/components/booking/components/footer/index.js +15 -3
- package/lib/components/booking/components/footer/utils.d.ts +19 -0
- package/lib/components/booking/components/footer/utils.js +109 -33
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/lib/components/booking/components/voucher/index.js +21 -7
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.js +1 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/index.js +1 -2
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/lib/components/booking/notes/addNote/index.d.ts +1 -0
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +1 -0
- package/lib/components/booking/utils.js +11 -0
- package/lib/components/checkout/PaymentModal.d.ts +7 -5
- package/lib/components/checkout/PaymentModal.js +73 -127
- package/lib/components/checkout/components/AdditionalModule/index.js +6 -0
- package/lib/components/checkout/components/AmountSummary/index.less +4 -5
- package/lib/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/index.d.ts +1 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +2 -1
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +12 -6
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/payo/config.d.ts +1 -0
- 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/tip.d.ts +1 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -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/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/login/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Cache/index.d.ts +1 -0
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +13 -11
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- 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/model.d.ts +1 -9
- package/lib/components/pay/toC/status.d.ts +1 -0
- package/lib/components/pay/toC/status.js +5 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/calendar/index.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- 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/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/lib/components/schedules/products/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/resources/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/schedules/index.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/shoppingCart/index.d.ts +1 -0
- 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/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/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/index.js +8 -8
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/components/WalletCard.js +4 -0
- package/lib/components/wallet/index.js +2 -2
- package/lib/components/wallet/model.d.ts +1 -9
- 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/hooks/usePaymentLogger.d.ts +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +12 -0
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Cover/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Price/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +1 -0
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/lib/plus/saasRegister/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/lib/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
- 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/pisellPaymentList/example.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +34 -39
- package/lowcode/settings-registry/meta.ts +29 -0
- package/lowcode/wallet-pass-detail/meta.ts +89 -0
- package/package.json +3 -3
- package/es/components/checkout/PaymentPlugin.d.ts +0 -2
- package/lib/components/checkout/PaymentPlugin.d.ts +0 -2
- package/lib/components/checkout/PaymentPlugin.js +0 -181
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
+
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."); }
|
|
8
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
2
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
12
|
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; }
|
|
@@ -34,7 +42,7 @@ export var getRelationDetailsTotal = function getRelationDetailsTotal(relation_d
|
|
|
34
42
|
* @param state
|
|
35
43
|
* @returns
|
|
36
44
|
*/
|
|
37
|
-
var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
45
|
+
var getProductExpectAmount = function getProductExpectAmount(state, isEdit, isOriginTotal) {
|
|
38
46
|
var price = new Decimal(0);
|
|
39
47
|
var duration = new Decimal(0);
|
|
40
48
|
// 是否是跨日预约
|
|
@@ -54,7 +62,8 @@ var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
|
54
62
|
if (isDay || isNormalProductByDurationSchedule(item)) {
|
|
55
63
|
var quantity = new Decimal(item._extend.quantity || 1);
|
|
56
64
|
var itemTotal = new Decimal(item._extend.total || 0);
|
|
57
|
-
|
|
65
|
+
var itemOriginTotal = new Decimal(item._extend.origin_total || 0);
|
|
66
|
+
price = price.add((isOriginTotal ? itemOriginTotal : itemTotal).mul(quantity));
|
|
58
67
|
|
|
59
68
|
// 普通商品不能加到时长上
|
|
60
69
|
var _duration = isDayBookingProduct(item, state) ? new Decimal(item._extend.duration || 0) : new Decimal(0);
|
|
@@ -62,7 +71,8 @@ var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
|
62
71
|
} else {
|
|
63
72
|
var _quantity = new Decimal(item._extend.quantity || 1);
|
|
64
73
|
var _itemTotal = new Decimal(item._extend.total || 0);
|
|
65
|
-
|
|
74
|
+
var _itemOriginTotal = new Decimal(item._extend.origin_total || 0);
|
|
75
|
+
price = price.add((isOriginTotal ? _itemOriginTotal : _itemTotal).mul(_quantity));
|
|
66
76
|
|
|
67
77
|
// 附加商品
|
|
68
78
|
var relationTotal = new Decimal(getRelationDetailsTotal(item._extend.relation_details || []));
|
|
@@ -87,7 +97,8 @@ var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
|
87
97
|
var _item = _step3.value;
|
|
88
98
|
var _quantity2 = new Decimal(_item._extend.quantity || 1);
|
|
89
99
|
var _itemTotal2 = new Decimal(_item._extend.total || 0);
|
|
90
|
-
|
|
100
|
+
var _itemOriginTotal2 = new Decimal(_item._extend.origin_total || 0);
|
|
101
|
+
price = price.add((isOriginTotal ? _itemOriginTotal2 : _itemTotal2).mul(_quantity2));
|
|
91
102
|
}
|
|
92
103
|
} catch (err) {
|
|
93
104
|
_iterator3.e(err);
|
|
@@ -164,7 +175,52 @@ var getProductItemTax = function getProductItemTax(item, state, options) {
|
|
|
164
175
|
}
|
|
165
176
|
|
|
166
177
|
// 结果 = 单个商品税费 × 数量
|
|
167
|
-
return singleItemTax.times(quantity);
|
|
178
|
+
return singleItemTax.times(quantity).toDecimalPlaces(2, Decimal.ROUND_HALF_UP);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* 计算商品附加费 包含子商品的总附加费
|
|
183
|
+
*/
|
|
184
|
+
var getProductSurchargeFee = function getProductSurchargeFee(product) {
|
|
185
|
+
var _extend = product._extend;
|
|
186
|
+
if (!_extend) {
|
|
187
|
+
return 0;
|
|
188
|
+
}
|
|
189
|
+
var surcharge_fee = _extend.surcharge_fee,
|
|
190
|
+
relation_details = _extend.relation_details,
|
|
191
|
+
other = _extend.other,
|
|
192
|
+
surcharge_rounding_remainder = _extend.surcharge_rounding_remainder;
|
|
193
|
+
var totalSurchargeFee = new Decimal(0);
|
|
194
|
+
if (surcharge_fee) {
|
|
195
|
+
totalSurchargeFee = totalSurchargeFee.plus(surcharge_fee);
|
|
196
|
+
}
|
|
197
|
+
if (surcharge_rounding_remainder) {
|
|
198
|
+
totalSurchargeFee = totalSurchargeFee.plus(surcharge_rounding_remainder);
|
|
199
|
+
}
|
|
200
|
+
if (relation_details) {
|
|
201
|
+
var _iterator4 = _createForOfIteratorHelper(relation_details),
|
|
202
|
+
_step4;
|
|
203
|
+
try {
|
|
204
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
205
|
+
var item = _step4.value;
|
|
206
|
+
totalSurchargeFee = totalSurchargeFee.plus(getProductSurchargeFee(item));
|
|
207
|
+
}
|
|
208
|
+
} catch (err) {
|
|
209
|
+
_iterator4.e(err);
|
|
210
|
+
} finally {
|
|
211
|
+
_iterator4.f();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (other !== null && other !== void 0 && other.bundle) {
|
|
215
|
+
totalSurchargeFee = totalSurchargeFee.plus(other.bundle.reduce(function (total, item) {
|
|
216
|
+
var surchargeFee = new Decimal(item.surcharge_fee || 0).times(item.num || item.quantity || 1);
|
|
217
|
+
if (item.surcharge_rounding_remainder) {
|
|
218
|
+
surchargeFee = surchargeFee.plus(item.surcharge_rounding_remainder);
|
|
219
|
+
}
|
|
220
|
+
return total.plus(surchargeFee);
|
|
221
|
+
}, new Decimal(0)));
|
|
222
|
+
}
|
|
223
|
+
return totalSurchargeFee.toNumber();
|
|
168
224
|
};
|
|
169
225
|
|
|
170
226
|
/**
|
|
@@ -183,17 +239,21 @@ var processItemsTax = function processItemsTax(items, state, options) {
|
|
|
183
239
|
productExpectAmount = computed.productExpectAmount;
|
|
184
240
|
var originTax = new Decimal(0);
|
|
185
241
|
var tax = new Decimal(0);
|
|
186
|
-
var
|
|
187
|
-
|
|
242
|
+
var _iterator5 = _createForOfIteratorHelper(items),
|
|
243
|
+
_step5;
|
|
188
244
|
try {
|
|
189
|
-
for (
|
|
190
|
-
var
|
|
245
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
246
|
+
var _item$_extend, _item$_extend2, _item$_extend$other;
|
|
247
|
+
var item = _step5.value;
|
|
191
248
|
var quantity = new Decimal(item._extend.quantity || 1);
|
|
192
249
|
var unitPrice = new Decimal(item._extend.total || 0);
|
|
250
|
+
var mainProductPrice = new Decimal(getMainProductTotal(item) || 0);
|
|
251
|
+
|
|
252
|
+
// const surchargeFee = getProductSurchargeFee(item);
|
|
193
253
|
|
|
194
254
|
// 计算原始税费(折扣前)- 单个商品
|
|
195
255
|
var originalTaxPerItem = getProductItemTax(_objectSpread(_objectSpread({}, item), {}, {
|
|
196
|
-
total:
|
|
256
|
+
total: mainProductPrice.add(((_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.surcharge_fee) || 0).toNumber(),
|
|
197
257
|
quantity: 1
|
|
198
258
|
}), state, {
|
|
199
259
|
tax_rate: tax_rate,
|
|
@@ -206,12 +266,31 @@ var processItemsTax = function processItemsTax(items, state, options) {
|
|
|
206
266
|
itemDiscount = unitPrice.dividedBy(productExpectAmount).times(shopDiscount);
|
|
207
267
|
}
|
|
208
268
|
|
|
209
|
-
// 商品折后单价 = 商品单价 - 商品折后单价
|
|
210
|
-
|
|
269
|
+
// // 商品折后单价 = 商品单价 - 商品折后单价
|
|
270
|
+
// const itemDiscountedUnitPrice = unitPrice.minus(itemDiscount).add(surchargeFee);
|
|
211
271
|
|
|
212
|
-
// 计算折后税费(折扣后)- 单个商品
|
|
213
|
-
|
|
214
|
-
|
|
272
|
+
// // 计算折后税费(折扣后)- 单个商品 加子商品的税费
|
|
273
|
+
// const discountedTaxPerItem = getProductItemTax(
|
|
274
|
+
// {
|
|
275
|
+
// ...item,
|
|
276
|
+
// total: itemDiscountedUnitPrice.toNumber(),
|
|
277
|
+
// price: item._extend.total,
|
|
278
|
+
// quantity: 1,
|
|
279
|
+
// },
|
|
280
|
+
// state,
|
|
281
|
+
// { tax_rate, is_price_include_tax }
|
|
282
|
+
// );
|
|
283
|
+
|
|
284
|
+
// 按比例计算主商品应分摊的折扣
|
|
285
|
+
var mainItemDiscount = new Decimal(0);
|
|
286
|
+
if (unitPrice.greaterThan(0)) {
|
|
287
|
+
mainItemDiscount = mainProductPrice.dividedBy(productExpectAmount).times(shopDiscount);
|
|
288
|
+
}
|
|
289
|
+
var mainItemDiscountedUnitPrice = mainProductPrice.minus(mainItemDiscount).add(((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.surcharge_fee) || 0);
|
|
290
|
+
|
|
291
|
+
// 计算折后税费(折扣后)- 主商品的税费
|
|
292
|
+
var maxDiscountedTaxPerItem = getProductItemTax(_objectSpread(_objectSpread({}, item), {}, {
|
|
293
|
+
total: mainItemDiscountedUnitPrice.toNumber(),
|
|
215
294
|
price: item._extend.total,
|
|
216
295
|
quantity: 1
|
|
217
296
|
}), state, {
|
|
@@ -219,18 +298,20 @@ var processItemsTax = function processItemsTax(items, state, options) {
|
|
|
219
298
|
is_price_include_tax: is_price_include_tax
|
|
220
299
|
});
|
|
221
300
|
|
|
222
|
-
//
|
|
223
|
-
|
|
224
|
-
item._extend.
|
|
301
|
+
// item._extend.payment_price = itemDiscountedUnitPrice;
|
|
302
|
+
// 保存到商品扩展信息中(保留两位小数)
|
|
303
|
+
// item._extend.original_tax_fee = originalTaxPerItem.toNumber();
|
|
304
|
+
// item._extend.tax_fee = discountedTaxPerItem.toNumber();
|
|
305
|
+
item._extend.main_product_attached_bundle_tax_fee = maxDiscountedTaxPerItem.toNumber();
|
|
225
306
|
|
|
226
307
|
// 注意:加时商品独立计算,不考虑主商品数量
|
|
227
308
|
var addTimeTotalTax = new Decimal(0);
|
|
228
309
|
if (Array.isArray(item._extend.relation_details)) {
|
|
229
|
-
var
|
|
230
|
-
|
|
310
|
+
var _iterator6 = _createForOfIteratorHelper(item._extend.relation_details),
|
|
311
|
+
_step6;
|
|
231
312
|
try {
|
|
232
|
-
for (
|
|
233
|
-
var atItem =
|
|
313
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
314
|
+
var atItem = _step6.value;
|
|
234
315
|
// 计算单件加时商品折扣后价格
|
|
235
316
|
var _originTotal = new Decimal(atItem.selling_price || atItem.price || 0);
|
|
236
317
|
var _discountedTotal = _originTotal;
|
|
@@ -238,8 +319,7 @@ var processItemsTax = function processItemsTax(items, state, options) {
|
|
|
238
319
|
_discountedTotal = _originTotal.minus(_originTotal.dividedBy(productExpectAmount).times(shopDiscount));
|
|
239
320
|
}
|
|
240
321
|
var addTimeTaxPerItem = getProductItemTax(_objectSpread(_objectSpread({}, atItem), {}, {
|
|
241
|
-
total: _discountedTotal,
|
|
242
|
-
// 可能包含原有数据,或前端临时数据
|
|
322
|
+
total: _discountedTotal.add((atItem === null || atItem === void 0 ? void 0 : atItem.surcharge_fee) || 0).toNumber(),
|
|
243
323
|
quantity: atItem.product_quantity || atItem.num || 1
|
|
244
324
|
}), state, {
|
|
245
325
|
tax_rate: tax_rate,
|
|
@@ -248,20 +328,84 @@ var processItemsTax = function processItemsTax(items, state, options) {
|
|
|
248
328
|
addTimeTotalTax = addTimeTotalTax.plus(addTimeTaxPerItem);
|
|
249
329
|
}
|
|
250
330
|
} catch (err) {
|
|
251
|
-
|
|
331
|
+
_iterator6.e(err);
|
|
332
|
+
} finally {
|
|
333
|
+
_iterator6.f();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// 处理 bundle 子商品(仅原价子商品)
|
|
338
|
+
var bundleTotalOriginTax = new Decimal(0);
|
|
339
|
+
var bundleTotalTax = new Decimal(0);
|
|
340
|
+
if (Array.isArray((_item$_extend$other = item._extend.other) === null || _item$_extend$other === void 0 ? void 0 : _item$_extend$other.bundle)) {
|
|
341
|
+
var _iterator7 = _createForOfIteratorHelper(item._extend.other.bundle),
|
|
342
|
+
_step7;
|
|
343
|
+
try {
|
|
344
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
345
|
+
var bundleItem = _step7.value;
|
|
346
|
+
// 只处理原价的子商品
|
|
347
|
+
if (getBundleItemIsOriginalPrice(bundleItem)) {
|
|
348
|
+
var _ref2, _bundleItem$bundle_se;
|
|
349
|
+
var bundleQuantity = new Decimal(bundleItem.quantity || 1);
|
|
350
|
+
var bundleUnitPrice = new Decimal((_ref2 = (_bundleItem$bundle_se = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se !== void 0 ? _bundleItem$bundle_se : bundleItem.price) !== null && _ref2 !== void 0 ? _ref2 : 0);
|
|
351
|
+
|
|
352
|
+
// 计算原始税费(折扣前)- 单个商品
|
|
353
|
+
var bundleOriginalTaxPerItem = getProductItemTax(_objectSpread(_objectSpread({}, bundleItem), {}, {
|
|
354
|
+
total: bundleUnitPrice.add((bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.surcharge_fee) || 0).toNumber(),
|
|
355
|
+
quantity: 1
|
|
356
|
+
}), state, {
|
|
357
|
+
tax_rate: tax_rate,
|
|
358
|
+
is_price_include_tax: is_price_include_tax
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
// 计算平摊到该bundle商品的折扣
|
|
362
|
+
var bundleItemDiscount = new Decimal(0);
|
|
363
|
+
if (productExpectAmount > 0) {
|
|
364
|
+
bundleItemDiscount = bundleUnitPrice.dividedBy(productExpectAmount).times(shopDiscount);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// bundle商品折后单价
|
|
368
|
+
var bundleDiscountedUnitPrice = bundleUnitPrice.minus(bundleItemDiscount).add((bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.surcharge_fee) || 0);
|
|
369
|
+
|
|
370
|
+
// 计算折后税费(折扣后)- 单个商品
|
|
371
|
+
var bundleDiscountedTaxPerItem = getProductItemTax(_objectSpread(_objectSpread({}, bundleItem), {}, {
|
|
372
|
+
total: bundleDiscountedUnitPrice.toNumber(),
|
|
373
|
+
quantity: 1
|
|
374
|
+
}), state, {
|
|
375
|
+
tax_rate: tax_rate,
|
|
376
|
+
is_price_include_tax: is_price_include_tax
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
// bundle商品折后单价
|
|
380
|
+
// bundleItem.bundle_payment_price = bundleDiscountedUnitPrice;
|
|
381
|
+
// 保存到bundle商品上(单个商品的税费,保留两位小数)
|
|
382
|
+
bundleItem.original_tax_fee = new Decimal(bundleOriginalTaxPerItem).toNumber();
|
|
383
|
+
bundleItem.tax_fee = new Decimal(bundleDiscountedTaxPerItem).toNumber();
|
|
384
|
+
|
|
385
|
+
// 累加bundle税费(需要乘以bundle数量和主商品数量)
|
|
386
|
+
bundleTotalOriginTax = bundleTotalOriginTax.plus(bundleOriginalTaxPerItem.times(bundleQuantity));
|
|
387
|
+
bundleTotalTax = bundleTotalTax.plus(bundleDiscountedTaxPerItem.times(bundleQuantity));
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
} catch (err) {
|
|
391
|
+
_iterator7.e(err);
|
|
252
392
|
} finally {
|
|
253
|
-
|
|
393
|
+
_iterator7.f();
|
|
254
394
|
}
|
|
255
395
|
}
|
|
396
|
+
var original_tax_fee = originalTaxPerItem.add(bundleTotalOriginTax);
|
|
397
|
+
var tax_fee = maxDiscountedTaxPerItem.add(bundleTotalTax);
|
|
398
|
+
item._extend.original_tax_fee = original_tax_fee.toNumber();
|
|
399
|
+
item._extend.tax_fee = tax_fee.toNumber();
|
|
256
400
|
|
|
257
401
|
// 累加到总税费(乘以数量)
|
|
258
|
-
originTax = originTax.plus(
|
|
259
|
-
tax = tax.plus(
|
|
402
|
+
originTax = originTax.plus(original_tax_fee.times(quantity)).plus(addTimeTotalTax);
|
|
403
|
+
tax = tax.plus(tax_fee.times(quantity)).plus(addTimeTotalTax);
|
|
260
404
|
}
|
|
261
405
|
} catch (err) {
|
|
262
|
-
|
|
406
|
+
_iterator5.e(err);
|
|
263
407
|
} finally {
|
|
264
|
-
|
|
408
|
+
_iterator5.f();
|
|
265
409
|
}
|
|
266
410
|
return {
|
|
267
411
|
originTax: originTax,
|
|
@@ -361,10 +505,9 @@ var isProductMatchSurchargeCondition = function isProductMatchSurchargeCondition
|
|
|
361
505
|
var surchargeConfig = options.surchargeConfig,
|
|
362
506
|
_options$scheduleById = options.scheduleById,
|
|
363
507
|
scheduleById = _options$scheduleById === void 0 ? {} : _options$scheduleById;
|
|
364
|
-
var
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
isCustomItem = _item$_extend.isCustomItem;
|
|
508
|
+
var startDate = item.startDate,
|
|
509
|
+
product_id = item.product_id,
|
|
510
|
+
isCustomItem = item.isCustomItem;
|
|
368
511
|
var _surchargeConfig$open = surchargeConfig.open_product,
|
|
369
512
|
open_product = _surchargeConfig$open === void 0 ? 0 : _surchargeConfig$open,
|
|
370
513
|
_surchargeConfig$is_a = surchargeConfig.is_all,
|
|
@@ -395,7 +538,6 @@ var isProductMatchSurchargeCondition = function isProductMatchSurchargeCondition
|
|
|
395
538
|
isProductMatch = false;
|
|
396
539
|
} else {
|
|
397
540
|
// 普通商品:检查是否在指定商品列表中
|
|
398
|
-
var product_id = other === null || other === void 0 ? void 0 : other.product_id;
|
|
399
541
|
isProductMatch = available_product_ids.includes(product_id);
|
|
400
542
|
}
|
|
401
543
|
}
|
|
@@ -434,6 +576,156 @@ var isProductMatchSurchargeCondition = function isProductMatchSurchargeCondition
|
|
|
434
576
|
return isProductMatch && isScheduleMatch;
|
|
435
577
|
};
|
|
436
578
|
|
|
579
|
+
// bundle商品是否是原价
|
|
580
|
+
var getBundleItemIsOriginalPrice = function getBundleItemIsOriginalPrice(item) {
|
|
581
|
+
return (item === null || item === void 0 ? void 0 : item.price_type) === 'markup' && (item === null || item === void 0 ? void 0 : item.price_type_ext) === 'product_price';
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
// bundle商品是否是加价
|
|
585
|
+
var getBundleItemIsMarkupPrice = function getBundleItemIsMarkupPrice(item) {
|
|
586
|
+
return (item === null || item === void 0 ? void 0 : item.price_type) === 'markup' && ((item === null || item === void 0 ? void 0 : item.price_type_ext) === '' || !(item !== null && item !== void 0 && item.price_type_ext));
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
// bundle商品是否是减价
|
|
590
|
+
var getBundleItemIsDiscountPrice = function getBundleItemIsDiscountPrice(item) {
|
|
591
|
+
return (item === null || item === void 0 ? void 0 : item.price_type) === 'markdown' && ((item === null || item === void 0 ? void 0 : item.price_type_ext) === '' || !(item !== null && item !== void 0 && item.price_type_ext));
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
// bundle商品是否是加价或减价
|
|
595
|
+
var getBundleItemIsMarkupOrDiscountPrice = function getBundleItemIsMarkupOrDiscountPrice(item) {
|
|
596
|
+
return getBundleItemIsMarkupPrice(item) || getBundleItemIsDiscountPrice(item);
|
|
597
|
+
};
|
|
598
|
+
var getDiscountAmount = function getDiscountAmount(discounts) {
|
|
599
|
+
return (discounts || []).reduce(function (total, discount) {
|
|
600
|
+
return total.add(new Decimal(discount.amount || 0));
|
|
601
|
+
}, new Decimal(0)).toNumber();
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* 获取主商品加价减价后的总价 (主商品价格 + 子商品加价减价)
|
|
606
|
+
*/
|
|
607
|
+
var getMainProductTotal = function getMainProductTotal(item) {
|
|
608
|
+
var _item$_extend$other2, _item$_extend$other3, _item$_extend$other5;
|
|
609
|
+
var total = new Decimal(item._extend.main_product_selling_price || item._extend.price || 0);
|
|
610
|
+
|
|
611
|
+
// 如果主商品没有main_product_selling_price 则通过discount_list计算
|
|
612
|
+
if (!item._extend.main_product_selling_price) {
|
|
613
|
+
// 主商品折扣金额
|
|
614
|
+
var discountAmount = getDiscountAmount(item.discount_list);
|
|
615
|
+
// 主商品总价 - 主商品折扣金额
|
|
616
|
+
total = total.minus(discountAmount);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
// 单规格
|
|
620
|
+
if ((_item$_extend$other2 = item._extend.other) !== null && _item$_extend$other2 !== void 0 && _item$_extend$other2.option && Array.isArray((_item$_extend$other3 = item._extend.other) === null || _item$_extend$other3 === void 0 ? void 0 : _item$_extend$other3.option)) {
|
|
621
|
+
var _item$_extend$other4;
|
|
622
|
+
total = total.add((_item$_extend$other4 = item._extend.other) === null || _item$_extend$other4 === void 0 ? void 0 : _item$_extend$other4.option.reduce(function (t, option) {
|
|
623
|
+
return t.add(new Decimal(option.price || 0).mul(option.num || 1));
|
|
624
|
+
}, new Decimal(0)));
|
|
625
|
+
}
|
|
626
|
+
var _iterator8 = _createForOfIteratorHelper(((_item$_extend$other5 = item._extend.other) === null || _item$_extend$other5 === void 0 ? void 0 : _item$_extend$other5.bundle) || []),
|
|
627
|
+
_step8;
|
|
628
|
+
try {
|
|
629
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
630
|
+
var bundleItem = _step8.value;
|
|
631
|
+
if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
|
|
632
|
+
var _ref3, _bundleItem$bundle_se2;
|
|
633
|
+
// 子商品折扣金额
|
|
634
|
+
var _discountAmount = getDiscountAmount(bundleItem.discount_list);
|
|
635
|
+
// 子商品价格
|
|
636
|
+
var bundleItemPrice = new Decimal((_ref3 = (_bundleItem$bundle_se2 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se2 !== void 0 ? _bundleItem$bundle_se2 : bundleItem.price) !== null && _ref3 !== void 0 ? _ref3 : 0);
|
|
637
|
+
// todo: 套餐子商品后不需要处理 子商品价格 - 子商品折扣金额
|
|
638
|
+
var bundleItemTotal = bundleItemPrice.minus(_discountAmount);
|
|
639
|
+
total = total.add(bundleItemTotal);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
} catch (err) {
|
|
643
|
+
_iterator8.e(err);
|
|
644
|
+
} finally {
|
|
645
|
+
_iterator8.f();
|
|
646
|
+
}
|
|
647
|
+
return total.toNumber();
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* 清除附加费
|
|
652
|
+
*/
|
|
653
|
+
var clearSurchargeFee = function clearSurchargeFee(state) {
|
|
654
|
+
var service = state.service,
|
|
655
|
+
addons = state.addons;
|
|
656
|
+
if (Array.isArray(service === null || service === void 0 ? void 0 : service.value)) {
|
|
657
|
+
var _iterator9 = _createForOfIteratorHelper(service.value),
|
|
658
|
+
_step9;
|
|
659
|
+
try {
|
|
660
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
661
|
+
var _item$_extend$other6;
|
|
662
|
+
var item = _step9.value;
|
|
663
|
+
item._extend.surcharge_fee = 0;
|
|
664
|
+
item._extend.relation_surcharge_ids = [];
|
|
665
|
+
var _iterator10 = _createForOfIteratorHelper(((_item$_extend$other6 = item._extend.other) === null || _item$_extend$other6 === void 0 ? void 0 : _item$_extend$other6.bundle) || []),
|
|
666
|
+
_step10;
|
|
667
|
+
try {
|
|
668
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
669
|
+
var bundleItem = _step10.value;
|
|
670
|
+
bundleItem.surcharge_fee = 0;
|
|
671
|
+
bundleItem.relation_surcharge_ids = [];
|
|
672
|
+
}
|
|
673
|
+
} catch (err) {
|
|
674
|
+
_iterator10.e(err);
|
|
675
|
+
} finally {
|
|
676
|
+
_iterator10.f();
|
|
677
|
+
}
|
|
678
|
+
var _iterator11 = _createForOfIteratorHelper(item._extend.relation_details || []),
|
|
679
|
+
_step11;
|
|
680
|
+
try {
|
|
681
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
682
|
+
var relationDetail = _step11.value;
|
|
683
|
+
relationDetail.surcharge_fee = 0;
|
|
684
|
+
relationDetail.relation_surcharge_ids = [];
|
|
685
|
+
}
|
|
686
|
+
} catch (err) {
|
|
687
|
+
_iterator11.e(err);
|
|
688
|
+
} finally {
|
|
689
|
+
_iterator11.f();
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
} catch (err) {
|
|
693
|
+
_iterator9.e(err);
|
|
694
|
+
} finally {
|
|
695
|
+
_iterator9.f();
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
if (Array.isArray(addons === null || addons === void 0 ? void 0 : addons.value)) {
|
|
699
|
+
var _iterator12 = _createForOfIteratorHelper(addons.value),
|
|
700
|
+
_step12;
|
|
701
|
+
try {
|
|
702
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
703
|
+
var _item2$_extend$other;
|
|
704
|
+
var _item2 = _step12.value;
|
|
705
|
+
_item2._extend.surcharge_fee = 0;
|
|
706
|
+
_item2._extend.relation_surcharge_ids = [];
|
|
707
|
+
var _iterator13 = _createForOfIteratorHelper(((_item2$_extend$other = _item2._extend.other) === null || _item2$_extend$other === void 0 ? void 0 : _item2$_extend$other.bundle) || []),
|
|
708
|
+
_step13;
|
|
709
|
+
try {
|
|
710
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
711
|
+
var _bundleItem = _step13.value;
|
|
712
|
+
_bundleItem.surcharge_fee = 0;
|
|
713
|
+
_bundleItem.relation_surcharge_ids = [];
|
|
714
|
+
}
|
|
715
|
+
} catch (err) {
|
|
716
|
+
_iterator13.e(err);
|
|
717
|
+
} finally {
|
|
718
|
+
_iterator13.f();
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
} catch (err) {
|
|
722
|
+
_iterator12.e(err);
|
|
723
|
+
} finally {
|
|
724
|
+
_iterator12.f();
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
|
|
437
729
|
/**
|
|
438
730
|
* 订单附加费各项信息
|
|
439
731
|
* @param state
|
|
@@ -470,6 +762,8 @@ var getSurcharge = function getSurcharge(state, options) {
|
|
|
470
762
|
}
|
|
471
763
|
return [];
|
|
472
764
|
}
|
|
765
|
+
// 清除附加费
|
|
766
|
+
clearSurchargeFee(state);
|
|
473
767
|
|
|
474
768
|
// 新增状态
|
|
475
769
|
var service = state.service,
|
|
@@ -489,85 +783,222 @@ var getSurcharge = function getSurcharge(state, options) {
|
|
|
489
783
|
fixed = _surchargeConfig$fixe === void 0 ? '0' : _surchargeConfig$fixe,
|
|
490
784
|
id = surchargeConfig.id,
|
|
491
785
|
type = surchargeConfig.type,
|
|
492
|
-
description = surchargeConfig.description
|
|
786
|
+
description = surchargeConfig.description,
|
|
787
|
+
open_product = surchargeConfig.open_product;
|
|
493
788
|
|
|
494
789
|
// 收集所有符合条件的商品
|
|
495
790
|
var matchedItems = [];
|
|
496
791
|
|
|
497
792
|
// 检查service中符合条件的商品
|
|
498
793
|
if (Array.isArray(service === null || service === void 0 ? void 0 : service.value)) {
|
|
499
|
-
var
|
|
500
|
-
|
|
794
|
+
var _iterator14 = _createForOfIteratorHelper(service.value),
|
|
795
|
+
_step14;
|
|
501
796
|
try {
|
|
502
|
-
for (
|
|
503
|
-
var
|
|
504
|
-
|
|
797
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
798
|
+
var _item$_extend$other7;
|
|
799
|
+
var item = _step14.value;
|
|
800
|
+
// 主商品符合附加费条件
|
|
801
|
+
if (isProductMatchSurchargeCondition({
|
|
802
|
+
isCustomItem: item.isCustomItem,
|
|
803
|
+
startDate: item._extend.startDate,
|
|
804
|
+
product_id: item.product_id
|
|
805
|
+
}, {
|
|
505
806
|
surchargeConfig: surchargeConfig,
|
|
506
807
|
scheduleById: scheduleById || {},
|
|
507
808
|
ScheduleModule: ScheduleModule
|
|
508
809
|
})) {
|
|
810
|
+
// 主商品加价减价后的总价
|
|
811
|
+
var total = getMainProductTotal(item);
|
|
812
|
+
var mainQuantity = item._extend.quantity || 1;
|
|
509
813
|
matchedItems.push({
|
|
510
|
-
total:
|
|
511
|
-
addTimeTotal: getRelationDetailsTotal(
|
|
512
|
-
|
|
814
|
+
total: total,
|
|
815
|
+
// addTimeTotal: getRelationDetailsTotal(
|
|
816
|
+
// item._extend.relation_details || []
|
|
817
|
+
// ),
|
|
818
|
+
isMain: true,
|
|
819
|
+
quantity: mainQuantity,
|
|
820
|
+
item: item,
|
|
821
|
+
mainQuantity: mainQuantity // 主商品的mainQuantity等于自己的quantity
|
|
513
822
|
});
|
|
514
823
|
}
|
|
824
|
+
// 遍历子商品 原价商品符合附加费条件
|
|
825
|
+
var _iterator15 = _createForOfIteratorHelper(((_item$_extend$other7 = item._extend.other) === null || _item$_extend$other7 === void 0 ? void 0 : _item$_extend$other7.bundle) || []),
|
|
826
|
+
_step15;
|
|
827
|
+
try {
|
|
828
|
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
|
829
|
+
var bundleItem = _step15.value;
|
|
830
|
+
// bundle商品是原价且符合附加费条件
|
|
831
|
+
if (getBundleItemIsOriginalPrice(bundleItem) && isProductMatchSurchargeCondition({
|
|
832
|
+
isCustomItem: false,
|
|
833
|
+
startDate: item._extend.startDate,
|
|
834
|
+
product_id: bundleItem._bundle_product_id
|
|
835
|
+
}, {
|
|
836
|
+
surchargeConfig: surchargeConfig,
|
|
837
|
+
scheduleById: scheduleById || {},
|
|
838
|
+
ScheduleModule: ScheduleModule
|
|
839
|
+
})) {
|
|
840
|
+
var _ref4, _bundleItem$bundle_se3;
|
|
841
|
+
var _mainQuantity = item._extend.quantity || 1;
|
|
842
|
+
matchedItems.push({
|
|
843
|
+
isMain: false,
|
|
844
|
+
total: Number((_ref4 = (_bundleItem$bundle_se3 = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se3 !== void 0 ? _bundleItem$bundle_se3 : bundleItem.price) !== null && _ref4 !== void 0 ? _ref4 : 0),
|
|
845
|
+
quantity: bundleItem.num || bundleItem.quantity || 1,
|
|
846
|
+
item: bundleItem,
|
|
847
|
+
mainQuantity: _mainQuantity // 子商品的mainQuantity是所属主商品的quantity
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
// 加时商品符合附加费条件
|
|
853
|
+
} catch (err) {
|
|
854
|
+
_iterator15.e(err);
|
|
855
|
+
} finally {
|
|
856
|
+
_iterator15.f();
|
|
857
|
+
}
|
|
858
|
+
var _iterator16 = _createForOfIteratorHelper(item._extend.relation_details || []),
|
|
859
|
+
_step16;
|
|
860
|
+
try {
|
|
861
|
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
|
862
|
+
var relationDetail = _step16.value;
|
|
863
|
+
if (isProductMatchSurchargeCondition({
|
|
864
|
+
isCustomItem: false,
|
|
865
|
+
startDate: item._extend.startDate,
|
|
866
|
+
product_id: relationDetail.product_id
|
|
867
|
+
}, {
|
|
868
|
+
surchargeConfig: surchargeConfig,
|
|
869
|
+
scheduleById: scheduleById || {},
|
|
870
|
+
ScheduleModule: ScheduleModule
|
|
871
|
+
})) {
|
|
872
|
+
var _relationDetail$metad;
|
|
873
|
+
matchedItems.push({
|
|
874
|
+
isMain: false,
|
|
875
|
+
total: Number((relationDetail === null || relationDetail === void 0 ? void 0 : relationDetail.price) || (relationDetail === null || relationDetail === void 0 || (_relationDetail$metad = relationDetail.metadata) === null || _relationDetail$metad === void 0 ? void 0 : _relationDetail$metad.main_product_attached_bundle_selling_price)),
|
|
876
|
+
quantity: relationDetail.num || relationDetail.quantity || 1,
|
|
877
|
+
item: relationDetail,
|
|
878
|
+
mainQuantity: 1 // 加时商品不受主商品数量影响
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
} catch (err) {
|
|
883
|
+
_iterator16.e(err);
|
|
884
|
+
} finally {
|
|
885
|
+
_iterator16.f();
|
|
886
|
+
}
|
|
515
887
|
}
|
|
516
888
|
} catch (err) {
|
|
517
|
-
|
|
889
|
+
_iterator14.e(err);
|
|
518
890
|
} finally {
|
|
519
|
-
|
|
891
|
+
_iterator14.f();
|
|
520
892
|
}
|
|
521
893
|
}
|
|
522
894
|
|
|
523
895
|
// 检查addons中符合条件的商品
|
|
524
896
|
if (Array.isArray(addons === null || addons === void 0 ? void 0 : addons.value)) {
|
|
525
|
-
var
|
|
526
|
-
|
|
897
|
+
var _iterator17 = _createForOfIteratorHelper(addons.value),
|
|
898
|
+
_step17;
|
|
527
899
|
try {
|
|
528
|
-
for (
|
|
529
|
-
var
|
|
530
|
-
if (isProductMatchSurchargeCondition(
|
|
900
|
+
for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
|
|
901
|
+
var _item3 = _step17.value;
|
|
902
|
+
if (isProductMatchSurchargeCondition(_item3, {
|
|
531
903
|
surchargeConfig: surchargeConfig,
|
|
532
904
|
scheduleById: scheduleById || {},
|
|
533
905
|
ScheduleModule: ScheduleModule
|
|
534
906
|
})) {
|
|
535
907
|
matchedItems.push({
|
|
536
|
-
|
|
537
|
-
|
|
908
|
+
isMain: true,
|
|
909
|
+
total: Number(_item3._extend.total),
|
|
910
|
+
quantity: _item3._extend.quantity || 1,
|
|
911
|
+
item: _item3,
|
|
912
|
+
mainQuantity: 1 // addons独立商品,mainQuantity为1
|
|
538
913
|
});
|
|
539
914
|
}
|
|
540
915
|
}
|
|
541
916
|
} catch (err) {
|
|
542
|
-
|
|
917
|
+
_iterator17.e(err);
|
|
543
918
|
} finally {
|
|
544
|
-
|
|
919
|
+
_iterator17.f();
|
|
545
920
|
}
|
|
546
921
|
}
|
|
547
922
|
var finalAmount = 0;
|
|
923
|
+
|
|
924
|
+
// 计算商品总数:主商品和addons按quantity计算,子商品(bundle item)需要乘以主商品数量
|
|
925
|
+
var productCount = matchedItems.reduce(function (total, item) {
|
|
926
|
+
if (item.isMain) {
|
|
927
|
+
// 主商品和addons商品
|
|
928
|
+
return total + (item.quantity || 1);
|
|
929
|
+
} else {
|
|
930
|
+
// 子商品(bundle item)和加时商品
|
|
931
|
+
// 加时商品的 mainQuantity = 1,所以不受影响
|
|
932
|
+
// bundle item 的 mainQuantity = 主商品数量,需要乘以实际数量
|
|
933
|
+
return total + (item.quantity || 1) * (item.mainQuantity || 1);
|
|
934
|
+
}
|
|
935
|
+
}, 0);
|
|
936
|
+
|
|
937
|
+
// 追加进入的固定附加费总值
|
|
938
|
+
var fixedTotal = new Decimal(0);
|
|
548
939
|
if (matchedItems.length > 0) {
|
|
549
940
|
// 基于每个商品计算附加费:max(0, 商品价格) * rate + fixed
|
|
550
941
|
var configTotal = new Decimal(0);
|
|
551
942
|
|
|
552
943
|
// 计算百分比附加费 - 对每个商品单独计算
|
|
553
|
-
if (percentage && new Decimal(percentage).gt(0)) {
|
|
944
|
+
if (percentage && new Decimal(percentage).gt(0) || fixed) {
|
|
554
945
|
var percentageRate = new Decimal(percentage);
|
|
555
|
-
var
|
|
556
|
-
|
|
946
|
+
var _iterator18 = _createForOfIteratorHelper(matchedItems.entries()),
|
|
947
|
+
_step18;
|
|
557
948
|
try {
|
|
558
|
-
for (
|
|
559
|
-
var
|
|
949
|
+
for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
|
|
950
|
+
var _step18$value = _slicedToArray(_step18.value, 2),
|
|
951
|
+
index = _step18$value[0],
|
|
952
|
+
_item4 = _step18$value[1];
|
|
953
|
+
var isLast = index === matchedItems.length - 1;
|
|
560
954
|
// 对每个商品:max(0, 价格) * 数量 * 费率
|
|
561
|
-
var itemPrice = new Decimal(Math.max(0,
|
|
562
|
-
var itemQuantity = new Decimal(
|
|
563
|
-
var addTimeTotal = new Decimal(
|
|
564
|
-
|
|
565
|
-
|
|
955
|
+
var itemPrice = new Decimal(Math.max(0, _item4.total || 0));
|
|
956
|
+
var itemQuantity = new Decimal(_item4.isMain ? _item4.quantity || 1 : _item4.quantity * _item4.mainQuantity || 1);
|
|
957
|
+
var addTimeTotal = new Decimal(_item4.addTimeTotal || 0);
|
|
958
|
+
// 单个商品总附加费
|
|
959
|
+
var itemTotalSurcharge = itemPrice.times(itemQuantity).plus(addTimeTotal).times(percentageRate);
|
|
960
|
+
|
|
961
|
+
// 单个商品单数量附加费
|
|
962
|
+
var itemSurcharge = itemPrice.times(percentageRate);
|
|
963
|
+
|
|
964
|
+
// 固定附加费 = 1 / 商品数量 * 固定附加费(向下取整保留两位小数)
|
|
965
|
+
var fixedSurcharge = new Decimal(1).div(productCount).times(fixed).times(100).floor().div(100).toFixed(2);
|
|
966
|
+
var quantity = _item4.isMain ? _item4.quantity : _item4.quantity * _item4.mainQuantity;
|
|
967
|
+
fixedTotal = fixedTotal.plus(new Decimal(fixedSurcharge).times(quantity).toNumber());
|
|
968
|
+
// 如果是最后一个商品 判断fixed - fixedTotal 是否有剩余小数 如果有的话,追加抹平字段
|
|
969
|
+
if (isLast && fixedTotal.gt(0)) {
|
|
970
|
+
var remaining = new Decimal(fixed).minus(fixedTotal).toNumber();
|
|
971
|
+
if (remaining > 0) {
|
|
972
|
+
if (_item4.isMain) {
|
|
973
|
+
_item4.item._extend.surcharge_rounding_remainder = remaining;
|
|
974
|
+
} else {
|
|
975
|
+
_item4.item.surcharge_rounding_remainder = remaining;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
// 只有当 open_product !== 0 时,才将附加费追加到商品身上
|
|
980
|
+
// open_product === 0 表示商品未开启该附加费,只在订单级别累加
|
|
981
|
+
if (open_product !== 0) {
|
|
982
|
+
if (_item4.isMain) {
|
|
983
|
+
var _item4$item$_extend;
|
|
984
|
+
var originSurchargeFee = new Decimal(_item4.item._extend.surcharge_fee || 0);
|
|
985
|
+
// 保留两位小数
|
|
986
|
+
_item4.item._extend.surcharge_fee = originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toNumber();
|
|
987
|
+
_item4.item._extend.relation_surcharge_ids = [].concat(_toConsumableArray(((_item4$item$_extend = _item4.item._extend) === null || _item4$item$_extend === void 0 ? void 0 : _item4$item$_extend.relation_surcharge_ids) || []), [id]);
|
|
988
|
+
} else {
|
|
989
|
+
var _item4$item;
|
|
990
|
+
var _originSurchargeFee = new Decimal(_item4.item.surcharge_fee || 0);
|
|
991
|
+
// 保留两位小数
|
|
992
|
+
_item4.item.surcharge_fee = _originSurchargeFee.plus(itemSurcharge).plus(fixedSurcharge).toNumber();
|
|
993
|
+
_item4.item.relation_surcharge_ids = [].concat(_toConsumableArray(((_item4$item = _item4.item) === null || _item4$item === void 0 ? void 0 : _item4$item.relation_surcharge_ids) || []), [id]);
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
configTotal = configTotal.plus(itemTotalSurcharge);
|
|
566
997
|
}
|
|
567
998
|
} catch (err) {
|
|
568
|
-
|
|
999
|
+
_iterator18.e(err);
|
|
569
1000
|
} finally {
|
|
570
|
-
|
|
1001
|
+
_iterator18.f();
|
|
571
1002
|
}
|
|
572
1003
|
}
|
|
573
1004
|
|
|
@@ -594,7 +1025,10 @@ var getSurcharge = function getSurcharge(state, options) {
|
|
|
594
1025
|
type: 'default',
|
|
595
1026
|
fixed: fixed,
|
|
596
1027
|
amount: finalAmount,
|
|
597
|
-
percentage: percentage
|
|
1028
|
+
percentage: percentage,
|
|
1029
|
+
metadata: {
|
|
1030
|
+
open_product: open_product
|
|
1031
|
+
}
|
|
598
1032
|
});
|
|
599
1033
|
}
|
|
600
1034
|
return surchargeWithAmount;
|
|
@@ -665,13 +1099,13 @@ export var getIsPriceIncludeTax = function getIsPriceIncludeTax(state) {
|
|
|
665
1099
|
var _state$bookingDetail$, _state$bookingDetail6;
|
|
666
1100
|
return (_state$bookingDetail$ = (_state$bookingDetail6 = state.bookingDetail) === null || _state$bookingDetail6 === void 0 ? void 0 : _state$bookingDetail6.is_price_include_tax) !== null && _state$bookingDetail$ !== void 0 ? _state$bookingDetail$ : 0;
|
|
667
1101
|
};
|
|
668
|
-
var getExpectAmount = function getExpectAmount(
|
|
669
|
-
var price =
|
|
670
|
-
tax =
|
|
671
|
-
surchargeAmount =
|
|
672
|
-
shopDiscount =
|
|
673
|
-
state =
|
|
674
|
-
options =
|
|
1102
|
+
var getExpectAmount = function getExpectAmount(_ref5) {
|
|
1103
|
+
var price = _ref5.price,
|
|
1104
|
+
tax = _ref5.tax,
|
|
1105
|
+
surchargeAmount = _ref5.surchargeAmount,
|
|
1106
|
+
shopDiscount = _ref5.shopDiscount,
|
|
1107
|
+
state = _ref5.state,
|
|
1108
|
+
options = _ref5.options;
|
|
675
1109
|
var _tax = tax;
|
|
676
1110
|
// 如果价格含税, 则将税费改为0
|
|
677
1111
|
if (getIsPriceIncludeTax(state) || options !== null && options !== void 0 && options.is_price_include_tax) {
|
|
@@ -693,9 +1127,9 @@ var getRoundingAmount = function getRoundingAmount(state) {
|
|
|
693
1127
|
var _state$bookingDetail9;
|
|
694
1128
|
return Number(state === null || state === void 0 || (_state$bookingDetail9 = state.bookingDetail) === null || _state$bookingDetail9 === void 0 ? void 0 : _state$bookingDetail9.rounding_amount) || 0;
|
|
695
1129
|
};
|
|
696
|
-
var getSumTotalAmount = function getSumTotalAmount(
|
|
697
|
-
var expectAmount =
|
|
698
|
-
roundingAmount =
|
|
1130
|
+
var getSumTotalAmount = function getSumTotalAmount(_ref6) {
|
|
1131
|
+
var expectAmount = _ref6.expectAmount,
|
|
1132
|
+
roundingAmount = _ref6.roundingAmount;
|
|
699
1133
|
return expectAmount + roundingAmount;
|
|
700
1134
|
};
|
|
701
1135
|
|
|
@@ -767,6 +1201,20 @@ export var getSumTotal = function getSumTotal(state, options) {
|
|
|
767
1201
|
options: options
|
|
768
1202
|
});
|
|
769
1203
|
|
|
1204
|
+
// 商品原价 不包含折扣
|
|
1205
|
+
var _getProductExpectAmou2 = getProductExpectAmount(state, options.isEdit, true),
|
|
1206
|
+
productExpectAmountWithoutDiscount = _getProductExpectAmou2.productExpectAmount;
|
|
1207
|
+
|
|
1208
|
+
// 订单原价 不包含整单折扣 不包含商品券折扣卡抵扣
|
|
1209
|
+
var originExpectAmountWithoutDiscount = getExpectAmount({
|
|
1210
|
+
price: productExpectAmountWithoutDiscount,
|
|
1211
|
+
tax: originTax,
|
|
1212
|
+
surchargeAmount: surchargeAmount,
|
|
1213
|
+
shopDiscount: 0,
|
|
1214
|
+
state: state,
|
|
1215
|
+
options: options
|
|
1216
|
+
});
|
|
1217
|
+
|
|
770
1218
|
// 总支付金额 总计
|
|
771
1219
|
var sumTotalAmount = getSumTotalAmount({
|
|
772
1220
|
expectAmount: expectAmount,
|
|
@@ -803,6 +1251,8 @@ export var getSumTotal = function getSumTotal(state, options) {
|
|
|
803
1251
|
totalRefundAmount: totalRefundAmount,
|
|
804
1252
|
dueAmount: dueAmount,
|
|
805
1253
|
roundingAmount: roundingAmount,
|
|
806
|
-
originExpectAmount: originExpectAmount
|
|
1254
|
+
originExpectAmount: originExpectAmount,
|
|
1255
|
+
// 订单原价 不包含整单折扣 不包含商品券折扣卡抵扣
|
|
1256
|
+
originExpectAmountWithoutDiscount: originExpectAmountWithoutDiscount
|
|
807
1257
|
};
|
|
808
1258
|
};
|