@pisell/private-materials 3.3.74 → 3.3.76
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 +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/appointmentBooking/components/Cart/Item/index.js +2 -4
- package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.less +1 -1
- package/es/components/appointmentBooking/components/Date/index.js +14 -24
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +14 -8
- package/es/components/appointmentBooking/components/Services/index.js +36 -38
- package/es/components/appointmentBooking/components/Voucher/index.js +0 -13
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +7 -6
- package/es/components/appointmentBooking/index.js +0 -14
- package/es/components/appointmentBooking/index.less +1 -1
- package/es/components/appointmentBooking/locales.js +3 -3
- package/es/components/booking/addons/index.js +3 -12
- package/es/components/booking/addons/model.js +0 -5
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.js +1 -3
- package/es/components/booking/components/TabProduct/selectProductItem/index.less +0 -6
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/footer/amount.js +1 -2
- package/es/components/booking/components/footer/index.js +3 -9
- package/es/components/booking/components/footer/utils.js +35 -73
- package/es/components/booking/components/voucher/index.js +66 -110
- 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/useQuotation.d.ts +0 -1
- package/es/components/booking/hooks/useQuotation.js +1 -16
- package/es/components/booking/info/client/index.js +3 -12
- 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/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/header/index.d.ts +1 -0
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.js +1 -1
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.js +1 -3
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +2 -6
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/index.js +4 -9
- package/es/components/booking/info2/serve.d.ts +1 -1
- package/es/components/booking/info2/serve.js +8 -12
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/index.js +3 -5
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +2 -5
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info2/utils.d.ts +1 -1
- package/es/components/booking/info2/utils.js +2 -3
- package/es/components/booking/info2/utilsByBooking.d.ts +1 -1
- package/es/components/booking/info2/utilsByBooking.js +3 -5
- package/es/components/booking/locales.d.ts +0 -3
- package/es/components/booking/locales.js +3 -6
- 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/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/booking/notes/addNote/index.d.ts +1 -0
- package/es/components/booking/utils.d.ts +0 -1
- package/es/components/booking/utils.js +0 -4
- package/es/components/eftpos/index.d.ts +1 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +2 -1
- 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 +2 -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/payo/config.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eftposPay/tip.d.ts +1 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- 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/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/es/components/login/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/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/index.js +4 -5
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/ruleSetting/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/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/index.d.ts +1 -0
- package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/es/components/schedules/products/list/index.d.ts +1 -0
- package/es/components/schedules/resources/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.d.ts +1 -0
- package/es/components/schedules/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/Cart/Product.d.ts +0 -1
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +6 -9
- package/es/components/ticketBooking/components/ticketBooking/index.js +3 -124
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/locales.d.ts +146 -164
- package/es/components/ticketBooking/locales.js +147 -195
- package/es/components/ticketBooking/utils/index.d.ts +1 -5
- package/es/components/ticketBooking/utils/index.js +6 -58
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +4 -5
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.less +1 -1
- package/lib/components/appointmentBooking/components/Date/index.js +5 -12
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +3 -2
- package/lib/components/appointmentBooking/components/Services/index.js +18 -19
- package/lib/components/appointmentBooking/components/Voucher/index.js +0 -9
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -0
- package/lib/components/appointmentBooking/index.js +0 -11
- package/lib/components/appointmentBooking/index.less +1 -1
- package/lib/components/appointmentBooking/locales.js +3 -3
- package/lib/components/booking/addons/index.js +2 -12
- package/lib/components/booking/addons/model.js +0 -3
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/selectProductItem/index.js +1 -5
- package/lib/components/booking/components/TabProduct/selectProductItem/index.less +0 -6
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.js +1 -2
- package/lib/components/booking/components/footer/index.js +5 -10
- package/lib/components/booking/components/footer/utils.js +11 -47
- package/lib/components/booking/components/voucher/index.js +67 -111
- 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/useQuotation.d.ts +0 -1
- package/lib/components/booking/hooks/useQuotation.js +1 -19
- package/lib/components/booking/info/client/index.js +3 -10
- 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/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/header/index.d.ts +1 -0
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.js +1 -1
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.js +0 -2
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +1 -3
- package/lib/components/booking/info/utils.js +3 -1
- package/lib/components/booking/info2/index.js +9 -9
- package/lib/components/booking/info2/serve.d.ts +1 -1
- package/lib/components/booking/info2/serve.js +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/index.js +2 -4
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +2 -5
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info2/utils.d.ts +1 -1
- package/lib/components/booking/info2/utils.js +2 -2
- package/lib/components/booking/info2/utilsByBooking.d.ts +1 -1
- package/lib/components/booking/info2/utilsByBooking.js +2 -3
- package/lib/components/booking/locales.d.ts +0 -3
- package/lib/components/booking/locales.js +3 -6
- 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/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/lib/components/booking/notes/addNote/index.d.ts +1 -0
- package/lib/components/booking/utils.d.ts +0 -1
- package/lib/components/booking/utils.js +0 -6
- package/lib/components/eftpos/index.d.ts +1 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +2 -1
- 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 +2 -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/payo/config.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eftposPay/tip.d.ts +1 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- 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/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/lib/components/login/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/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/ruleSetting/index.d.ts +1 -0
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/lib/components/schedules/calendar/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/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/index.d.ts +1 -0
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/lib/components/schedules/products/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/resources/list/index.d.ts +1 -0
- package/lib/components/schedules/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/Cart/Product.d.ts +0 -1
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/taxSelect/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +4 -8
- package/lib/components/ticketBooking/components/ticketBooking/index.js +3 -124
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/locales.d.ts +146 -164
- package/lib/components/ticketBooking/locales.js +4 -22
- package/lib/components/ticketBooking/utils/index.d.ts +1 -5
- package/lib/components/ticketBooking/utils/index.js +5 -48
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/package.json +4 -4
- package/es/components/booking/components/voucher/utils.d.ts +0 -4
- package/es/components/booking/components/voucher/utils.js +0 -15
- package/es/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
- package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
- package/es/components/ticketBooking/utils/formatTime.d.ts +0 -31
- package/es/components/ticketBooking/utils/formatTime.js +0 -144
- package/lib/components/booking/components/voucher/utils.d.ts +0 -4
- package/lib/components/booking/components/voucher/utils.js +0 -43
- package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
- package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
- package/lib/components/ticketBooking/utils/formatTime.d.ts +0 -31
- package/lib/components/ticketBooking/utils/formatTime.js +0 -139
|
@@ -55,8 +55,7 @@ var getProductAmount = function getProductAmount(state, isEdit) {
|
|
|
55
55
|
var _duration = isDayBookingProduct(_item, state) ? _item._extend.duration : 0;
|
|
56
56
|
duration += _duration;
|
|
57
57
|
} else {
|
|
58
|
-
|
|
59
|
-
price += Number(_item._extend.total) * Number(_quantity);
|
|
58
|
+
price += Number(_item._extend.total);
|
|
60
59
|
|
|
61
60
|
// 附加商品
|
|
62
61
|
price += getRelationDetailsTotal(_item._extend.relation_details || []);
|
|
@@ -47,7 +47,7 @@ import dayjs from 'dayjs';
|
|
|
47
47
|
* @Date: 2024-01-30 16:51
|
|
48
48
|
*/
|
|
49
49
|
var Footer = function Footer(props) {
|
|
50
|
-
var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _businessUtils$getApp,
|
|
50
|
+
var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _businessUtils$getApp, _state$addons4, _state$bookingDetail12, _state$bookingDetail13;
|
|
51
51
|
var state = props.state,
|
|
52
52
|
buttons = props.buttons,
|
|
53
53
|
dispatch = props.dispatch,
|
|
@@ -240,7 +240,6 @@ var Footer = function Footer(props) {
|
|
|
240
240
|
|
|
241
241
|
// 是否安装商品券应用
|
|
242
242
|
var hasGoodPassApp = !!(businessUtils !== null && businessUtils !== void 0 && (_businessUtils$getApp = businessUtils.getAppByModal) !== null && _businessUtils$getApp !== void 0 && _businessUtils$getApp.call(businessUtils, 'goodpass'));
|
|
243
|
-
var hasDiscountCardApp = !!(businessUtils !== null && businessUtils !== void 0 && (_businessUtils$getApp2 = businessUtils.getAppByModal) !== null && _businessUtils$getApp2 !== void 0 && _businessUtils$getApp2.call(businessUtils, 'discountcard'));
|
|
244
243
|
console.log('has goodpass app:', hasGoodPassApp);
|
|
245
244
|
|
|
246
245
|
/**
|
|
@@ -1292,19 +1291,14 @@ var Footer = function Footer(props) {
|
|
|
1292
1291
|
label: locales.getText('pisell2.text.refunded-amount')
|
|
1293
1292
|
}];
|
|
1294
1293
|
}, [total, (_state$bookingDetail13 = state.bookingDetail) === null || _state$bookingDetail13 === void 0 ? void 0 : _state$bookingDetail13.surcharge, state, state.bookingId]);
|
|
1295
|
-
var paymentRefundedStatus = useMemo(function () {
|
|
1296
|
-
var _state$bookingDetail14;
|
|
1297
|
-
return ['partially_refunded', 'refunded'].includes(state === null || state === void 0 || (_state$bookingDetail14 = state.bookingDetail) === null || _state$bookingDetail14 === void 0 ? void 0 : _state$bookingDetail14.payment_status);
|
|
1298
|
-
}, [state === null || state === void 0 ? void 0 : state.bookingDetail]);
|
|
1299
1294
|
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
1300
1295
|
title: false,
|
|
1301
1296
|
round: true,
|
|
1302
1297
|
loading: showFooter,
|
|
1303
1298
|
active: true
|
|
1304
|
-
},
|
|
1299
|
+
}, hasGoodPassApp && source === 'info' ? /*#__PURE__*/React.createElement(VoucherCard, {
|
|
1305
1300
|
state: state,
|
|
1306
|
-
dispatch: dispatch
|
|
1307
|
-
source: source
|
|
1301
|
+
dispatch: dispatch
|
|
1308
1302
|
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
1309
1303
|
className: "pisell-lowcode__booking-footer-total"
|
|
1310
1304
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -11,7 +11,7 @@ import { getSumCapacity } from "../../info2/utilsByBooking";
|
|
|
11
11
|
import { getDays } from "../../utils";
|
|
12
12
|
import { appointmentTypes } from "../../info/service2/status";
|
|
13
13
|
import { isDaysBooking, formatDayTime, isEventBooking, isNormalProductByDurationSchedule } from "../../info/service2/utils";
|
|
14
|
-
import {
|
|
14
|
+
import { locales, sendWarningLog } from '@pisell/utils';
|
|
15
15
|
import { PisellToast } from "@pisell/materials";
|
|
16
16
|
var formatNote = function formatNote(data) {
|
|
17
17
|
var _data$notes;
|
|
@@ -198,17 +198,12 @@ var formatResource = function formatResource(service) {
|
|
|
198
198
|
* @Date: 2024-12-07 14:52
|
|
199
199
|
*/
|
|
200
200
|
var formatHolders = function formatHolders(state, item, values) {
|
|
201
|
-
var _state$bookingConfig, _item$_extend, _item$_extend2
|
|
201
|
+
var _state$bookingConfig, _item$_extend, _item$_extend2;
|
|
202
202
|
var form_id = (state === null || state === void 0 || (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.config) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.basic) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.appointment_subject) === null || _state$bookingConfig === void 0 ? void 0 : _state$bookingConfig.form_id) || 0;
|
|
203
|
-
var form_record = (_item$_extend = item._extend) !== null && _item$_extend !== void 0 && _item$_extend.holder_id ? [(_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.holder_id] : [];
|
|
204
|
-
if ((_item$_extend3 = item._extend) !== null && _item$_extend3 !== void 0 && _item$_extend3.holder_id && isArr((_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.holder_id)) {
|
|
205
|
-
var _item$_extend5;
|
|
206
|
-
form_record = (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.holder_id;
|
|
207
|
-
}
|
|
208
203
|
var obj = {
|
|
209
204
|
customer_id: values.customer_id,
|
|
210
205
|
form_id: form_id,
|
|
211
|
-
form_record:
|
|
206
|
+
form_record: (_item$_extend = item._extend) !== null && _item$_extend !== void 0 && _item$_extend.holder_id ? [(_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.holder_id] : []
|
|
212
207
|
};
|
|
213
208
|
|
|
214
209
|
// 连锁加盟子店铺 增加参数
|
|
@@ -227,9 +222,9 @@ var formatHolders = function formatHolders(state, item, values) {
|
|
|
227
222
|
* @Date: 2024-12-23 12:05
|
|
228
223
|
*/
|
|
229
224
|
export var formatProductPrice = function formatProductPrice(item) {
|
|
230
|
-
var _item$
|
|
231
|
-
var other = (_item$
|
|
232
|
-
var price = Number((_item$
|
|
225
|
+
var _item$_extend3, _item$_extend4;
|
|
226
|
+
var other = (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.other;
|
|
227
|
+
var price = Number((_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.price);
|
|
233
228
|
// 单规格, 单价 + 单规格价格
|
|
234
229
|
if (other !== null && other !== void 0 && other.option) {
|
|
235
230
|
var _other$option;
|
|
@@ -240,21 +235,21 @@ export var formatProductPrice = function formatProductPrice(item) {
|
|
|
240
235
|
return price;
|
|
241
236
|
};
|
|
242
237
|
var formatMetaData = function formatMetaData(item) {
|
|
243
|
-
var _item$
|
|
238
|
+
var _item$_extend5, _item$_extend6, _item$_extend8;
|
|
244
239
|
var metadata = {};
|
|
245
|
-
if ((_item$
|
|
240
|
+
if ((_item$_extend5 = item._extend) !== null && _item$_extend5 !== void 0 && _item$_extend5.capacity) {
|
|
246
241
|
metadata.capacity = item._extend.capacity;
|
|
247
242
|
}
|
|
248
243
|
if (item._extend.groupId) {
|
|
249
244
|
metadata.groupId = item._extend.groupId;
|
|
250
245
|
}
|
|
251
|
-
if ((_item$
|
|
252
|
-
var _item$
|
|
253
|
-
metadata.holder_id = (_item$
|
|
246
|
+
if ((_item$_extend6 = item._extend) !== null && _item$_extend6 !== void 0 && _item$_extend6.holder_id) {
|
|
247
|
+
var _item$_extend7;
|
|
248
|
+
metadata.holder_id = (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.holder_id;
|
|
254
249
|
}
|
|
255
|
-
if ((_item$
|
|
256
|
-
var _item$
|
|
257
|
-
metadata.multiDayPrices = (_item$
|
|
250
|
+
if ((_item$_extend8 = item._extend) !== null && _item$_extend8 !== void 0 && _item$_extend8.multiDayPrices) {
|
|
251
|
+
var _item$_extend9;
|
|
252
|
+
metadata.multiDayPrices = (_item$_extend9 = item._extend) === null || _item$_extend9 === void 0 ? void 0 : _item$_extend9.multiDayPrices;
|
|
258
253
|
}
|
|
259
254
|
return metadata;
|
|
260
255
|
};
|
|
@@ -281,8 +276,8 @@ var formatMetaData = function formatMetaData(item) {
|
|
|
281
276
|
* @Author: WangHan
|
|
282
277
|
* @Date: 2024-12-07 14:21
|
|
283
278
|
*/
|
|
284
|
-
var formatProducts = function formatProducts(item
|
|
285
|
-
var _item$
|
|
279
|
+
var formatProducts = function formatProducts(item) {
|
|
280
|
+
var _item$_extend10, _item$_extend11, _item$_extend12, _item$_extend13;
|
|
286
281
|
var total = Number(item._extend.total);
|
|
287
282
|
var origin_total = Number(item._extend.origin_total);
|
|
288
283
|
var discount_amount = origin_total - total;
|
|
@@ -296,9 +291,9 @@ var formatProducts = function formatProducts(item, quantity) {
|
|
|
296
291
|
return item.type !== 'product';
|
|
297
292
|
});
|
|
298
293
|
return {
|
|
299
|
-
"num":
|
|
294
|
+
"num": item._extend.quantity,
|
|
300
295
|
"price": formatProductPrice(item),
|
|
301
|
-
"source_product_price": (_item$
|
|
296
|
+
"source_product_price": (_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.price,
|
|
302
297
|
"product_id": (item === null || item === void 0 ? void 0 : item.product_id) || item.id,
|
|
303
298
|
"discount_amount": notManualDiscount.length > 0 ? 0 : discount_amount,
|
|
304
299
|
"product_discount_reason": item._extend.discount_reason || '',
|
|
@@ -308,10 +303,10 @@ var formatProducts = function formatProducts(item, quantity) {
|
|
|
308
303
|
"discount_per": item._extend.discount_per,
|
|
309
304
|
"discount_type": item._extend.discount_type || discount_type,
|
|
310
305
|
"order_detail_id": item._extend.order_detail_id || 0,
|
|
311
|
-
"product_bundle": formatProductBundle((_item$
|
|
306
|
+
"product_bundle": formatProductBundle((_item$_extend11 = item._extend) === null || _item$_extend11 === void 0 || (_item$_extend11 = _item$_extend11.other) === null || _item$_extend11 === void 0 ? void 0 : _item$_extend11.bundle),
|
|
312
307
|
"bundle_edit": item._extend.bundle_edit,
|
|
313
|
-
"product_option_item": formatProductOption((_item$
|
|
314
|
-
"product_variant_id": ((_item$
|
|
308
|
+
"product_option_item": formatProductOption((_item$_extend12 = item._extend) === null || _item$_extend12 === void 0 || (_item$_extend12 = _item$_extend12.other) === null || _item$_extend12 === void 0 ? void 0 : _item$_extend12.option),
|
|
309
|
+
"product_variant_id": ((_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 || (_item$_extend13 = _item$_extend13.other) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.product_variant_id) || 0,
|
|
315
310
|
"discount_list": notManualDiscount,
|
|
316
311
|
metadata: formatMetaData(item)
|
|
317
312
|
};
|
|
@@ -331,8 +326,8 @@ var formatDayRelationProducts = function formatDayRelationProducts(data, booking
|
|
|
331
326
|
|
|
332
327
|
// 过滤出卡片中的普通商品
|
|
333
328
|
var relation_products = list === null || list === void 0 ? void 0 : list.filter(function (item) {
|
|
334
|
-
var _item$
|
|
335
|
-
var holderId = (_item$
|
|
329
|
+
var _item$_extend14;
|
|
330
|
+
var holderId = (_item$_extend14 = item._extend) === null || _item$_extend14 === void 0 ? void 0 : _item$_extend14.holder_id;
|
|
336
331
|
var bookingHolderId = booking_item._extend.holder_id;
|
|
337
332
|
var isDayBookingProduct = appointmentTypes.includes(item.extension_type);
|
|
338
333
|
return holderId && holderId === bookingHolderId && !isDayBookingProduct;
|
|
@@ -358,15 +353,15 @@ var formatAppointmentProductLists = function formatAppointmentProductLists(data)
|
|
|
358
353
|
|
|
359
354
|
// 找出预约商品
|
|
360
355
|
list = list.filter(function (item) {
|
|
361
|
-
var _item$
|
|
362
|
-
return ((_item$
|
|
356
|
+
var _item$_extend15;
|
|
357
|
+
return ((_item$_extend15 = item._extend) === null || _item$_extend15 === void 0 ? void 0 : _item$_extend15.holder_id) && appointmentTypes.includes(item.extension_type);
|
|
363
358
|
});
|
|
364
359
|
|
|
365
360
|
// 对预约商品列表根据holder_id进行分组
|
|
366
361
|
var groupMap = new Map();
|
|
367
362
|
list.forEach(function (item) {
|
|
368
|
-
var _item$
|
|
369
|
-
var key = (_item$
|
|
363
|
+
var _item$_extend16;
|
|
364
|
+
var key = (_item$_extend16 = item._extend) === null || _item$_extend16 === void 0 ? void 0 : _item$_extend16.holder_id; // 分组键
|
|
370
365
|
if (!groupMap.has(key)) {
|
|
371
366
|
groupMap.set(key, []);
|
|
372
367
|
}
|
|
@@ -386,12 +381,6 @@ var formatAppointmentProductLists = function formatAppointmentProductLists(data)
|
|
|
386
381
|
return list || [];
|
|
387
382
|
} catch (error) {}
|
|
388
383
|
};
|
|
389
|
-
var getHolderByIndex = function getHolderByIndex(holder, index) {
|
|
390
|
-
var _holder$form_record;
|
|
391
|
-
return _objectSpread(_objectSpread({}, holder), {}, {
|
|
392
|
-
form_record: [holder === null || holder === void 0 || (_holder$form_record = holder.form_record) === null || _holder$form_record === void 0 ? void 0 : _holder$form_record[index]].filter(Boolean)
|
|
393
|
-
});
|
|
394
|
-
};
|
|
395
384
|
|
|
396
385
|
/**
|
|
397
386
|
* @title: 预约商品信息
|
|
@@ -425,7 +414,7 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
425
414
|
var dayParams = {};
|
|
426
415
|
var eventOtherParams = data.eventOtherParams;
|
|
427
416
|
var bookings = [];
|
|
428
|
-
list.
|
|
417
|
+
bookings = list.map(function (item) {
|
|
429
418
|
var start_date = item._extend.startDate.format('YYYY-MM-DD');
|
|
430
419
|
var end_date = item._extend.endDate.format('YYYY-MM-DD');
|
|
431
420
|
var end_time = item._extend.endDate.format("HH:mm");
|
|
@@ -439,9 +428,9 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
439
428
|
|
|
440
429
|
// 跨日预约下的普通商品
|
|
441
430
|
if (isDay) {
|
|
442
|
-
var _item$
|
|
443
|
-
var startDate = ((_item$
|
|
444
|
-
var endDate = ((_item$
|
|
431
|
+
var _item$_extend17, _item$_extend18, _item$_extend19, _item$_extend20;
|
|
432
|
+
var startDate = ((_item$_extend17 = item._extend) === null || _item$_extend17 === void 0 ? void 0 : _item$_extend17.startDate) || ((_item$_extend18 = item._extend) === null || _item$_extend18 === void 0 ? void 0 : _item$_extend18.start_date);
|
|
433
|
+
var endDate = ((_item$_extend19 = item._extend) === null || _item$_extend19 === void 0 ? void 0 : _item$_extend19.endDate) || ((_item$_extend20 = item._extend) === null || _item$_extend20 === void 0 ? void 0 : _item$_extend20.end_date);
|
|
445
434
|
var _formatDayTime = formatDayTime({
|
|
446
435
|
startDate: startDate,
|
|
447
436
|
endDate: endDate
|
|
@@ -463,7 +452,7 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
463
452
|
}
|
|
464
453
|
}, 'minutes');
|
|
465
454
|
}
|
|
466
|
-
|
|
455
|
+
return _objectSpread(_objectSpread({
|
|
467
456
|
"product": formatProducts(item),
|
|
468
457
|
"relation_products": formatRelationDetails(item._extend.relation_details),
|
|
469
458
|
'id': item.booking_id || 0,
|
|
@@ -485,19 +474,6 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
485
474
|
"resources": formatResource(item),
|
|
486
475
|
"metadata": formatMetaData(item)
|
|
487
476
|
}, eventOtherParams || {}), dayParams);
|
|
488
|
-
if (isDay) {
|
|
489
|
-
bookings.push(booking);
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
for (var i = 0; i < (item._extend.quantity || 1); i++) {
|
|
493
|
-
bookings.push(_objectSpread(_objectSpread({}, booking), {}, {
|
|
494
|
-
"product": formatProducts(item, 1),
|
|
495
|
-
"number": item._extend.capacity ? getSumCapacity({
|
|
496
|
-
cacheItem: item
|
|
497
|
-
}, false) : item._extend.number || 1,
|
|
498
|
-
"holder": getHolderByIndex(booking.holder, i)
|
|
499
|
-
}));
|
|
500
|
-
}
|
|
501
477
|
});
|
|
502
478
|
return bookings;
|
|
503
479
|
};
|
|
@@ -515,8 +491,8 @@ var formatRelationProducts = function formatRelationProducts(data) {
|
|
|
515
491
|
var list = ((_data$service = data.service) === null || _data$service === void 0 ? void 0 : _data$service.value) || [];
|
|
516
492
|
// open items 下的商品
|
|
517
493
|
list = list.filter(function (item) {
|
|
518
|
-
var _item$
|
|
519
|
-
return !((_item$
|
|
494
|
+
var _item$_extend21;
|
|
495
|
+
return !((_item$_extend21 = item._extend) !== null && _item$_extend21 !== void 0 && _item$_extend21.holder_id);
|
|
520
496
|
});
|
|
521
497
|
var relationProducts = [];
|
|
522
498
|
relationProducts = list.map(function (item) {
|
|
@@ -611,11 +587,7 @@ export var formatValues = function formatValues(state) {
|
|
|
611
587
|
if (isDay || isEvent) {
|
|
612
588
|
values.relation_products = formatRelationProducts(state);
|
|
613
589
|
} else {
|
|
614
|
-
var _values$relation_prod;
|
|
615
590
|
values.relation_products = formatNormalProducts(state);
|
|
616
|
-
if (!((_values$relation_prod = values.relation_products) !== null && _values$relation_prod !== void 0 && _values$relation_prod.length)) {
|
|
617
|
-
values.relation_products = undefined;
|
|
618
|
-
}
|
|
619
591
|
}
|
|
620
592
|
// 服务
|
|
621
593
|
values.bookings = formatBookings(state, values);
|
|
@@ -645,18 +617,8 @@ export var formatValues = function formatValues(state) {
|
|
|
645
617
|
export var checkHolderIsError = function checkHolderIsError(state) {
|
|
646
618
|
var _state$client;
|
|
647
619
|
var holderError = state.service.value.some(function (item) {
|
|
648
|
-
var _item$_extend25;
|
|
649
620
|
// 普通商品不需要检测holder
|
|
650
|
-
|
|
651
|
-
return false;
|
|
652
|
-
}
|
|
653
|
-
if (item._extend.quantity === 1 && !item._extend.holder_id) {
|
|
654
|
-
return true;
|
|
655
|
-
}
|
|
656
|
-
if (item._extend.quantity > 1 && ((_item$_extend25 = item._extend) === null || _item$_extend25 === void 0 || (_item$_extend25 = _item$_extend25.holder_id) === null || _item$_extend25 === void 0 ? void 0 : _item$_extend25.length) !== item._extend.quantity) {
|
|
657
|
-
return true;
|
|
658
|
-
}
|
|
659
|
-
return false;
|
|
621
|
+
return !item._extend.holder_id && !isNormalProductByDurationSchedule(item);
|
|
660
622
|
});
|
|
661
623
|
var clientId = (_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id;
|
|
662
624
|
if (holderError && (!clientId || clientId === 0 || clientId === 1)) {
|
|
@@ -7,10 +7,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
13
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
11
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
12
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -26,8 +22,7 @@ import useEngineContext from "../../../../hooks/useEngineContext";
|
|
|
26
22
|
import { PisellInput, PisellGoodPassCard, PisellToast } from '@pisell/materials';
|
|
27
23
|
import { useIsBooking4Shop } from "../../hooks/useIsBooking4Shop";
|
|
28
24
|
import "./index.less";
|
|
29
|
-
import { useMemoizedFn, useDebounceFn
|
|
30
|
-
import { getServiceAddons } from "./utils";
|
|
25
|
+
import { useMemoizedFn, useDebounceFn } from 'ahooks';
|
|
31
26
|
var ShopDiscountHooks = {
|
|
32
27
|
onInited: 'shopDiscount:onInited',
|
|
33
28
|
onDestroy: 'shopDiscount:onDestroy',
|
|
@@ -40,11 +35,10 @@ var ShopDiscountHooks = {
|
|
|
40
35
|
};
|
|
41
36
|
var services = {};
|
|
42
37
|
var VoucherCard = function VoucherCard(props) {
|
|
43
|
-
var _context$appHelper, _state$client$value
|
|
38
|
+
var _context$appHelper, _state$client$value;
|
|
44
39
|
var context = useEngineContext();
|
|
45
40
|
var state = props.state,
|
|
46
|
-
dispatch = props.dispatch
|
|
47
|
-
source = props.source;
|
|
41
|
+
dispatch = props.dispatch;
|
|
48
42
|
var _useState = useState(false),
|
|
49
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
50
44
|
showDetail = _useState2[0],
|
|
@@ -59,27 +53,35 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
59
53
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
60
54
|
discountList = _useState6[0],
|
|
61
55
|
setDisCountList = _useState6[1];
|
|
62
|
-
var
|
|
63
|
-
var addonsValueRef = useRef(state.addons.value);
|
|
56
|
+
var productRef = useRef(state.service.value);
|
|
64
57
|
var isBooking4Shop = useIsBooking4Shop(state);
|
|
65
58
|
var shopDiscount = pisellos.getModule('shopDiscount');
|
|
66
59
|
services = state.service;
|
|
60
|
+
var availableData = useMemo(function () {
|
|
61
|
+
if (!isBooking4Shop) return [];
|
|
62
|
+
var shopDiscount = pisellos.getModule('shopDiscount');
|
|
63
|
+
return discountList.filter(function (item) {
|
|
64
|
+
return !!item.isAvailable;
|
|
65
|
+
}).map(function (discount) {
|
|
66
|
+
return _objectSpread(_objectSpread({}, discount), {}, {
|
|
67
|
+
savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice(discount)
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}, [discountList, isBooking4Shop]);
|
|
67
71
|
|
|
68
72
|
// 设置client
|
|
69
|
-
|
|
73
|
+
useEffect(function () {
|
|
70
74
|
if (isBooking4Shop) {
|
|
71
75
|
shopDiscount.setCustomer(state.client.value);
|
|
72
76
|
}
|
|
73
|
-
}, [(_state$client$value = state.client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id, isBooking4Shop]
|
|
74
|
-
wait: 200
|
|
75
|
-
});
|
|
77
|
+
}, [(_state$client$value = state.client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id, isBooking4Shop]);
|
|
76
78
|
|
|
77
79
|
// 设置productList
|
|
78
80
|
useEffect(function () {
|
|
79
81
|
if (isBooking4Shop) {
|
|
80
|
-
shopDiscount.setProductList(
|
|
82
|
+
shopDiscount.setProductList(state.service.value);
|
|
81
83
|
}
|
|
82
|
-
}, [state.service.value,
|
|
84
|
+
}, [state.service.value, isBooking4Shop]);
|
|
83
85
|
var serviceMemo = useMemo(function () {
|
|
84
86
|
var _ref;
|
|
85
87
|
var val = (_ref = state.service.value || []) === null || _ref === void 0 ? void 0 : _ref.map(function (value) {
|
|
@@ -87,6 +89,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
87
89
|
return {
|
|
88
90
|
booking_id: value.booking_id,
|
|
89
91
|
id: value.id,
|
|
92
|
+
_id: value._id,
|
|
90
93
|
price: value.price,
|
|
91
94
|
total: value === null || value === void 0 || (_value$_extend = value._extend) === null || _value$_extend === void 0 ? void 0 : _value$_extend.total,
|
|
92
95
|
discount_list: value.discount_list,
|
|
@@ -95,43 +98,24 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
95
98
|
});
|
|
96
99
|
return val;
|
|
97
100
|
}, [state.service.value]);
|
|
98
|
-
var addonsMemo = useMemo(function () {
|
|
99
|
-
var _ref2;
|
|
100
|
-
var val = (_ref2 = state.addons.value || []) === null || _ref2 === void 0 ? void 0 : _ref2.map(function (value) {
|
|
101
|
-
var _value$_extend3, _value$_extend4;
|
|
102
|
-
return {
|
|
103
|
-
booking_id: value.booking_id,
|
|
104
|
-
id: value.id,
|
|
105
|
-
_id: value._id,
|
|
106
|
-
price: value.price,
|
|
107
|
-
total: value === null || value === void 0 || (_value$_extend3 = value._extend) === null || _value$_extend3 === void 0 ? void 0 : _value$_extend3.total,
|
|
108
|
-
discount_list: value.discount_list,
|
|
109
|
-
_key: value._key,
|
|
110
|
-
num: value === null || value === void 0 || (_value$_extend4 = value._extend) === null || _value$_extend4 === void 0 ? void 0 : _value$_extend4.quantity
|
|
111
|
-
};
|
|
112
|
-
});
|
|
113
|
-
return val;
|
|
114
|
-
}, [state.addons.value]);
|
|
115
|
-
var disabled = useMemo(function () {
|
|
116
|
-
var _state$bookingDetail;
|
|
117
|
-
if (['paid', 'partially_paid'].includes((_state$bookingDetail = state.bookingDetail) === null || _state$bookingDetail === void 0 ? void 0 : _state$bookingDetail.payment_status) && [].concat(_toConsumableArray(addonsMemo), _toConsumableArray(serviceMemo)).every(function (item) {
|
|
118
|
-
return item.booking_id;
|
|
119
|
-
})) {
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
return false;
|
|
123
|
-
}, [state, addonsMemo, serviceMemo]);
|
|
124
101
|
var _useDebounceFn = useDebounceFn(function () {
|
|
125
102
|
var _state$service;
|
|
126
103
|
// console.log('state.service.value1', state.service.value);
|
|
127
|
-
if (
|
|
104
|
+
if (productRef.current === state.service.value || !((_state$service = state.service) !== null && _state$service !== void 0 && (_state$service = _state$service.value) !== null && _state$service !== void 0 && _state$service.length)) {
|
|
128
105
|
return;
|
|
129
106
|
}
|
|
130
107
|
if (isBooking4Shop) {
|
|
131
|
-
var val = shopDiscount.calcDiscount(
|
|
132
|
-
console.log('input: ', state.service.value);
|
|
133
|
-
console.log('output: ', val);
|
|
134
|
-
|
|
108
|
+
var val = shopDiscount.calcDiscount(state.service.value);
|
|
109
|
+
// console.log('input: ', state.service.value);
|
|
110
|
+
// console.log('output: ', val);
|
|
111
|
+
productRef.current = val.productList;
|
|
112
|
+
// console.log('val.productList', val.productList);
|
|
113
|
+
dispatch({
|
|
114
|
+
type: 'setService',
|
|
115
|
+
payload: _objectSpread(_objectSpread({}, services), {}, {
|
|
116
|
+
value: ((val === null || val === void 0 ? void 0 : val.productList) || []).filter(Boolean)
|
|
117
|
+
})
|
|
118
|
+
});
|
|
135
119
|
}
|
|
136
120
|
}, {
|
|
137
121
|
wait: 500
|
|
@@ -141,7 +125,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
141
125
|
// 更新productList
|
|
142
126
|
useEffect(function () {
|
|
143
127
|
run();
|
|
144
|
-
}, [JSON.stringify(serviceMemo),
|
|
128
|
+
}, [JSON.stringify(serviceMemo), isBooking4Shop]);
|
|
145
129
|
var fn = useMemoizedFn(function (result) {
|
|
146
130
|
var _result$productList;
|
|
147
131
|
if (!(result !== null && result !== void 0 && result.productList) || result !== null && result !== void 0 && (_result$productList = result.productList) !== null && _result$productList !== void 0 && _result$productList.some(function (item) {
|
|
@@ -149,13 +133,18 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
149
133
|
})) {
|
|
150
134
|
return;
|
|
151
135
|
}
|
|
152
|
-
|
|
136
|
+
dispatch({
|
|
137
|
+
type: 'setService',
|
|
138
|
+
payload: _objectSpread(_objectSpread({}, services), {}, {
|
|
139
|
+
value: result.productList
|
|
140
|
+
})
|
|
141
|
+
});
|
|
153
142
|
});
|
|
154
143
|
|
|
155
144
|
// 监听customer变化
|
|
156
145
|
useEffect(function () {
|
|
157
146
|
if (!isBooking4Shop) return;
|
|
158
|
-
|
|
147
|
+
pisellos.effects.on(ShopDiscountHooks.onScanCustomerChange, function (customer) {
|
|
159
148
|
// 更新客户
|
|
160
149
|
dispatch({
|
|
161
150
|
type: 'setClient',
|
|
@@ -163,49 +152,22 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
163
152
|
value: customer
|
|
164
153
|
}
|
|
165
154
|
});
|
|
166
|
-
};
|
|
167
|
-
var onDiscountListChange = function onDiscountListChange(discount) {
|
|
168
|
-
setDisCountList(discount);
|
|
169
|
-
};
|
|
170
|
-
pisellos.effects.on(ShopDiscountHooks.onScanCustomerChange, onScanCustomerChange);
|
|
155
|
+
});
|
|
171
156
|
pisellos.effects.on(ShopDiscountHooks.onLoadPrepareCalcResult, fn);
|
|
172
|
-
pisellos.effects.on(ShopDiscountHooks.onDiscountListChange,
|
|
157
|
+
pisellos.effects.on(ShopDiscountHooks.onDiscountListChange, function (discount) {
|
|
158
|
+
setDisCountList(discount);
|
|
159
|
+
});
|
|
173
160
|
return function () {
|
|
174
161
|
shopDiscount.clear();
|
|
175
|
-
pisellos.effects.off(ShopDiscountHooks.onCustomerChange
|
|
176
|
-
pisellos.effects.off(ShopDiscountHooks.onLoadPrepareCalcResult
|
|
177
|
-
pisellos.effects.off(ShopDiscountHooks.onDiscountListChange
|
|
162
|
+
pisellos.effects.off(ShopDiscountHooks.onCustomerChange);
|
|
163
|
+
pisellos.effects.off(ShopDiscountHooks.onLoadPrepareCalcResult);
|
|
164
|
+
pisellos.effects.off(ShopDiscountHooks.onDiscountListChange);
|
|
178
165
|
};
|
|
179
166
|
}, [state.bookingId, isBooking4Shop, fn]);
|
|
180
|
-
var productListToValue = useMemoizedFn(function (list, edit) {
|
|
181
|
-
var _getServiceAddons = getServiceAddons(list),
|
|
182
|
-
serviceList = _getServiceAddons.serviceList,
|
|
183
|
-
addonsList = _getServiceAddons.addonsList;
|
|
184
|
-
serviceValueRef.current = serviceList;
|
|
185
|
-
addonsValueRef.current = addonsList;
|
|
186
|
-
var other = {};
|
|
187
|
-
if (edit) {
|
|
188
|
-
other = {
|
|
189
|
-
edit: true
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
dispatch({
|
|
193
|
-
type: 'setService',
|
|
194
|
-
payload: _objectSpread({
|
|
195
|
-
value: serviceList
|
|
196
|
-
}, other)
|
|
197
|
-
});
|
|
198
|
-
dispatch({
|
|
199
|
-
type: 'setAddons',
|
|
200
|
-
payload: _objectSpread({
|
|
201
|
-
value: addonsList
|
|
202
|
-
}, other)
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
167
|
|
|
206
168
|
// apply code
|
|
207
169
|
var onScanCode = /*#__PURE__*/function () {
|
|
208
|
-
var
|
|
170
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
209
171
|
var val;
|
|
210
172
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
211
173
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -216,11 +178,18 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
216
178
|
val = _context.sent;
|
|
217
179
|
console.log(val);
|
|
218
180
|
if (val !== null && val !== void 0 && val.isAvailable) {
|
|
219
|
-
|
|
181
|
+
productRef.current = val.productList;
|
|
182
|
+
dispatch({
|
|
183
|
+
type: 'setService',
|
|
184
|
+
payload: {
|
|
185
|
+
value: val.productList,
|
|
186
|
+
edit: true
|
|
187
|
+
}
|
|
188
|
+
});
|
|
220
189
|
setCode('');
|
|
221
190
|
} else {
|
|
222
191
|
PisellToast({
|
|
223
|
-
content:
|
|
192
|
+
content: locales.getText('pisell2.text.goodpass.code-invalid')
|
|
224
193
|
});
|
|
225
194
|
}
|
|
226
195
|
case 5:
|
|
@@ -230,27 +199,10 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
230
199
|
}, _callee);
|
|
231
200
|
}));
|
|
232
201
|
return function onScanCode() {
|
|
233
|
-
return
|
|
202
|
+
return _ref2.apply(this, arguments);
|
|
234
203
|
};
|
|
235
204
|
}();
|
|
236
|
-
var availableData = useMemo(function () {
|
|
237
|
-
if (!isBooking4Shop) return [];
|
|
238
|
-
var shopDiscount = pisellos.getModule('shopDiscount');
|
|
239
|
-
return discountList.filter(function (item) {
|
|
240
|
-
return !!item.isAvailable;
|
|
241
|
-
}).map(function (discount) {
|
|
242
|
-
return _objectSpread(_objectSpread({}, discount), {}, {
|
|
243
|
-
isDisabled: discount.isDisabled || discount.isDisabledForProductUsed || disabled,
|
|
244
|
-
savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice(discount)
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
}, [discountList, isBooking4Shop, disabled]);
|
|
248
205
|
if (!isBooking4Shop) return null;
|
|
249
|
-
var mixedSort = function mixedSort(val) {
|
|
250
|
-
return _toConsumableArray(val).sort(function (a, b) {
|
|
251
|
-
return Number(b === null || b === void 0 ? void 0 : b.isSelected) - Number(a === null || a === void 0 ? void 0 : a.isSelected);
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
206
|
return /*#__PURE__*/React.createElement("div", {
|
|
255
207
|
className: "pisell-lowcode__booking-footer-voucher-container"
|
|
256
208
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -275,8 +227,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
275
227
|
style: {
|
|
276
228
|
width: '100%'
|
|
277
229
|
},
|
|
278
|
-
dataSource:
|
|
279
|
-
mixedSort: mixedSort,
|
|
230
|
+
dataSource: availableData,
|
|
280
231
|
onChange: function onChange(val) {
|
|
281
232
|
var shopDiscount = pisellos.getModule('shopDiscount');
|
|
282
233
|
var detail = shopDiscount.setDiscountSelected({
|
|
@@ -284,7 +235,13 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
284
235
|
isSelected: val.isSelected
|
|
285
236
|
});
|
|
286
237
|
console.log('setDiscountSelected:', detail);
|
|
287
|
-
|
|
238
|
+
dispatch({
|
|
239
|
+
type: 'setService',
|
|
240
|
+
payload: {
|
|
241
|
+
edit: true,
|
|
242
|
+
value: detail.productList
|
|
243
|
+
}
|
|
244
|
+
});
|
|
288
245
|
}
|
|
289
246
|
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
290
247
|
className: "voucher-code-input-wrapper"
|
|
@@ -301,7 +258,6 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
301
258
|
setCode((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
302
259
|
},
|
|
303
260
|
size: "small",
|
|
304
|
-
allowClear: true,
|
|
305
261
|
placeholder: locales.getText('pisell2.text.goodpass.enter-code')
|
|
306
262
|
// suffix={
|
|
307
263
|
// <PisellTooltip title="">
|