@pisell/private-materials 3.3.42 → 3.3.44
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 +5 -5
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -25
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +31 -16
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +39 -20
- package/es/components/appointmentBooking/components/Date/index.js +2 -13
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Form/index.js +76 -167
- package/es/components/appointmentBooking/components/Form/utils.d.ts +8 -0
- package/es/components/appointmentBooking/components/Form/utils.js +36 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +78 -46
- package/es/components/appointmentBooking/components/Resource/index.js +92 -115
- package/es/components/appointmentBooking/components/Services/index.js +19 -4
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +20 -27
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/es/components/appointmentBooking/context.js +50 -3
- package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/es/components/appointmentBooking/hooks.d.ts +1 -2
- package/es/components/appointmentBooking/hooks.js +377 -269
- package/es/components/appointmentBooking/utils.d.ts +91 -2
- package/es/components/appointmentBooking/utils.js +350 -61
- package/es/components/booking/components/footer/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.js +2 -1
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/component/fail/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +1 -0
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/es/components/productExtension/index.d.ts +0 -1
- package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/es/components/productSelect/components/productGroup/index.d.ts +11 -7
- package/es/components/productSelect/components/productGroup/index.js +32 -19
- package/es/components/productSelect/components/productGroup/index.less +17 -3
- package/es/components/productSelect/index.d.ts +3 -2
- package/es/components/productSelect/index.js +20 -6
- package/es/components/productSelect/index.less +7 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/es/components/shoppingCart/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +11 -3
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/es/components/wallet/hooks/useWalletCard.d.ts +0 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +0 -5
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +35 -16
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +37 -21
- package/lib/components/appointmentBooking/components/Date/index.js +0 -6
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Form/index.js +56 -108
- package/lib/components/appointmentBooking/components/Form/utils.d.ts +8 -0
- package/lib/components/appointmentBooking/components/Form/utils.js +49 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +49 -19
- package/lib/components/appointmentBooking/components/Resource/index.js +51 -69
- package/lib/components/appointmentBooking/components/Services/index.js +16 -3
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +1 -7
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/lib/components/appointmentBooking/context.js +52 -4
- package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
- package/lib/components/appointmentBooking/hooks.d.ts +1 -2
- package/lib/components/appointmentBooking/hooks.js +153 -57
- package/lib/components/appointmentBooking/utils.d.ts +91 -2
- package/lib/components/appointmentBooking/utils.js +210 -50
- package/lib/components/booking/components/footer/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.js +2 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +1 -0
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/lib/components/productExtension/index.d.ts +0 -1
- package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/lib/components/productSelect/components/productGroup/index.d.ts +11 -7
- package/lib/components/productSelect/components/productGroup/index.js +12 -10
- package/lib/components/productSelect/components/productGroup/index.less +17 -3
- package/lib/components/productSelect/index.d.ts +3 -2
- package/lib/components/productSelect/index.js +17 -3
- package/lib/components/productSelect/index.less +7 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/lib/components/shoppingCart/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +9 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lowcode/product-select/meta.ts +18 -34
- package/package.json +2 -2
|
@@ -38,26 +38,41 @@ var import_progressBar = __toESM(require("../../../eventBooking/components/progr
|
|
|
38
38
|
var import_context = require("../../context");
|
|
39
39
|
var import_hooks = require("../../hooks");
|
|
40
40
|
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
41
|
+
var import_utils2 = require("../../utils");
|
|
41
42
|
var import_index = require("./index.less");
|
|
42
43
|
var Header = () => {
|
|
43
44
|
var _a;
|
|
44
|
-
const {
|
|
45
|
+
const {
|
|
46
|
+
currentStep,
|
|
47
|
+
appointmentBooking,
|
|
48
|
+
setTimes,
|
|
49
|
+
carts,
|
|
50
|
+
currentStepParams,
|
|
51
|
+
currentSelectedResources
|
|
52
|
+
} = (0, import_context.useAppointmentBookingContext)();
|
|
45
53
|
const shopDiscount = (0, import_hooks.useShopDiscount)();
|
|
46
54
|
const context = (0, import_useEngineContext.default)();
|
|
47
|
-
const {
|
|
48
|
-
const {
|
|
49
|
-
const { setOtherData } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
55
|
+
const { stepList, updateStep, removeStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
56
|
+
const { setOtherData, getOtherData } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
50
57
|
const { checkProductType } = (0, import_hooks.useAppointmentBookingProduct)();
|
|
58
|
+
const utils = (0, import_hooks.contextUtils)();
|
|
51
59
|
const stepName = (0, import_react.useMemo)(() => {
|
|
52
|
-
var _a2, _b, _c
|
|
60
|
+
var _a2, _b, _c;
|
|
53
61
|
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
54
62
|
if (!key) return "";
|
|
55
|
-
if (key
|
|
56
|
-
const
|
|
63
|
+
if (key.startsWith("select-resource")) {
|
|
64
|
+
const currentResource = (_b = currentSelectedResources == null ? void 0 : currentSelectedResources[0]) == null ? void 0 : _b.currentSelectedResource;
|
|
65
|
+
const resourceItem = (currentResource == null ? void 0 : currentResource.resourceItem) || {};
|
|
66
|
+
const name = (0, import_utils2.getResourceTitle)(
|
|
67
|
+
appointmentBooking,
|
|
68
|
+
resourceItem == null ? void 0 : resourceItem.code,
|
|
69
|
+
utils,
|
|
70
|
+
resourceItem
|
|
71
|
+
);
|
|
57
72
|
return import_utils.locales.getText("pisell2.event.select.category")(name);
|
|
58
73
|
}
|
|
59
|
-
return ((
|
|
60
|
-
}, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key,
|
|
74
|
+
return ((_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.description) || "";
|
|
75
|
+
}, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key, currentSelectedResources]);
|
|
61
76
|
const handleBack = async () => {
|
|
62
77
|
var _a2, _b;
|
|
63
78
|
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
@@ -82,29 +97,44 @@ var Header = () => {
|
|
|
82
97
|
if (key === "select-time") {
|
|
83
98
|
setTimes([]);
|
|
84
99
|
}
|
|
85
|
-
if (key
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if ((resourceStep == null ? void 0 : resourceStep.isSkip) && (resourceStep == null ? void 0 : resourceStep.key) === "select-resource") {
|
|
90
|
-
appointmentBooking.deleteCartItemInfo("resource");
|
|
100
|
+
if (key.startsWith("fill-form")) {
|
|
101
|
+
const form_key = "booking_form";
|
|
102
|
+
let booking_form = getOtherData(form_key);
|
|
103
|
+
setOtherData(form_key, { ...booking_form, [key]: {} });
|
|
91
104
|
}
|
|
92
105
|
appointmentBooking.back();
|
|
93
|
-
const prevStepData = stepList[(
|
|
94
|
-
const currentStepData = stepList[
|
|
106
|
+
const prevStepData = stepList[(currentStepParams == null ? void 0 : currentStepParams.index) - 1];
|
|
107
|
+
const currentStepData = stepList[currentStepParams == null ? void 0 : currentStepParams.index];
|
|
95
108
|
if ((currentStepData == null ? void 0 : currentStepData.isSkip) || (prevStepData == null ? void 0 : prevStepData.isSkip)) {
|
|
96
109
|
const key2 = (currentStepData == null ? void 0 : currentStepData.isSkip) ? currentStepData == null ? void 0 : currentStepData.key : prevStepData == null ? void 0 : prevStepData.key;
|
|
110
|
+
if (key2 === "select-resource") {
|
|
111
|
+
appointmentBooking.deleteCartItemInfo("resource");
|
|
112
|
+
}
|
|
97
113
|
updateStep(key2, {
|
|
98
114
|
isSkip: false
|
|
99
115
|
});
|
|
100
116
|
}
|
|
117
|
+
if ((prevStepData == null ? void 0 : prevStepData.key) === "select-service") {
|
|
118
|
+
stepList.forEach((item) => {
|
|
119
|
+
if (item.key.startsWith("select-resource_") || item.key.startsWith("fill-form_")) {
|
|
120
|
+
removeStep(item.key);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if ((currentStepData == null ? void 0 : currentStepData.key) === "select-resource") {
|
|
125
|
+
stepList.forEach((item) => {
|
|
126
|
+
if (item.key.startsWith("fill-form_")) {
|
|
127
|
+
removeStep(item.key);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
101
131
|
};
|
|
102
132
|
const handleClose = () => {
|
|
103
133
|
var _a2, _b;
|
|
104
134
|
appointmentBooking.destroy();
|
|
105
135
|
(_a2 = shopDiscount == null ? void 0 : shopDiscount.destroy) == null ? void 0 : _a2.call(shopDiscount);
|
|
106
|
-
const
|
|
107
|
-
(_b =
|
|
136
|
+
const utils2 = context.appHelper.utils || {};
|
|
137
|
+
(_b = utils2 == null ? void 0 : utils2.history) == null ? void 0 : _b.replace("/");
|
|
108
138
|
};
|
|
109
139
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
110
140
|
import_progressBar.default,
|
|
@@ -39,10 +39,8 @@ var import_materials = require("@pisell/materials");
|
|
|
39
39
|
var import_hooks = require("../../hooks");
|
|
40
40
|
var import_context = require("../../context");
|
|
41
41
|
var import_utils = require("../../utils");
|
|
42
|
-
var import_utils2 = require("../../components/Cart/utils");
|
|
43
|
-
var import_utils3 = require("./utils");
|
|
44
42
|
var import_guests = __toESM(require("../../assets/guests.svg"));
|
|
45
|
-
var
|
|
43
|
+
var import_utils2 = require("@pisell/utils");
|
|
46
44
|
var import_index = require("./index.less");
|
|
47
45
|
var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
48
46
|
const [selectedResource, setSelectedResource] = (0, import_react.useState)(0);
|
|
@@ -50,63 +48,19 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
50
48
|
appointmentBooking,
|
|
51
49
|
carts,
|
|
52
50
|
resourceOtherParams,
|
|
53
|
-
setCarts,
|
|
54
51
|
currentStep,
|
|
55
52
|
setResourceOtherParams,
|
|
56
|
-
|
|
57
|
-
setPolicyIds
|
|
53
|
+
currentStepParams
|
|
58
54
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
59
|
-
const {
|
|
60
|
-
getResourceList,
|
|
61
|
-
autoSelectAllProductResources,
|
|
62
|
-
getResourceTimeSlot
|
|
63
|
-
} = (0, import_hooks.useAppointmentBookingResource)();
|
|
55
|
+
const { getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
|
|
64
56
|
const { checkSkipResourceStep } = (0, import_hooks.useIsSkipResourceStep)();
|
|
65
57
|
const { updateStep, nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
66
|
-
const { openLoginModal, isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
67
|
-
const { getHolders, checkAccount } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
68
|
-
const { isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
69
|
-
const utils = (0, import_hooks.contextUtils)();
|
|
70
58
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
71
59
|
next: async () => {
|
|
72
|
-
var _a, _b, _c;
|
|
73
|
-
const result = (0, import_utils2.checkResource)({ carts, resources });
|
|
74
|
-
if (result) {
|
|
75
|
-
setCarts(result);
|
|
76
|
-
}
|
|
77
|
-
setIsErrorHolder(!!result);
|
|
78
|
-
if (!!result) {
|
|
79
|
-
(0, import_utils3.scrollToFirstErrorCard)();
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const resultCarts = (0, import_utils.formatCartsResources)(carts, resources, setPolicyIds);
|
|
83
|
-
const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
|
|
84
|
-
const accountLists = await appointmentBooking.getAccounts();
|
|
85
|
-
const checkResult = (0, import_utils.checkHasFormStep)({
|
|
86
|
-
setIsErrorHolder,
|
|
87
|
-
nextStep,
|
|
88
|
-
hasResourceFormId: (resultCarts == null ? void 0 : resultCarts.length) > 0,
|
|
89
|
-
currentStep,
|
|
90
|
-
stepList,
|
|
91
|
-
appointmentBooking,
|
|
92
|
-
locales: import_utils4.locales,
|
|
93
|
-
openLoginModal,
|
|
94
|
-
utils,
|
|
95
|
-
accountLists,
|
|
96
|
-
getHolders,
|
|
97
|
-
checkHolder: import_utils2.checkHolder,
|
|
98
|
-
checkAccount,
|
|
99
|
-
setCarts,
|
|
100
|
-
carts,
|
|
101
|
-
isFormSubject,
|
|
102
|
-
isLogin
|
|
103
|
-
});
|
|
104
|
-
if (checkResult) return;
|
|
105
60
|
setResourceOtherParams({
|
|
106
61
|
...resourceOtherParams,
|
|
107
62
|
errorList: null
|
|
108
63
|
});
|
|
109
|
-
getResourceTimeSlot();
|
|
110
64
|
nextStep();
|
|
111
65
|
}
|
|
112
66
|
}));
|
|
@@ -119,8 +73,6 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
119
73
|
var _a;
|
|
120
74
|
try {
|
|
121
75
|
const _resources = getResourceList();
|
|
122
|
-
await autoSelectAllProductResources();
|
|
123
|
-
getResourceList();
|
|
124
76
|
const skipResourceStep = await checkSkipResourceStep();
|
|
125
77
|
const key = (_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key;
|
|
126
78
|
updateStep(key, {
|
|
@@ -135,40 +87,70 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
135
87
|
}
|
|
136
88
|
};
|
|
137
89
|
checkAndSkipResourceStep();
|
|
138
|
-
}, []);
|
|
90
|
+
}, [currentStepParams.key]);
|
|
139
91
|
const anyResource = [
|
|
140
92
|
{
|
|
141
93
|
id: 0,
|
|
142
94
|
image: import_guests.default,
|
|
143
|
-
title:
|
|
144
|
-
subtitle:
|
|
95
|
+
title: import_utils2.locales.getText("pisell2.appointment.any.professional"),
|
|
96
|
+
subtitle: import_utils2.locales.getText("pisell2.appointment.for.maximum.availability")
|
|
145
97
|
}
|
|
146
98
|
];
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
99
|
+
const appointmentBoard = (0, import_react.useMemo)(() => {
|
|
100
|
+
return (0, import_utils.currentAppointmentBoard)(
|
|
101
|
+
currentStepParams.key,
|
|
102
|
+
resources,
|
|
103
|
+
appointmentBooking
|
|
104
|
+
);
|
|
105
|
+
}, [currentStepParams.key, resources]);
|
|
106
|
+
const renderLists = (0, import_react.useMemo)(() => {
|
|
107
|
+
if (carts.length > 1 || !(carts == null ? void 0 : carts.length)) {
|
|
108
|
+
return [];
|
|
157
109
|
}
|
|
158
|
-
|
|
110
|
+
return (0, import_utils.currentRenderLists)(resources, appointmentBoard == null ? void 0 : appointmentBoard.form_code);
|
|
111
|
+
}, [resources, appointmentBoard == null ? void 0 : appointmentBoard.form_code, carts]);
|
|
112
|
+
(0, import_react.useEffect)(() => {
|
|
113
|
+
const autoSelectResources = async () => {
|
|
114
|
+
if (!(appointmentBoard == null ? void 0 : appointmentBoard.form_code)) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const res = await appointmentBooking.autoSelectAllProductResources(
|
|
118
|
+
appointmentBoard == null ? void 0 : appointmentBoard.form_code
|
|
119
|
+
);
|
|
120
|
+
setResourceOtherParams({
|
|
121
|
+
...resourceOtherParams,
|
|
122
|
+
...res
|
|
123
|
+
});
|
|
124
|
+
getResourceList();
|
|
125
|
+
const cartItem = carts == null ? void 0 : carts[0];
|
|
126
|
+
appointmentBooking.updateCart({
|
|
127
|
+
_id: cartItem == null ? void 0 : cartItem._id,
|
|
128
|
+
...cartItem
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
autoSelectResources();
|
|
132
|
+
}, [appointmentBoard]);
|
|
159
133
|
const resourcesResult = (0, import_react.useMemo)(() => {
|
|
160
|
-
|
|
161
|
-
|
|
134
|
+
let _anyResource = (appointmentBoard == null ? void 0 : appointmentBoard.isRequired) ? [] : [...anyResource];
|
|
135
|
+
return _anyResource.concat(renderLists || []);
|
|
136
|
+
}, [renderLists, appointmentBoard]);
|
|
162
137
|
const onClick = (e) => {
|
|
163
138
|
var _a;
|
|
164
139
|
setSelectedResource(e.id);
|
|
165
140
|
if (e.id) {
|
|
166
141
|
return appointmentBooking.updateCart({
|
|
167
142
|
_id: (_a = carts == null ? void 0 : carts[0]) == null ? void 0 : _a._id,
|
|
168
|
-
resources: [e
|
|
143
|
+
resources: (0, import_utils.updateCartResources)(carts == null ? void 0 : carts[0], e)
|
|
169
144
|
});
|
|
170
145
|
}
|
|
171
146
|
};
|
|
147
|
+
(0, import_react.useEffect)(() => {
|
|
148
|
+
var _a, _b, _c;
|
|
149
|
+
const selectedResource2 = (_c = (_b = (_a = carts == null ? void 0 : carts[0]) == null ? void 0 : _a._origin) == null ? void 0 : _b.resources) == null ? void 0 : _c.find(
|
|
150
|
+
(item) => (item == null ? void 0 : item.form_id) === (appointmentBoard == null ? void 0 : appointmentBoard.form_id)
|
|
151
|
+
);
|
|
152
|
+
setSelectedResource((selectedResource2 == null ? void 0 : selectedResource2.id) || 0);
|
|
153
|
+
}, [carts, appointmentBoard == null ? void 0 : appointmentBoard.form_id]);
|
|
172
154
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-resource-wrap" }, !(resourcesResult == null ? void 0 : resourcesResult.length) ? /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true }) : /* @__PURE__ */ import_react.default.createElement(
|
|
173
155
|
import_materials.PisellCustomCheckboxGroup,
|
|
174
156
|
{
|
|
@@ -188,7 +170,7 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
188
170
|
}
|
|
189
171
|
);
|
|
190
172
|
},
|
|
191
|
-
columns: (0,
|
|
173
|
+
columns: (0, import_utils2.isMobile)() ? 2 : 3,
|
|
192
174
|
horizontalGap: 16,
|
|
193
175
|
verticalGap: 16,
|
|
194
176
|
onClick: (e) => onClick && onClick(e)
|
|
@@ -48,7 +48,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
48
48
|
const { isDateSelectedFirst, isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
49
49
|
const { getProducts, checkProductType } = (0, import_hooks.useAppointmentBookingProduct)();
|
|
50
50
|
const { removeStep, nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
51
|
-
const { currentStep, setLoading } = (0, import_context.useAppointmentBookingContext)();
|
|
51
|
+
const { currentStep, setLoading, carts } = (0, import_context.useAppointmentBookingContext)();
|
|
52
52
|
const [products, setProducts] = (0, import_react.useState)(null);
|
|
53
53
|
const [productLoading, setProductLoading] = (0, import_react.useState)(false);
|
|
54
54
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
@@ -57,7 +57,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
57
57
|
setTimeout(() => {
|
|
58
58
|
nextStep();
|
|
59
59
|
setLoading(false);
|
|
60
|
-
},
|
|
60
|
+
}, 500);
|
|
61
61
|
}
|
|
62
62
|
}));
|
|
63
63
|
(0, import_react.useEffect)(() => {
|
|
@@ -153,6 +153,17 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
155
|
};
|
|
156
|
+
const productListSetting = (0, import_react.useMemo)(() => {
|
|
157
|
+
var _a;
|
|
158
|
+
const { customPageData } = ((_a = context.engine) == null ? void 0 : _a.props) || {};
|
|
159
|
+
let productListBlock;
|
|
160
|
+
if (Array.isArray(customPageData == null ? void 0 : customPageData.block)) {
|
|
161
|
+
productListBlock = customPageData.block.find(
|
|
162
|
+
(b) => "product_list" === b.type
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
return (productListBlock == null ? void 0 : productListBlock.setting) || {};
|
|
166
|
+
}, [context]);
|
|
156
167
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-service-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
157
168
|
import_productSelect.default,
|
|
158
169
|
{
|
|
@@ -171,7 +182,9 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
171
182
|
tabItemActiveBg: "var(--theme-color)",
|
|
172
183
|
categoryTextColor: "#1B1B1B",
|
|
173
184
|
cardSelectedBg: "var(--theme-color)"
|
|
174
|
-
}
|
|
185
|
+
},
|
|
186
|
+
productListSetting,
|
|
187
|
+
selectedItems: carts
|
|
175
188
|
}
|
|
176
189
|
));
|
|
177
190
|
});
|
|
@@ -65,13 +65,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
|
65
65
|
}, []);
|
|
66
66
|
const getAutoSelect = async (val) => {
|
|
67
67
|
setSelectedTime(val);
|
|
68
|
-
const { resourceCodes } = getResourceList();
|
|
69
|
-
const { errorList } = await appointmentBooking.autoSelectAllProductResources(
|
|
70
|
-
resourceCodes == null ? void 0 : resourceCodes[1],
|
|
71
|
-
val
|
|
72
|
-
);
|
|
73
68
|
const result = await appointmentBooking.submitTimeSlot(val);
|
|
74
|
-
console.log(errorList, result, "wh9896788");
|
|
75
69
|
};
|
|
76
70
|
(0, import_react.useEffect)(() => {
|
|
77
71
|
var _a, _b, _c;
|
|
@@ -81,7 +75,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
|
81
75
|
if ((_c = carts == null ? void 0 : carts[0]) == null ? void 0 : _c.start_time) return;
|
|
82
76
|
getAutoSelect(times == null ? void 0 : times[0]);
|
|
83
77
|
}
|
|
84
|
-
}, [times]);
|
|
78
|
+
}, [times, carts]);
|
|
85
79
|
const onClick = async (e) => {
|
|
86
80
|
setSelectedResource(e == null ? void 0 : e.start_time);
|
|
87
81
|
getAutoSelect(e);
|
|
@@ -37,11 +37,12 @@ var import_react = __toESM(require("react"));
|
|
|
37
37
|
var import_hooks = require("./hooks");
|
|
38
38
|
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
39
39
|
var import_tasks = require("../../utils/tasks");
|
|
40
|
+
var import_utils = require("./utils");
|
|
40
41
|
var AppointmentBookingContext = (0, import_react.createContext)(void 0);
|
|
41
42
|
var AppointmentBookingProvider = ({
|
|
42
43
|
children
|
|
43
44
|
}) => {
|
|
44
|
-
var _a, _b, _c, _d, _e;
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
45
46
|
const policyIdsRef = (0, import_react.useRef)([]);
|
|
46
47
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
47
48
|
const [summary, setSummary] = (0, import_react.useState)({});
|
|
@@ -57,6 +58,7 @@ var AppointmentBookingProvider = ({
|
|
|
57
58
|
const [isErrorHolder, setIsErrorHolder] = (0, import_react.useState)(false);
|
|
58
59
|
const [tasksManager] = (0, import_react.useState)(() => new import_tasks.TasksManager());
|
|
59
60
|
const [policyParams, setPolicyParams] = (0, import_react.useState)(null);
|
|
61
|
+
const [currentSelectedResources, setCurrentSelectedResources] = (0, import_react.useState)();
|
|
60
62
|
const { appHelper } = (0, import_useEngineContext.default)();
|
|
61
63
|
const symbolic = (_a = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _a.getSymbolic();
|
|
62
64
|
(0, import_react.useEffect)(() => {
|
|
@@ -75,14 +77,57 @@ var AppointmentBookingProvider = ({
|
|
|
75
77
|
policyParams.callback();
|
|
76
78
|
}
|
|
77
79
|
};
|
|
80
|
+
const stepLists = (0, import_react.useMemo)(() => {
|
|
81
|
+
var _a2, _b2, _c2;
|
|
82
|
+
return ((_c2 = (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.step) == null ? void 0 : _b2.store) == null ? void 0 : _c2.stepList) || [];
|
|
83
|
+
}, [(_d = (_c = (_b = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _b.step) == null ? void 0 : _c.store) == null ? void 0 : _d.stepList]);
|
|
78
84
|
const isLastStep = (0, import_react.useMemo)(() => {
|
|
79
85
|
var _a2;
|
|
80
86
|
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
81
87
|
return key === "confirm-information";
|
|
82
88
|
}, [
|
|
83
|
-
(
|
|
84
|
-
(
|
|
89
|
+
(_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.key,
|
|
90
|
+
(_h = (_g = (_f = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _f.step) == null ? void 0 : _g.store) == null ? void 0 : _h.stepList
|
|
85
91
|
]);
|
|
92
|
+
const currentStepParams = (0, import_react.useMemo)(() => {
|
|
93
|
+
var _a2;
|
|
94
|
+
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
95
|
+
const index = stepLists.findIndex((item) => item.key === key);
|
|
96
|
+
return {
|
|
97
|
+
key,
|
|
98
|
+
index,
|
|
99
|
+
stepLists
|
|
100
|
+
};
|
|
101
|
+
}, [(_i = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _i.key, stepLists]);
|
|
102
|
+
(0, import_react.useEffect)(() => {
|
|
103
|
+
var _a2, _b2;
|
|
104
|
+
if (((_a2 = currentStepParams == null ? void 0 : currentStepParams.key) == null ? void 0 : _a2.startsWith("select-resource")) || ((_b2 = currentStepParams == null ? void 0 : currentStepParams.key) == null ? void 0 : _b2.startsWith("fill-form"))) {
|
|
105
|
+
if (!(carts == null ? void 0 : carts.length) || !(resources == null ? void 0 : resources.length)) {
|
|
106
|
+
return setCurrentSelectedResources(null);
|
|
107
|
+
}
|
|
108
|
+
const currentSelectedResources2 = carts.map((item) => {
|
|
109
|
+
return {
|
|
110
|
+
_id: item == null ? void 0 : item._id,
|
|
111
|
+
currentSelectedResource: (0, import_utils.getCartCurrentResourceData)(
|
|
112
|
+
item,
|
|
113
|
+
currentStepParams == null ? void 0 : currentStepParams.key,
|
|
114
|
+
resources
|
|
115
|
+
)
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
setCurrentSelectedResources(currentSelectedResources2);
|
|
119
|
+
appointmentBooking.setOtherData(
|
|
120
|
+
"current_selected_resources",
|
|
121
|
+
currentSelectedResources2
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
}, [currentStepParams == null ? void 0 : currentStepParams.key, carts, resources]);
|
|
125
|
+
(0, import_react.useEffect)(() => {
|
|
126
|
+
const currentSelectedResources2 = appointmentBooking.getOtherData(
|
|
127
|
+
"current_selected_resources"
|
|
128
|
+
);
|
|
129
|
+
setCurrentSelectedResources(currentSelectedResources2 || []);
|
|
130
|
+
}, []);
|
|
86
131
|
const value = {
|
|
87
132
|
appointmentBooking,
|
|
88
133
|
times,
|
|
@@ -116,7 +161,10 @@ var AppointmentBookingProvider = ({
|
|
|
116
161
|
policyIdsRef,
|
|
117
162
|
setPolicyIds,
|
|
118
163
|
openPolicy,
|
|
119
|
-
closePolicy
|
|
164
|
+
closePolicy,
|
|
165
|
+
currentStepParams,
|
|
166
|
+
currentSelectedResources,
|
|
167
|
+
setCurrentSelectedResources
|
|
120
168
|
};
|
|
121
169
|
return /* @__PURE__ */ import_react.default.createElement(AppointmentBookingContext.Provider, { value }, children);
|
|
122
170
|
};
|
|
@@ -75,7 +75,6 @@ export declare const useAppointmentBookingResource: () => {
|
|
|
75
75
|
resources: any;
|
|
76
76
|
resourceCodes: any;
|
|
77
77
|
};
|
|
78
|
-
autoSelectAllProductResources: (index?: number) => Promise<any>;
|
|
79
78
|
};
|
|
80
79
|
/**
|
|
81
80
|
* @title: 是否跳过资源选择步骤
|
|
@@ -85,7 +84,7 @@ export declare const useAppointmentBookingResource: () => {
|
|
|
85
84
|
* @Date: 2025-04-21 11:47
|
|
86
85
|
*/
|
|
87
86
|
export declare const useIsSkipResourceStep: () => {
|
|
88
|
-
checkSkipResourceStep: (
|
|
87
|
+
checkSkipResourceStep: () => Promise<boolean>;
|
|
89
88
|
};
|
|
90
89
|
/**
|
|
91
90
|
* @title: 获取预约配置
|