@pisell/private-materials 3.2.20 → 3.2.22
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- package/es/components/appointmentBooking/components/Cart/Item/index.js +7 -2
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Date/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.js +228 -0
- package/es/components/appointmentBooking/components/Voucher/index.less +26 -0
- package/es/components/appointmentBooking/hooks.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +4 -0
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/appointmentBooking/locales.d.ts +27 -0
- package/es/components/appointmentBooking/locales.js +30 -3
- package/es/components/appointmentBooking/utils.js +3 -1
- package/es/components/booking/addons/index.js +1 -0
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +5 -1
- package/es/components/booking/components/footer/utils.js +18 -2
- package/es/components/booking/components/voucher/index.d.ts +3 -0
- package/es/components/booking/components/voucher/index.js +237 -0
- package/es/components/booking/components/voucher/index.less +88 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.js +115 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/hooks/useClearCart.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/header/index.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/index.d.ts +1 -0
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +9 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/locales.d.ts +18 -0
- package/es/components/booking/locales.js +21 -3
- package/es/components/booking/materiels/contacts/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/payments/index.js +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/index.d.ts +1 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftpos/surcharge/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/component/fail/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/network.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/component/manual/index.d.ts +1 -0
- package/es/components/eftposPay/component/signature/index.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +1 -0
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/resources/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/schedules/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +1 -0
- package/es/components/wallet/Detail/index.js +20 -14
- package/es/components/wallet/Voucher/index.js +1 -0
- package/es/components/wallet/index.js +15 -1
- package/es/components/wallet/locales.d.ts +3 -0
- package/es/components/wallet/locales.js +3 -0
- package/es/components/wallet/model.d.ts +1 -1
- package/es/components/wallet/utils/formatUtils.js +1 -1
- package/es/components/walletList/index.js +5 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +3 -2
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Date/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +209 -0
- package/lib/components/appointmentBooking/components/Voucher/index.less +26 -0
- package/lib/components/appointmentBooking/hooks.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +8 -2
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/appointmentBooking/locales.d.ts +27 -0
- package/lib/components/appointmentBooking/locales.js +30 -3
- package/lib/components/appointmentBooking/utils.js +3 -1
- package/lib/components/booking/addons/index.js +1 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +2 -1
- package/lib/components/booking/components/footer/utils.js +18 -1
- package/lib/components/booking/components/voucher/index.d.ts +3 -0
- package/lib/components/booking/components/voucher/index.js +211 -0
- package/lib/components/booking/components/voucher/index.less +88 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.js +109 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
- package/lib/components/booking/deposit/index.d.ts +1 -0
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/header/index.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +8 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/locales.d.ts +18 -0
- package/lib/components/booking/locales.js +21 -3
- package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/index.d.ts +1 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftpos/surcharge/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +1 -0
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/schedules/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/taxSelect/index.d.ts +1 -0
- package/lib/components/wallet/Detail/index.js +6 -1
- package/lib/components/wallet/Voucher/index.js +1 -0
- package/lib/components/wallet/index.js +15 -1
- package/lib/components/wallet/locales.d.ts +3 -0
- package/lib/components/wallet/locales.js +3 -0
- package/lib/components/wallet/model.d.ts +1 -1
- package/lib/components/wallet/utils/formatUtils.js +1 -1
- package/lib/components/walletList/index.js +6 -2
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/package.json +2 -2
|
@@ -98,7 +98,16 @@ var locales_default = {
|
|
|
98
98
|
"pisell2.appointment.add.guest": "Add guest",
|
|
99
99
|
"pisell2.appointment.edit.service": "Edit services",
|
|
100
100
|
"pisell2.appointment.remove.guest": "Remove guest",
|
|
101
|
-
"pisell2.appointment.no.available.service": "No available times for this service. Please choose another."
|
|
101
|
+
"pisell2.appointment.no.available.service": "No available times for this service. Please choose another.",
|
|
102
|
+
"pisell2.text.apply": "Apply",
|
|
103
|
+
"pisell2.text.goodpass": "GoodPass",
|
|
104
|
+
"pisell2.text.goodpass.product-vouchers": "Product Vouchers",
|
|
105
|
+
"pisell2.text.goodpass.view-more": "View More",
|
|
106
|
+
"pisell2.text.goodpass.code": "Code",
|
|
107
|
+
"pisell2.text.goodpass.enter-code": "Enter Code",
|
|
108
|
+
"pisell2.text.goodpass.code-invalid": "Current code is invalid",
|
|
109
|
+
"pisell2.text.goodpass.login": "Login",
|
|
110
|
+
"pisell2.text.goodpass.login-tip": " for member benefit Or use account credit"
|
|
102
111
|
},
|
|
103
112
|
"zh-CN": {
|
|
104
113
|
"pisell2.event.calendar.limit.unavailable": "不可预约",
|
|
@@ -175,7 +184,16 @@ var locales_default = {
|
|
|
175
184
|
"pisell2.appointment.add.guest": "添加预约人",
|
|
176
185
|
"pisell2.appointment.edit.service": "编辑服务",
|
|
177
186
|
"pisell2.appointment.remove.guest": "移除预约人",
|
|
178
|
-
"pisell2.appointment.no.available.service": "此服务无可用时间,请选择其他服务。"
|
|
187
|
+
"pisell2.appointment.no.available.service": "此服务无可用时间,请选择其他服务。",
|
|
188
|
+
"pisell2.text.apply": "应用",
|
|
189
|
+
"pisell2.text.goodpass": "商品券",
|
|
190
|
+
"pisell2.text.goodpass.product-vouchers": "商品兑换券",
|
|
191
|
+
"pisell2.text.goodpass.view-more": "查看更多",
|
|
192
|
+
"pisell2.text.goodpass.code": "券码",
|
|
193
|
+
"pisell2.text.goodpass.enter-code": "请输入券码",
|
|
194
|
+
"pisell2.text.goodpass.code-invalid": "当前券码不可用",
|
|
195
|
+
"pisell2.text.goodpass.login": "登录",
|
|
196
|
+
"pisell2.text.goodpass.login-tip": "以获取会员福利或使用账户积分"
|
|
179
197
|
},
|
|
180
198
|
"zh-HK": {
|
|
181
199
|
"pisell2.event.calendar.limit.unavailable": "不可預約",
|
|
@@ -252,6 +270,15 @@ var locales_default = {
|
|
|
252
270
|
"pisell2.appointment.add.guest": "添加預約人",
|
|
253
271
|
"pisell2.appointment.edit.service": "編輯服務",
|
|
254
272
|
"pisell2.appointment.remove.guest": "移除預約人",
|
|
255
|
-
"pisell2.appointment.no.available.service": "此服务无可用时间,请选择其他服务。"
|
|
273
|
+
"pisell2.appointment.no.available.service": "此服务无可用时间,请选择其他服务。",
|
|
274
|
+
"pisell2.text.apply": "應用",
|
|
275
|
+
"pisell2.text.goodpass": "商品券",
|
|
276
|
+
"pisell2.text.goodpass.product-vouchers": "商品兌換券",
|
|
277
|
+
"pisell2.text.goodpass.view-more": "查看更多",
|
|
278
|
+
"pisell2.text.goodpass.code": "券碼",
|
|
279
|
+
"pisell2.text.goodpass.enter-code": "請輸入券碼",
|
|
280
|
+
"pisell2.text.goodpass.code-invalid": "當前券碼不可用",
|
|
281
|
+
"pisell2.text.goodpass.login": "登錄",
|
|
282
|
+
"pisell2.text.goodpass.login-tip": "以獲取會員福利或使用賬戶積分"
|
|
256
283
|
}
|
|
257
284
|
};
|
|
@@ -355,7 +355,7 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
355
355
|
if (!state.bookingId) {
|
|
356
356
|
return null;
|
|
357
357
|
}
|
|
358
|
-
return /* @__PURE__ */ import_react.default.createElement(import_footer.default, { state, buttons: _footer, source: "addons" });
|
|
358
|
+
return /* @__PURE__ */ import_react.default.createElement(import_footer.default, { state, dispatch, buttons: _footer, source: "addons" });
|
|
359
359
|
}, [state, _footer]);
|
|
360
360
|
const editProductDetail = (item) => {
|
|
361
361
|
if (state.disabledEdit) {
|
|
@@ -49,6 +49,7 @@ var import_amount = require("./amount");
|
|
|
49
49
|
var import_index = require("./index.less");
|
|
50
50
|
var import_serve2 = require("./serve");
|
|
51
51
|
var import_utils4 = require("./utils");
|
|
52
|
+
var import_voucher = __toESM(require("../voucher"));
|
|
52
53
|
var Footer = (props) => {
|
|
53
54
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
54
55
|
const { state, buttons, dispatch, source } = props;
|
|
@@ -782,7 +783,7 @@ var Footer = (props) => {
|
|
|
782
783
|
break;
|
|
783
784
|
}
|
|
784
785
|
};
|
|
785
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { title: false, round: true, loading: showFooter, active: true }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-total" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-total" }, totalText), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-arrears" }, arrearsText)), /* @__PURE__ */ import_react.default.createElement(
|
|
786
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { title: false, round: true, loading: showFooter, active: true }, /* @__PURE__ */ import_react.default.createElement(import_voucher.default, { state, dispatch }), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-total" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-total" }, totalText), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-arrears" }, arrearsText)), /* @__PURE__ */ import_react.default.createElement(
|
|
786
787
|
"span",
|
|
787
788
|
{
|
|
788
789
|
className: "pisell-lowcode__booking-footer-right",
|
|
@@ -188,17 +188,32 @@ var formatMetaData = (item) => {
|
|
|
188
188
|
}
|
|
189
189
|
return metadata;
|
|
190
190
|
};
|
|
191
|
+
var formatDiscountList = (list) => {
|
|
192
|
+
return list.map((item) => {
|
|
193
|
+
var _a, _b, _c, _d;
|
|
194
|
+
return {
|
|
195
|
+
amount: item.amount,
|
|
196
|
+
product_id: item.product_id || ((_a = item.discount) == null ? void 0 : _a.product_id),
|
|
197
|
+
resource_id: item.resource_id || ((_b = item.discount) == null ? void 0 : _b.resource_id),
|
|
198
|
+
title: item.title || ((_c = item.discount) == null ? void 0 : _c.title),
|
|
199
|
+
original_amount: item.original_amount || ((_d = item.discount) == null ? void 0 : _d.original_amount),
|
|
200
|
+
id: item.id,
|
|
201
|
+
type: item.type
|
|
202
|
+
};
|
|
203
|
+
});
|
|
204
|
+
};
|
|
191
205
|
var formatProducts = (item) => {
|
|
192
206
|
var _a, _b, _c, _d, _e, _f;
|
|
193
207
|
const total = Number(item._extend.total);
|
|
194
208
|
const origin_total = Number(item._extend.origin_total);
|
|
195
209
|
const discount_amount = origin_total - total;
|
|
210
|
+
const discount_list = formatDiscountList((item == null ? void 0 : item.discount_list) || []);
|
|
196
211
|
const discount_type = discount_amount < 0 ? "change_price" : "discount";
|
|
197
212
|
return {
|
|
198
213
|
"num": item._extend.quantity,
|
|
199
214
|
"price": formatProductPrice(item),
|
|
200
215
|
"product_id": (item == null ? void 0 : item.product_id) || item.id,
|
|
201
|
-
"discount_amount": discount_amount,
|
|
216
|
+
"discount_amount": discount_list.length > 0 ? 0 : discount_amount,
|
|
202
217
|
"product_discount_reason": item._extend.discount_reason || "",
|
|
203
218
|
"is_charge_tax": item.is_charge_tax,
|
|
204
219
|
"note": (item == null ? void 0 : item.note) || "",
|
|
@@ -210,6 +225,7 @@ var formatProducts = (item) => {
|
|
|
210
225
|
"bundle_edit": item._extend.bundle_edit,
|
|
211
226
|
"product_option_item": formatProductOption((_d = (_c = item._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.option),
|
|
212
227
|
"product_variant_id": ((_f = (_e = item._extend) == null ? void 0 : _e.other) == null ? void 0 : _f.product_variant_id) || 0,
|
|
228
|
+
"discount_list": discount_list,
|
|
213
229
|
metadata: formatMetaData(item)
|
|
214
230
|
};
|
|
215
231
|
};
|
|
@@ -363,6 +379,7 @@ var formatValues = (state) => {
|
|
|
363
379
|
...values,
|
|
364
380
|
...customer
|
|
365
381
|
};
|
|
382
|
+
debugger;
|
|
366
383
|
values.holder = formatHolder(state, values);
|
|
367
384
|
if (isDay) {
|
|
368
385
|
values.relation_products = formatRelationProducts(state);
|
|
@@ -0,0 +1,211 @@
|
|
|
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/booking/components/voucher/index.tsx
|
|
30
|
+
var voucher_exports = {};
|
|
31
|
+
__export(voucher_exports, {
|
|
32
|
+
default: () => voucher_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(voucher_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_ChevronDown = __toESM(require("@pisell/icon/es/ChevronDown"));
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_antd = require("antd");
|
|
39
|
+
var import_utils = require("@pisell/utils");
|
|
40
|
+
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
41
|
+
var import_materials = require("@pisell/materials");
|
|
42
|
+
var import_icons = require("@ant-design/icons");
|
|
43
|
+
var import_index = require("./index.less");
|
|
44
|
+
var ShopDiscountHooks = {
|
|
45
|
+
onInited: "shopDiscount:onInited",
|
|
46
|
+
onDestroy: "shopDiscount:onDestroy",
|
|
47
|
+
onLoadDiscountList: "shopDiscount:onLoadDiscountList",
|
|
48
|
+
onCustomerChange: "shopDiscount:onCustomerChange",
|
|
49
|
+
onDiscountListChange: "shopDiscount:onDiscountListChange",
|
|
50
|
+
onRulesListChange: "shopDiscount:onRulesListChange",
|
|
51
|
+
onLoadPrepareCalcResult: "shopDiscount:onLoadPrepareCalcResult"
|
|
52
|
+
};
|
|
53
|
+
var VoucherCard = (props) => {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const context = (0, import_useEngineContext.default)();
|
|
56
|
+
const [showDetail, setShowDetail] = (0, import_react.useState)(true);
|
|
57
|
+
const { state, dispatch } = props;
|
|
58
|
+
const { pisellos } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
59
|
+
const [code, setCode] = (0, import_react.useState)("");
|
|
60
|
+
const [discountList, setDisCountList] = (0, import_react.useState)([]);
|
|
61
|
+
const productRef = (0, import_react.useRef)(state.service.value);
|
|
62
|
+
const shopDiscount = pisellos.getModule("shopDiscount");
|
|
63
|
+
const availableData = (0, import_react.useMemo)(() => {
|
|
64
|
+
const shopDiscount2 = pisellos.getModule("shopDiscount");
|
|
65
|
+
return discountList.filter((item) => !!item.isAvailable).map((discount) => {
|
|
66
|
+
return {
|
|
67
|
+
...discount,
|
|
68
|
+
savedAmount: shopDiscount2.calcDiscountApplicableProductTotalPrice(discount)
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
}, [discountList]);
|
|
72
|
+
(0, import_react.useEffect)(() => {
|
|
73
|
+
shopDiscount.setCustomer(state.client.value);
|
|
74
|
+
}, [(_b = state.client.value) == null ? void 0 : _b.id]);
|
|
75
|
+
(0, import_react.useEffect)(() => {
|
|
76
|
+
shopDiscount.setProductList(state.service.value);
|
|
77
|
+
}, [state.service.value]);
|
|
78
|
+
(0, import_react.useEffect)(() => {
|
|
79
|
+
if (productRef.current === state.service.value) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const val = shopDiscount.calcDiscount(state.service.value);
|
|
83
|
+
console.log("input: ", state.service.value);
|
|
84
|
+
console.log("output: ", val);
|
|
85
|
+
productRef.current = val.productList;
|
|
86
|
+
dispatch({
|
|
87
|
+
type: "setService",
|
|
88
|
+
payload: {
|
|
89
|
+
value: val.productList
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}, [state.service.value]);
|
|
93
|
+
(0, import_react.useEffect)(() => {
|
|
94
|
+
pisellos.effects.on(ShopDiscountHooks.onCustomerChange, (customer) => {
|
|
95
|
+
console.log(customer, "customerChange");
|
|
96
|
+
dispatch({
|
|
97
|
+
type: "setClient",
|
|
98
|
+
payload: {
|
|
99
|
+
value: customer
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
pisellos.effects.on(
|
|
104
|
+
ShopDiscountHooks.onLoadPrepareCalcResult,
|
|
105
|
+
(result) => {
|
|
106
|
+
dispatch({
|
|
107
|
+
type: "setService",
|
|
108
|
+
payload: {
|
|
109
|
+
value: result.productList
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
pisellos.effects.on(
|
|
115
|
+
ShopDiscountHooks.onDiscountListChange,
|
|
116
|
+
(discount) => {
|
|
117
|
+
console.log(discount, "discountChange");
|
|
118
|
+
setDisCountList(discount);
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
return () => {
|
|
122
|
+
shopDiscount.clear();
|
|
123
|
+
pisellos.effects.off(ShopDiscountHooks.onCustomerChange);
|
|
124
|
+
pisellos.effects.off(ShopDiscountHooks.onLoadPrepareCalcResult);
|
|
125
|
+
pisellos.effects.off(ShopDiscountHooks.onDiscountListChange);
|
|
126
|
+
};
|
|
127
|
+
}, [state.bookingId]);
|
|
128
|
+
const onScanCode = async () => {
|
|
129
|
+
const val = await shopDiscount.scanCode(code);
|
|
130
|
+
console.log(val);
|
|
131
|
+
if (val == null ? void 0 : val.isAvailable) {
|
|
132
|
+
dispatch({
|
|
133
|
+
type: "setService",
|
|
134
|
+
payload: {
|
|
135
|
+
value: val.productList
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
} else {
|
|
139
|
+
(0, import_materials.PisellToast)({
|
|
140
|
+
content: import_utils.locales.getText("pisell2.text.goodpass.code-invalid")
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-voucher-container" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "voucher-title" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "voucher-title-left" }, import_utils.locales.getText("pisell2.text.goodpass")), /* @__PURE__ */ import_react.default.createElement(
|
|
145
|
+
"span",
|
|
146
|
+
{
|
|
147
|
+
className: "voucher-title-right",
|
|
148
|
+
onClick: () => {
|
|
149
|
+
console.log("showDetail: ", showDetail);
|
|
150
|
+
setShowDetail(!showDetail);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
import_utils.locales.getText("pisell2.text.details"),
|
|
154
|
+
" ",
|
|
155
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
156
|
+
import_ChevronDown.default,
|
|
157
|
+
{
|
|
158
|
+
className: (0, import_classnames.default)("voucher-right-icon", {
|
|
159
|
+
show: showDetail
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
className: (0, import_classnames.default)("voucher-detail", {
|
|
167
|
+
show: showDetail
|
|
168
|
+
})
|
|
169
|
+
},
|
|
170
|
+
(availableData == null ? void 0 : availableData.length) > 0 ? /* @__PURE__ */ import_react.default.createElement(
|
|
171
|
+
import_materials.PisellGoodPassCard,
|
|
172
|
+
{
|
|
173
|
+
style: { width: "100%" },
|
|
174
|
+
dataSource: availableData,
|
|
175
|
+
onChange: (val) => {
|
|
176
|
+
const shopDiscount2 = pisellos.getModule("shopDiscount");
|
|
177
|
+
const detail = shopDiscount2.setDiscountSelected({
|
|
178
|
+
discountId: val.id,
|
|
179
|
+
isSelected: val.isSelected
|
|
180
|
+
});
|
|
181
|
+
console.log("setDiscountSelected:", detail);
|
|
182
|
+
dispatch({
|
|
183
|
+
type: "setService",
|
|
184
|
+
payload: {
|
|
185
|
+
value: detail.productList
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
) : null,
|
|
191
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "voucher-code-input-wrapper" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "voucher-code-input" }, /* @__PURE__ */ import_react.default.createElement("div", { style: { whiteSpace: "nowrap" } }, import_utils.locales.getText("pisell2.text.goodpass.code"), ":"), /* @__PURE__ */ import_react.default.createElement(
|
|
192
|
+
import_materials.PisellInput,
|
|
193
|
+
{
|
|
194
|
+
value: code,
|
|
195
|
+
onChange: (e) => {
|
|
196
|
+
var _a2;
|
|
197
|
+
setCode((_a2 = e.target) == null ? void 0 : _a2.value);
|
|
198
|
+
},
|
|
199
|
+
size: "small",
|
|
200
|
+
placeholder: import_utils.locales.getText("pisell2.text.goodpass.enter-code"),
|
|
201
|
+
suffix: /* @__PURE__ */ import_react.default.createElement(import_materials.PisellTooltip, { title: "" }, /* @__PURE__ */ import_react.default.createElement(
|
|
202
|
+
import_icons.QuestionCircleOutlined,
|
|
203
|
+
{
|
|
204
|
+
style: { color: "rgba(0,0,0,.45)" }
|
|
205
|
+
}
|
|
206
|
+
))
|
|
207
|
+
}
|
|
208
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { size: "small", onClick: onScanCode, disabled: !code }, import_utils.locales.getText("pisell2.text.apply")))
|
|
209
|
+
));
|
|
210
|
+
};
|
|
211
|
+
var voucher_default = VoucherCard;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
.pisell-lowcode__booking-footer-voucher-container {
|
|
2
|
+
margin-bottom: 8px;
|
|
3
|
+
.voucher-title {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
margin-bottom: 10px;
|
|
8
|
+
|
|
9
|
+
.voucher-title-left {
|
|
10
|
+
color: var(--base-black, #000);
|
|
11
|
+
font-size: 18px;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
line-height: 28px;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.voucher-title-right {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
gap: 4px;
|
|
24
|
+
color: #7f56d9;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
font-size: 18px;
|
|
27
|
+
font-style: normal;
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.voucher-right-icon {
|
|
32
|
+
font-size: 20px;
|
|
33
|
+
width: 24px;
|
|
34
|
+
height: 24px;
|
|
35
|
+
color: #7f56d9;
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
|
|
40
|
+
&.show {
|
|
41
|
+
transform: rotate(180deg);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.voucher-detail {
|
|
47
|
+
width: 100%;
|
|
48
|
+
transition: 0.2s;
|
|
49
|
+
max-height: 0;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
|
|
54
|
+
&.show {
|
|
55
|
+
max-height: unset;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.voucher-code-input-wrapper {
|
|
60
|
+
margin-top: 6px;
|
|
61
|
+
display: flex;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 42px;
|
|
64
|
+
padding: 8px;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 8px;
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
border-radius: 8px;
|
|
70
|
+
border: 1px solid var(--Gray-300, #d0d5dd);
|
|
71
|
+
background: #fff;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.voucher-code-input {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
> div {
|
|
78
|
+
color: var(--Gray-500, #667085);
|
|
79
|
+
text-align: center;
|
|
80
|
+
font-family: Inter;
|
|
81
|
+
font-size: 16px;
|
|
82
|
+
font-style: normal;
|
|
83
|
+
font-weight: 600;
|
|
84
|
+
line-height: 20px;
|
|
85
|
+
margin-right: 8px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface ApplicableProductDetails {
|
|
4
|
+
amount: string;
|
|
5
|
+
type: string;
|
|
6
|
+
resource_id: number;
|
|
7
|
+
title: string;
|
|
8
|
+
original_amount: string;
|
|
9
|
+
}
|
|
10
|
+
interface Discount {
|
|
11
|
+
id: number;
|
|
12
|
+
product_name: string;
|
|
13
|
+
encoded: string;
|
|
14
|
+
code: string;
|
|
15
|
+
tag: string;
|
|
16
|
+
expire_time?: string;
|
|
17
|
+
product_id: number;
|
|
18
|
+
relation_type: string;
|
|
19
|
+
par_value: string;
|
|
20
|
+
used_par_value: string;
|
|
21
|
+
limit_status: string;
|
|
22
|
+
limited_relation_product_data: any;
|
|
23
|
+
balance: string;
|
|
24
|
+
format_title: any;
|
|
25
|
+
product: any;
|
|
26
|
+
savedAmount: number;
|
|
27
|
+
isDisabled: boolean;
|
|
28
|
+
isSelected?: boolean;
|
|
29
|
+
isAvailable?: boolean;
|
|
30
|
+
isUsed?: boolean;
|
|
31
|
+
applicableProductIds?: number[];
|
|
32
|
+
applicableProductDetails: ApplicableProductDetails[];
|
|
33
|
+
appliedProductDetails: any[];
|
|
34
|
+
}
|
|
35
|
+
export interface PisellGoodPassCardProps {
|
|
36
|
+
/**数据源 */
|
|
37
|
+
dataSource: Array<Discount>;
|
|
38
|
+
/**事件 */
|
|
39
|
+
onChange?: (current: {
|
|
40
|
+
id: string | number;
|
|
41
|
+
isSelected: boolean;
|
|
42
|
+
}) => void;
|
|
43
|
+
/**样式 */
|
|
44
|
+
style: React.CSSProperties;
|
|
45
|
+
}
|
|
46
|
+
declare const index: (props: PisellGoodPassCardProps) => JSX.Element;
|
|
47
|
+
export default index;
|
|
@@ -0,0 +1,109 @@
|
|
|
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/booking/components/voucher/pisellGoodPassCard/index.tsx
|
|
30
|
+
var pisellGoodPassCard_exports = {};
|
|
31
|
+
__export(pisellGoodPassCard_exports, {
|
|
32
|
+
default: () => pisellGoodPassCard_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellGoodPassCard_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_materials = require("@pisell/materials");
|
|
39
|
+
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var clsPrefix = "pisell-good-pass-card";
|
|
42
|
+
var index = (props) => {
|
|
43
|
+
var _a;
|
|
44
|
+
const context = (0, import_useEngineContext.default)();
|
|
45
|
+
const { translationShop } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
46
|
+
const { dataSource = [], onChange, style = {} } = props;
|
|
47
|
+
const [showModal, setShowModal] = (0, import_react.useState)(false);
|
|
48
|
+
console.log("pisell good card datasource", dataSource);
|
|
49
|
+
const handleChange = (newValue) => {
|
|
50
|
+
if (onChange) {
|
|
51
|
+
onChange(newValue);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const handleItemChange = (item, checked) => {
|
|
55
|
+
handleChange({
|
|
56
|
+
id: item.id,
|
|
57
|
+
isSelected: checked
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const renderVoucherContent = (item) => {
|
|
61
|
+
return /* @__PURE__ */ import_react.default.createElement("span", null, "Save ", /* @__PURE__ */ import_react.default.createElement(import_materials.PisellText.Amount, { value: item.savedAmount }));
|
|
62
|
+
};
|
|
63
|
+
const renderActionElement = (item) => {
|
|
64
|
+
const isChecked = item.isSelected;
|
|
65
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
import_antd.Checkbox,
|
|
67
|
+
{
|
|
68
|
+
disabled: item.isDisabled,
|
|
69
|
+
style: { marginLeft: 8 },
|
|
70
|
+
checked: isChecked,
|
|
71
|
+
onChange: (e) => handleItemChange(item, e.target.checked)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
const renderVoucherItem = (item) => {
|
|
76
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { key: item.id, className: `${clsPrefix}-voucher-item` }, /* @__PURE__ */ import_react.default.createElement("div", { className: "item-title" }, translationShop(item.format_title)), /* @__PURE__ */ import_react.default.createElement("div", { className: "item-content" }, renderVoucherContent(item), renderActionElement(item)));
|
|
77
|
+
};
|
|
78
|
+
const renderModal = () => {
|
|
79
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
80
|
+
import_materials.PisellModal,
|
|
81
|
+
{
|
|
82
|
+
title: "Vouchers",
|
|
83
|
+
footer: null,
|
|
84
|
+
open: showModal,
|
|
85
|
+
onCancel: () => setShowModal(false),
|
|
86
|
+
className: `${clsPrefix}-all-items-modal`
|
|
87
|
+
},
|
|
88
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "10px 0" } }, dataSource.map(renderVoucherItem))
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
const renderMixedMode = () => {
|
|
92
|
+
const list = dataSource.length > 3 ? dataSource.slice(0, 3) : dataSource;
|
|
93
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: `${clsPrefix}-header` }, /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.text.goodpass.product-vouchers")), /* @__PURE__ */ import_react.default.createElement(import_antd.Typography.Text, { underline: true, onClick: () => setShowModal(true) }, import_utils.locales.getText("pisell2.text.goodpass.view-more"))), /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, { style: { margin: 4 } }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${clsPrefix}-body` }, list.map(renderVoucherItem)));
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderModal(), /* @__PURE__ */ import_react.default.createElement(
|
|
96
|
+
import_materials.PisellCard,
|
|
97
|
+
{
|
|
98
|
+
padding: 8,
|
|
99
|
+
borderRadius: 8,
|
|
100
|
+
style: {
|
|
101
|
+
width: 378,
|
|
102
|
+
...style
|
|
103
|
+
},
|
|
104
|
+
className: clsPrefix
|
|
105
|
+
},
|
|
106
|
+
renderMixedMode()
|
|
107
|
+
));
|
|
108
|
+
};
|
|
109
|
+
var pisellGoodPassCard_default = index;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.pisell-good-pass-card-all-items-modal,
|
|
2
|
+
.pisell-good-pass-card {
|
|
3
|
+
.pisell-good-pass-card-header,
|
|
4
|
+
.pisell-good-pass-card-group-header {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
align-items: center;
|
|
8
|
+
color: var(--Gray-900, #101828);
|
|
9
|
+
text-align: center;
|
|
10
|
+
font-family: Inter;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
line-height: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pisell-good-pass-card-voucher-item {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
height: 22px;
|
|
22
|
+
|
|
23
|
+
.item-title {
|
|
24
|
+
color: var(--Gray-500, #667085);
|
|
25
|
+
text-align: center;
|
|
26
|
+
font-family: Inter;
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
font-style: normal;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
line-height: 20px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.item-content {
|
|
34
|
+
color: var(--, #8157d5);
|
|
35
|
+
font-family: Inter;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
font-style: normal;
|
|
38
|
+
font-weight: 400;
|
|
39
|
+
line-height: 20px;
|
|
40
|
+
|
|
41
|
+
.add-btn {
|
|
42
|
+
color: var(--, #8157d5);
|
|
43
|
+
text-align: center;
|
|
44
|
+
font-family: Inter;
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
font-style: normal;
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
line-height: 20px; /* 142.857% */
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|