@pisell/private-materials 6.3.10 → 6.3.12
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 +1 -1
- package/build/lowcode/preview.js +13 -13
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +27 -3
- package/es/components/appointmentBooking/components/Content/index.js +3 -3
- package/es/components/appointmentBooking/components/Voucher/index.js +6 -5
- package/es/components/appointmentBooking/hooks.js +4 -2
- package/es/components/appointmentBooking/index.js +10 -0
- package/es/components/booking/addons/index.js +12 -8
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
- package/es/components/booking/components/browserSelect/index.js +1 -1
- package/es/components/booking/components/footer/index.js +19 -9
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.js +8 -5
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info2/service/addService/utils.js +16 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/index.js +11 -11
- package/es/components/booking/notes/model.js +5 -5
- package/es/components/booking/payments/model.js +5 -5
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +34 -8
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/eventBooking/components/progressBar/index.js +0 -20
- package/es/components/listComponent/index.js +5 -5
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +7 -20
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.js +2 -12
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +24 -31
- package/es/components/pay/toC/utils.d.ts +1 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/es/components/productExtension/card/index.js +3 -3
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.js +12 -12
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/server.js +2 -2
- package/es/components/ruleSetting/ruleBorder/index.js +1 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/calendar/index.js +4 -4
- package/es/components/schedules/calendar/serve.js +2 -2
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.js +5 -5
- package/es/components/schedules/components/CurrentDay/serve.js +2 -2
- package/es/components/schedules/components/DropdownSort/index.js +1 -1
- package/es/components/schedules/components/ResourceList/index.js +1 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/components/Search/index.js +5 -5
- package/es/components/schedules/model.js +5 -5
- package/es/components/schedules/openHours/index.js +1 -1
- package/es/components/schedules/openHours/serve.js +2 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/products/serve.js +2 -2
- package/es/components/schedules/products/utils.js +5 -5
- package/es/components/schedules/resources/detail/detailContent.js +2 -2
- package/es/components/schedules/resources/detail/index.js +10 -10
- package/es/components/schedules/resources/list/index.js +2 -2
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.js +1 -1
- package/es/components/schedules/resources/serve.js +2 -2
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/schedules/utils.js +4 -4
- package/es/components/selectModal/index.js +2 -2
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/wallet/Detail/index.js +250 -64
- package/es/components/wallet/Detail/locales.d.ts +51 -0
- package/es/components/wallet/Detail/locales.js +57 -3
- package/es/components/wallet/Detail/serve.js +5 -1
- package/es/components/wallet/components/UsageRules/index.d.ts +23 -0
- package/es/components/wallet/components/UsageRules/index.js +147 -0
- package/es/components/wallet/components/UsageRules/index.less +157 -0
- package/es/components/wallet/components/WalletCard.js +2 -3
- package/es/components/wallet/components/index.d.ts +1 -0
- package/es/components/wallet/components/index.js +2 -1
- package/es/hooks/useComponents.js +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -1
- package/es/plus/productSelect/ProductCard/index.less +5 -22
- package/es/plus/productSelect/components/pisellPriceText/index.d.ts +1 -0
- package/es/plus/productSelect/components/pisellPriceText/index.js +1 -0
- package/es/plus/productSelect/components/pisellPriceText/index.less +4 -0
- package/es/plus/saasCreateOrganization/components/Header.d.ts +3 -0
- package/es/plus/saasCreateOrganization/components/Header.js +62 -0
- package/es/plus/saasCreateOrganization/index.d.ts +4 -0
- package/es/plus/saasCreateOrganization/index.js +15 -0
- package/es/plus/saasCreateOrganization/index.less +55 -0
- package/es/plus/saasCreateOrganization/locales.d.ts +15 -0
- package/es/plus/saasCreateOrganization/locales.js +14 -0
- package/es/plus/saasCreateOrganization/types.d.ts +69 -0
- package/es/plus/saasCreateOrganization/types.js +1 -0
- package/es/plus/saasLogin/index.d.ts +5 -0
- package/es/plus/saasLogin/index.js +165 -0
- package/es/plus/saasLogin/index.less +136 -0
- package/es/plus/saasLogin/locales.d.ts +51 -0
- package/es/plus/saasLogin/locales.js +50 -0
- package/es/plus/saasLogin/types.d.ts +62 -0
- package/es/plus/saasLogin/types.js +1 -0
- package/es/plus/saasLogin/utils.d.ts +35 -0
- package/es/plus/saasLogin/utils.js +31 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +9 -0
- package/es/plus/saasRegister/components/EntryEmail.js +92 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +9 -0
- package/es/plus/saasRegister/components/EntryInfo.js +145 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +4 -0
- package/es/plus/saasRegister/components/GoLogin.js +27 -0
- package/es/plus/saasRegister/components/Header.d.ts +3 -0
- package/es/plus/saasRegister/components/Header.js +62 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +8 -0
- package/es/plus/saasRegister/components/VerifyError.js +68 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +5 -0
- package/es/plus/saasRegister/components/VerifyingLink.js +16 -0
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +7 -0
- package/es/plus/saasRegister/components/VertifyEmail.js +121 -0
- package/es/plus/saasRegister/index.d.ts +5 -0
- package/es/plus/saasRegister/index.js +246 -0
- package/es/plus/saasRegister/index.less +218 -0
- package/es/plus/saasRegister/locales.d.ts +117 -0
- package/es/plus/saasRegister/locales.js +116 -0
- package/es/plus/saasRegister/types.d.ts +114 -0
- package/es/plus/saasRegister/types.js +24 -0
- package/es/utils/index.d.ts +1 -1
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +22 -2
- package/lib/components/appointmentBooking/components/Content/index.js +2 -2
- package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
- package/lib/components/appointmentBooking/hooks.js +4 -2
- package/lib/components/appointmentBooking/index.js +6 -0
- package/lib/components/booking/addons/index.js +1 -11
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.js +15 -8
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.js +3 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/utils.js +15 -3
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +30 -8
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/eventBooking/components/progressBar/index.js +0 -18
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +7 -11
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.js +2 -9
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +2 -6
- package/lib/components/pay/toC/utils.d.ts +1 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/schedules/utils.js +1 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/wallet/Detail/index.js +128 -9
- package/lib/components/wallet/Detail/locales.d.ts +51 -0
- package/lib/components/wallet/Detail/locales.js +57 -3
- package/lib/components/wallet/Detail/serve.js +6 -1
- package/lib/components/wallet/components/UsageRules/index.d.ts +23 -0
- package/lib/components/wallet/components/UsageRules/index.js +113 -0
- package/lib/components/wallet/components/UsageRules/index.less +157 -0
- package/lib/components/wallet/components/WalletCard.js +1 -1
- package/lib/components/wallet/components/index.d.ts +1 -0
- package/lib/components/wallet/components/index.js +3 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +9 -0
- package/lib/plus/productSelect/ProductCard/index.less +5 -22
- package/lib/plus/productSelect/components/pisellPriceText/index.d.ts +1 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.js +1 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.less +4 -0
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +3 -0
- package/lib/plus/saasCreateOrganization/components/Header.js +99 -0
- package/lib/plus/saasCreateOrganization/index.d.ts +4 -0
- package/lib/plus/saasCreateOrganization/index.js +47 -0
- package/lib/plus/saasCreateOrganization/index.less +55 -0
- package/lib/plus/saasCreateOrganization/locales.d.ts +15 -0
- package/lib/plus/saasCreateOrganization/locales.js +38 -0
- package/lib/plus/saasCreateOrganization/types.d.ts +69 -0
- package/lib/plus/saasCreateOrganization/types.js +17 -0
- package/lib/plus/saasLogin/index.d.ts +5 -0
- package/lib/plus/saasLogin/index.js +171 -0
- package/lib/plus/saasLogin/index.less +136 -0
- package/lib/plus/saasLogin/locales.d.ts +51 -0
- package/lib/plus/saasLogin/locales.js +74 -0
- package/lib/plus/saasLogin/types.d.ts +62 -0
- package/lib/plus/saasLogin/types.js +17 -0
- package/lib/plus/saasLogin/utils.d.ts +35 -0
- package/lib/plus/saasLogin/utils.js +50 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +9 -0
- package/lib/plus/saasRegister/components/EntryEmail.js +92 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +9 -0
- package/lib/plus/saasRegister/components/EntryInfo.js +128 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +4 -0
- package/lib/plus/saasRegister/components/GoLogin.js +58 -0
- package/lib/plus/saasRegister/components/Header.d.ts +3 -0
- package/lib/plus/saasRegister/components/Header.js +99 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +8 -0
- package/lib/plus/saasRegister/components/VerifyError.js +123 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +5 -0
- package/lib/plus/saasRegister/components/VerifyingLink.js +44 -0
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +7 -0
- package/lib/plus/saasRegister/components/VertifyEmail.js +110 -0
- package/lib/plus/saasRegister/index.d.ts +5 -0
- package/lib/plus/saasRegister/index.js +205 -0
- package/lib/plus/saasRegister/index.less +218 -0
- package/lib/plus/saasRegister/locales.d.ts +117 -0
- package/lib/plus/saasRegister/locales.js +140 -0
- package/lib/plus/saasRegister/types.d.ts +114 -0
- package/lib/plus/saasRegister/types.js +54 -0
- package/lib/utils/index.d.ts +1 -1
- package/lowcode/saas-create-organization/meta.ts +214 -0
- package/lowcode/saas-create-organization/snippets.ts +25 -0
- package/lowcode/saas-login/meta.ts +370 -0
- package/lowcode/saas-login/snippets.ts +38 -0
- package/lowcode/saas-register/meta.ts +386 -0
- package/lowcode/saas-register/snippets.ts +31 -0
- package/package.json +5 -5
@@ -50,7 +50,7 @@ var { Text } = import_materials2.Typography;
|
|
50
50
|
import_dayjs.default.extend(import_timezone.default);
|
51
51
|
import_dayjs.default.extend(import_utc.default);
|
52
52
|
var Detail = (0, import_react.forwardRef)((props, ref) => {
|
53
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
54
54
|
const {
|
55
55
|
detail = {},
|
56
56
|
buttonGroupList = [[]],
|
@@ -67,8 +67,94 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
67
67
|
expire_date = "",
|
68
68
|
product = {}
|
69
69
|
} = detail;
|
70
|
-
const { description = "" } = product || {};
|
70
|
+
const { description = "", extension_data = [], customer_order_behavior_count = 0 } = product || {};
|
71
71
|
const context = (0, import_useEngineContext.default)();
|
72
|
+
const [extensionData, setExtensionData] = (0, import_react.useState)([]);
|
73
|
+
const [customerOrderBehaviorCount, setCustomerOrderBehaviorCount] = (0, import_react.useState)(0);
|
74
|
+
const [totalOrderBehaviorCount, setTotalOrderBehaviorCount] = (0, import_react.useState)(0);
|
75
|
+
const [todayOrderBehaviorCount, setTodayOrderBehaviorCount] = (0, import_react.useState)(0);
|
76
|
+
const [weekOrderBehaviorCount, setWeekOrderBehaviorCount] = (0, import_react.useState)(0);
|
77
|
+
const [monthOrderBehaviorCount, setMonthOrderBehaviorCount] = (0, import_react.useState)(0);
|
78
|
+
const [usageCreditsData, setUsageCreditsData] = (0, import_react.useState)(null);
|
79
|
+
const [shouldShowUsageRules, setShouldShowUsageRules] = (0, import_react.useState)(false);
|
80
|
+
const generateUsageRules = (creditsData) => {
|
81
|
+
if (!creditsData) return [];
|
82
|
+
const rules = [];
|
83
|
+
if (creditsData.max_per_day > 0) {
|
84
|
+
rules.push({
|
85
|
+
type: "daily",
|
86
|
+
limit: creditsData.max_per_day,
|
87
|
+
description: "",
|
88
|
+
// Will be filled by localized text
|
89
|
+
resetTime: ""
|
90
|
+
// Will be filled by localized text
|
91
|
+
});
|
92
|
+
}
|
93
|
+
if (creditsData.max_per_week > 0) {
|
94
|
+
rules.push({
|
95
|
+
type: "weekly",
|
96
|
+
limit: creditsData.max_per_week,
|
97
|
+
description: "",
|
98
|
+
// Will be filled by localized text
|
99
|
+
resetTime: ""
|
100
|
+
// Will be filled by localized text
|
101
|
+
});
|
102
|
+
}
|
103
|
+
if (creditsData.max_per_month > 0) {
|
104
|
+
rules.push({
|
105
|
+
type: "monthly",
|
106
|
+
limit: creditsData.max_per_month,
|
107
|
+
description: "",
|
108
|
+
// Will be filled by localized text
|
109
|
+
resetTime: ""
|
110
|
+
// Will be filled by localized text
|
111
|
+
});
|
112
|
+
}
|
113
|
+
return rules;
|
114
|
+
};
|
115
|
+
const generatePersonalLimit = (creditsData, usedCount = { totalOrderBehaviorCount: 0, customerOrderBehaviorCount: 0 }) => {
|
116
|
+
if (!creditsData) return void 0;
|
117
|
+
const totalCredits = creditsData.total_credits || 0;
|
118
|
+
const perUserLimit = creditsData.per_user_limit || 0;
|
119
|
+
let total = 0;
|
120
|
+
if (totalCredits > 0 && perUserLimit > 0) {
|
121
|
+
total = Math.min(totalCredits, perUserLimit);
|
122
|
+
} else {
|
123
|
+
total = Math.max(totalCredits, perUserLimit);
|
124
|
+
}
|
125
|
+
let total_remaining = 0;
|
126
|
+
if (totalCredits > 0) {
|
127
|
+
total_remaining = totalCredits - usedCount.totalOrderBehaviorCount;
|
128
|
+
}
|
129
|
+
let perUser_remaining = 0;
|
130
|
+
if (perUserLimit > 0) {
|
131
|
+
perUser_remaining = perUserLimit - usedCount.customerOrderBehaviorCount;
|
132
|
+
}
|
133
|
+
let remaining = 0;
|
134
|
+
if (total_remaining > 0 && perUser_remaining > 0) {
|
135
|
+
remaining = Math.min(total_remaining, perUser_remaining);
|
136
|
+
} else {
|
137
|
+
if (total_remaining === 0) {
|
138
|
+
if (totalCredits === 0) {
|
139
|
+
remaining = perUser_remaining;
|
140
|
+
} else {
|
141
|
+
remaining = 0;
|
142
|
+
}
|
143
|
+
} else {
|
144
|
+
if (perUser_remaining === 0) {
|
145
|
+
remaining = 0;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}
|
149
|
+
return {
|
150
|
+
total,
|
151
|
+
remaining,
|
152
|
+
note: ""
|
153
|
+
// Will be filled by localized text
|
154
|
+
};
|
155
|
+
};
|
156
|
+
const usageRules = generateUsageRules(usageCreditsData);
|
157
|
+
const personalLimit = generatePersonalLimit(usageCreditsData, { totalOrderBehaviorCount, customerOrderBehaviorCount });
|
72
158
|
const utils = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
|
73
159
|
const dvaStore = (_c = (_b = utils == null ? void 0 : utils.getStore) == null ? void 0 : _b.call(utils)) == null ? void 0 : _c.getState();
|
74
160
|
const [TimeLineData, setTimeLineData] = (0, import_react.useState)([]);
|
@@ -182,9 +268,37 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
182
268
|
return isNegative ? `-${!["point_card", "good_pass"].includes(tag) ? symbol : ""}${absAmount}` : `${!["point_card", "good_pass"].includes(tag) ? symbol : ""}${amount}`;
|
183
269
|
};
|
184
270
|
const getDetail = async () => {
|
185
|
-
const {
|
271
|
+
const {
|
272
|
+
apple_wallet_url: apple_wallet_url2 = "",
|
273
|
+
google_wallet_url: google_wallet_url2 = "",
|
274
|
+
extension_data: extension_data2 = [],
|
275
|
+
customer_order_behavior_count: customer_order_behavior_count2 = 0,
|
276
|
+
total_order_behavior_count = 0,
|
277
|
+
today_order_behavior_count = 0,
|
278
|
+
week_order_behavior_count = 0,
|
279
|
+
month_order_behavior_count = 0
|
280
|
+
} = await (0, import_serve.getDetailApi)({ id: detail.id || "" });
|
186
281
|
setAppleWalletUrl(apple_wallet_url2);
|
187
282
|
setGoogleWalletUrl(google_wallet_url2);
|
283
|
+
setExtensionData(extension_data2);
|
284
|
+
setCustomerOrderBehaviorCount(customer_order_behavior_count2);
|
285
|
+
setTotalOrderBehaviorCount(total_order_behavior_count);
|
286
|
+
setTodayOrderBehaviorCount(today_order_behavior_count);
|
287
|
+
setWeekOrderBehaviorCount(week_order_behavior_count);
|
288
|
+
setMonthOrderBehaviorCount(month_order_behavior_count);
|
289
|
+
if (Array.isArray(extension_data2) && extension_data2.length > 0) {
|
290
|
+
const usageCreditsItem = extension_data2.find((item) => item.field_key === "usage_credits");
|
291
|
+
if (usageCreditsItem == null ? void 0 : usageCreditsItem.value) {
|
292
|
+
setUsageCreditsData(usageCreditsItem.value);
|
293
|
+
setShouldShowUsageRules(true);
|
294
|
+
} else {
|
295
|
+
setUsageCreditsData(null);
|
296
|
+
setShouldShowUsageRules(false);
|
297
|
+
}
|
298
|
+
} else {
|
299
|
+
setUsageCreditsData(null);
|
300
|
+
setShouldShowUsageRules(false);
|
301
|
+
}
|
188
302
|
};
|
189
303
|
(0, import_react.useEffect)(() => {
|
190
304
|
if (detail.id) {
|
@@ -545,7 +659,7 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
545
659
|
className: `wallet-detail${platform === "h5" ? " wallet-detail-h5" : " wallet-detail-pc"} ${className || ""}`,
|
546
660
|
ref: detailWrapperRef
|
547
661
|
},
|
548
|
-
(platform === "h5" || showWalletBar) &&
|
662
|
+
(platform === "h5" || showWalletBar) && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-header" }, /* @__PURE__ */ import_react.default.createElement(import_components.WalletBar, { setup: "detail", onBack: handleBack })),
|
549
663
|
/* @__PURE__ */ import_react.default.createElement(
|
550
664
|
"div",
|
551
665
|
{
|
@@ -604,10 +718,15 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
604
718
|
isHasBorder: false
|
605
719
|
}
|
606
720
|
),
|
607
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-card-content-tip" }, description
|
608
|
-
|
609
|
-
|
610
|
-
|
721
|
+
description && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-card-content-tip" }, /* @__PURE__ */ import_react.default.createElement("div", { dangerouslySetInnerHTML: { __html: description } })),
|
722
|
+
shouldShowUsageRules && /* @__PURE__ */ import_react.default.createElement(
|
723
|
+
import_components.UsageRules,
|
724
|
+
{
|
725
|
+
locales: import_utils.locales,
|
726
|
+
rules: usageRules,
|
727
|
+
personalLimit
|
728
|
+
}
|
729
|
+
)
|
611
730
|
),
|
612
731
|
/* @__PURE__ */ import_react.default.createElement(
|
613
732
|
"section",
|
@@ -632,7 +751,7 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
632
751
|
step: "detail",
|
633
752
|
addWalletLoading,
|
634
753
|
onAppleWalletClick: tag === "gift_card" ? addWalletCard : void 0,
|
635
|
-
onRechargeClick: tag === "gift_card" && ((
|
754
|
+
onRechargeClick: tag === "gift_card" && ((_j = detail == null ? void 0 : detail.machinecode_config) == null ? void 0 : _j.hide_recharge) === 0 ? handleRecharge : void 0,
|
636
755
|
platform,
|
637
756
|
isIOS: (0, import_utils.isIos)()
|
638
757
|
}
|
@@ -29,6 +29,23 @@ declare const _default: {
|
|
29
29
|
'page.wallet.openedInBrowser': string;
|
30
30
|
'page.wallet.openFailed': string;
|
31
31
|
'page.wallet.loading': string;
|
32
|
+
'page.wallet.usageRules': string;
|
33
|
+
'page.wallet.usageRulesSubtitle': string;
|
34
|
+
'page.wallet.timeUsageLimits': string;
|
35
|
+
'page.wallet.totalQuantityControl': string;
|
36
|
+
'page.wallet.dailyLimit': string;
|
37
|
+
'page.wallet.weeklyLimit': string;
|
38
|
+
'page.wallet.monthlyLimit': string;
|
39
|
+
'page.wallet.personalLimit': string;
|
40
|
+
'page.wallet.dailyLimitDesc': string;
|
41
|
+
'page.wallet.weeklyLimitDesc': string;
|
42
|
+
'page.wallet.monthlyLimitDesc': string;
|
43
|
+
'page.wallet.monthlyLimitUnlimited': string;
|
44
|
+
'page.wallet.personalLimitDesc': string;
|
45
|
+
'page.wallet.dailyReset': string;
|
46
|
+
'page.wallet.weeklyReset': string;
|
47
|
+
'page.wallet.monthlyReset': string;
|
48
|
+
'page.wallet.voucherExpireNote': string;
|
32
49
|
};
|
33
50
|
'zh-CN': {
|
34
51
|
'page.wallet.copyTitle': string;
|
@@ -60,6 +77,23 @@ declare const _default: {
|
|
60
77
|
'page.wallet.openedInBrowser': string;
|
61
78
|
'page.wallet.openFailed': string;
|
62
79
|
'page.wallet.loading': string;
|
80
|
+
'page.wallet.usageRules': string;
|
81
|
+
'page.wallet.usageRulesSubtitle': string;
|
82
|
+
'page.wallet.timeUsageLimits': string;
|
83
|
+
'page.wallet.totalQuantityControl': string;
|
84
|
+
'page.wallet.dailyLimit': string;
|
85
|
+
'page.wallet.weeklyLimit': string;
|
86
|
+
'page.wallet.monthlyLimit': string;
|
87
|
+
'page.wallet.personalLimit': string;
|
88
|
+
'page.wallet.dailyLimitDesc': string;
|
89
|
+
'page.wallet.weeklyLimitDesc': string;
|
90
|
+
'page.wallet.monthlyLimitDesc': string;
|
91
|
+
'page.wallet.monthlyLimitUnlimited': string;
|
92
|
+
'page.wallet.personalLimitDesc': string;
|
93
|
+
'page.wallet.dailyReset': string;
|
94
|
+
'page.wallet.weeklyReset': string;
|
95
|
+
'page.wallet.monthlyReset': string;
|
96
|
+
'page.wallet.voucherExpireNote': string;
|
63
97
|
};
|
64
98
|
'zh-HK': {
|
65
99
|
'page.wallet.copyTitle': string;
|
@@ -91,6 +125,23 @@ declare const _default: {
|
|
91
125
|
'page.wallet.openedInBrowser': string;
|
92
126
|
'page.wallet.openFailed': string;
|
93
127
|
'page.wallet.loading': string;
|
128
|
+
'page.wallet.usageRules': string;
|
129
|
+
'page.wallet.usageRulesSubtitle': string;
|
130
|
+
'page.wallet.timeUsageLimits': string;
|
131
|
+
'page.wallet.totalQuantityControl': string;
|
132
|
+
'page.wallet.dailyLimit': string;
|
133
|
+
'page.wallet.weeklyLimit': string;
|
134
|
+
'page.wallet.monthlyLimit': string;
|
135
|
+
'page.wallet.personalLimit': string;
|
136
|
+
'page.wallet.dailyLimitDesc': string;
|
137
|
+
'page.wallet.weeklyLimitDesc': string;
|
138
|
+
'page.wallet.monthlyLimitDesc': string;
|
139
|
+
'page.wallet.monthlyLimitUnlimited': string;
|
140
|
+
'page.wallet.personalLimitDesc': string;
|
141
|
+
'page.wallet.dailyReset': string;
|
142
|
+
'page.wallet.weeklyReset': string;
|
143
|
+
'page.wallet.monthlyReset': string;
|
144
|
+
'page.wallet.voucherExpireNote': string;
|
94
145
|
};
|
95
146
|
};
|
96
147
|
export default _default;
|
@@ -55,7 +55,25 @@ var locales_default = {
|
|
55
55
|
"page.wallet.useAppleInstead": "You are using an iOS device, would you like to use Apple Wallet instead of Google Wallet?",
|
56
56
|
"page.wallet.openedInBrowser": "Opened in browser",
|
57
57
|
"page.wallet.openFailed": "Failed to open wallet link",
|
58
|
-
"page.wallet.loading": "Loading wallet..."
|
58
|
+
"page.wallet.loading": "Loading wallet...",
|
59
|
+
// Usage Rules
|
60
|
+
"page.wallet.usageRules": "Terms & Conditions",
|
61
|
+
"page.wallet.usageRulesSubtitle": "Please read the following usage conditions carefully",
|
62
|
+
"page.wallet.timeUsageLimits": "Time Window Restrictions",
|
63
|
+
"page.wallet.totalQuantityControl": "Total Usage Control",
|
64
|
+
"page.wallet.dailyLimit": "Daily Limit:",
|
65
|
+
"page.wallet.weeklyLimit": "Weekly Limit:",
|
66
|
+
"page.wallet.monthlyLimit": "Monthly Limit:",
|
67
|
+
"page.wallet.personalLimit": "Personal Limit:",
|
68
|
+
"page.wallet.dailyLimitDesc": "Maximum {limit} uses from 12:00 AM to 11:59 PM each day",
|
69
|
+
"page.wallet.weeklyLimitDesc": "Maximum {limit} uses from Monday 12:00 AM to Sunday 11:59 PM",
|
70
|
+
"page.wallet.monthlyLimitDesc": "Maximum {limit} uses from 1st 12:00 AM to end of month 11:59 PM",
|
71
|
+
"page.wallet.monthlyLimitUnlimited": "Unlimited",
|
72
|
+
"page.wallet.personalLimitDesc": "You can use this voucher maximum {total} times ({remaining} remaining)",
|
73
|
+
"page.wallet.dailyReset": "Counter resets automatically at midnight",
|
74
|
+
"page.wallet.weeklyReset": "Counter resets every Monday at midnight",
|
75
|
+
"page.wallet.monthlyReset": "Counter resets on 1st of each month at midnight",
|
76
|
+
"page.wallet.voucherExpireNote": "Voucher will automatically expire when limit is reached"
|
59
77
|
},
|
60
78
|
"zh-CN": {
|
61
79
|
// 简体中文翻译
|
@@ -89,7 +107,25 @@ var locales_default = {
|
|
89
107
|
"page.wallet.useAppleInstead": "您正在使用iOS设备,是否使用Apple Wallet代替Google Wallet?",
|
90
108
|
"page.wallet.openedInBrowser": "已在浏览器中打开",
|
91
109
|
"page.wallet.openFailed": "打开钱包链接失败",
|
92
|
-
"page.wallet.loading": "正在加载钱包..."
|
110
|
+
"page.wallet.loading": "正在加载钱包...",
|
111
|
+
// Usage Rules
|
112
|
+
"page.wallet.usageRules": "使用规则",
|
113
|
+
"page.wallet.usageRulesSubtitle": "请仔细阅读以下使用条件",
|
114
|
+
"page.wallet.timeUsageLimits": "时间使用限制",
|
115
|
+
"page.wallet.totalQuantityControl": "总量控制",
|
116
|
+
"page.wallet.dailyLimit": "每日限制:",
|
117
|
+
"page.wallet.weeklyLimit": "每周限制:",
|
118
|
+
"page.wallet.monthlyLimit": "每月限制:",
|
119
|
+
"page.wallet.personalLimit": "个人限额:",
|
120
|
+
"page.wallet.dailyLimitDesc": "每天0点-24点最多使用{limit}次",
|
121
|
+
"page.wallet.weeklyLimitDesc": "每周一0点-周日24点最多使用{limit}次",
|
122
|
+
"page.wallet.monthlyLimitDesc": "每月1号0点-月末24点最多使用{limit}次",
|
123
|
+
"page.wallet.monthlyLimitUnlimited": "无限制",
|
124
|
+
"page.wallet.personalLimitDesc": "您最多可使用此券{total}次(剩余{remaining}次)",
|
125
|
+
"page.wallet.dailyReset": "每天0点自动重置计数",
|
126
|
+
"page.wallet.weeklyReset": "每周一0点自动重置计数",
|
127
|
+
"page.wallet.monthlyReset": "每月1号0点自动重置计数",
|
128
|
+
"page.wallet.voucherExpireNote": "用完后此券将自动失效"
|
93
129
|
},
|
94
130
|
"zh-HK": {
|
95
131
|
// 繁体中文翻译
|
@@ -123,6 +159,24 @@ var locales_default = {
|
|
123
159
|
"page.wallet.useAppleInstead": "您正在使用iOS設備,是否使用Apple Wallet代替Google Wallet?",
|
124
160
|
"page.wallet.openedInBrowser": "已在瀏覽器中打開",
|
125
161
|
"page.wallet.openFailed": "打開錢包連結失敗",
|
126
|
-
"page.wallet.loading": "正在加載錢包..."
|
162
|
+
"page.wallet.loading": "正在加載錢包...",
|
163
|
+
// Usage Rules
|
164
|
+
"page.wallet.usageRules": "使用規則",
|
165
|
+
"page.wallet.usageRulesSubtitle": "請仔細閱讀以下使用條件",
|
166
|
+
"page.wallet.timeUsageLimits": "時間使用限制",
|
167
|
+
"page.wallet.totalQuantityControl": "總量控制",
|
168
|
+
"page.wallet.dailyLimit": "每日限制:",
|
169
|
+
"page.wallet.weeklyLimit": "每週限制:",
|
170
|
+
"page.wallet.monthlyLimit": "每月限制:",
|
171
|
+
"page.wallet.personalLimit": "個人限額:",
|
172
|
+
"page.wallet.dailyLimitDesc": "每天0點-24點最多使用{limit}次",
|
173
|
+
"page.wallet.weeklyLimitDesc": "每週一0點-週日24點最多使用{limit}次",
|
174
|
+
"page.wallet.monthlyLimitDesc": "每月1號0點-月末24點最多使用{limit}次",
|
175
|
+
"page.wallet.monthlyLimitUnlimited": "無限制",
|
176
|
+
"page.wallet.personalLimitDesc": "您最多可使用此券{total}次(剩餘{remaining}次)",
|
177
|
+
"page.wallet.dailyReset": "每天0點自動重置計數",
|
178
|
+
"page.wallet.weeklyReset": "每週一0點自動重置計數",
|
179
|
+
"page.wallet.monthlyReset": "每月1號0點自動重置計數",
|
180
|
+
"page.wallet.voucherExpireNote": "用完後此券將自動失效"
|
127
181
|
}
|
128
182
|
};
|
@@ -29,7 +29,12 @@ var getAssetList = async (params) => {
|
|
29
29
|
return data;
|
30
30
|
};
|
31
31
|
var getDetailApi = async (params) => {
|
32
|
-
const { data } = await import_utils.request.getRequest().get(`/h5/machinecode/lowcode/detail/${params.id}`, {
|
32
|
+
const { data } = await import_utils.request.getRequest().get(`/h5/machinecode/lowcode/detail/${params.id}`, {
|
33
|
+
order_behavior_count: 1,
|
34
|
+
// 订单行为次数
|
35
|
+
order_behavior_count_customer: 1
|
36
|
+
// 客户订单行为次数
|
37
|
+
});
|
33
38
|
return data;
|
34
39
|
};
|
35
40
|
// Annotate the CommonJS export names for ESM import in node:
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './index.less';
|
3
|
+
interface UsageRule {
|
4
|
+
type: 'daily' | 'weekly' | 'monthly';
|
5
|
+
limit: number;
|
6
|
+
description: string;
|
7
|
+
resetTime?: string;
|
8
|
+
}
|
9
|
+
interface UsageRulesProps {
|
10
|
+
className?: string;
|
11
|
+
style?: React.CSSProperties;
|
12
|
+
rules?: UsageRule[];
|
13
|
+
personalLimit?: {
|
14
|
+
total: number;
|
15
|
+
remaining: number;
|
16
|
+
note?: string;
|
17
|
+
};
|
18
|
+
locales?: {
|
19
|
+
getText: (key: string) => string;
|
20
|
+
};
|
21
|
+
}
|
22
|
+
declare function UsageRules({ className, style, rules, personalLimit, locales }: UsageRulesProps): JSX.Element;
|
23
|
+
export default UsageRules;
|
@@ -0,0 +1,113 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
25
|
+
mod
|
26
|
+
));
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
|
+
|
29
|
+
// src/components/wallet/components/UsageRules/index.tsx
|
30
|
+
var UsageRules_exports = {};
|
31
|
+
__export(UsageRules_exports, {
|
32
|
+
default: () => UsageRules_default
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(UsageRules_exports);
|
35
|
+
var import_react = __toESM(require("react"));
|
36
|
+
var import_materials = require("@pisell/materials");
|
37
|
+
var import_index = require("./index.less");
|
38
|
+
var { Text } = import_materials.Typography;
|
39
|
+
function UsageRules({
|
40
|
+
className = "",
|
41
|
+
style,
|
42
|
+
rules,
|
43
|
+
personalLimit = {
|
44
|
+
total: 5,
|
45
|
+
remaining: 3,
|
46
|
+
note: "用完后此券将自动失效"
|
47
|
+
},
|
48
|
+
locales
|
49
|
+
}) {
|
50
|
+
const interpolateText = (text, variables) => {
|
51
|
+
return text.replace(/\{(\w+)\}/g, (match, key) => {
|
52
|
+
return variables[key] !== void 0 ? variables[key] : match;
|
53
|
+
});
|
54
|
+
};
|
55
|
+
const getText = (key, fallback) => {
|
56
|
+
return (locales == null ? void 0 : locales.getText(key)) || fallback || key;
|
57
|
+
};
|
58
|
+
const getRuleDescription = (type, limit) => {
|
59
|
+
if (limit === 0 && type === "monthly") {
|
60
|
+
return getText("page.wallet.monthlyLimitUnlimited", "无限制");
|
61
|
+
}
|
62
|
+
const templateKey = `page.wallet.${type}LimitDesc`;
|
63
|
+
const template = getText(templateKey, "");
|
64
|
+
return interpolateText(template, { limit });
|
65
|
+
};
|
66
|
+
const getRuleResetTime = (type) => {
|
67
|
+
const resetKey = `page.wallet.${type}Reset`;
|
68
|
+
return getText(resetKey, "");
|
69
|
+
};
|
70
|
+
const defaultRules = [
|
71
|
+
{
|
72
|
+
type: "daily",
|
73
|
+
limit: 3,
|
74
|
+
description: getRuleDescription("daily", 3),
|
75
|
+
resetTime: getRuleResetTime("daily")
|
76
|
+
},
|
77
|
+
{
|
78
|
+
type: "weekly",
|
79
|
+
limit: 15,
|
80
|
+
description: getRuleDescription("weekly", 15),
|
81
|
+
resetTime: getRuleResetTime("weekly")
|
82
|
+
},
|
83
|
+
{
|
84
|
+
type: "monthly",
|
85
|
+
limit: 60,
|
86
|
+
description: getRuleDescription("monthly", 60),
|
87
|
+
resetTime: getRuleResetTime("monthly")
|
88
|
+
}
|
89
|
+
];
|
90
|
+
const processedRules = rules ? rules.map((rule) => ({
|
91
|
+
...rule,
|
92
|
+
description: getRuleDescription(rule.type, rule.limit),
|
93
|
+
resetTime: getRuleResetTime(rule.type)
|
94
|
+
})) : defaultRules;
|
95
|
+
const finalRules = processedRules;
|
96
|
+
const getRuleLabel = (type) => {
|
97
|
+
switch (type) {
|
98
|
+
case "daily":
|
99
|
+
return getText("page.wallet.dailyLimit", "每日限制:");
|
100
|
+
case "weekly":
|
101
|
+
return getText("page.wallet.weeklyLimit", "每周限制:");
|
102
|
+
case "monthly":
|
103
|
+
return getText("page.wallet.monthlyLimit", "每月限制:");
|
104
|
+
default:
|
105
|
+
return getText("page.wallet.dailyLimit", "限制:");
|
106
|
+
}
|
107
|
+
};
|
108
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `usage-rules ${className}`, style }, /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-title" }, getText("page.wallet.usageRules", "使用规则")), /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-subtitle" }, getText("page.wallet.usageRulesSubtitle", "请仔细阅读以下使用条件")), /* @__PURE__ */ import_react.default.createElement("div", { className: "usage-rules-section" }, /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-section-title" }, getText("page.wallet.timeUsageLimits", "时间使用限制")), /* @__PURE__ */ import_react.default.createElement("div", { className: "usage-rules-list" }, finalRules.length > 0 ? finalRules.map((rule, index) => /* @__PURE__ */ import_react.default.createElement("div", { key: index, className: "usage-rules-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "usage-rules-item-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "usage-rules-item-main-line" }, /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-item-label" }, getRuleLabel(rule.type)), /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-item-description" }, rule.description)), rule.resetTime && /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-item-reset" }, rule.resetTime)))) : /* @__PURE__ */ import_react.default.createElement("div", { className: "usage-rules-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "usage-rules-item-content" }, /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-item-description" }, getText("page.wallet.monthlyLimitUnlimited", "无限制")))))), /* @__PURE__ */ import_react.default.createElement("div", { className: "usage-rules-section" }, /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-section-title" }, getText("page.wallet.totalQuantityControl", "总量控制")), /* @__PURE__ */ import_react.default.createElement("div", { className: "usage-rules-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "usage-rules-item-content" }, personalLimit.total > 0 ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-item-label" }, getText("page.wallet.personalLimit", "个人限额:")), /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-item-description" }, interpolateText(
|
109
|
+
getText("page.wallet.personalLimitDesc", "您最多可使用此券{total}次(剩余{remaining}次)"),
|
110
|
+
{ total: personalLimit.total, remaining: personalLimit.remaining }
|
111
|
+
)), /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-item-note" }, getText("page.wallet.voucherExpireNote", "用完后此券将自动失效"))) : /* @__PURE__ */ import_react.default.createElement(Text, { className: "usage-rules-item-description" }, getText("page.wallet.monthlyLimitUnlimited", "无限制"))))));
|
112
|
+
}
|
113
|
+
var UsageRules_default = UsageRules;
|
@@ -0,0 +1,157 @@
|
|
1
|
+
.usage-rules {
|
2
|
+
padding: 16px;
|
3
|
+
background: #ffffff;
|
4
|
+
border-radius: 8px;
|
5
|
+
border: 1px solid #f0f0f0;
|
6
|
+
margin-top: 16px;
|
7
|
+
margin-bottom: 20px;
|
8
|
+
|
9
|
+
// 确保所有Text组件都是块级元素
|
10
|
+
.ant-typography {
|
11
|
+
display: block !important;
|
12
|
+
width: 100% !important;
|
13
|
+
margin-bottom: 0 !important;
|
14
|
+
}
|
15
|
+
|
16
|
+
&-title {
|
17
|
+
font-size: 18px;
|
18
|
+
font-weight: 600;
|
19
|
+
color: #000000;
|
20
|
+
line-height: 24px;
|
21
|
+
margin-bottom: 8px;
|
22
|
+
display: block;
|
23
|
+
width: 100%;
|
24
|
+
}
|
25
|
+
|
26
|
+
&-subtitle {
|
27
|
+
font-size: 14px;
|
28
|
+
color: #6B7280;
|
29
|
+
line-height: 20px;
|
30
|
+
margin-bottom: 24px;
|
31
|
+
display: block;
|
32
|
+
width: 100%;
|
33
|
+
}
|
34
|
+
|
35
|
+
&-section {
|
36
|
+
margin-bottom: 24px;
|
37
|
+
|
38
|
+
&:last-child {
|
39
|
+
margin-bottom: 0;
|
40
|
+
}
|
41
|
+
|
42
|
+
&-title {
|
43
|
+
font-size: 16px;
|
44
|
+
font-weight: 500;
|
45
|
+
color: #6B7280;
|
46
|
+
line-height: 20px;
|
47
|
+
margin-bottom: 16px;
|
48
|
+
display: block;
|
49
|
+
width: 100%;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
&-list {
|
54
|
+
display: flex;
|
55
|
+
flex-direction: column;
|
56
|
+
gap: 16px;
|
57
|
+
}
|
58
|
+
|
59
|
+
&-item {
|
60
|
+
position: relative;
|
61
|
+
display: flex;
|
62
|
+
align-items: flex-start;
|
63
|
+
|
64
|
+
&::before {
|
65
|
+
content: '•';
|
66
|
+
color: #697281;
|
67
|
+
font-size: 16px;
|
68
|
+
line-height: 20px;
|
69
|
+
font-weight: bold;
|
70
|
+
margin-right: 8px;
|
71
|
+
flex-shrink: 0;
|
72
|
+
margin-top: 0;
|
73
|
+
}
|
74
|
+
|
75
|
+
&-content {
|
76
|
+
flex: 1;
|
77
|
+
min-width: 0;
|
78
|
+
}
|
79
|
+
|
80
|
+
&-main-line {
|
81
|
+
margin-bottom: 4px;
|
82
|
+
}
|
83
|
+
|
84
|
+
&-label {
|
85
|
+
font-size: 14px;
|
86
|
+
font-weight: 600;
|
87
|
+
color: #000000;
|
88
|
+
line-height: 20px;
|
89
|
+
display: inline;
|
90
|
+
margin-right: 4px;
|
91
|
+
}
|
92
|
+
|
93
|
+
&-description {
|
94
|
+
font-size: 14px;
|
95
|
+
color: #000000;
|
96
|
+
line-height: 20px;
|
97
|
+
display: inline;
|
98
|
+
word-wrap: break-word;
|
99
|
+
}
|
100
|
+
|
101
|
+
&-reset {
|
102
|
+
font-size: 14px;
|
103
|
+
color: #000000;
|
104
|
+
line-height: 20px;
|
105
|
+
display: block;
|
106
|
+
width: 100%;
|
107
|
+
}
|
108
|
+
|
109
|
+
&-note {
|
110
|
+
font-size: 14px;
|
111
|
+
color: #000000;
|
112
|
+
line-height: 20px;
|
113
|
+
margin-top: 4px;
|
114
|
+
display: block;
|
115
|
+
width: 100%;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
// 响应式设计
|
122
|
+
@media (max-width: 768px) {
|
123
|
+
.usage-rules {
|
124
|
+
padding: 12px;
|
125
|
+
margin-top: 12px;
|
126
|
+
|
127
|
+
&-title {
|
128
|
+
font-size: 16px;
|
129
|
+
}
|
130
|
+
|
131
|
+
&-subtitle {
|
132
|
+
font-size: 13px;
|
133
|
+
}
|
134
|
+
|
135
|
+
&-section {
|
136
|
+
margin-bottom: 20px;
|
137
|
+
|
138
|
+
&-title {
|
139
|
+
font-size: 15px;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
&-item {
|
144
|
+
&::before {
|
145
|
+
font-size: 14px;
|
146
|
+
margin-right: 6px;
|
147
|
+
}
|
148
|
+
|
149
|
+
&-label,
|
150
|
+
&-description,
|
151
|
+
&-reset,
|
152
|
+
&-note {
|
153
|
+
font-size: 13px;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
}
|
@@ -73,7 +73,7 @@ var WalletCard = ({
|
|
73
73
|
disabled: isDisabled,
|
74
74
|
showDisabledReason: isDisabled,
|
75
75
|
disabledReason,
|
76
|
-
|
76
|
+
propStyle: { marginBottom: 16 },
|
77
77
|
showBalanceSymbol: !["point_card", "good_pass"].includes(tag),
|
78
78
|
active: isActive,
|
79
79
|
name: product_title,
|
@@ -30,13 +30,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
30
30
|
var components_exports = {};
|
31
31
|
__export(components_exports, {
|
32
32
|
FooterButtons: () => import_FooterButtons.default,
|
33
|
+
UsageRules: () => import_UsageRules.default,
|
33
34
|
WalletBar: () => import_WalletBar.default
|
34
35
|
});
|
35
36
|
module.exports = __toCommonJS(components_exports);
|
36
37
|
var import_WalletBar = __toESM(require("./WalletBar"));
|
37
38
|
var import_FooterButtons = __toESM(require("./FooterButtons"));
|
39
|
+
var import_UsageRules = __toESM(require("./UsageRules"));
|
38
40
|
// Annotate the CommonJS export names for ESM import in node:
|
39
41
|
0 && (module.exports = {
|
40
42
|
FooterButtons,
|
43
|
+
UsageRules,
|
41
44
|
WalletBar
|
42
45
|
});
|