@pisell/private-materials 3.3.16 → 3.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +3 -3
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -16
- package/es/components/appointmentBooking/components/Cart/Item/Total.js +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +40 -13
- package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/utils.d.ts +20 -0
- package/es/components/appointmentBooking/components/Cart/utils.js +67 -1
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +2 -3
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +50 -7
- package/es/components/appointmentBooking/components/Date/index.js +6 -0
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Form/index.js +61 -49
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +5 -4
- package/es/components/appointmentBooking/components/Services/index.js +2 -4
- package/es/components/appointmentBooking/components/Voucher/index.js +1 -1
- package/es/components/appointmentBooking/context.d.ts +5 -1
- package/es/components/appointmentBooking/context.js +37 -14
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/deposit/index.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +7 -19
- package/es/components/appointmentBooking/locales.d.ts +3 -0
- package/es/components/appointmentBooking/locales.js +196 -193
- package/es/components/appointmentBooking/utils.js +21 -13
- package/es/components/booking/components/customSelect/index.js +2 -0
- package/es/components/booking/components/footer/index.d.ts +0 -1
- package/es/components/booking/components/footer/index.js +27 -22
- package/es/components/booking/components/footer/utils.d.ts +1 -0
- package/es/components/booking/components/footer/utils.js +17 -2
- package/es/components/booking/components/voucher/index.d.ts +1 -0
- package/es/components/booking/forms/footer.d.ts +1 -0
- package/es/components/booking/forms/forms.d.ts +4 -0
- package/es/components/booking/forms/forms.js +14 -3
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/es/components/booking/forms/single/index.d.ts +1 -2
- package/es/components/booking/forms/single/index.js +33 -26
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/info/client/index.js +24 -3
- package/es/components/booking/info/client/index.less +39 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +10 -1
- package/es/components/booking/info/clientVariant/utils.d.ts +1 -0
- package/es/components/booking/info/clientVariant/utils.js +6 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +17 -2
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.less +17 -0
- package/es/components/booking/info/clientVariant/vertical/index.js +29 -4
- package/es/components/booking/info/clientVariant/vertical/index.less +18 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useAddHolder.d.ts +8 -1
- package/es/components/booking/info/hooks/useAddHolder.js +131 -31
- package/es/components/booking/info/hooks/useGetHolderList.d.ts +2 -0
- package/es/components/booking/info/hooks/useGetHolderList.js +48 -0
- package/es/components/booking/info/hooks/useHolderConfig.js +2 -2
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.js +4 -41
- package/es/components/booking/info/pet/index.js +83 -8
- package/es/components/booking/info/pet/serve.d.ts +1 -0
- package/es/components/booking/info/pet/serve.js +27 -0
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/Lists.js +2 -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 +2 -0
- package/es/components/booking/info/service2/utils.js +20 -10
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info2/utilsByBooking.d.ts +1 -0
- package/es/components/booking/info2/utilsByBooking.js +9 -1
- package/es/components/booking/locales.d.ts +21 -0
- package/es/components/booking/locales.js +42 -3
- package/es/components/booking/utils.js +3 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -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/Cart/ContinueButton/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- 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/Provider/Resource/index.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/bookingDetailModal/components/BookingOptions.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/index.d.ts +1 -0
- package/es/components/productSelect/components/TabProduct/index.d.ts +1 -0
- package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/es/components/shoppingCart/Provider.js +0 -1
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.js +0 -1
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +0 -2
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -3
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +5 -6
- package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/es/components/ticketBooking/index.d.ts +5 -2
- package/es/components/ticketBooking/index.js +20 -5
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -8
- package/lib/components/appointmentBooking/components/Cart/Item/Total.js +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +27 -11
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/utils.d.ts +20 -0
- package/lib/components/appointmentBooking/components/Cart/utils.js +32 -2
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +3 -3
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +26 -1
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Form/index.js +48 -36
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +5 -4
- package/lib/components/appointmentBooking/components/Services/index.js +4 -6
- package/lib/components/appointmentBooking/components/Voucher/index.js +2 -4
- package/lib/components/appointmentBooking/context.d.ts +5 -1
- package/lib/components/appointmentBooking/context.js +17 -5
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/deposit/index.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +1 -12
- package/lib/components/appointmentBooking/locales.d.ts +3 -0
- package/lib/components/appointmentBooking/locales.js +4 -1
- package/lib/components/appointmentBooking/utils.js +19 -13
- package/lib/components/booking/components/customSelect/index.js +2 -0
- package/lib/components/booking/components/footer/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.js +3 -1
- package/lib/components/booking/components/footer/utils.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.js +16 -1
- package/lib/components/booking/components/voucher/index.d.ts +1 -0
- package/lib/components/booking/forms/footer.d.ts +1 -0
- package/lib/components/booking/forms/forms.d.ts +4 -0
- package/lib/components/booking/forms/forms.js +13 -3
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/lib/components/booking/forms/single/index.d.ts +1 -2
- package/lib/components/booking/forms/single/index.js +13 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/info/client/index.js +20 -3
- package/lib/components/booking/info/client/index.less +39 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +8 -1
- package/lib/components/booking/info/clientVariant/utils.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/utils.js +34 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -3
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.less +17 -0
- package/lib/components/booking/info/clientVariant/vertical/index.js +31 -6
- package/lib/components/booking/info/clientVariant/vertical/index.less +18 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useAddHolder.d.ts +8 -1
- package/lib/components/booking/info/hooks/useAddHolder.js +88 -16
- package/lib/components/booking/info/hooks/useGetHolderList.d.ts +2 -0
- package/lib/components/booking/info/hooks/useGetHolderList.js +61 -0
- package/lib/components/booking/info/hooks/useHolderConfig.js +2 -2
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.js +2 -21
- package/lib/components/booking/info/pet/index.js +57 -10
- package/lib/components/booking/info/pet/serve.d.ts +1 -0
- package/lib/components/booking/info/pet/serve.js +33 -0
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.js +1 -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 +2 -0
- package/lib/components/booking/info/service2/utils.js +17 -7
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info2/utilsByBooking.d.ts +1 -0
- package/lib/components/booking/info2/utilsByBooking.js +8 -1
- package/lib/components/booking/locales.d.ts +21 -0
- package/lib/components/booking/locales.js +42 -3
- package/lib/components/booking/utils.js +3 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -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/Cart/ContinueButton/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- 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/Provider/Resource/index.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/bookingDetailModal/components/BookingOptions.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/index.d.ts +1 -0
- package/lib/components/productSelect/components/TabProduct/index.d.ts +1 -0
- package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/lib/components/shoppingCart/Provider.js +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.js +0 -1
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +1 -2
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +2 -3
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +4 -3
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.d.ts +5 -2
- package/lib/components/ticketBooking/index.js +13 -4
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lowcode/ticket-booking/meta.ts +26 -0
- package/package.json +2 -2
|
@@ -41,6 +41,7 @@ var Header = function Header() {
|
|
|
41
41
|
var stepName = useMemo(function () {
|
|
42
42
|
var _currentStep$step, _currentStep$step2;
|
|
43
43
|
var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
44
|
+
if (!key) return '';
|
|
44
45
|
|
|
45
46
|
// 选择资源则获取资源列表的第一个名称
|
|
46
47
|
if (key === 'select-resource') {
|
|
@@ -48,7 +49,7 @@ var Header = function Header() {
|
|
|
48
49
|
var name = (resources === null || resources === void 0 || (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[0]) === null || _resources$ === void 0 ? void 0 : _resources$.title) || '';
|
|
49
50
|
return locales.getText('pisell2.event.select.category')(name);
|
|
50
51
|
}
|
|
51
|
-
return currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.description;
|
|
52
|
+
return (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.description) || '';
|
|
52
53
|
}, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key, resources]);
|
|
53
54
|
|
|
54
55
|
/**
|
|
@@ -125,8 +126,8 @@ var Header = function Header() {
|
|
|
125
126
|
// 6. 默认回退一步
|
|
126
127
|
appointmentBooking.back();
|
|
127
128
|
|
|
128
|
-
// 再次将步骤更新为false
|
|
129
|
-
if (resourceStep !== null && resourceStep !== void 0 && resourceStep.isSkip && (resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key) === 'select-resource') {
|
|
129
|
+
// 再次将步骤更新为false, 增加这个判断为了跳过那一步没有设置holder,但是直接后退了
|
|
130
|
+
if (resourceStep !== null && resourceStep !== void 0 && resourceStep.isSkip && ((resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key) === 'select-resource' || (resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key) === 'select-service')) {
|
|
130
131
|
updateStep(resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key, {
|
|
131
132
|
index: currentStep === null || currentStep === void 0 ? void 0 : currentStep.index,
|
|
132
133
|
isSkip: false
|
|
@@ -158,7 +159,7 @@ var Header = function Header() {
|
|
|
158
159
|
utils === null || utils === void 0 || (_utils$history = utils.history) === null || _utils$history === void 0 || _utils$history.replace('/');
|
|
159
160
|
};
|
|
160
161
|
return /*#__PURE__*/React.createElement(ProgressBar, {
|
|
161
|
-
title: "".concat(locales.getText('pisell2.appointment.step')((currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 1)),
|
|
162
|
+
title: currentStep ? "".concat(locales.getText('pisell2.appointment.step')((currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 1)) : '',
|
|
162
163
|
description: stepName,
|
|
163
164
|
showBack: (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) > 0,
|
|
164
165
|
onBack: function onBack() {
|
|
@@ -16,12 +16,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
16
16
|
import React, { useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
17
17
|
import dayjs from 'dayjs';
|
|
18
18
|
import { isMobile, locales } from '@pisell/utils';
|
|
19
|
-
import { PisellToast } from '@pisell/materials';
|
|
20
19
|
import ProductSelect from "../../../productSelect";
|
|
21
20
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
22
21
|
import { useAppointmentBookingContext } from "../../context";
|
|
23
22
|
import { useAppointmentBooking, useAppointmentBookingSetting, useAppointmentBookingProduct, useAppointmentBookingStep } from "../../hooks";
|
|
24
23
|
import "./index.less";
|
|
24
|
+
import { Toast } from "../../utils";
|
|
25
25
|
var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
26
26
|
var context = useEngineContext();
|
|
27
27
|
var _ref = context.appHelper || {},
|
|
@@ -121,9 +121,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
121
121
|
_context.next = 15;
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
|
-
return _context.abrupt("return",
|
|
125
|
-
content: locales.getText('pisell2.appointment.no.available.service')
|
|
126
|
-
}));
|
|
124
|
+
return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
|
|
127
125
|
case 15:
|
|
128
126
|
appointmentBooking.storeProduct(product);
|
|
129
127
|
// duration 类型的商品,要获取一下资源
|
|
@@ -41,7 +41,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
41
41
|
var context = useEngineContext();
|
|
42
42
|
var appointmentBooking = useAppointmentBooking();
|
|
43
43
|
var shopDiscount = useShopDiscount();
|
|
44
|
-
var _useState = useState(
|
|
44
|
+
var _useState = useState(false),
|
|
45
45
|
_useState2 = _slicedToArray(_useState, 2),
|
|
46
46
|
showDetail = _useState2[0],
|
|
47
47
|
setShowDetail = _useState2[1];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { TasksManager } from '../../utils/tasks';
|
|
2
3
|
interface AppointmentBookingContextType {
|
|
3
4
|
appointmentBooking: any;
|
|
4
5
|
times: any[];
|
|
@@ -19,7 +20,10 @@ interface AppointmentBookingContextType {
|
|
|
19
20
|
setSelectedTime: (val: any) => void;
|
|
20
21
|
isAgreeDepositPolicy: boolean;
|
|
21
22
|
setIsAgreeDepositPolicy: (val: boolean) => void;
|
|
22
|
-
|
|
23
|
+
isLastStep: boolean;
|
|
24
|
+
tasksManager: TasksManager;
|
|
25
|
+
policyParams: any;
|
|
26
|
+
setPolicyParams: (val: any) => void;
|
|
23
27
|
[key: string]: any;
|
|
24
28
|
}
|
|
25
29
|
export declare const AppointmentBookingProvider: ({ children, }: {
|
|
@@ -4,12 +4,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { createContext, useContext, useState, useEffect } from 'react';
|
|
7
|
+
import React, { createContext, useContext, useState, useEffect, useMemo } from 'react';
|
|
8
8
|
import { useAppointmentBooking } from "./hooks";
|
|
9
9
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
10
|
+
import { TasksManager } from "../../utils/tasks";
|
|
10
11
|
var AppointmentBookingContext = /*#__PURE__*/createContext(undefined);
|
|
11
12
|
export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref) {
|
|
12
|
-
var _appHelper$utils;
|
|
13
|
+
var _appHelper$utils, _currentStep$step2, _appointmentBooking$s;
|
|
13
14
|
var children = _ref.children;
|
|
14
15
|
var appointmentBooking = useAppointmentBooking();
|
|
15
16
|
// 总计计算
|
|
@@ -49,18 +50,24 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
49
50
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
50
51
|
currentResource = _useState18[0],
|
|
51
52
|
setCurrentResource = _useState18[1];
|
|
52
|
-
var _useState19 = useState(
|
|
53
|
+
var _useState19 = useState(false),
|
|
53
54
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
loading = _useState20[0],
|
|
56
|
+
setLoading = _useState20[1];
|
|
56
57
|
var _useState21 = useState(false),
|
|
57
58
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
isErrorHolder = _useState22[0],
|
|
60
|
+
setIsErrorHolder = _useState22[1];
|
|
61
|
+
// 初始化 TasksManager
|
|
62
|
+
var _useState23 = useState(function () {
|
|
63
|
+
return new TasksManager();
|
|
64
|
+
}),
|
|
65
|
+
_useState24 = _slicedToArray(_useState23, 1),
|
|
66
|
+
tasksManager = _useState24[0];
|
|
67
|
+
var _useState25 = useState(null),
|
|
68
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
69
|
+
policyParams = _useState26[0],
|
|
70
|
+
setPolicyParams = _useState26[1];
|
|
64
71
|
var _useEngineContext = useEngineContext(),
|
|
65
72
|
appHelper = _useEngineContext.appHelper;
|
|
66
73
|
var symbolic = appHelper === null || appHelper === void 0 || (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : _appHelper$utils.getSymbolic();
|
|
@@ -68,6 +75,20 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
68
75
|
var currentStep = appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.getCurrentStep();
|
|
69
76
|
setCurrentStep(currentStep);
|
|
70
77
|
}, []);
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @title: 是否是最后一步
|
|
81
|
+
* @description:
|
|
82
|
+
* @param {*} useMemo
|
|
83
|
+
* @return {*}
|
|
84
|
+
* @Author: WangHan
|
|
85
|
+
* @Date: 2025-05-10 15:18
|
|
86
|
+
*/
|
|
87
|
+
var isLastStep = useMemo(function () {
|
|
88
|
+
var _currentStep$step;
|
|
89
|
+
var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
90
|
+
return key === 'confirm-information';
|
|
91
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList]);
|
|
71
92
|
var value = {
|
|
72
93
|
appointmentBooking: appointmentBooking,
|
|
73
94
|
times: times,
|
|
@@ -90,12 +111,14 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
|
|
|
90
111
|
setIsAgreeDepositPolicy: setIsAgreeDepositPolicy,
|
|
91
112
|
currentResource: currentResource,
|
|
92
113
|
setCurrentResource: setCurrentResource,
|
|
93
|
-
setStepParams: setStepParams,
|
|
94
|
-
stepParams: stepParams,
|
|
95
114
|
loading: loading,
|
|
96
115
|
setLoading: setLoading,
|
|
97
116
|
isErrorHolder: isErrorHolder,
|
|
98
|
-
setIsErrorHolder: setIsErrorHolder
|
|
117
|
+
setIsErrorHolder: setIsErrorHolder,
|
|
118
|
+
isLastStep: isLastStep,
|
|
119
|
+
tasksManager: tasksManager,
|
|
120
|
+
policyParams: policyParams,
|
|
121
|
+
setPolicyParams: setPolicyParams
|
|
99
122
|
};
|
|
100
123
|
return /*#__PURE__*/React.createElement(AppointmentBookingContext.Provider, {
|
|
101
124
|
value: value
|
|
@@ -5,14 +5,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
5
5
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
6
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
9
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
8
|
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; }
|
|
12
9
|
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; }
|
|
13
10
|
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; }
|
|
14
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
15
12
|
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); }
|
|
13
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
14
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
15
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
16
16
|
import { useState, useEffect, useMemo } from 'react';
|
|
17
17
|
import { locales } from "@pisell/utils";
|
|
18
18
|
import { usePisellOS } from "../../hooks/useEngineContext";
|
|
@@ -47,20 +47,13 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
47
47
|
var pisellOS = usePisellOS();
|
|
48
48
|
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
49
49
|
appointmentBooking = _useAppointmentBookin.appointmentBooking,
|
|
50
|
-
setCurrentStep = _useAppointmentBookin.setCurrentStep
|
|
51
|
-
setStepParams = _useAppointmentBookin.setStepParams,
|
|
52
|
-
stepParams = _useAppointmentBookin.stepParams;
|
|
50
|
+
setCurrentStep = _useAppointmentBookin.setCurrentStep;
|
|
53
51
|
var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
|
|
54
52
|
|
|
55
53
|
// 判断是否是最后一步
|
|
56
54
|
var getCurrentAndLastStep = function getCurrentAndLastStep() {
|
|
57
55
|
var currentStep = appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.getCurrentStep();
|
|
58
|
-
console.log('appointmentBooking_step:changed', currentStep);
|
|
59
56
|
setCurrentStep(currentStep);
|
|
60
|
-
setStepParams(_objectSpread(_objectSpread({}, stepParams), {}, {
|
|
61
|
-
isLastStep: (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) === stepList.length - 1,
|
|
62
|
-
isTwoLastStep: (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) === stepList.length - 2
|
|
63
|
-
}));
|
|
64
57
|
};
|
|
65
58
|
useEffect(function () {
|
|
66
59
|
getCurrentAndLastStep();
|
|
@@ -70,7 +63,6 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
70
63
|
while (1) switch (_context.prev = _context.next) {
|
|
71
64
|
case 0:
|
|
72
65
|
if (res.path === 'currentStep') {
|
|
73
|
-
console.log('appointmentBooking_step:changed', res);
|
|
74
66
|
getCurrentAndLastStep();
|
|
75
67
|
}
|
|
76
68
|
case 1:
|
|
@@ -255,16 +247,15 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
255
247
|
return appointmentBooking.getCart();
|
|
256
248
|
case 2:
|
|
257
249
|
carts = _context4.sent;
|
|
258
|
-
console.log(carts, appointmentBooking, utils, '3khhsdjf');
|
|
259
250
|
newCarts = carts === null || carts === void 0 ? void 0 : carts.map(function (item) {
|
|
260
251
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
261
252
|
addHolderButtonText: utils === null || utils === void 0 ? void 0 : utils.translation(bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_name)
|
|
262
253
|
});
|
|
263
254
|
});
|
|
264
255
|
setCarts(newCarts || []);
|
|
265
|
-
_context4.next =
|
|
256
|
+
_context4.next = 7;
|
|
266
257
|
return appointmentBooking.getSummary();
|
|
267
|
-
case
|
|
258
|
+
case 7:
|
|
268
259
|
summary = _context4.sent;
|
|
269
260
|
setSummary(summary || {});
|
|
270
261
|
|
|
@@ -272,8 +263,7 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
272
263
|
if (!carts.length) {
|
|
273
264
|
setIsAgreeDepositPolicy(false);
|
|
274
265
|
}
|
|
275
|
-
|
|
276
|
-
case 12:
|
|
266
|
+
case 10:
|
|
277
267
|
case "end":
|
|
278
268
|
return _context4.stop();
|
|
279
269
|
}
|
|
@@ -310,7 +300,6 @@ export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
|
|
|
310
300
|
var _utils$token, _utils$token$get;
|
|
311
301
|
var utils = contextUtils();
|
|
312
302
|
var isLogin = !!(utils !== null && utils !== void 0 && (_utils$token = utils.token) !== null && _utils$token !== void 0 && (_utils$token$get = _utils$token.get) !== null && _utils$token$get !== void 0 && _utils$token$get.call(_utils$token));
|
|
313
|
-
console.log(isLogin, 'isLogin');
|
|
314
303
|
var openLoginModal = function openLoginModal(params) {
|
|
315
304
|
var _ref11 = params || {},
|
|
316
305
|
callback = _ref11.callback;
|
|
@@ -509,7 +498,6 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
509
498
|
return item.code;
|
|
510
499
|
});
|
|
511
500
|
setResources(resources || []);
|
|
512
|
-
console.log(resourceCodes, resources, 'getResourceList');
|
|
513
501
|
return {
|
|
514
502
|
resources: resources,
|
|
515
503
|
resourceCodes: resourceCodes
|
|
@@ -102,6 +102,7 @@ declare const _default: {
|
|
|
102
102
|
'pisell2.appointment.select.time': string;
|
|
103
103
|
'pisell2.appointment.unselect.time': string;
|
|
104
104
|
'pisell2.appointment.unselect.date': string;
|
|
105
|
+
'pisell2.appointment.unuse.date': string;
|
|
105
106
|
'pisell2.appointment.add-guests': string;
|
|
106
107
|
'pisell2.text.apply': string;
|
|
107
108
|
'pisell2.text.goodpass': string;
|
|
@@ -216,6 +217,7 @@ declare const _default: {
|
|
|
216
217
|
'pisell2.appointment.select.time': string;
|
|
217
218
|
'pisell2.appointment.unselect.time': string;
|
|
218
219
|
'pisell2.appointment.unselect.date': string;
|
|
220
|
+
'pisell2.appointment.unuse.date': string;
|
|
219
221
|
'pisell2.appointment.add-guests': string;
|
|
220
222
|
'pisell2.text.apply': string;
|
|
221
223
|
'pisell2.text.goodpass': string;
|
|
@@ -330,6 +332,7 @@ declare const _default: {
|
|
|
330
332
|
'pisell2.appointment.select.time': string;
|
|
331
333
|
'pisell2.appointment.unselect.time': string;
|
|
332
334
|
'pisell2.appointment.unselect.date': string;
|
|
335
|
+
'pisell2.appointment.unuse.date': string;
|
|
333
336
|
'pisell2.appointment.add-guests': string;
|
|
334
337
|
'pisell2.text.apply': string;
|
|
335
338
|
'pisell2.text.goodpass': string;
|