@pisell/private-materials 3.2.22 → 3.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +13 -13
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/assets/guests.svg +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +83 -104
- package/es/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +32 -18
- package/es/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +11 -11
- package/es/components/appointmentBooking/components/Date/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Date/index.js +49 -32
- package/es/components/appointmentBooking/components/Date/index.less +5 -0
- package/es/components/appointmentBooking/components/Guest/index.js +8 -21
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +44 -7
- package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Resource/index.js +28 -20
- package/es/components/appointmentBooking/components/Resource/index.less +5 -0
- package/es/components/appointmentBooking/components/Services/index.js +20 -9
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +47 -32
- package/es/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.js +28 -18
- package/es/components/appointmentBooking/context.d.ts +2 -0
- package/es/components/appointmentBooking/context.js +7 -1
- package/es/components/appointmentBooking/hooks.d.ts +45 -9
- package/es/components/appointmentBooking/hooks.js +158 -121
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.js +12 -7
- package/es/components/appointmentBooking/locales.d.ts +30 -0
- package/es/components/appointmentBooking/locales.js +30 -0
- package/es/components/appointmentBooking/utils.d.ts +19 -0
- package/es/components/appointmentBooking/utils.js +68 -1
- package/es/components/booking/components/footer/utils.js +15 -15
- package/es/components/booking/components/voucher/index.d.ts +1 -1
- package/es/components/booking/components/voucher/index.js +28 -27
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.js +10 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/header/index.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/materiels/contacts/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/index.d.ts +0 -1
- package/es/components/eftpos/pos.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/component/fail/network.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/component/manual/index.d.ts +0 -1
- package/es/components/eftposPay/component/signature/index.d.ts +0 -1
- 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 +0 -1
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- 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/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/schedules/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +3 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +4 -3
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +0 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/assets/guests.svg +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +37 -27
- package/lib/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +23 -11
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +3 -5
- package/lib/components/appointmentBooking/components/Date/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Date/index.js +53 -47
- package/lib/components/appointmentBooking/components/Date/index.less +5 -0
- package/lib/components/appointmentBooking/components/Guest/index.js +6 -5
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +25 -3
- package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +16 -17
- package/lib/components/appointmentBooking/components/Resource/index.less +5 -0
- package/lib/components/appointmentBooking/components/Services/index.js +21 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +23 -21
- package/lib/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +28 -16
- package/lib/components/appointmentBooking/context.d.ts +2 -0
- package/lib/components/appointmentBooking/context.js +4 -1
- package/lib/components/appointmentBooking/hooks.d.ts +45 -9
- package/lib/components/appointmentBooking/hooks.js +28 -41
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.js +11 -7
- package/lib/components/appointmentBooking/locales.d.ts +30 -0
- package/lib/components/appointmentBooking/locales.js +30 -0
- package/lib/components/appointmentBooking/utils.d.ts +19 -0
- package/lib/components/appointmentBooking/utils.js +39 -1
- package/lib/components/booking/components/footer/utils.js +1 -15
- package/lib/components/booking/components/voucher/index.d.ts +1 -1
- package/lib/components/booking/components/voucher/index.js +28 -17
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.js +51 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/header/index.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/index.d.ts +0 -1
- package/lib/components/eftpos/pos.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
- package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
- 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 +0 -1
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- 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/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/schedules/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +1 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +3 -2
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/taxSelect/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M30.6 18.8a1 1 0 0 1-1.4-.2A6.45 6.45 0 0 0 24 16a1 1 0 0 1 0-2 3 3 0 1 0-2.905-3.75 1 1 0 0 1-1.937-.5 5 5 0 1 1 8.217 4.939 8.5 8.5 0 0 1 3.429 2.71A1 1 0 0 1 30.6 18.8m-6.735 7.7a1 1 0 1 1-1.73 1 7.125 7.125 0 0 0-12.27 0 1 1 0 1 1-1.73-1 9 9 0 0 1 4.217-3.74 6 6 0 1 1 7.296 0 9 9 0 0 1 4.217 3.74M16 22a4 4 0 1 0 0-8 4 4 0 0 0 0 8m-7-7a1 1 0 0 0-1-1 3 3 0 1 1 2.905-3.75 1 1 0 0 0 1.938-.5 5 5 0 1 0-8.218 4.939 8.5 8.5 0 0 0-3.425 2.71A1 1 0 1 0 2.8 18.6 6.45 6.45 0 0 1 8 16a1 1 0 0 0 1-1"></path></svg>
|
|
@@ -10,23 +10,14 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import React, { useMemo, useState } from 'react';
|
|
12
12
|
import { locales } from '@pisell/utils';
|
|
13
|
-
import { Button
|
|
14
|
-
// import {
|
|
15
|
-
// useCart,
|
|
16
|
-
// useHolder,
|
|
17
|
-
// useStep,
|
|
18
|
-
// useCheckout,
|
|
19
|
-
// useSales,
|
|
20
|
-
// useCustomer,
|
|
21
|
-
// } from '../../../../../Sales';
|
|
22
|
-
import { formatValues } from "../../../../Sales/Checkout/utils";
|
|
23
|
-
// import OrderProductModal from '../../OrderProductModal/index';
|
|
24
|
-
// import EmptyHolderModal from '../../EmptyHolderModal';
|
|
13
|
+
import { Button } from '@pisell/materials';
|
|
25
14
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
26
|
-
import { useAppointmentBookingLogin } from "../../../hooks";
|
|
15
|
+
import { useAppointmentBookingLogin, useAppointmentBookingResource, useAppointmentBookingAccount } from "../../../hooks";
|
|
27
16
|
import { useAppointmentBookingContext } from "../../../context";
|
|
17
|
+
import { formatCustomer } from "../../../utils";
|
|
28
18
|
import "./index.less";
|
|
29
19
|
var ContinueButton = function ContinueButton() {
|
|
20
|
+
var _currentStep$step2;
|
|
30
21
|
var context = useEngineContext();
|
|
31
22
|
var utils = context.appHelper.utils || {};
|
|
32
23
|
var _useState = useState(false),
|
|
@@ -36,54 +27,33 @@ var ContinueButton = function ContinueButton() {
|
|
|
36
27
|
var _useAppointmentBookin = useAppointmentBookingLogin(),
|
|
37
28
|
isLogin = _useAppointmentBookin.isLogin,
|
|
38
29
|
openLoginModal = _useAppointmentBookin.openLoginModal;
|
|
39
|
-
var _useAppointmentBookin2 =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
var _useAppointmentBookin2 = useAppointmentBookingAccount(),
|
|
31
|
+
accountLists = _useAppointmentBookin2.accountLists;
|
|
32
|
+
var _useAppointmentBookin3 = useAppointmentBookingContext(),
|
|
33
|
+
currentStep = _useAppointmentBookin3.currentStep,
|
|
34
|
+
isLastStep = _useAppointmentBookin3.isLastStep,
|
|
35
|
+
carts = _useAppointmentBookin3.carts,
|
|
36
|
+
appointmentBooking = _useAppointmentBookin3.appointmentBooking,
|
|
37
|
+
resourceOtherParams = _useAppointmentBookin3.resourceOtherParams;
|
|
38
|
+
var _useAppointmentBookin4 = useAppointmentBookingResource(),
|
|
39
|
+
getResourceTimeSlot = _useAppointmentBookin4.getResourceTimeSlot;
|
|
40
|
+
var disabled = useMemo(function () {
|
|
41
|
+
var _currentStep$step, _resourceOtherParams$;
|
|
42
|
+
var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
43
|
+
if (!carts.length) return true;
|
|
51
44
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
case 0:
|
|
65
|
-
value = formatValues(data); // 如果检测成功,则直接下单
|
|
66
|
-
// const result = await onCheckout(value);
|
|
67
|
-
result = {
|
|
68
|
-
success: true
|
|
69
|
-
}; // 清空数据
|
|
70
|
-
if (result !== null && result !== void 0 && result.success) {
|
|
71
|
-
// removeSessionStorage();
|
|
72
|
-
} else {
|
|
73
|
-
PisellToast({
|
|
74
|
-
content: (result === null || result === void 0 || (_result$err = result.err) === null || _result$err === void 0 ? void 0 : _result$err.message) || ''
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
case 3:
|
|
78
|
-
case "end":
|
|
79
|
-
return _context.stop();
|
|
80
|
-
}
|
|
81
|
-
}, _callee);
|
|
82
|
-
}));
|
|
83
|
-
return function handleCheckout() {
|
|
84
|
-
return _ref.apply(this, arguments);
|
|
85
|
-
};
|
|
86
|
-
}();
|
|
45
|
+
// 选择资源部分需要判断是否有不可用的资源
|
|
46
|
+
if (key === 'select-resource' && (resourceOtherParams === null || resourceOtherParams === void 0 || (_resourceOtherParams$ = resourceOtherParams.errorList) === null || _resourceOtherParams$ === void 0 ? void 0 : _resourceOtherParams$.length) > 0) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 如果是选择服务页面,则判断是否账户下有空的购物车
|
|
51
|
+
// if (key === 'select-service' && isEmptyGuest(carts, accountLists)) {
|
|
52
|
+
// return true;
|
|
53
|
+
// }
|
|
54
|
+
|
|
55
|
+
return false;
|
|
56
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, carts, accountLists, resourceOtherParams === null || resourceOtherParams === void 0 ? void 0 : resourceOtherParams.errorList]);
|
|
87
57
|
|
|
88
58
|
/**
|
|
89
59
|
* @title: 下一步
|
|
@@ -93,50 +63,65 @@ var ContinueButton = function ContinueButton() {
|
|
|
93
63
|
* @Date: 2025-02-08 18:57
|
|
94
64
|
*/
|
|
95
65
|
var handleNextStep = /*#__PURE__*/function () {
|
|
96
|
-
var
|
|
66
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
67
|
+
var _currentStep$step3, _currentStep$step4;
|
|
97
68
|
var res;
|
|
98
|
-
return _regeneratorRuntime().wrap(function
|
|
99
|
-
while (1) switch (
|
|
69
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
70
|
+
while (1) switch (_context.prev = _context.next) {
|
|
100
71
|
case 0:
|
|
101
72
|
if (!isLastStep) {
|
|
102
|
-
|
|
73
|
+
_context.next = 14;
|
|
103
74
|
break;
|
|
104
75
|
}
|
|
105
76
|
setLoading(true);
|
|
106
|
-
|
|
107
|
-
|
|
77
|
+
_context.prev = 2;
|
|
78
|
+
_context.next = 5;
|
|
108
79
|
return appointmentBooking.submitOrder();
|
|
109
80
|
case 5:
|
|
110
|
-
res =
|
|
111
|
-
console.log(isLastStep, isLogin, res, 'wh9896788');
|
|
81
|
+
res = _context.sent;
|
|
112
82
|
utils.action({
|
|
113
83
|
type: 'pisell1.payment',
|
|
114
84
|
data: res === null || res === void 0 ? void 0 : res.data,
|
|
115
85
|
callback: function callback(e) {
|
|
116
|
-
console.log(e, 'wh9896788');
|
|
86
|
+
console.log(e, currentStep, 'wh9896788');
|
|
87
|
+
// PisellToast({
|
|
88
|
+
// content: result?.err?.message || '',
|
|
89
|
+
// });
|
|
117
90
|
// checkoutCallback.current && checkoutCallback.current(e);
|
|
118
91
|
}
|
|
119
92
|
});
|
|
120
93
|
setLoading(false);
|
|
121
|
-
|
|
94
|
+
_context.next = 13;
|
|
122
95
|
break;
|
|
123
|
-
case
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
console.log(isLastStep, isLogin, _context2.t0, 'wh9896788');
|
|
96
|
+
case 10:
|
|
97
|
+
_context.prev = 10;
|
|
98
|
+
_context.t0 = _context["catch"](2);
|
|
127
99
|
setLoading(false);
|
|
128
|
-
case
|
|
129
|
-
return
|
|
130
|
-
case
|
|
131
|
-
|
|
100
|
+
case 13:
|
|
101
|
+
return _context.abrupt("return");
|
|
102
|
+
case 14:
|
|
103
|
+
if ((currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key) === 'select-resource') {
|
|
104
|
+
getResourceTimeSlot('resources');
|
|
105
|
+
}
|
|
106
|
+
if ((currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key) === 'select-time') {
|
|
107
|
+
// getResourceTimeSlot('resources');
|
|
108
|
+
// const { errorList } =
|
|
109
|
+
// await appointmentBooking.autoSelectAllProductResources(
|
|
110
|
+
// 'sites',
|
|
111
|
+
// selectedTime
|
|
112
|
+
// );
|
|
113
|
+
// const result = await appointmentBooking.submitTimeSlot(selectedTime);
|
|
114
|
+
// console.log(errorList, result, 'wh9896788');
|
|
115
|
+
}
|
|
116
|
+
return _context.abrupt("return", appointmentBooking.next());
|
|
132
117
|
case 17:
|
|
133
118
|
case "end":
|
|
134
|
-
return
|
|
119
|
+
return _context.stop();
|
|
135
120
|
}
|
|
136
|
-
},
|
|
121
|
+
}, _callee, null, [[2, 10]]);
|
|
137
122
|
}));
|
|
138
123
|
return function handleNextStep() {
|
|
139
|
-
return
|
|
124
|
+
return _ref.apply(this, arguments);
|
|
140
125
|
};
|
|
141
126
|
}();
|
|
142
127
|
|
|
@@ -148,21 +133,28 @@ var ContinueButton = function ContinueButton() {
|
|
|
148
133
|
* @Date: 2025-01-16 16:30
|
|
149
134
|
*/
|
|
150
135
|
var handleContinue = /*#__PURE__*/function () {
|
|
151
|
-
var
|
|
152
|
-
return _regeneratorRuntime().wrap(function
|
|
153
|
-
while (1) switch (
|
|
136
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
137
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
138
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
154
139
|
case 0:
|
|
155
140
|
if (!isLastStep) {
|
|
156
|
-
|
|
141
|
+
_context2.next = 3;
|
|
157
142
|
break;
|
|
158
143
|
}
|
|
159
144
|
if (isLogin) {
|
|
160
|
-
|
|
145
|
+
_context2.next = 3;
|
|
161
146
|
break;
|
|
162
147
|
}
|
|
163
|
-
return
|
|
148
|
+
return _context2.abrupt("return", openLoginModal({
|
|
164
149
|
callback: function callback(status) {
|
|
150
|
+
var _utils$store;
|
|
151
|
+
var user = (_utils$store = utils.store) === null || _utils$store === void 0 || (_utils$store = _utils$store.getState()) === null || _utils$store === void 0 || (_utils$store = _utils$store.global) === null || _utils$store === void 0 ? void 0 : _utils$store.userInfo;
|
|
152
|
+
var currentUser = formatCustomer(user);
|
|
153
|
+
var meAccount = accountLists === null || accountLists === void 0 ? void 0 : accountLists.find(function (d) {
|
|
154
|
+
return !(d !== null && d !== void 0 && d.isGuest);
|
|
155
|
+
});
|
|
165
156
|
if (status === 'success') {
|
|
157
|
+
appointmentBooking.setLoginAccount(meAccount === null || meAccount === void 0 ? void 0 : meAccount.id, currentUser);
|
|
166
158
|
handleNextStep();
|
|
167
159
|
}
|
|
168
160
|
}
|
|
@@ -171,12 +163,12 @@ var ContinueButton = function ContinueButton() {
|
|
|
171
163
|
handleNextStep();
|
|
172
164
|
case 4:
|
|
173
165
|
case "end":
|
|
174
|
-
return
|
|
166
|
+
return _context2.stop();
|
|
175
167
|
}
|
|
176
|
-
},
|
|
168
|
+
}, _callee2);
|
|
177
169
|
}));
|
|
178
170
|
return function handleContinue() {
|
|
179
|
-
return
|
|
171
|
+
return _ref2.apply(this, arguments);
|
|
180
172
|
};
|
|
181
173
|
}();
|
|
182
174
|
|
|
@@ -195,21 +187,8 @@ var ContinueButton = function ContinueButton() {
|
|
|
195
187
|
return locales.getText('pisell2.event.close.continue');
|
|
196
188
|
}
|
|
197
189
|
}, [isLastStep]);
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* @title: 确认按钮loading
|
|
201
|
-
* @description:
|
|
202
|
-
* @param {*} useMemo
|
|
203
|
-
* @return {*}
|
|
204
|
-
* @Author: WangHan
|
|
205
|
-
* @Date: 2025-01-21 23:03
|
|
206
|
-
*/
|
|
207
|
-
var confirmLoading = useMemo(function () {
|
|
208
|
-
if (!isLastStep) return false;
|
|
209
|
-
return (createBooking === null || createBooking === void 0 ? void 0 : createBooking.loading) || (checkBeforeBooking === null || checkBeforeBooking === void 0 ? void 0 : checkBeforeBooking.loading);
|
|
210
|
-
}, [isLastStep, createBooking === null || createBooking === void 0 ? void 0 : createBooking.loading, checkBeforeBooking === null || checkBeforeBooking === void 0 ? void 0 : checkBeforeBooking.loading]);
|
|
211
190
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
212
|
-
disabled:
|
|
191
|
+
disabled: disabled,
|
|
213
192
|
size: "large",
|
|
214
193
|
type: "primary",
|
|
215
194
|
onClick: function onClick() {
|
|
@@ -18,6 +18,7 @@ var Total = function Total(_ref) {
|
|
|
18
18
|
totalTaxFee = summary.totalTaxFee,
|
|
19
19
|
isPriceIncludeTax = summary.isPriceIncludeTax,
|
|
20
20
|
total = summary.total;
|
|
21
|
+
console.log(summary, 'summarysummary');
|
|
21
22
|
return /*#__PURE__*/React.createElement("div", {
|
|
22
23
|
className: "event-total-wrap ".concat(className)
|
|
23
24
|
}, !isPriceIncludeTax && Number(totalTaxFee) > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,26 +1,32 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
1
7
|
import React, { useMemo } from 'react';
|
|
2
8
|
import { isMobile, locales } from '@pisell/utils';
|
|
3
9
|
import ShoppingCart from "../../../../shoppingCart";
|
|
4
10
|
import ContinueButton from "../ContinueButton";
|
|
5
|
-
import {
|
|
11
|
+
import { useAppointmentBooking } from "../../../hooks";
|
|
6
12
|
import { useAppointmentBookingContext } from "../../../context";
|
|
7
|
-
import
|
|
8
|
-
import { formatHolder, formatCarts } from "../../../utils";
|
|
13
|
+
import { useAppointmentBookingAccount } from "../../../hooks";
|
|
14
|
+
import { formatHolder, formatCarts, formatCurrentUser } from "../../../utils";
|
|
9
15
|
import VoucherCard from "../../Voucher";
|
|
16
|
+
import Total from "./Total";
|
|
10
17
|
import "./index.less";
|
|
11
18
|
var CartItem = function CartItem() {
|
|
12
19
|
var _currentStep$step, _currentStep$step2;
|
|
13
20
|
var appointmentBooking = useAppointmentBooking();
|
|
14
|
-
var appointmentBookingAccount = useAppointmentBookingAccount();
|
|
15
21
|
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
16
22
|
carts = _useAppointmentBookin.carts,
|
|
17
|
-
summary = _useAppointmentBookin.summary,
|
|
18
23
|
isLastStep = _useAppointmentBookin.isLastStep,
|
|
19
24
|
currentStep = _useAppointmentBookin.currentStep,
|
|
20
25
|
resources = _useAppointmentBookin.resources;
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
console.log(
|
|
26
|
+
var _useAppointmentBookin2 = useAppointmentBookingAccount(),
|
|
27
|
+
accountLists = _useAppointmentBookin2.accountLists;
|
|
28
|
+
console.log(accountLists, 'wh97879678');
|
|
29
|
+
var currentUser = formatCurrentUser();
|
|
24
30
|
var holderIds = useMemo(function () {
|
|
25
31
|
return accountLists.map(function (item) {
|
|
26
32
|
return item.id;
|
|
@@ -29,24 +35,30 @@ var CartItem = function CartItem() {
|
|
|
29
35
|
var holders = useMemo(function () {
|
|
30
36
|
return formatHolder(accountLists);
|
|
31
37
|
}, [accountLists]);
|
|
32
|
-
var handleClickCard = function handleClickCard(e, type,
|
|
33
|
-
console.log(e, type, key, 'wh9988767');
|
|
34
|
-
|
|
38
|
+
var handleClickCard = function handleClickCard(e, type, val) {
|
|
35
39
|
// 更改备注
|
|
36
40
|
if (type === 'note') {
|
|
37
|
-
return appointmentBooking.updateCart(
|
|
38
|
-
|
|
39
|
-
});
|
|
41
|
+
return appointmentBooking.updateCart(_objectSpread({
|
|
42
|
+
_id: e === null || e === void 0 ? void 0 : e._id
|
|
43
|
+
}, val));
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
// 删除购物车下某个商品
|
|
43
47
|
if (type === 'delete') {
|
|
44
|
-
|
|
48
|
+
return appointmentBooking.deleteCart(e === null || e === void 0 ? void 0 : e._id);
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
// 删除购物车
|
|
48
52
|
if (type === 'delete_holders') {
|
|
49
|
-
return appointmentBooking.removeAccount(
|
|
53
|
+
return appointmentBooking.removeAccount(val);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 更改资源
|
|
57
|
+
if (type === 'change_resource') {
|
|
58
|
+
return appointmentBooking.updateCart({
|
|
59
|
+
_id: e === null || e === void 0 ? void 0 : e._id,
|
|
60
|
+
resources: [val]
|
|
61
|
+
});
|
|
50
62
|
}
|
|
51
63
|
};
|
|
52
64
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -60,7 +72,8 @@ var CartItem = function CartItem() {
|
|
|
60
72
|
holders: holders,
|
|
61
73
|
disabledEdit: isLastStep,
|
|
62
74
|
isShowChangeResource: (currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key) === 'select-resource',
|
|
63
|
-
isShowDelete: (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.
|
|
75
|
+
isShowDelete: (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key) === 'select-service',
|
|
76
|
+
isShowPackageNote: false
|
|
64
77
|
},
|
|
65
78
|
collapseParams: {
|
|
66
79
|
activeKey: holderIds,
|
|
@@ -69,11 +82,12 @@ var CartItem = function CartItem() {
|
|
|
69
82
|
platform: "h5",
|
|
70
83
|
emptyText: locales.getText('pisell2.event.empty.service'),
|
|
71
84
|
isOpenGroup: !!(holderIds !== null && holderIds !== void 0 && holderIds.length),
|
|
85
|
+
isHideClearCart: true,
|
|
72
86
|
onChange: function onChange(e, type, key) {
|
|
73
87
|
return handleClickCard(e, type, key);
|
|
74
88
|
}
|
|
75
89
|
})), /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: "
|
|
90
|
+
className: "appointment-footer"
|
|
77
91
|
}, /*#__PURE__*/React.createElement(VoucherCard, {
|
|
78
92
|
currentUser: currentUser,
|
|
79
93
|
products: carts
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
height: 100%;
|
|
3
3
|
.content {
|
|
4
4
|
background: #fff;
|
|
5
|
-
padding:
|
|
5
|
+
padding: 0 16px;
|
|
6
|
+
max-height: 60vh;
|
|
7
|
+
overflow-y: auto;
|
|
8
|
+
|
|
6
9
|
.pisell-lowcode__shopping-cart-content {
|
|
7
10
|
.ant-card-body {
|
|
8
11
|
padding: 0;
|
|
@@ -10,9 +13,9 @@
|
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
15
|
|
|
13
|
-
.
|
|
16
|
+
.appointment-footer {
|
|
14
17
|
background: #fff;
|
|
15
|
-
padding:
|
|
18
|
+
padding: 10px 16px 0;
|
|
16
19
|
display: flex;
|
|
17
20
|
flex-direction: column;
|
|
18
21
|
gap: 14px;
|
|
@@ -74,7 +77,7 @@
|
|
|
74
77
|
overflow-y: auto;
|
|
75
78
|
padding: 0 0 140px;
|
|
76
79
|
}
|
|
77
|
-
.
|
|
80
|
+
.appointment-footer {
|
|
78
81
|
z-index: 10;
|
|
79
82
|
position: fixed;
|
|
80
83
|
bottom: 0;
|
|
@@ -14,30 +14,30 @@ import Date from "../Date";
|
|
|
14
14
|
import Resource from "../Resource";
|
|
15
15
|
import TimeSlicing from "../TimeSlicing";
|
|
16
16
|
import Guest from "../Guest";
|
|
17
|
-
import { useAppointmentBookingStep, useAppointmentBookingCart } from "../../hooks";
|
|
18
17
|
import { useAppointmentBookingContext } from "../../context";
|
|
18
|
+
import { useAppointmentBookingCart, useAppointmentBookingStep } from "../../hooks";
|
|
19
19
|
import "./index.less";
|
|
20
20
|
var Layout = function Layout() {
|
|
21
|
-
var _currentStep$
|
|
22
|
-
var appointmentBookingStep = useAppointmentBookingStep();
|
|
23
|
-
var appointmentBookingCart = useAppointmentBookingCart();
|
|
21
|
+
var _currentStep$step, _currentStep$step3, _currentStep$step4;
|
|
24
22
|
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
25
23
|
currentStep = _useAppointmentBookin.currentStep;
|
|
24
|
+
|
|
25
|
+
// 不要删除
|
|
26
|
+
useAppointmentBookingCart();
|
|
27
|
+
useAppointmentBookingStep();
|
|
26
28
|
var _useState = useState({}),
|
|
27
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
30
|
params = _useState2[0],
|
|
29
31
|
setParams = _useState2[1];
|
|
30
32
|
useEffect(function () {
|
|
31
|
-
var _currentStep$step;
|
|
32
|
-
console.log(currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key, 'whcurrentStep?.step?.key');
|
|
33
33
|
window.scrollTo({
|
|
34
34
|
top: 0,
|
|
35
35
|
behavior: 'smooth'
|
|
36
36
|
});
|
|
37
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$
|
|
37
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key]);
|
|
38
38
|
var Com = useMemo(function () {
|
|
39
|
-
var _currentStep$
|
|
40
|
-
var key = currentStep === null || currentStep === void 0 || (_currentStep$
|
|
39
|
+
var _currentStep$step2;
|
|
40
|
+
var key = currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key;
|
|
41
41
|
if (!key) return null;
|
|
42
42
|
var components = {
|
|
43
43
|
// 选择服务
|
|
@@ -56,7 +56,7 @@ var Layout = function Layout() {
|
|
|
56
56
|
onChange: setParams,
|
|
57
57
|
params: params
|
|
58
58
|
});
|
|
59
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$
|
|
59
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key]);
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* @title: 动态计算中间内容区域的高度
|
|
@@ -80,7 +80,7 @@ var Layout = function Layout() {
|
|
|
80
80
|
content.style.overflowY = 'auto';
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$
|
|
83
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key]);
|
|
84
84
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement("div", {
|
|
85
85
|
className: "parallel-content-wrap ".concat(isMobile() ? 'parallel-content-mobile-wrap' : '')
|
|
86
86
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -18,30 +18,35 @@ import { Skeleton } from 'antd';
|
|
|
18
18
|
import Dayjs from 'dayjs';
|
|
19
19
|
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
|
|
20
20
|
Dayjs.extend(isSameOrBefore);
|
|
21
|
-
import { weekListText } from "./state";
|
|
22
21
|
import classNames from 'classnames';
|
|
22
|
+
import { locales } from '@pisell/utils';
|
|
23
23
|
import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons';
|
|
24
24
|
import { useAppointmentBookingContext } from "../../context";
|
|
25
25
|
import "./index.less";
|
|
26
26
|
var CalendarDate = function CalendarDate(props) {
|
|
27
|
-
var _useState = useState(),
|
|
27
|
+
var _useState = useState(false),
|
|
28
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var _useState3 = useState([]),
|
|
29
|
+
loading = _useState2[0],
|
|
30
|
+
setLoading = _useState2[1];
|
|
31
|
+
var _useState3 = useState(),
|
|
33
32
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
currentDate = _useState4[0],
|
|
34
|
+
setCurrentDate = _useState4[1];
|
|
35
|
+
// 生成7天的时间列表
|
|
36
|
+
var _useState5 = useState([]),
|
|
37
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
38
|
+
dateMonthList = _useState6[0],
|
|
39
|
+
setDateMonthList = _useState6[1];
|
|
36
40
|
// 切换的月份
|
|
37
|
-
var
|
|
41
|
+
var _useState7 = useState(function () {
|
|
38
42
|
return Dayjs();
|
|
39
43
|
}),
|
|
40
|
-
|
|
41
|
-
currentMonth =
|
|
42
|
-
setCurrentMonth =
|
|
44
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
45
|
+
currentMonth = _useState8[0],
|
|
46
|
+
setCurrentMonth = _useState8[1];
|
|
43
47
|
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
44
48
|
appointmentBooking = _useAppointmentBookin.appointmentBooking;
|
|
49
|
+
var weekListText = [locales.getText('pisell2.appointment.sunday'), locales.getText('pisell2.appointment.monday'), locales.getText('pisell2.appointment.tuesday'), locales.getText('pisell2.appointment.wednesday'), locales.getText('pisell2.appointment.thursday'), locales.getText('pisell2.appointment.friday'), locales.getText('pisell2.appointment.saturday')];
|
|
45
50
|
|
|
46
51
|
// 计算开始渲染的列
|
|
47
52
|
var startingColumn = 0 % 7; // 0 表示星期日
|
|
@@ -98,30 +103,36 @@ var CalendarDate = function CalendarDate(props) {
|
|
|
98
103
|
};
|
|
99
104
|
var getDates = /*#__PURE__*/function () {
|
|
100
105
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(date) {
|
|
101
|
-
var startDate, endDate, params, data, firstAvailableDate, baseMonthData, updatedDates;
|
|
106
|
+
var startDate, endDate, params, data, selected, firstAvailableDate, baseMonthData, updatedDates;
|
|
102
107
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
103
108
|
while (1) switch (_context.prev = _context.next) {
|
|
104
109
|
case 0:
|
|
110
|
+
_context.prev = 0;
|
|
105
111
|
startDate = Dayjs(date).startOf('month').format('YYYY-MM-DD');
|
|
106
112
|
endDate = Dayjs(date).endOf('month').format('YYYY-MM-DD');
|
|
107
113
|
params = {
|
|
108
114
|
startDate: startDate,
|
|
109
115
|
endDate: endDate
|
|
110
116
|
};
|
|
111
|
-
_context.next =
|
|
117
|
+
_context.next = 6;
|
|
112
118
|
return appointmentBooking.getAvailableDate(params);
|
|
113
|
-
case
|
|
119
|
+
case 6:
|
|
114
120
|
data = _context.sent;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
_context.next = 9;
|
|
122
|
+
return appointmentBooking.getDateRange();
|
|
123
|
+
case 9:
|
|
124
|
+
selected = _context.sent;
|
|
125
|
+
if ((selected === null || selected === void 0 ? void 0 : selected.length) > 0) {
|
|
126
|
+
setCurrentDate(selected[0].date);
|
|
127
|
+
} else {
|
|
128
|
+
// 当前月则默认选中当前第一个可用的
|
|
129
|
+
if (date.format('YYYY-MM') === Dayjs().format('YYYY-MM')) {
|
|
130
|
+
firstAvailableDate = data.find(function (d) {
|
|
131
|
+
return d.status === 'available';
|
|
132
|
+
});
|
|
133
|
+
setCurrentDate(firstAvailableDate === null || firstAvailableDate === void 0 ? void 0 : firstAvailableDate.date);
|
|
134
|
+
appointmentBooking.setDateRange([firstAvailableDate]);
|
|
135
|
+
}
|
|
125
136
|
}
|
|
126
137
|
|
|
127
138
|
// 创建基础日历数据
|
|
@@ -137,12 +148,20 @@ var CalendarDate = function CalendarDate(props) {
|
|
|
137
148
|
}
|
|
138
149
|
return day;
|
|
139
150
|
});
|
|
151
|
+
setLoading(false);
|
|
140
152
|
setDateMonthList(updatedDates);
|
|
141
|
-
|
|
153
|
+
_context.next = 21;
|
|
154
|
+
break;
|
|
155
|
+
case 17:
|
|
156
|
+
_context.prev = 17;
|
|
157
|
+
_context.t0 = _context["catch"](0);
|
|
158
|
+
setLoading(false);
|
|
159
|
+
console.log(_context.t0, 'wh978968234234');
|
|
160
|
+
case 21:
|
|
142
161
|
case "end":
|
|
143
162
|
return _context.stop();
|
|
144
163
|
}
|
|
145
|
-
}, _callee);
|
|
164
|
+
}, _callee, null, [[0, 17]]);
|
|
146
165
|
}));
|
|
147
166
|
return function getDates(_x) {
|
|
148
167
|
return _ref.apply(this, arguments);
|
|
@@ -178,6 +197,7 @@ var CalendarDate = function CalendarDate(props) {
|
|
|
178
197
|
var currentMonthText = currentMonth.format('YYYY-MM');
|
|
179
198
|
var newNextMonth = Dayjs(currentMonthText).add(1, 'month');
|
|
180
199
|
setCurrentMonth(newNextMonth);
|
|
200
|
+
setLoading(true);
|
|
181
201
|
};
|
|
182
202
|
return /*#__PURE__*/React.createElement("div", {
|
|
183
203
|
className: 'calendar-date-box'
|
|
@@ -216,17 +236,14 @@ var CalendarDate = function CalendarDate(props) {
|
|
|
216
236
|
var isCurrentMonth = Dayjs(day.date).isSame(currentMonth, 'month');
|
|
217
237
|
return /*#__PURE__*/React.createElement("div", {
|
|
218
238
|
key: index,
|
|
219
|
-
className: classNames('calendar-days-items', _defineProperty(_defineProperty(_defineProperty({}, 'disabledDate', day === null || day === void 0 ? void 0 : day.disabled), 'selectDate', currentDate === date), 'other-month-days', !isCurrentMonth)),
|
|
239
|
+
className: classNames('calendar-days-items', _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 'disabledDate', day === null || day === void 0 ? void 0 : day.disabled), 'selectDate', currentDate === date), 'other-month-days', !isCurrentMonth), 'loading-item', loading)),
|
|
220
240
|
onClick: function onClick() {
|
|
221
241
|
if (day !== null && day !== void 0 && day.disabled) return;
|
|
222
|
-
console.log(day, 'wh987976');
|
|
223
242
|
setCurrentDate(date);
|
|
224
243
|
appointmentBooking.setDateRange([day]);
|
|
225
244
|
}
|
|
226
245
|
}, isCurrentMonth && /*#__PURE__*/React.createElement("div", {
|
|
227
|
-
className: classNames('day-text'
|
|
228
|
-
// ['day-line']: !disabled,
|
|
229
|
-
})
|
|
246
|
+
className: classNames('day-text')
|
|
230
247
|
}, Dayjs(day.date).format('D')));
|
|
231
248
|
})))));
|
|
232
249
|
};
|