@pisell/private-materials 6.6.44 → 6.6.46
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/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/components/Voucher/index.js +22 -7
- package/es/components/booking/addons/index.js +3 -2
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/footer/amount.js +1 -1
- package/es/components/booking/components/footer/index.js +7 -0
- package/es/components/booking/components/footer/utils.d.ts +1 -1
- package/es/components/booking/components/footer/utils.js +7 -5
- package/es/components/booking/components/voucher/index.js +6 -0
- package/es/components/booking/components/voucher/index.less +4 -1
- package/es/components/booking/components/voucherModal/index.less +1 -0
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/editService/index.js +8 -2
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/components/WalletPassModule/index.js +1 -0
- package/es/components/checkout/components/WalletPassModule/utils.d.ts +1 -0
- package/es/components/checkout/components/WalletPassModule/utils.js +17 -3
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +316 -192
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +166 -145
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
- package/es/components/pay/toC/WalletPassBlock/index.js +3 -1
- package/es/components/pay/toC/index.js +66 -27
- package/es/components/pay/toC/model.d.ts +10 -1
- package/es/components/pay/toC/serve.d.ts +18 -0
- package/es/components/pay/toC/serve.js +29 -1
- package/es/components/pay/toC/utils.d.ts +2 -2
- package/es/components/pay/toC/utils.js +4 -0
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +7 -4
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Voucher/index.js +10 -2
- package/lib/components/booking/addons/index.js +3 -2
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/footer/amount.js +1 -1
- package/lib/components/booking/components/footer/index.js +9 -0
- package/lib/components/booking/components/footer/utils.d.ts +1 -1
- package/lib/components/booking/components/footer/utils.js +5 -3
- package/lib/components/booking/components/voucher/index.js +6 -0
- package/lib/components/booking/components/voucher/index.less +4 -1
- package/lib/components/booking/components/voucherModal/index.less +1 -0
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/editService/index.js +24 -18
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/components/WalletPassModule/index.js +1 -0
- package/lib/components/checkout/components/WalletPassModule/utils.d.ts +1 -0
- package/lib/components/checkout/components/WalletPassModule/utils.js +18 -2
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +157 -108
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +90 -103
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
- package/lib/components/pay/toC/WalletPassBlock/index.js +3 -1
- package/lib/components/pay/toC/index.js +52 -11
- package/lib/components/pay/toC/model.d.ts +10 -1
- package/lib/components/pay/toC/serve.d.ts +18 -0
- package/lib/components/pay/toC/serve.js +6 -0
- package/lib/components/pay/toC/utils.d.ts +2 -2
- package/lib/components/pay/toC/utils.js +4 -0
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +11 -7
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/package.json +3 -3
- package/es/components/appointmentBooking/components/Date/state.d.ts +0 -63
- package/es/components/appointmentBooking/locales.d.ts +0 -603
- package/es/components/authentication/admin/AuthMethods/locales.d.ts +0 -413
- package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/index.d.ts +0 -6
- package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/locales.d.ts +0 -138
- package/es/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/types.d.ts +0 -43
- package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/index.d.ts +0 -6
- package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/locales.d.ts +0 -118
- package/es/components/authentication/admin/ChannelAuthSetting/CollectInfo/types.d.ts +0 -35
- package/es/components/authentication/admin/ChannelAuthSetting/OnlineShopAuth/index.d.ts +0 -6
- package/es/components/authentication/admin/ChannelAuthSetting/PageSetting/locales.d.ts +0 -43
- package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/index.d.ts +0 -8
- package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/locales.d.ts +0 -108
- package/es/components/authentication/admin/ChannelAuthSetting/PageSettingItem/types.d.ts +0 -28
- package/es/components/authentication/admin/ChannelAuthSetting/SaaSManagermentAuth/index.d.ts +0 -6
- package/es/components/authentication/admin/ChannelAuthSetting/locales.d.ts +0 -63
- package/es/components/authentication/admin/CustomerAuth/locales.d.ts +0 -108
- package/es/components/authentication/admin/CustomerOAuthConfig/locales.d.ts +0 -178
- package/es/components/authentication/admin/DeviceAuth/locales.d.ts +0 -93
- package/es/components/authentication/admin/OAuthConfig/locales.d.ts +0 -148
- package/es/components/authentication/admin/OrgAdminAuth/locales.d.ts +0 -88
- package/es/components/authentication/admin/POSOperatorAuth/locales.d.ts +0 -78
- package/es/components/authentication/admin/SaaSAdminAuth/locales.d.ts +0 -88
- package/es/components/booking/components/actionButtons/index.d.ts +0 -31
- package/es/components/booking/components/voucher/utils.d.ts +0 -5
- package/es/components/booking/editBookingModal/locales.d.ts +0 -33
- package/es/components/booking/editBookingModal/mock.d.ts +0 -991
- package/es/components/booking/info2/cartClientCard/locales.d.ts +0 -33
- package/es/components/booking/info2/service/addService/mock.d.ts +0 -216
- package/es/components/booking/info2/service/editService/DiscountChangeModal/index.d.ts +0 -25
- package/es/components/booking/locales.d.ts +0 -1619
- package/es/components/checkout/PaymentModal.d.ts +0 -31
- package/es/components/checkout/components/AdditionalModule/locales.d.ts +0 -58
- package/es/components/checkout/locales.d.ts +0 -853
- package/es/components/eftpos/locales.d.ts +0 -163
- package/es/components/eftposPay/locales.d.ts +0 -608
- package/es/components/eventBooking/locales.d.ts +0 -408
- package/es/components/list/locales.d.ts +0 -108
- package/es/components/list/utils/getText.d.ts +0 -53
- package/es/components/login/locales.d.ts +0 -38
- package/es/components/pay/toB/locales.d.ts +0 -88
- package/es/components/pay/toC/locales.d.ts +0 -511
- package/es/components/pinModal/locales.d.ts +0 -43
- package/es/components/pinVerifyModal/locales.d.ts +0 -38
- package/es/components/pisellSelectCustomerModal/locales.d.ts +0 -133
- package/es/components/productExtension/locales.d.ts +0 -78
- package/es/components/productSelect/components/pisellPriceText/index.d.ts +0 -11
- package/es/components/productSelect/locales.d.ts +0 -38
- package/es/components/ruleSetting/locales.d.ts +0 -78
- package/es/components/schedules/locales.d.ts +0 -143
- package/es/components/shoppingCart/locales.d.ts +0 -58
- package/es/components/stepController/locales.d.ts +0 -43
- package/es/components/subTotal/locales.d.ts +0 -68
- package/es/components/systemSettings/registry/components/ItemModal.d.ts +0 -4
- package/es/components/systemSettings/registry/locales.d.ts +0 -456
- package/es/components/systemSettings/registry/types.d.ts +0 -128
- package/es/components/taxSelect/locales.d.ts +0 -38
- package/es/components/ticketBooking/locales.d.ts +0 -328
- package/es/components/ticketBooking/utils/formatTime.d.ts +0 -33
- package/es/components/wallet/utils.d.ts +0 -48
- package/es/components/walletList/index.d.ts +0 -4
- package/es/components/walletList/locales.d.ts +0 -43
- package/es/components/walletList/types/index.d.ts +0 -196
- package/es/plus/clientCard/index.d.ts +0 -7
- package/es/plus/clientCard/locales.d.ts +0 -28
- package/es/plus/clientCard/types.d.ts +0 -135
- package/es/plus/clinetSearch/locales.d.ts +0 -178
- package/es/plus/contactInfo/locales.d.ts +0 -23
- package/es/plus/contactInfoModal/locales.d.ts +0 -108
- package/es/plus/noteModal/locales.d.ts +0 -53
- package/es/plus/productSelect/ProductCard/SkuCard/locales.d.ts +0 -68
- package/es/plus/productSelect/ProductCard/SkuCard/status.d.ts +0 -164
- package/es/plus/productSelect/components/pisellPriceText/index.d.ts +0 -14
- package/es/plus/productSelect/locales.d.ts +0 -38
- package/es/plus/saasAttendance/index.d.ts +0 -6
- package/es/plus/saasAttendance/locales.d.ts +0 -528
- package/es/plus/saasAttendance/settings/BasicInfoTab.d.ts +0 -5
- package/es/plus/saasAttendance/settings/ClockInMethodTab.d.ts +0 -8
- package/es/plus/saasAttendance/settings/CorrectionPolicyTab.d.ts +0 -8
- package/es/plus/saasAttendance/settings/ShiftScheduleTab.d.ts +0 -5
- package/es/plus/saasAttendance/settings/components/MapField.d.ts +0 -78
- package/es/plus/saasAttendance/settings/components/index.d.ts +0 -3
- package/es/plus/saasAttendance/settings/components/membersField/index.d.ts +0 -8
- package/es/plus/saasAttendance/settings/components/shiftModal/index.d.ts +0 -18
- package/es/plus/saasAttendance/settings/index.d.ts +0 -18
- package/es/plus/saasAttendance/settings/serve.d.ts +0 -27
- package/es/plus/saasAttendance/settings/types.d.ts +0 -130
- package/es/plus/saasCreateOrganization/locales.d.ts +0 -23
- package/es/plus/saasLogin/locales.d.ts +0 -83
- package/es/plus/saasRegister/locales.d.ts +0 -193
- package/es/plus/saasRole/components/PermissionManager/index.d.ts +0 -19
- package/es/plus/saasRole/index.d.ts +0 -14
- package/es/plus/saasRole/locales.d.ts +0 -319
- package/es/plus/saasRole/serve.d.ts +0 -72
- package/es/plus/saasRole/types.d.ts +0 -177
- package/es/plus/saasRole/utils.d.ts +0 -0
- package/es/plus/saasTeamMembers/components/MemberDrawer/ExtensionFormTabContent.d.ts +0 -31
- package/es/plus/saasTeamMembers/components/MemberDrawer/index.d.ts +0 -23
- package/es/plus/saasTeamMembers/index.d.ts +0 -5
- package/es/plus/saasTeamMembers/locales.d.ts +0 -546
- package/es/plus/saasTeamMembers/serve.d.ts +0 -95
- package/es/plus/saasTeamMembers/type.d.ts +0 -158
- package/es/plus/selectHolder/locales.d.ts +0 -38
- package/es/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +0 -39
- package/es/plus/walletEditor/locales.d.ts +0 -223
- package/es/plus/walletEditor/types.d.ts +0 -54
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +0 -11
- package/es/plus/walletPassGallery/components/passList/index.d.ts +0 -13
- package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +0 -12
- package/es/plus/walletPassGallery/index.d.ts +0 -11
- package/es/plus/walletPassGallery/locales.d.ts +0 -473
- package/es/plus/walletPassGallery/serve.d.ts +0 -245
- package/es/plus/walletPassGallery/utils.d.ts +0 -48
- package/es/pro/Login2.0/locales.d.ts +0 -903
- package/es/pro/Login2.0/shared/types.d.ts +0 -234
- package/es/pro/comprehensiveSearch/components/searchSection/locales.d.ts +0 -23
- package/es/pro/comprehensiveSearch/locales.d.ts +0 -23
- package/es/pro/numberKeyboard/locales.d.ts +0 -18
- package/es/pro/pisellPhoneKeyboard/locales.d.ts +0 -18
- package/es/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +0 -63
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +0 -68
- package/es/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +0 -73
- package/es/pro/skuDetailModal/locales.d.ts +0 -78
- package/es/pro/skuDetailModal/types.d.ts +0 -352
- package/lib/components/appointmentBooking/components/Date/state.d.ts +0 -63
- package/lib/components/appointmentBooking/locales.d.ts +0 -603
- package/lib/components/authentication/admin/AuthMethods/locales.d.ts +0 -413
- package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/index.d.ts +0 -6
- package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/locales.d.ts +0 -138
- package/lib/components/authentication/admin/ChannelAuthSetting/AuthenticationMethods/types.d.ts +0 -43
- package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/index.d.ts +0 -6
- package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/locales.d.ts +0 -118
- package/lib/components/authentication/admin/ChannelAuthSetting/CollectInfo/types.d.ts +0 -35
- package/lib/components/authentication/admin/ChannelAuthSetting/OnlineShopAuth/index.d.ts +0 -6
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSetting/locales.d.ts +0 -43
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/index.d.ts +0 -8
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/locales.d.ts +0 -108
- package/lib/components/authentication/admin/ChannelAuthSetting/PageSettingItem/types.d.ts +0 -28
- package/lib/components/authentication/admin/ChannelAuthSetting/SaaSManagermentAuth/index.d.ts +0 -6
- package/lib/components/authentication/admin/ChannelAuthSetting/locales.d.ts +0 -63
- package/lib/components/authentication/admin/CustomerAuth/locales.d.ts +0 -108
- package/lib/components/authentication/admin/CustomerOAuthConfig/locales.d.ts +0 -178
- package/lib/components/authentication/admin/DeviceAuth/locales.d.ts +0 -93
- package/lib/components/authentication/admin/OAuthConfig/locales.d.ts +0 -148
- package/lib/components/authentication/admin/OrgAdminAuth/locales.d.ts +0 -88
- package/lib/components/authentication/admin/POSOperatorAuth/locales.d.ts +0 -78
- package/lib/components/authentication/admin/SaaSAdminAuth/locales.d.ts +0 -88
- package/lib/components/booking/components/actionButtons/index.d.ts +0 -31
- package/lib/components/booking/components/voucher/utils.d.ts +0 -5
- package/lib/components/booking/editBookingModal/locales.d.ts +0 -33
- package/lib/components/booking/editBookingModal/mock.d.ts +0 -991
- package/lib/components/booking/info2/cartClientCard/locales.d.ts +0 -33
- package/lib/components/booking/info2/service/addService/mock.d.ts +0 -216
- package/lib/components/booking/info2/service/editService/DiscountChangeModal/index.d.ts +0 -25
- package/lib/components/booking/locales.d.ts +0 -1619
- package/lib/components/checkout/PaymentModal.d.ts +0 -31
- package/lib/components/checkout/components/AdditionalModule/locales.d.ts +0 -58
- package/lib/components/checkout/locales.d.ts +0 -853
- package/lib/components/eftpos/locales.d.ts +0 -163
- package/lib/components/eftposPay/locales.d.ts +0 -608
- package/lib/components/eventBooking/locales.d.ts +0 -408
- package/lib/components/list/locales.d.ts +0 -108
- package/lib/components/list/utils/getText.d.ts +0 -53
- package/lib/components/login/locales.d.ts +0 -38
- package/lib/components/pay/toB/locales.d.ts +0 -88
- package/lib/components/pay/toC/locales.d.ts +0 -511
- package/lib/components/pinModal/locales.d.ts +0 -43
- package/lib/components/pinVerifyModal/locales.d.ts +0 -38
- package/lib/components/pisellSelectCustomerModal/locales.d.ts +0 -133
- package/lib/components/productExtension/locales.d.ts +0 -78
- package/lib/components/productSelect/components/pisellPriceText/index.d.ts +0 -11
- package/lib/components/productSelect/locales.d.ts +0 -38
- package/lib/components/ruleSetting/locales.d.ts +0 -78
- package/lib/components/schedules/locales.d.ts +0 -143
- package/lib/components/shoppingCart/locales.d.ts +0 -58
- package/lib/components/stepController/locales.d.ts +0 -43
- package/lib/components/subTotal/locales.d.ts +0 -68
- package/lib/components/systemSettings/registry/components/ItemModal.d.ts +0 -4
- package/lib/components/systemSettings/registry/locales.d.ts +0 -456
- package/lib/components/systemSettings/registry/types.d.ts +0 -128
- package/lib/components/taxSelect/locales.d.ts +0 -38
- package/lib/components/ticketBooking/locales.d.ts +0 -328
- package/lib/components/ticketBooking/utils/formatTime.d.ts +0 -33
- package/lib/components/wallet/utils.d.ts +0 -48
- package/lib/components/walletList/index.d.ts +0 -4
- package/lib/components/walletList/locales.d.ts +0 -43
- package/lib/components/walletList/types/index.d.ts +0 -196
- package/lib/plus/clientCard/index.d.ts +0 -7
- package/lib/plus/clientCard/locales.d.ts +0 -28
- package/lib/plus/clientCard/types.d.ts +0 -135
- package/lib/plus/clinetSearch/locales.d.ts +0 -178
- package/lib/plus/contactInfo/locales.d.ts +0 -23
- package/lib/plus/contactInfoModal/locales.d.ts +0 -108
- package/lib/plus/noteModal/locales.d.ts +0 -53
- package/lib/plus/productSelect/ProductCard/SkuCard/locales.d.ts +0 -68
- package/lib/plus/productSelect/ProductCard/SkuCard/status.d.ts +0 -164
- package/lib/plus/productSelect/components/pisellPriceText/index.d.ts +0 -14
- package/lib/plus/productSelect/locales.d.ts +0 -38
- package/lib/plus/saasAttendance/index.d.ts +0 -6
- package/lib/plus/saasAttendance/locales.d.ts +0 -528
- package/lib/plus/saasAttendance/settings/BasicInfoTab.d.ts +0 -5
- package/lib/plus/saasAttendance/settings/ClockInMethodTab.d.ts +0 -8
- package/lib/plus/saasAttendance/settings/CorrectionPolicyTab.d.ts +0 -8
- package/lib/plus/saasAttendance/settings/ShiftScheduleTab.d.ts +0 -5
- package/lib/plus/saasAttendance/settings/components/MapField.d.ts +0 -78
- package/lib/plus/saasAttendance/settings/components/index.d.ts +0 -3
- package/lib/plus/saasAttendance/settings/components/membersField/index.d.ts +0 -8
- package/lib/plus/saasAttendance/settings/components/shiftModal/index.d.ts +0 -18
- package/lib/plus/saasAttendance/settings/index.d.ts +0 -18
- package/lib/plus/saasAttendance/settings/serve.d.ts +0 -27
- package/lib/plus/saasAttendance/settings/types.d.ts +0 -130
- package/lib/plus/saasCreateOrganization/locales.d.ts +0 -23
- package/lib/plus/saasLogin/locales.d.ts +0 -83
- package/lib/plus/saasRegister/locales.d.ts +0 -193
- package/lib/plus/saasRole/components/PermissionManager/index.d.ts +0 -19
- package/lib/plus/saasRole/index.d.ts +0 -14
- package/lib/plus/saasRole/locales.d.ts +0 -319
- package/lib/plus/saasRole/serve.d.ts +0 -72
- package/lib/plus/saasRole/types.d.ts +0 -177
- package/lib/plus/saasRole/utils.d.ts +0 -0
- package/lib/plus/saasTeamMembers/components/MemberDrawer/ExtensionFormTabContent.d.ts +0 -31
- package/lib/plus/saasTeamMembers/components/MemberDrawer/index.d.ts +0 -23
- package/lib/plus/saasTeamMembers/index.d.ts +0 -5
- package/lib/plus/saasTeamMembers/locales.d.ts +0 -546
- package/lib/plus/saasTeamMembers/serve.d.ts +0 -95
- package/lib/plus/saasTeamMembers/type.d.ts +0 -158
- package/lib/plus/selectHolder/locales.d.ts +0 -38
- package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +0 -39
- package/lib/plus/walletEditor/locales.d.ts +0 -223
- package/lib/plus/walletEditor/types.d.ts +0 -54
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +0 -11
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +0 -13
- package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +0 -12
- package/lib/plus/walletPassGallery/index.d.ts +0 -11
- package/lib/plus/walletPassGallery/locales.d.ts +0 -473
- package/lib/plus/walletPassGallery/serve.d.ts +0 -245
- package/lib/plus/walletPassGallery/utils.d.ts +0 -48
- package/lib/pro/Login2.0/locales.d.ts +0 -903
- package/lib/pro/Login2.0/shared/types.d.ts +0 -234
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.d.ts +0 -23
- package/lib/pro/comprehensiveSearch/locales.d.ts +0 -23
- package/lib/pro/numberKeyboard/locales.d.ts +0 -18
- package/lib/pro/pisellPhoneKeyboard/locales.d.ts +0 -18
- package/lib/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +0 -63
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +0 -68
- package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +0 -73
- package/lib/pro/skuDetailModal/locales.d.ts +0 -78
- package/lib/pro/skuDetailModal/types.d.ts +0 -352
|
@@ -19,12 +19,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
19
19
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
21
|
import { useState, useEffect, useMemo, useRef } from 'react';
|
|
22
|
-
import { useMemoizedFn } from 'ahooks';
|
|
22
|
+
import { useMemoizedFn, useUpdateEffect } from 'ahooks';
|
|
23
23
|
import { uniqueByKey, locales } from '@pisell/utils';
|
|
24
24
|
import { useToast } from '@pisell/materials';
|
|
25
25
|
import dayjs from 'dayjs';
|
|
26
26
|
import { usePisellOS } from "../../../hooks/useEngineContext";
|
|
27
|
-
import { formatDiscountWalletData, formatMachineCodeServer2CardList, isSameContent } from "../components/WalletPassModule/utils";
|
|
27
|
+
import { formatDiscountWalletData, formatMachineCodeServer2CardList, getVoucherAvailableStatus, isSameContent } from "../components/WalletPassModule/utils";
|
|
28
28
|
import usePaymentLogger from "./usePaymentLogger";
|
|
29
29
|
import { isWalkIn } from "../../booking/utils";
|
|
30
30
|
import { useActiveExecute } from "../../ticketBooking/hooks/pisellos";
|
|
@@ -36,21 +36,33 @@ import { useShopDiscountModule } from "../../ticketBooking/hooks/pisellos/useSho
|
|
|
36
36
|
export var useWalletPass = function useWalletPass(props) {
|
|
37
37
|
var onSelectChange = props.onSelectChange,
|
|
38
38
|
customAmount = props.customAmount,
|
|
39
|
-
clientId = props.clientId
|
|
39
|
+
clientId = props.clientId,
|
|
40
|
+
totalAmount = props.totalAmount;
|
|
40
41
|
var logger = usePaymentLogger();
|
|
41
42
|
var _useActiveExecute = useActiveExecute(),
|
|
42
43
|
executeIfActive = _useActiveExecute.executeIfActive;
|
|
43
44
|
|
|
44
|
-
//
|
|
45
|
+
// 钱包推荐列表(推荐选中的券)
|
|
45
46
|
var _useState = useState([]),
|
|
46
47
|
_useState2 = _slicedToArray(_useState, 2),
|
|
47
48
|
walletRecommendList = _useState2[0],
|
|
48
49
|
setWalletRecommendList = _useState2[1];
|
|
49
|
-
//
|
|
50
|
+
// 用户识别码列表(全部券列表,包括可用和不可用)
|
|
50
51
|
var _useState3 = useState([]),
|
|
51
52
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
53
|
userIdentificationCodes = _useState4[0],
|
|
53
54
|
setUserIdentificationCodes = _useState4[1];
|
|
55
|
+
// 可计算的券列表(transformList)
|
|
56
|
+
var _useState5 = useState([]),
|
|
57
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
58
|
+
transformList = _useState6[0],
|
|
59
|
+
setTransformList = _useState6[1];
|
|
60
|
+
// 不适用的券列表(noApplicableVoucher)
|
|
61
|
+
var _useState7 = useState([]),
|
|
62
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
63
|
+
noApplicableVoucher = _useState8[0],
|
|
64
|
+
setNoApplicableVoucher = _useState8[1];
|
|
65
|
+
|
|
54
66
|
// 保存初始顺序的数组
|
|
55
67
|
var initialOrderedDataRef = useRef([]);
|
|
56
68
|
|
|
@@ -60,31 +72,34 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
60
72
|
// 跟踪执行过 handleConfirmEditAmount 的 data.id
|
|
61
73
|
var confirmedEditAmountIdsRef = useRef([]);
|
|
62
74
|
|
|
63
|
-
//
|
|
64
|
-
var timeoutRef = useRef(null);
|
|
65
|
-
|
|
66
|
-
// 搜索用户识别码列表
|
|
67
|
-
var _useState5 = useState([]),
|
|
68
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
69
|
-
searchIdentificationCodeList = _useState6[0],
|
|
70
|
-
setSearchIdentificationCodeList = _useState6[1];
|
|
71
|
-
var _useState7 = useState({}),
|
|
72
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
73
|
-
orderInfo = _useState8[0],
|
|
74
|
-
setOrderInfo = _useState8[1];
|
|
75
|
-
|
|
76
|
-
// 当前选中的钱包
|
|
75
|
+
// 搜索用户识别码列表(addList)
|
|
77
76
|
var _useState9 = useState([]),
|
|
78
77
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
searchIdentificationCodeList = _useState10[0],
|
|
79
|
+
setSearchIdentificationCodeList = _useState10[1];
|
|
80
|
+
var _useState11 = useState({}),
|
|
81
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
82
|
+
orderInfo = _useState12[0],
|
|
83
|
+
setOrderInfo = _useState12[1];
|
|
84
|
+
|
|
85
|
+
// 当前选中的钱包(完整对象)
|
|
86
|
+
var _useState13 = useState([]),
|
|
87
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
88
|
+
selectedWallet = _useState14[0],
|
|
89
|
+
setSelectedWallet = _useState14[1];
|
|
81
90
|
var selectedWalletRef = useRef([]);
|
|
82
91
|
|
|
92
|
+
// 当前选中的券ID列表(按选中顺序)
|
|
93
|
+
var _useState15 = useState([]),
|
|
94
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
95
|
+
selectedVoucherIds = _useState16[0],
|
|
96
|
+
setSelectedVoucherIds = _useState16[1];
|
|
97
|
+
|
|
83
98
|
// 不可用的钱包数据
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
disabledWalletData =
|
|
87
|
-
setDisabledWalletData =
|
|
99
|
+
var _useState17 = useState([]),
|
|
100
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
101
|
+
disabledWalletData = _useState18[0],
|
|
102
|
+
setDisabledWalletData = _useState18[1];
|
|
88
103
|
|
|
89
104
|
// 设置钱包但不设置使用默认钱包
|
|
90
105
|
var notSetWalletSelectRef = useRef(false);
|
|
@@ -92,7 +107,13 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
92
107
|
// 是否显示最佳优惠
|
|
93
108
|
var showBestToastRef = useRef(false);
|
|
94
109
|
|
|
95
|
-
//
|
|
110
|
+
// 商品列表
|
|
111
|
+
var _useState19 = useState([]),
|
|
112
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
113
|
+
products = _useState20[0],
|
|
114
|
+
setProducts = _useState20[1];
|
|
115
|
+
|
|
116
|
+
// 当前选中的钱包id(保留兼容性)
|
|
96
117
|
var selectedWalletIds = useMemo(function () {
|
|
97
118
|
return selectedWallet.map(function (item) {
|
|
98
119
|
return item.id;
|
|
@@ -102,24 +123,30 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
102
123
|
var Toast = useToast();
|
|
103
124
|
|
|
104
125
|
// 加载状态
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
loading =
|
|
108
|
-
setLoading =
|
|
126
|
+
var _useState21 = useState(false),
|
|
127
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
128
|
+
loading = _useState22[0],
|
|
129
|
+
setLoading = _useState22[1];
|
|
109
130
|
// 错误信息
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
error =
|
|
113
|
-
setError =
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
discountList =
|
|
117
|
-
setDiscountList =
|
|
131
|
+
var _useState23 = useState(null),
|
|
132
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
133
|
+
error = _useState24[0],
|
|
134
|
+
setError = _useState24[1];
|
|
135
|
+
var _useState25 = useState([]),
|
|
136
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
137
|
+
discountList = _useState26[0],
|
|
138
|
+
setDiscountList = _useState26[1];
|
|
118
139
|
|
|
119
140
|
// 获取checkout模块
|
|
120
141
|
var checkoutModule = pisellos.getModule('checkout');
|
|
121
142
|
var shopDiscount = useShopDiscountModule();
|
|
122
143
|
var paymentModule = checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.payment;
|
|
144
|
+
|
|
145
|
+
// 获取钱包计算器
|
|
146
|
+
var walletPassEvaluator = useMemo(function () {
|
|
147
|
+
var _paymentModule$window, _paymentModule$window2;
|
|
148
|
+
return paymentModule === null || paymentModule === void 0 || (_paymentModule$window = paymentModule.window) === null || _paymentModule$window === void 0 || (_paymentModule$window2 = _paymentModule$window.getWalletPassEvaluator) === null || _paymentModule$window2 === void 0 ? void 0 : _paymentModule$window2.call(_paymentModule$window);
|
|
149
|
+
}, []);
|
|
123
150
|
var setWalletSelect = useMemoizedFn(function (data) {
|
|
124
151
|
setSelectedWallet(data);
|
|
125
152
|
selectedWalletRef.current = data;
|
|
@@ -276,15 +303,77 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
276
303
|
orderedResult.push.apply(orderedResult, _toConsumableArray(newItems));
|
|
277
304
|
return orderedResult;
|
|
278
305
|
});
|
|
306
|
+
|
|
307
|
+
// 合并计算数据源:transformList + searchIdentificationCodeList(addList)
|
|
308
|
+
var allVouchersForCalculation = useMemo(function () {
|
|
309
|
+
return [].concat(_toConsumableArray(transformList || []), _toConsumableArray(searchIdentificationCodeList || []));
|
|
310
|
+
}, [transformList, searchIdentificationCodeList]);
|
|
311
|
+
|
|
312
|
+
// 根据选中的券ID获取选中的券对象列表(保持选中顺序)
|
|
313
|
+
var selectedVouchers = useMemo(function () {
|
|
314
|
+
return selectedVoucherIds.map(function (id) {
|
|
315
|
+
return allVouchersForCalculation.find(function (v) {
|
|
316
|
+
return v.id === id;
|
|
317
|
+
});
|
|
318
|
+
}).filter(Boolean);
|
|
319
|
+
}, [selectedVoucherIds, allVouchersForCalculation]);
|
|
320
|
+
|
|
321
|
+
// 前端计算展示列表和当前券的详细信息
|
|
322
|
+
var _useMemo = useMemo(function () {
|
|
323
|
+
if (!walletPassEvaluator || !allVouchersForCalculation.length || !totalAmount) {
|
|
324
|
+
return {
|
|
325
|
+
displayVouchers: [].concat(_toConsumableArray(transformList || []), _toConsumableArray(noApplicableVoucher || [])),
|
|
326
|
+
displayOtherVouchers: searchIdentificationCodeList || [],
|
|
327
|
+
selectedWithDetails: [],
|
|
328
|
+
totalDeduction: 0
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// 有选中的券,重新计算(基于 transformList + searchIdentificationCodeList)
|
|
333
|
+
var result = walletPassEvaluator.recalculateVouchers(allVouchersForCalculation, selectedVouchers, totalAmount, products || []);
|
|
334
|
+
|
|
335
|
+
// 分离当前客户的券和其他客户的券(搜索添加的券)
|
|
336
|
+
var currentCustomerVouchers = [];
|
|
337
|
+
var otherCustomerVouchers = [];
|
|
338
|
+
result.allWithUpdatedStatus.forEach(function (voucher) {
|
|
339
|
+
// 判断是否是搜索添加的券
|
|
340
|
+
var isSearchVoucher = searchIdentificationCodeList.some(function (item) {
|
|
341
|
+
return item.id === voucher.id;
|
|
342
|
+
});
|
|
343
|
+
if (isSearchVoucher) {
|
|
344
|
+
otherCustomerVouchers.push(voucher);
|
|
345
|
+
} else {
|
|
346
|
+
currentCustomerVouchers.push(voucher);
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
return {
|
|
350
|
+
displayVouchers: [].concat(currentCustomerVouchers, _toConsumableArray(noApplicableVoucher || [])),
|
|
351
|
+
displayOtherVouchers: otherCustomerVouchers,
|
|
352
|
+
selectedWithDetails: result.selectedWithDetails,
|
|
353
|
+
totalDeduction: result.selectedWithDetails.reduce(function (sum, v) {
|
|
354
|
+
return sum + (v.actualDeduction || 0);
|
|
355
|
+
}, 0)
|
|
356
|
+
};
|
|
357
|
+
}, [selectedVouchers, allVouchersForCalculation, transformList, searchIdentificationCodeList, noApplicableVoucher, totalAmount, products]),
|
|
358
|
+
displayVouchers = _useMemo.displayVouchers,
|
|
359
|
+
displayOtherVouchers = _useMemo.displayOtherVouchers,
|
|
360
|
+
selectedWithDetails = _useMemo.selectedWithDetails,
|
|
361
|
+
totalDeduction = _useMemo.totalDeduction;
|
|
362
|
+
|
|
363
|
+
// 监听 selectedWithDetails 变化,自动通知外部
|
|
364
|
+
useUpdateEffect(function () {
|
|
365
|
+
notifySelectChange(selectedWithDetails);
|
|
366
|
+
setLoading(false);
|
|
367
|
+
}, [selectedWithDetails]);
|
|
279
368
|
var data = useMemo(function () {
|
|
280
|
-
//
|
|
281
|
-
return formatMachineCodeServer2CardList(uniqueByKey(mergeDataWithInitialOrder([].concat(_toConsumableArray(selectedWallet), _toConsumableArray(
|
|
282
|
-
}, [
|
|
369
|
+
// 使用前端计算后的数据
|
|
370
|
+
return formatMachineCodeServer2CardList(uniqueByKey(mergeDataWithInitialOrder([].concat(_toConsumableArray(selectedWallet), _toConsumableArray(displayVouchers), _toConsumableArray(displayOtherVouchers))), 'id'), selectedVoucherIds);
|
|
371
|
+
}, [displayVouchers, displayOtherVouchers, selectedVoucherIds, selectedWallet]);
|
|
283
372
|
|
|
284
|
-
//
|
|
285
|
-
var
|
|
373
|
+
// 获取用户识别码列表
|
|
374
|
+
var fetchUserIdentificationCodes = useMemoizedFn( /*#__PURE__*/function () {
|
|
286
375
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
287
|
-
var result;
|
|
376
|
+
var result, newData;
|
|
288
377
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
289
378
|
while (1) switch (_context.prev = _context.next) {
|
|
290
379
|
case 0:
|
|
@@ -292,66 +381,31 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
292
381
|
setError(null);
|
|
293
382
|
_context.prev = 2;
|
|
294
383
|
_context.next = 5;
|
|
295
|
-
return paymentModule.wallet.
|
|
384
|
+
return paymentModule.wallet.getUserIdentificationCodeListAsync(params);
|
|
296
385
|
case 5:
|
|
297
386
|
result = _context.sent;
|
|
298
|
-
|
|
387
|
+
newData = uniqueByKey([].concat(_toConsumableArray(result), _toConsumableArray(selectedWalletRef.current)), 'id'); // const orderedData = mergeDataWithInitialOrder(newData);
|
|
388
|
+
setUserIdentificationCodes(newData);
|
|
299
389
|
return _context.abrupt("return", result);
|
|
300
|
-
case
|
|
301
|
-
_context.prev =
|
|
390
|
+
case 11:
|
|
391
|
+
_context.prev = 11;
|
|
302
392
|
_context.t0 = _context["catch"](2);
|
|
303
|
-
setError(_context.t0 instanceof Error ? _context.t0.message : '
|
|
393
|
+
setError(_context.t0 instanceof Error ? _context.t0.message : '获取用户识别码列表失败');
|
|
304
394
|
throw _context.t0;
|
|
305
|
-
case
|
|
306
|
-
_context.prev =
|
|
395
|
+
case 15:
|
|
396
|
+
_context.prev = 15;
|
|
307
397
|
setLoading(false);
|
|
308
|
-
return _context.finish(
|
|
309
|
-
case
|
|
398
|
+
return _context.finish(15);
|
|
399
|
+
case 18:
|
|
310
400
|
case "end":
|
|
311
401
|
return _context.stop();
|
|
312
402
|
}
|
|
313
|
-
}, _callee, null, [[2,
|
|
403
|
+
}, _callee, null, [[2, 11, 15, 18]]);
|
|
314
404
|
}));
|
|
315
405
|
return function (_x) {
|
|
316
406
|
return _ref.apply(this, arguments);
|
|
317
407
|
};
|
|
318
408
|
}());
|
|
319
|
-
// 获取用户识别码列表
|
|
320
|
-
var fetchUserIdentificationCodes = useMemoizedFn( /*#__PURE__*/function () {
|
|
321
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
322
|
-
var result, newData;
|
|
323
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
324
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
325
|
-
case 0:
|
|
326
|
-
setLoading(true);
|
|
327
|
-
setError(null);
|
|
328
|
-
_context2.prev = 2;
|
|
329
|
-
_context2.next = 5;
|
|
330
|
-
return paymentModule.wallet.getUserIdentificationCodeListAsync(params);
|
|
331
|
-
case 5:
|
|
332
|
-
result = _context2.sent;
|
|
333
|
-
newData = uniqueByKey([].concat(_toConsumableArray(result), _toConsumableArray(selectedWalletRef.current)), 'id'); // const orderedData = mergeDataWithInitialOrder(newData);
|
|
334
|
-
setUserIdentificationCodes(newData);
|
|
335
|
-
return _context2.abrupt("return", result);
|
|
336
|
-
case 11:
|
|
337
|
-
_context2.prev = 11;
|
|
338
|
-
_context2.t0 = _context2["catch"](2);
|
|
339
|
-
setError(_context2.t0 instanceof Error ? _context2.t0.message : '获取用户识别码列表失败');
|
|
340
|
-
throw _context2.t0;
|
|
341
|
-
case 15:
|
|
342
|
-
_context2.prev = 15;
|
|
343
|
-
setLoading(false);
|
|
344
|
-
return _context2.finish(15);
|
|
345
|
-
case 18:
|
|
346
|
-
case "end":
|
|
347
|
-
return _context2.stop();
|
|
348
|
-
}
|
|
349
|
-
}, _callee2, null, [[2, 11, 15, 18]]);
|
|
350
|
-
}));
|
|
351
|
-
return function (_x2) {
|
|
352
|
-
return _ref2.apply(this, arguments);
|
|
353
|
-
};
|
|
354
|
-
}());
|
|
355
409
|
|
|
356
410
|
// 获取缓存数据
|
|
357
411
|
var getCachedWalletRecommendList = useMemoizedFn(function () {
|
|
@@ -383,46 +437,103 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
383
437
|
var handleSearchIdentificationCodeCompleted = useMemoizedFn(function (data) {
|
|
384
438
|
var currentSearchResults = data.currentSearchResults,
|
|
385
439
|
cachedSearchResults = data.cachedSearchResults;
|
|
440
|
+
// 使用 walletPassEvaluator.searchVoucherFormat 格式化搜索结果
|
|
441
|
+
var formattedResults = currentSearchResults;
|
|
442
|
+
if (walletPassEvaluator && currentSearchResults.length > 0 && totalAmount) {
|
|
443
|
+
formattedResults = walletPassEvaluator.searchVoucherFormat({
|
|
444
|
+
vouchers: currentSearchResults,
|
|
445
|
+
orderTotalAmount: totalAmount,
|
|
446
|
+
products: products || []
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// 格式化缓存的搜索结果(如果存在)
|
|
451
|
+
var formattedCachedResults = cachedSearchResults || [];
|
|
452
|
+
if (walletPassEvaluator && cachedSearchResults && cachedSearchResults.length > 0 && totalAmount) {
|
|
453
|
+
formattedCachedResults = walletPassEvaluator.searchVoucherFormat({
|
|
454
|
+
vouchers: cachedSearchResults,
|
|
455
|
+
orderTotalAmount: totalAmount,
|
|
456
|
+
products: products || []
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// 合并缓存的搜索结果和当前搜索结果,并去重
|
|
461
|
+
var mergedSearchResults = uniqueByKey([].concat(_toConsumableArray(formattedCachedResults || []), _toConsumableArray(formattedResults)), 'id');
|
|
386
462
|
var isAvailableData = [];
|
|
387
463
|
var isDisabledData = [];
|
|
388
|
-
if (
|
|
389
|
-
|
|
390
|
-
if (
|
|
464
|
+
if (formattedResults.length > 0) {
|
|
465
|
+
formattedResults.forEach(function (item) {
|
|
466
|
+
if (getVoucherAvailableStatus(item)) {
|
|
391
467
|
isAvailableData.push(item);
|
|
392
468
|
} else {
|
|
393
469
|
isDisabledData.push(item);
|
|
394
470
|
}
|
|
395
471
|
});
|
|
396
472
|
}
|
|
473
|
+
var availableData = mergedSearchResults.filter(function (item) {
|
|
474
|
+
return getVoucherAvailableStatus(item);
|
|
475
|
+
});
|
|
476
|
+
// 更新不可用钱包数据(需要包含所有搜索结果中的不可用数据)
|
|
477
|
+
var allDisabledData = mergedSearchResults.filter(function (item) {
|
|
478
|
+
return !getVoucherAvailableStatus(item);
|
|
479
|
+
});
|
|
480
|
+
setDisabledWalletData(allDisabledData);
|
|
397
481
|
|
|
398
|
-
//
|
|
399
|
-
setDisabledWalletData(isDisabledData);
|
|
482
|
+
// 如果只有一个可用券,自动选中
|
|
400
483
|
var newValues = _toConsumableArray(selectedWalletRef.current);
|
|
401
484
|
if (isAvailableData.length === 1) {
|
|
402
485
|
newValues = [].concat(_toConsumableArray(selectedWalletRef.current), isAvailableData);
|
|
403
486
|
}
|
|
404
|
-
|
|
487
|
+
|
|
488
|
+
// 更新搜索结果列表(合并缓存和当前搜索结果,使用去重后的数据)
|
|
489
|
+
setSearchIdentificationCodeList(availableData);
|
|
490
|
+
setNoApplicableVoucher(allDisabledData);
|
|
405
491
|
setWalletSelect(newValues);
|
|
406
|
-
|
|
492
|
+
|
|
493
|
+
// 更新选中的券ID列表(会触发 useMemo 重新计算 selectedWithDetails)
|
|
494
|
+
setSelectedVoucherIds(newValues.map(function (item) {
|
|
407
495
|
return item.id;
|
|
408
496
|
}));
|
|
497
|
+
|
|
498
|
+
// useUpdateEffect 会自动在 selectedWithDetails 更新后通知外部
|
|
409
499
|
});
|
|
410
500
|
var onOrderCreated = useMemoizedFn(function () {
|
|
501
|
+
var _paymentModule$wallet, _paymentModule$wallet2;
|
|
411
502
|
var orderInfo = checkoutModule.getOrderOriginalData();
|
|
412
503
|
setOrderInfo(orderInfo);
|
|
504
|
+
|
|
505
|
+
// 从缓存获取初始化数据(包含新的数据结构)
|
|
413
506
|
var recommendList = getCachedWalletRecommendList();
|
|
414
507
|
var userIdentificationCodes = getCachedUserIdentificationCodes();
|
|
508
|
+
|
|
509
|
+
// 获取 transformList 和 noApplicableVoucher(从 paymentModule 的缓存中)
|
|
510
|
+
// 这些数据在 initializeWalletDataAsync 中已经计算并缓存
|
|
511
|
+
var walletInitData = (paymentModule === null || paymentModule === void 0 || (_paymentModule$wallet = paymentModule.wallet) === null || _paymentModule$wallet === void 0 || (_paymentModule$wallet2 = _paymentModule$wallet.getStoredWalletInitData) === null || _paymentModule$wallet2 === void 0 ? void 0 : _paymentModule$wallet2.call(_paymentModule$wallet)) || {};
|
|
512
|
+
var transformListData = walletInitData.transformList || userIdentificationCodes;
|
|
513
|
+
var noApplicableVoucherData = walletInitData.noApplicableVoucher || [];
|
|
514
|
+
var productsData = walletInitData.products || [];
|
|
415
515
|
var initialData = [].concat(_toConsumableArray(recommendList), _toConsumableArray(userIdentificationCodes));
|
|
416
516
|
|
|
417
517
|
// 设置钱包推荐列表
|
|
418
518
|
setWalletRecommendList(recommendList);
|
|
419
|
-
//
|
|
420
|
-
setUserIdentificationCodes(
|
|
519
|
+
// 设置用户识别码列表(全部券)
|
|
520
|
+
setUserIdentificationCodes(userIdentificationCodes);
|
|
521
|
+
// 设置可计算的券列表
|
|
522
|
+
setTransformList(transformListData);
|
|
523
|
+
// 设置不适用的券列表
|
|
524
|
+
setNoApplicableVoucher(noApplicableVoucherData);
|
|
525
|
+
// 设置产品列表
|
|
526
|
+
setProducts(productsData);
|
|
421
527
|
// 设置初始顺序
|
|
422
528
|
initialOrderedDataRef.current = initialData;
|
|
529
|
+
|
|
423
530
|
// 设置默认选中钱包
|
|
424
531
|
if (!notSetWalletSelectRef.current) {
|
|
425
532
|
setWalletSelect(recommendList);
|
|
533
|
+
// 设置默认选中的券ID
|
|
534
|
+
setSelectedVoucherIds(recommendList.map(function (item) {
|
|
535
|
+
return item.id;
|
|
536
|
+
}));
|
|
426
537
|
var _select = paymentModule.wallet.formatWalletPassList2PreparePayments(recommendList).map(function (item) {
|
|
427
538
|
return {
|
|
428
539
|
code: item.tag,
|
|
@@ -441,6 +552,7 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
441
552
|
onSelectChange === null || onSelectChange === void 0 || onSelectChange(_select);
|
|
442
553
|
} else {
|
|
443
554
|
setWalletSelect([]);
|
|
555
|
+
setSelectedVoucherIds([]);
|
|
444
556
|
notSetWalletSelectRef.current = false;
|
|
445
557
|
onSelectChange === null || onSelectChange === void 0 || onSelectChange([]);
|
|
446
558
|
}
|
|
@@ -487,27 +599,27 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
487
599
|
setLoading(false);
|
|
488
600
|
});
|
|
489
601
|
var handlePaymentStarted = useMemoizedFn( /*#__PURE__*/function () {
|
|
490
|
-
var
|
|
491
|
-
return _regeneratorRuntime().wrap(function
|
|
492
|
-
while (1) switch (
|
|
602
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
603
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
604
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
493
605
|
case 0:
|
|
494
|
-
if (!(params.paymentMethodCode !== 'VOUCHER_BATCH')) {
|
|
495
|
-
|
|
606
|
+
if (!(params.paymentMethodCode !== 'VOUCHER_BATCH' && Number(customAmount || 0) > 0)) {
|
|
607
|
+
_context2.next = 4;
|
|
496
608
|
break;
|
|
497
609
|
}
|
|
498
610
|
notSetWalletSelectRef.current = true;
|
|
499
|
-
|
|
611
|
+
_context2.next = 4;
|
|
500
612
|
return checkoutModule.initWalletData({
|
|
501
613
|
order_wait_pay_amount: Number(customAmount)
|
|
502
614
|
});
|
|
503
615
|
case 4:
|
|
504
616
|
case "end":
|
|
505
|
-
return
|
|
617
|
+
return _context2.stop();
|
|
506
618
|
}
|
|
507
|
-
},
|
|
619
|
+
}, _callee2);
|
|
508
620
|
}));
|
|
509
|
-
return function (
|
|
510
|
-
return
|
|
621
|
+
return function (_x2) {
|
|
622
|
+
return _ref2.apply(this, arguments);
|
|
511
623
|
};
|
|
512
624
|
}());
|
|
513
625
|
|
|
@@ -559,16 +671,6 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
559
671
|
};
|
|
560
672
|
}, [paymentModule]);
|
|
561
673
|
|
|
562
|
-
// 组件卸载时清理定时器
|
|
563
|
-
useEffect(function () {
|
|
564
|
-
return function () {
|
|
565
|
-
if (timeoutRef.current) {
|
|
566
|
-
clearTimeout(timeoutRef.current);
|
|
567
|
-
timeoutRef.current = null;
|
|
568
|
-
}
|
|
569
|
-
};
|
|
570
|
-
}, []);
|
|
571
|
-
|
|
572
674
|
// 所有列表 包含推荐列表、用户识别码列表、搜索用户识别码列表
|
|
573
675
|
var allList = useMemo(function () {
|
|
574
676
|
var reversedSearchData = _toConsumableArray(searchIdentificationCodeList).reverse();
|
|
@@ -584,12 +686,9 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
584
686
|
});
|
|
585
687
|
});
|
|
586
688
|
|
|
587
|
-
//
|
|
588
|
-
var
|
|
589
|
-
var
|
|
590
|
-
return value.includes(item.id);
|
|
591
|
-
});
|
|
592
|
-
var prepare_payments = paymentModule.wallet.formatWalletPassList2PreparePayments(val);
|
|
689
|
+
// 纯粹的通知函数,将选中的券详情通知给外部
|
|
690
|
+
var notifySelectChange = useMemoizedFn(function (selectedDetails) {
|
|
691
|
+
var prepare_payments = paymentModule.wallet.formatWalletPassList2PreparePayments(selectedDetails);
|
|
593
692
|
var select = prepare_payments.map(function (item) {
|
|
594
693
|
return {
|
|
595
694
|
voucher_id: item.voucher_id,
|
|
@@ -601,16 +700,13 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
601
700
|
});
|
|
602
701
|
logger === null || logger === void 0 || logger.addLog({
|
|
603
702
|
type: 'info',
|
|
604
|
-
title: '
|
|
605
|
-
metadata: {
|
|
703
|
+
title: 'useWalletPass_notifySelectChange 通知外部选择变化',
|
|
704
|
+
metadata: {
|
|
705
|
+
selectedDetails: selectedDetails,
|
|
706
|
+
select: select
|
|
707
|
+
}
|
|
606
708
|
});
|
|
607
709
|
onSelectChange === null || onSelectChange === void 0 || onSelectChange(select);
|
|
608
|
-
fetchUserIdentificationCodes({
|
|
609
|
-
prepare_payments: prepare_payments,
|
|
610
|
-
available: 2,
|
|
611
|
-
filter_prepare_wallet_pass: 1,
|
|
612
|
-
other_exact_codes: getOtherExactCodes()
|
|
613
|
-
});
|
|
614
710
|
});
|
|
615
711
|
var handleSearchIdentificationCode = useMemoizedFn(function (value) {
|
|
616
712
|
return paymentModule.wallet.searchIdentificationCodeAsync({
|
|
@@ -619,13 +715,46 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
619
715
|
});
|
|
620
716
|
});
|
|
621
717
|
|
|
622
|
-
//
|
|
718
|
+
// 处理选中钱包(只更新选中ID,触发前端重新计算)
|
|
623
719
|
var handleSelectWallet = useMemoizedFn(function (value) {
|
|
624
|
-
|
|
720
|
+
setLoading(true);
|
|
721
|
+
|
|
722
|
+
// 1. 找出被取消选中的券ID
|
|
723
|
+
var deselectedIds = selectedVoucherIds.filter(function (id) {
|
|
724
|
+
return !value.includes(id);
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
// 2. 如果有被取消选中的券,检查是否需要重置 edit_current_amount
|
|
728
|
+
if (deselectedIds.length > 0) {
|
|
729
|
+
// 找出这些券中有 edit_current_amount 的
|
|
730
|
+
var needResetIds = deselectedIds.filter(function (id) {
|
|
731
|
+
var voucher = allVouchersForCalculation.find(function (v) {
|
|
732
|
+
return v.id === id;
|
|
733
|
+
});
|
|
734
|
+
return (voucher === null || voucher === void 0 ? void 0 : voucher.edit_current_amount) !== undefined;
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
// 重置这些券的 edit_current_amount
|
|
738
|
+
if (needResetIds.length > 0) {
|
|
739
|
+
updateWalletDataById(needResetIds, {
|
|
740
|
+
edit_current_amount: undefined
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
// 从 confirmedEditAmountIdsRef 中移除这些ID
|
|
744
|
+
confirmedEditAmountIdsRef.current = confirmedEditAmountIdsRef.current.filter(function (id) {
|
|
745
|
+
return !needResetIds.includes(id);
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
// 3. 更新选中的券ID列表(会触发 useMemo 重新计算 selectedWithDetails)
|
|
751
|
+
setSelectedVoucherIds(value);
|
|
752
|
+
|
|
753
|
+
// 4. 同时更新 selectedWallet 用于兼容现有逻辑
|
|
754
|
+
var val = allVouchersForCalculation.filter(function (item) {
|
|
625
755
|
return value.includes(item.id);
|
|
626
756
|
});
|
|
627
757
|
setWalletSelect(val);
|
|
628
|
-
handleFetchUserIdentificationCodes(value);
|
|
629
758
|
});
|
|
630
759
|
|
|
631
760
|
// 获取过期钱包id
|
|
@@ -648,12 +777,15 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
648
777
|
|
|
649
778
|
// 清除所有选中的钱包
|
|
650
779
|
var clearAllSelectedWallet = useMemoizedFn(function () {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
780
|
+
// 1. 重置所有已编辑过金额的券
|
|
781
|
+
if (confirmedEditAmountIdsRef.current.length > 0) {
|
|
782
|
+
updateWalletDataById(confirmedEditAmountIdsRef.current, {
|
|
783
|
+
edit_current_amount: undefined
|
|
784
|
+
});
|
|
785
|
+
// 清空已编辑的券ID列表
|
|
786
|
+
confirmedEditAmountIdsRef.current = [];
|
|
787
|
+
}
|
|
788
|
+
|
|
657
789
|
// 如果没有选中钱包,则不处理
|
|
658
790
|
if (selectedWalletIds.length === 0 && selectedDiscountList.length === 0) {
|
|
659
791
|
return;
|
|
@@ -676,8 +808,19 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
676
808
|
pisellos === null || pisellos === void 0 || (_pisellos$effects = pisellos.effects) === null || _pisellos$effects === void 0 || _pisellos$effects.emit('shopDiscount:onSelectedDiscountListChange', detail);
|
|
677
809
|
return;
|
|
678
810
|
}
|
|
811
|
+
|
|
812
|
+
// 清空选中的钱包
|
|
679
813
|
setWalletSelect([]);
|
|
680
|
-
|
|
814
|
+
setSelectedVoucherIds([]);
|
|
815
|
+
|
|
816
|
+
// 清空时立即通知外部(不等待 useUpdateEffect)
|
|
817
|
+
logger === null || logger === void 0 || logger.addLog({
|
|
818
|
+
type: 'info',
|
|
819
|
+
title: 'useWalletPass_clearAllSelectedWallet 立即通知外部清空',
|
|
820
|
+
metadata: {}
|
|
821
|
+
});
|
|
822
|
+
onSelectChange === null || onSelectChange === void 0 || onSelectChange([]);
|
|
823
|
+
setLoading(false);
|
|
681
824
|
});
|
|
682
825
|
|
|
683
826
|
// 判断当前选择是否已是最优选择
|
|
@@ -732,12 +875,14 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
732
875
|
Toast === null || Toast === void 0 || Toast.info(locales.getText('wallet-pass-module-already-best-combination'));
|
|
733
876
|
} else {
|
|
734
877
|
var _select2 = searchIdentificationCodeList.filter(function (item) {
|
|
735
|
-
return item
|
|
878
|
+
return getVoucherAvailableStatus(item);
|
|
736
879
|
});
|
|
737
880
|
setWalletSelect(_select2);
|
|
738
|
-
|
|
881
|
+
// 更新选中的券ID列表(会触发 useMemo 重新计算 selectedWithDetails)
|
|
882
|
+
setSelectedVoucherIds(_select2.map(function (item) {
|
|
739
883
|
return item.id;
|
|
740
|
-
})
|
|
884
|
+
}));
|
|
885
|
+
// useUpdateEffect 会自动在 selectedWithDetails 更新后通知外部
|
|
741
886
|
if (_select2.length) {
|
|
742
887
|
Toast === null || Toast === void 0 || Toast.success(locales.getText('wallet-pass-module-best-combination-selected'));
|
|
743
888
|
}
|
|
@@ -766,11 +911,14 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
766
911
|
if (hasGoodPass && !isBestDiscount) return;
|
|
767
912
|
// 重置为最优选择并显示Toast提示
|
|
768
913
|
setWalletSelect(newWalletRecommendList);
|
|
769
|
-
|
|
914
|
+
// 更新选中的券ID列表(会触发 useMemo 重新计算 selectedWithDetails)
|
|
915
|
+
setSelectedVoucherIds(newWalletRecommendList.map(function (item) {
|
|
770
916
|
return item.id;
|
|
771
|
-
})
|
|
917
|
+
}));
|
|
918
|
+
// useUpdateEffect 会自动在 selectedWithDetails 更新后通知外部
|
|
772
919
|
Toast === null || Toast === void 0 || Toast.success(locales.getText('wallet-pass-module-best-combination-selected'));
|
|
773
920
|
}
|
|
921
|
+
setLoading(false);
|
|
774
922
|
});
|
|
775
923
|
var handleSelectDiscount = useMemoizedFn(function (value, option) {
|
|
776
924
|
var _detail$discountList, _pisellos$effects2;
|
|
@@ -815,6 +963,10 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
815
963
|
var newUserIdentificationCodes = updateArrayItemById(userIdentificationCodes, targetId, updateData);
|
|
816
964
|
setUserIdentificationCodes(newUserIdentificationCodes);
|
|
817
965
|
|
|
966
|
+
// 更新transformList中对应ID的数据(用于前端计算)
|
|
967
|
+
var newTransformList = updateArrayItemById(transformList, targetId, updateData);
|
|
968
|
+
setTransformList(newTransformList);
|
|
969
|
+
|
|
818
970
|
// 更新searchIdentificationCodeList中对应ID的数据
|
|
819
971
|
var newSearchIdentificationCodeList = updateArrayItemById(searchIdentificationCodeList, targetId, updateData);
|
|
820
972
|
setSearchIdentificationCodeList(newSearchIdentificationCodeList);
|
|
@@ -825,6 +977,7 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
825
977
|
return {
|
|
826
978
|
newWalletRecommendList: newWalletRecommendList,
|
|
827
979
|
newUserIdentificationCodes: newUserIdentificationCodes,
|
|
980
|
+
newTransformList: newTransformList,
|
|
828
981
|
newSearchIdentificationCodeList: newSearchIdentificationCodeList,
|
|
829
982
|
newSelectedWallet: newSelectedWallet
|
|
830
983
|
};
|
|
@@ -832,70 +985,42 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
832
985
|
var handleConfirmEditAmount = useMemoizedFn(function (value, id, data) {
|
|
833
986
|
// 如果金额为0,直接触发 handleSelectWallet 把当前id过滤掉
|
|
834
987
|
if (value === 0) {
|
|
835
|
-
var filteredIds =
|
|
988
|
+
var filteredIds = selectedVoucherIds.filter(function (walletId) {
|
|
836
989
|
return walletId !== data.id;
|
|
837
990
|
});
|
|
838
991
|
handleSelectWallet(filteredIds);
|
|
839
992
|
return;
|
|
840
993
|
}
|
|
994
|
+
setLoading(true);
|
|
841
995
|
|
|
842
996
|
// 将执行过的 data.id 添加到跟踪数组中(避免重复)
|
|
843
997
|
if (!confirmedEditAmountIdsRef.current.includes(data.id)) {
|
|
844
998
|
confirmedEditAmountIdsRef.current.push(data.id);
|
|
845
999
|
}
|
|
846
1000
|
|
|
847
|
-
//
|
|
1001
|
+
// 使用通用函数更新所有相关状态(包括 transformList 和 searchIdentificationCodeList)
|
|
1002
|
+
// 这会触发 useMemo 重新计算 selectedWithDetails
|
|
848
1003
|
updateWalletDataById(data.id, {
|
|
849
1004
|
edit_current_amount: value
|
|
850
1005
|
});
|
|
851
1006
|
|
|
852
|
-
//
|
|
853
|
-
|
|
854
|
-
clearTimeout(timeoutRef.current);
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
// 设置新的定时器并保存引用
|
|
858
|
-
timeoutRef.current = setTimeout(function () {
|
|
859
|
-
handleFetchUserIdentificationCodes(selectedWalletIds);
|
|
860
|
-
timeoutRef.current = null; // 执行完成后清空引用
|
|
861
|
-
});
|
|
1007
|
+
// useUpdateEffect 会自动在 selectedWithDetails 更新后通知外部
|
|
1008
|
+
// walletPassEvaluator.recalculateVouchers 会识别 edit_current_amount 字段
|
|
862
1009
|
});
|
|
863
1010
|
var handleBeforeEditAmount = useMemoizedFn( /*#__PURE__*/function () {
|
|
864
|
-
var
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
1011
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(value, index, data) {
|
|
1012
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1013
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
868
1014
|
case 0:
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
code: data.code,
|
|
872
|
-
prepare_payments: paymentModule.wallet.formatWalletPassList2PreparePayments(selectedWalletRef.current.filter(function (item) {
|
|
873
|
-
return item.id !== data.id;
|
|
874
|
-
}))
|
|
875
|
-
}, {
|
|
876
|
-
noCache: true
|
|
877
|
-
});
|
|
878
|
-
case 2:
|
|
879
|
-
result = _context4.sent;
|
|
880
|
-
// 如果result中有数据,使用result中的数据更新状态
|
|
881
|
-
if (result.data && result.data.length > 0) {
|
|
882
|
-
resultItem = result.data.find(function (item) {
|
|
883
|
-
return item.id === data.id;
|
|
884
|
-
});
|
|
885
|
-
if (resultItem) {
|
|
886
|
-
// 使用通用函数更新所有相关状态
|
|
887
|
-
updateWalletDataById(data.id, resultItem);
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
return _context4.abrupt("return", true);
|
|
891
|
-
case 5:
|
|
1015
|
+
return _context3.abrupt("return", true);
|
|
1016
|
+
case 1:
|
|
892
1017
|
case "end":
|
|
893
|
-
return
|
|
1018
|
+
return _context3.stop();
|
|
894
1019
|
}
|
|
895
|
-
},
|
|
1020
|
+
}, _callee3);
|
|
896
1021
|
}));
|
|
897
|
-
return function (_x4, _x5
|
|
898
|
-
return
|
|
1022
|
+
return function (_x3, _x4, _x5) {
|
|
1023
|
+
return _ref3.apply(this, arguments);
|
|
899
1024
|
};
|
|
900
1025
|
}());
|
|
901
1026
|
return {
|
|
@@ -919,7 +1044,6 @@ export var useWalletPass = function useWalletPass(props) {
|
|
|
919
1044
|
selectedDiscountList: selectedDiscountList,
|
|
920
1045
|
handleSelectDiscount: handleSelectDiscount,
|
|
921
1046
|
customerName: customerName,
|
|
922
|
-
fetchWalletRecommendList: fetchWalletRecommendList,
|
|
923
1047
|
fetchUserIdentificationCodes: fetchUserIdentificationCodes,
|
|
924
1048
|
getCachedWalletRecommendList: getCachedWalletRecommendList,
|
|
925
1049
|
getCachedUserIdentificationCodes: getCachedUserIdentificationCodes,
|