@pisell/private-materials 3.2.22 → 3.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +13 -13
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/assets/guests.svg +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +83 -104
- package/es/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +32 -18
- package/es/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +11 -11
- package/es/components/appointmentBooking/components/Date/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Date/index.js +49 -32
- package/es/components/appointmentBooking/components/Date/index.less +5 -0
- package/es/components/appointmentBooking/components/Guest/index.js +8 -21
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +44 -7
- package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Resource/index.js +28 -20
- package/es/components/appointmentBooking/components/Resource/index.less +5 -0
- package/es/components/appointmentBooking/components/Services/index.js +20 -9
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +47 -32
- package/es/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.js +28 -18
- package/es/components/appointmentBooking/context.d.ts +2 -0
- package/es/components/appointmentBooking/context.js +7 -1
- package/es/components/appointmentBooking/hooks.d.ts +45 -9
- package/es/components/appointmentBooking/hooks.js +158 -121
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.js +12 -7
- package/es/components/appointmentBooking/locales.d.ts +30 -0
- package/es/components/appointmentBooking/locales.js +30 -0
- package/es/components/appointmentBooking/utils.d.ts +19 -0
- package/es/components/appointmentBooking/utils.js +68 -1
- package/es/components/booking/components/footer/utils.js +15 -15
- package/es/components/booking/components/voucher/index.d.ts +1 -1
- package/es/components/booking/components/voucher/index.js +28 -27
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.js +10 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/header/index.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/materiels/contacts/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/index.d.ts +0 -1
- package/es/components/eftpos/pos.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/component/fail/network.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/component/manual/index.d.ts +0 -1
- package/es/components/eftposPay/component/signature/index.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +0 -1
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/schedules/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +3 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +4 -3
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +0 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/assets/guests.svg +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +37 -27
- package/lib/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +23 -11
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +3 -5
- package/lib/components/appointmentBooking/components/Date/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Date/index.js +53 -47
- package/lib/components/appointmentBooking/components/Date/index.less +5 -0
- package/lib/components/appointmentBooking/components/Guest/index.js +6 -5
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +25 -3
- package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +16 -17
- package/lib/components/appointmentBooking/components/Resource/index.less +5 -0
- package/lib/components/appointmentBooking/components/Services/index.js +21 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +23 -21
- package/lib/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +28 -16
- package/lib/components/appointmentBooking/context.d.ts +2 -0
- package/lib/components/appointmentBooking/context.js +4 -1
- package/lib/components/appointmentBooking/hooks.d.ts +45 -9
- package/lib/components/appointmentBooking/hooks.js +28 -41
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.js +11 -7
- package/lib/components/appointmentBooking/locales.d.ts +30 -0
- package/lib/components/appointmentBooking/locales.js +30 -0
- package/lib/components/appointmentBooking/utils.d.ts +19 -0
- package/lib/components/appointmentBooking/utils.js +39 -1
- package/lib/components/booking/components/footer/utils.js +1 -15
- package/lib/components/booking/components/voucher/index.d.ts +1 -1
- package/lib/components/booking/components/voucher/index.js +28 -17
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.js +51 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/header/index.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/index.d.ts +0 -1
- package/lib/components/eftpos/pos.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
- package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +0 -1
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/schedules/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +1 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +3 -2
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/taxSelect/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/package.json +4 -4
|
@@ -36,14 +36,12 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_materials = require("@pisell/materials");
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
|
-
var import_hooks = require("../../hooks");
|
|
40
39
|
var import_context = require("../../context");
|
|
40
|
+
var import_hooks = require("../../hooks");
|
|
41
41
|
var import_utils2 = require("../../utils");
|
|
42
42
|
var import_index = require("./index.less");
|
|
43
43
|
var Guest = () => {
|
|
44
44
|
const [openOption, setOpenOption] = (0, import_react.useState)(false);
|
|
45
|
-
const [holderItem, setHolderItem] = (0, import_react.useState)(null);
|
|
46
|
-
const [removeOpen, setRemoveOpen] = (0, import_react.useState)(false);
|
|
47
45
|
const { carts, appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
48
46
|
const { accountLists } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
49
47
|
const lists = (0, import_react.useMemo)(() => {
|
|
@@ -80,7 +78,6 @@ var Guest = () => {
|
|
|
80
78
|
{
|
|
81
79
|
size: "large",
|
|
82
80
|
onClick: () => {
|
|
83
|
-
setHolderItem(item);
|
|
84
81
|
setOpenOption(true);
|
|
85
82
|
}
|
|
86
83
|
},
|
|
@@ -93,7 +90,6 @@ var Guest = () => {
|
|
|
93
90
|
menu: {
|
|
94
91
|
items: _options,
|
|
95
92
|
onClick: (e) => {
|
|
96
|
-
setHolderItem(item);
|
|
97
93
|
handleClick(e, item);
|
|
98
94
|
}
|
|
99
95
|
},
|
|
@@ -104,6 +100,11 @@ var Guest = () => {
|
|
|
104
100
|
);
|
|
105
101
|
};
|
|
106
102
|
const handleAddGuest = () => {
|
|
103
|
+
if (accountLists.length >= 6) {
|
|
104
|
+
return (0, import_materials.PisellToast)({
|
|
105
|
+
content: import_utils.locales.getText("pisell2.appointment.max.guest")
|
|
106
|
+
});
|
|
107
|
+
}
|
|
107
108
|
const guest = {
|
|
108
109
|
id: (0, import_utils.getUniqueId)(),
|
|
109
110
|
username: `Guest${accountLists.length + 1}`,
|
|
@@ -33,13 +33,35 @@ __export(Header_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Header_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
36
37
|
var import_progressBar = __toESM(require("../../../eventBooking/components/progressBar"));
|
|
37
38
|
var import_context = require("../../context");
|
|
38
39
|
var import_index = require("./index.less");
|
|
39
40
|
var Header = () => {
|
|
40
41
|
var _a, _b;
|
|
41
|
-
const { currentStep, appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
42
|
+
const { currentStep, appointmentBooking, resources } = (0, import_context.useAppointmentBookingContext)();
|
|
43
|
+
const stepName = (0, import_react.useMemo)(() => {
|
|
44
|
+
var _a2, _b2, _c, _d, _e;
|
|
45
|
+
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
46
|
+
if (key === "select-resource") {
|
|
47
|
+
const name = ((_d = (_c = (_b2 = resources == null ? void 0 : resources[0]) == null ? void 0 : _b2.resources) == null ? void 0 : _c[0]) == null ? void 0 : _d.title) || "";
|
|
48
|
+
return import_utils.locales.getText("pisell2.event.select.category")(name);
|
|
49
|
+
}
|
|
50
|
+
return (_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.description;
|
|
51
|
+
}, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key, resources]);
|
|
42
52
|
const handleBack = () => {
|
|
53
|
+
var _a2;
|
|
54
|
+
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
55
|
+
const types = {
|
|
56
|
+
"select-time": "time",
|
|
57
|
+
"select-resource": "resource"
|
|
58
|
+
};
|
|
59
|
+
if (types[key]) {
|
|
60
|
+
appointmentBooking.deleteCartItemInfo(types[key]);
|
|
61
|
+
}
|
|
62
|
+
if (key === "select-date") {
|
|
63
|
+
appointmentBooking.clearDateRange();
|
|
64
|
+
}
|
|
43
65
|
appointmentBooking.back();
|
|
44
66
|
};
|
|
45
67
|
const handleClose = () => {
|
|
@@ -48,8 +70,8 @@ var Header = () => {
|
|
|
48
70
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
49
71
|
import_progressBar.default,
|
|
50
72
|
{
|
|
51
|
-
title: (
|
|
52
|
-
description:
|
|
73
|
+
title: (_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.title,
|
|
74
|
+
description: stepName,
|
|
53
75
|
showBack: (currentStep == null ? void 0 : currentStep.index) > 0,
|
|
54
76
|
onBack: () => handleBack(),
|
|
55
77
|
onClose: () => handleClose()
|
|
@@ -38,32 +38,32 @@ var import_resourceDisplay = __toESM(require("../../../eventBooking/components/r
|
|
|
38
38
|
var import_materials = require("@pisell/materials");
|
|
39
39
|
var import_hooks = require("../../hooks");
|
|
40
40
|
var import_context = require("../../context");
|
|
41
|
+
var import_guests = __toESM(require("../../assets/guests.svg"));
|
|
41
42
|
var import_utils = require("@pisell/utils");
|
|
42
43
|
var import_index = require("./index.less");
|
|
43
|
-
var Resource = (
|
|
44
|
+
var Resource = () => {
|
|
44
45
|
const [selectedResource, setSelectedResource] = (0, import_react.useState)(0);
|
|
45
46
|
const { appointmentBooking, resources, carts, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
|
|
46
|
-
const {
|
|
47
|
-
getResourceList,
|
|
48
|
-
getResourceTimeSlot,
|
|
49
|
-
autoSelectAllProductResources
|
|
50
|
-
} = (0, import_hooks.useAppointmentBookingResource)();
|
|
47
|
+
const { getResourceList, autoSelectAllProductResources } = (0, import_hooks.useAppointmentBookingResource)();
|
|
51
48
|
console.log(resources, carts, appointmentBooking, "lists, products");
|
|
52
49
|
(0, import_react.useEffect)(() => {
|
|
50
|
+
var _a, _b, _c;
|
|
53
51
|
const _resources = getResourceList();
|
|
54
|
-
|
|
52
|
+
const code = (_c = (_b = (_a = _resources == null ? void 0 : _resources[0]) == null ? void 0 : _a.resources) == null ? void 0 : _b[0]) == null ? void 0 : _c.code;
|
|
53
|
+
autoSelectAllProductResources(code);
|
|
55
54
|
}, []);
|
|
56
55
|
(0, import_react.useEffect)(() => {
|
|
57
56
|
var _a;
|
|
58
|
-
console.log(resourceOtherParams == null ? void 0 : resourceOtherParams.errorList, "errorListerrorListerrorList");
|
|
59
57
|
if (((_a = resourceOtherParams == null ? void 0 : resourceOtherParams.errorList) == null ? void 0 : _a.length) > 0) {
|
|
60
|
-
return
|
|
58
|
+
return (0, import_materials.PisellToast)({
|
|
59
|
+
content: import_utils.locales.getText("pisell2.appointment.no.available.time")
|
|
60
|
+
});
|
|
61
61
|
}
|
|
62
62
|
}, [resourceOtherParams == null ? void 0 : resourceOtherParams.errorList]);
|
|
63
63
|
const anyResource = [
|
|
64
64
|
{
|
|
65
65
|
id: 0,
|
|
66
|
-
image:
|
|
66
|
+
image: import_guests.default,
|
|
67
67
|
title: "Any professional",
|
|
68
68
|
subtitle: "for maximum availability"
|
|
69
69
|
}
|
|
@@ -71,7 +71,6 @@ var Resource = ({ onChange }) => {
|
|
|
71
71
|
const currentResource = (0, import_react.useMemo)(() => {
|
|
72
72
|
var _a, _b;
|
|
73
73
|
if (resources.length && carts.length) {
|
|
74
|
-
console.log(resources, carts, "lists, products");
|
|
75
74
|
if (carts.length === 1) {
|
|
76
75
|
return (_b = (_a = resources[0]) == null ? void 0 : _a.resources) == null ? void 0 : _b[0];
|
|
77
76
|
} else {
|
|
@@ -88,12 +87,11 @@ var Resource = ({ onChange }) => {
|
|
|
88
87
|
const onClick = (e) => {
|
|
89
88
|
var _a;
|
|
90
89
|
setSelectedResource(e.id);
|
|
91
|
-
console.log(currentResource, e, "whcurrentResourcecurrentResource");
|
|
90
|
+
console.log(currentResource, e, carts, "whcurrentResourcecurrentResource");
|
|
92
91
|
if (e.id) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
resources:
|
|
96
|
-
currentResourceId: e.id
|
|
92
|
+
return appointmentBooking.updateCart({
|
|
93
|
+
_id: (_a = carts == null ? void 0 : carts[0]) == null ? void 0 : _a._id,
|
|
94
|
+
resources: [e]
|
|
97
95
|
});
|
|
98
96
|
}
|
|
99
97
|
};
|
|
@@ -111,7 +109,8 @@ var Resource = ({ onChange }) => {
|
|
|
111
109
|
dataSource: item,
|
|
112
110
|
direction: "vertical",
|
|
113
111
|
children: !(item == null ? void 0 : item.image) ? (_a = item == null ? void 0 : item.title) == null ? void 0 : _a.charAt(0).toUpperCase() : null,
|
|
114
|
-
selected: selectedResource === (item == null ? void 0 : item.id)
|
|
112
|
+
selected: selectedResource === (item == null ? void 0 : item.id),
|
|
113
|
+
className: !item.id ? "appointment-resource-guest-card" : ""
|
|
115
114
|
}
|
|
116
115
|
);
|
|
117
116
|
},
|
|
@@ -33,22 +33,36 @@ __export(Services_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Services_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
36
37
|
var import_SearchLg = __toESM(require("@pisell/icon/es/SearchLg"));
|
|
37
38
|
var import_utils = require("@pisell/utils");
|
|
38
39
|
var import_materials = require("@pisell/materials");
|
|
39
|
-
var import_antd = require("antd");
|
|
40
40
|
var import_TabProduct = __toESM(require("../../../booking/components/TabProduct"));
|
|
41
41
|
var import_utils2 = require("../../../booking/utils");
|
|
42
42
|
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
43
43
|
var import_context = require("../../context");
|
|
44
|
+
var import_hooks = require("../../hooks");
|
|
45
|
+
var import_utils3 = require("../../utils");
|
|
44
46
|
var import_index = require("./index.less");
|
|
45
47
|
var Services = () => {
|
|
46
48
|
const searchRef = (0, import_react.useRef)();
|
|
47
49
|
const [search, setSearch] = (0, import_react.useState)("");
|
|
48
50
|
const context = (0, import_useEngineContext.default)();
|
|
49
51
|
const { utils } = context.appHelper || {};
|
|
50
|
-
const
|
|
52
|
+
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
53
|
+
const { products, setProducts } = (0, import_context.useAppointmentBookingContext)();
|
|
54
|
+
const { accountLists } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
55
|
+
const accountRef = (0, import_react.useRef)(accountLists);
|
|
56
|
+
const currentUser = (0, import_utils3.formatCurrentUser)();
|
|
51
57
|
(0, import_react.useEffect)(() => {
|
|
58
|
+
console.log(accountLists, accountRef, "wh978896786");
|
|
59
|
+
}, [accountLists, accountRef]);
|
|
60
|
+
(0, import_react.useEffect)(() => {
|
|
61
|
+
var _a;
|
|
62
|
+
console.log(accountRef.current, currentUser, "accountRef");
|
|
63
|
+
if (!((_a = accountRef.current) == null ? void 0 : _a.length) && currentUser) {
|
|
64
|
+
appointmentBooking.addAccount([currentUser]);
|
|
65
|
+
}
|
|
52
66
|
const { productModuleParams } = appointmentBooking.otherParams || {};
|
|
53
67
|
appointmentBooking.loadProducts(productModuleParams).then((res) => {
|
|
54
68
|
setProducts(res || []);
|
|
@@ -65,6 +79,11 @@ var Services = () => {
|
|
|
65
79
|
const resources = ((_b = (_a = data == null ? void 0 : data.origin) == null ? void 0 : _a.product_resource) == null ? void 0 : _b.resources) || [];
|
|
66
80
|
const activeStatus = resources.find((item2) => item2.status === 1);
|
|
67
81
|
if (!activeStatus) {
|
|
82
|
+
return (0, import_materials.PisellToast)({
|
|
83
|
+
content: import_utils.locales.getText(
|
|
84
|
+
"pisell2.appointment.no.available.service"
|
|
85
|
+
)
|
|
86
|
+
});
|
|
68
87
|
}
|
|
69
88
|
const product = {
|
|
70
89
|
...data,
|
|
@@ -34,34 +34,31 @@ __export(TimeSlicing_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(TimeSlicing_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_materials = require("@pisell/materials");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
37
38
|
var import_context = require("../../context");
|
|
38
39
|
var import_index = require("./index.less");
|
|
39
40
|
var Resource = ({ params }) => {
|
|
40
41
|
const [selectedResource, setSelectedResource] = (0, import_react.useState)("");
|
|
41
|
-
const { times, resources, appointmentBooking, carts } = (0, import_context.useAppointmentBookingContext)();
|
|
42
|
+
const { times, resources, appointmentBooking, carts, setSelectedTime } = (0, import_context.useAppointmentBookingContext)();
|
|
42
43
|
console.log(params, resources, times, "wh8765");
|
|
44
|
+
const getAutoSelect = async (val) => {
|
|
45
|
+
setSelectedTime(val);
|
|
46
|
+
const { errorList } = await appointmentBooking.autoSelectAllProductResources("sites", val);
|
|
47
|
+
const result = await appointmentBooking.submitTimeSlot(val);
|
|
48
|
+
console.log(errorList, result, "wh9896788");
|
|
49
|
+
};
|
|
50
|
+
(0, import_react.useEffect)(() => {
|
|
51
|
+
var _a;
|
|
52
|
+
if ((times == null ? void 0 : times.length) > 0) {
|
|
53
|
+
setSelectedResource((_a = times == null ? void 0 : times[0]) == null ? void 0 : _a.start_time);
|
|
54
|
+
getAutoSelect(times == null ? void 0 : times[0]);
|
|
55
|
+
}
|
|
56
|
+
}, [times]);
|
|
43
57
|
const onClick = async (e) => {
|
|
44
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
45
58
|
setSelectedResource(e == null ? void 0 : e.start_time);
|
|
46
|
-
|
|
47
|
-
resourceProductData: resources == null ? void 0 : resources[0],
|
|
48
|
-
resources: (_c = (_b = (_a = resources == null ? void 0 : resources[0]) == null ? void 0 : _a.resources) == null ? void 0 : _b[1]) == null ? void 0 : _c.renderList,
|
|
49
|
-
timeSlots: e
|
|
50
|
-
});
|
|
51
|
-
if (data) {
|
|
52
|
-
const _resources = [
|
|
53
|
-
(_g = (_f = (_e = (_d = resources == null ? void 0 : resources[0]) == null ? void 0 : _d.resources) == null ? void 0 : _e[0]) == null ? void 0 : _f.renderList) == null ? void 0 : _g[0],
|
|
54
|
-
(_k = (_j = (_i = (_h = resources == null ? void 0 : resources[0]) == null ? void 0 : _h.resources) == null ? void 0 : _i[1]) == null ? void 0 : _j.renderList) == null ? void 0 : _k[0]
|
|
55
|
-
];
|
|
56
|
-
const aa = await appointmentBooking.submitTimeSlot({
|
|
57
|
-
resourceProductData: resources == null ? void 0 : resources[0],
|
|
58
|
-
selectedResources: _resources,
|
|
59
|
-
timeSlots: e
|
|
60
|
-
});
|
|
61
|
-
console.log(data, _resources, aa, "wh9879676");
|
|
62
|
-
}
|
|
59
|
+
getAutoSelect(e);
|
|
63
60
|
};
|
|
64
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-time-slicing-wrap" }, times.map((item, index) => {
|
|
61
|
+
return (times == null ? void 0 : times.length) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-time-slicing-wrap" }, times.map((item, index) => {
|
|
65
62
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
66
63
|
"div",
|
|
67
64
|
{
|
|
@@ -72,6 +69,11 @@ var Resource = ({ params }) => {
|
|
|
72
69
|
/* @__PURE__ */ import_react.default.createElement("span", null, item == null ? void 0 : item.start_time),
|
|
73
70
|
/* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-chevron-right", className: `icon` })
|
|
74
71
|
);
|
|
75
|
-
}))
|
|
72
|
+
})) : /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
import_materials.PisellEmpty,
|
|
74
|
+
{
|
|
75
|
+
description: import_utils.locales.getText("pisell2.appointment.booking.empty.time")
|
|
76
|
+
}
|
|
77
|
+
);
|
|
76
78
|
};
|
|
77
79
|
var TimeSlicing_default = Resource;
|
|
@@ -42,6 +42,7 @@ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContex
|
|
|
42
42
|
var import_materials = require("@pisell/materials");
|
|
43
43
|
var import_icons = require("@ant-design/icons");
|
|
44
44
|
var import_hooks = require("../../hooks");
|
|
45
|
+
var import_utils2 = require("../../utils");
|
|
45
46
|
var import_voucher = require("../../../booking/components/voucher/index.less");
|
|
46
47
|
var import_index = require("./index.less");
|
|
47
48
|
var ShopDiscountHooks = {
|
|
@@ -65,6 +66,8 @@ var VoucherCard = (props) => {
|
|
|
65
66
|
const [code, setCode] = (0, import_react.useState)("");
|
|
66
67
|
const [discountList, setDisCountList] = (0, import_react.useState)([]);
|
|
67
68
|
const productRef = (0, import_react.useRef)(products);
|
|
69
|
+
const { openLoginModal } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
70
|
+
const { accountLists } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
68
71
|
const cart = (_b = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _b.cart;
|
|
69
72
|
const isUserLoggedIn = (0, import_react.useMemo)(() => {
|
|
70
73
|
var _a2, _b2;
|
|
@@ -79,29 +82,30 @@ var VoucherCard = (props) => {
|
|
|
79
82
|
});
|
|
80
83
|
}, [discountList]);
|
|
81
84
|
(0, import_react.useEffect)(() => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
if (isUserLoggedIn) {
|
|
86
|
+
const shopDiscount2 = pisellos.getModule("shopDiscount");
|
|
87
|
+
shopDiscount2.setCustomer(currentUser);
|
|
88
|
+
}
|
|
89
|
+
}, [currentUser.id, isUserLoggedIn]);
|
|
85
90
|
(0, import_react.useEffect)(() => {
|
|
86
91
|
shopDiscount.setProductList(products);
|
|
87
92
|
}, [products]);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
const val = shopDiscount.calcDiscount(products);
|
|
93
|
-
console.log("input: ", products);
|
|
94
|
-
console.log("output: ", val);
|
|
95
|
-
productRef.current = val.productList;
|
|
93
|
+
const onCartChange = () => {
|
|
94
|
+
const products2 = cart == null ? void 0 : cart.getItems();
|
|
95
|
+
const val = shopDiscount.calcDiscount(products2);
|
|
96
96
|
cart == null ? void 0 : cart.batchSetItems(val.productList);
|
|
97
|
-
}
|
|
97
|
+
};
|
|
98
98
|
(0, import_react.useEffect)(() => {
|
|
99
|
+
const val = shopDiscount.getDiscountList();
|
|
100
|
+
setDisCountList(val);
|
|
99
101
|
pisellos.effects.on(
|
|
100
102
|
ShopDiscountHooks.onLoadPrepareCalcResult,
|
|
101
103
|
(result) => {
|
|
102
104
|
cart == null ? void 0 : cart.batchSetItems(result.productList);
|
|
103
105
|
}
|
|
104
106
|
);
|
|
107
|
+
pisellos.effects.on("appointmentBooking_cart:onAddItem", onCartChange);
|
|
108
|
+
pisellos.effects.on("appointmentBooking_cart:onRemoveItem", onCartChange);
|
|
105
109
|
pisellos.effects.on(
|
|
106
110
|
ShopDiscountHooks.onDiscountListChange,
|
|
107
111
|
(discount) => {
|
|
@@ -127,11 +131,17 @@ var VoucherCard = (props) => {
|
|
|
127
131
|
className: "login-btn",
|
|
128
132
|
onClick: () => {
|
|
129
133
|
if (!action) return;
|
|
130
|
-
|
|
131
|
-
type: "pisell1.login",
|
|
132
|
-
data: {},
|
|
134
|
+
openLoginModal({
|
|
133
135
|
callback: (status) => {
|
|
136
|
+
var _a2, _b2, _c;
|
|
137
|
+
const user = (_c = (_b2 = (_a2 = utils.store) == null ? void 0 : _a2.getState()) == null ? void 0 : _b2.global) == null ? void 0 : _c.userInfo;
|
|
138
|
+
const currentUser2 = (0, import_utils2.formatCustomer)(user);
|
|
139
|
+
const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
|
|
134
140
|
if (status === "success") {
|
|
141
|
+
appointmentBooking.setLoginAccount(
|
|
142
|
+
meAccount == null ? void 0 : meAccount.id,
|
|
143
|
+
currentUser2
|
|
144
|
+
);
|
|
135
145
|
}
|
|
136
146
|
}
|
|
137
147
|
});
|
|
@@ -178,7 +188,9 @@ var VoucherCard = (props) => {
|
|
|
178
188
|
discountId: val.id,
|
|
179
189
|
isSelected: val.isSelected
|
|
180
190
|
});
|
|
181
|
-
(_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.cart) == null ? void 0 : _b2.batchSetItems(
|
|
191
|
+
(_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.cart) == null ? void 0 : _b2.batchSetItems(
|
|
192
|
+
detail.productList
|
|
193
|
+
);
|
|
182
194
|
}
|
|
183
195
|
}
|
|
184
196
|
) : null,
|
|
@@ -19,6 +19,8 @@ interface AppointmentBookingContextType {
|
|
|
19
19
|
symbolic?: any;
|
|
20
20
|
resourceOtherParams?: any;
|
|
21
21
|
setResourceOtherParams: (val: any) => void;
|
|
22
|
+
selectedTime: any;
|
|
23
|
+
setSelectedTime: (val: any) => void;
|
|
22
24
|
}
|
|
23
25
|
export declare const AppointmentBookingProvider: ({ children, }: {
|
|
24
26
|
children: ReactNode;
|
|
@@ -52,6 +52,7 @@ var AppointmentBookingProvider = ({
|
|
|
52
52
|
const [isLastStep, setIsLastStep] = (0, import_react.useState)(false);
|
|
53
53
|
const [carts, setCarts] = (0, import_react.useState)([]);
|
|
54
54
|
const [resourceOtherParams, setResourceOtherParams] = (0, import_react.useState)({});
|
|
55
|
+
const [selectedTime, setSelectedTime] = (0, import_react.useState)(null);
|
|
55
56
|
const { appHelper } = (0, import_useEngineContext.default)();
|
|
56
57
|
const symbolic = (_a = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _a.getSymbolic();
|
|
57
58
|
console.log(3234234, times, resources);
|
|
@@ -74,7 +75,9 @@ var AppointmentBookingProvider = ({
|
|
|
74
75
|
appHelper,
|
|
75
76
|
symbolic,
|
|
76
77
|
resourceOtherParams,
|
|
77
|
-
setResourceOtherParams
|
|
78
|
+
setResourceOtherParams,
|
|
79
|
+
selectedTime,
|
|
80
|
+
setSelectedTime
|
|
78
81
|
};
|
|
79
82
|
return /* @__PURE__ */ import_react.default.createElement(AppointmentBookingContext.Provider, { value }, children);
|
|
80
83
|
};
|
|
@@ -1,25 +1,61 @@
|
|
|
1
1
|
export declare const useAppointmentBooking: () => any;
|
|
2
2
|
export declare const useShopDiscount: () => any;
|
|
3
|
+
/**
|
|
4
|
+
* @title: 监听步骤发生变化
|
|
5
|
+
* @description:
|
|
6
|
+
* @return {*}
|
|
7
|
+
* @Author: WangHan
|
|
8
|
+
* @Date: 2025-04-15 11:11
|
|
9
|
+
*/
|
|
3
10
|
export declare const useAppointmentBookingStep: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* @title: 获取商品数据
|
|
13
|
+
* @description:
|
|
14
|
+
* @return {*}
|
|
15
|
+
* @Author: WangHan
|
|
16
|
+
* @Date: 2025-04-15 11:12
|
|
17
|
+
*/
|
|
4
18
|
export declare const useAppointmentBookingProduct: () => void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @title: 更新购物车数据
|
|
21
|
+
* @description:
|
|
22
|
+
* @return {*}
|
|
23
|
+
* @Author: WangHan
|
|
24
|
+
* @Date: 2025-04-15 11:12
|
|
25
|
+
*/
|
|
26
|
+
export declare const useAppointmentBookingCart: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* @title: 获取登录状态
|
|
29
|
+
* @description:
|
|
30
|
+
* @return {*}
|
|
31
|
+
* @Author: WangHan
|
|
32
|
+
* @Date: 2025-04-15 11:14
|
|
33
|
+
*/
|
|
8
34
|
export declare const useAppointmentBookingLogin: () => {
|
|
9
35
|
isLogin: boolean;
|
|
10
36
|
openLoginModal: (params: {
|
|
11
37
|
callback: any;
|
|
12
38
|
}) => void;
|
|
13
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* @title: 获取账户
|
|
42
|
+
* @description:
|
|
43
|
+
* @return {*}
|
|
44
|
+
* @Author: WangHan
|
|
45
|
+
* @Date: 2025-04-15 11:15
|
|
46
|
+
*/
|
|
14
47
|
export declare const useAppointmentBookingAccount: () => {
|
|
15
|
-
currentUser: {
|
|
16
|
-
id: any;
|
|
17
|
-
username: string;
|
|
18
|
-
};
|
|
19
48
|
accountLists: any;
|
|
20
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* @title: 获取资源数据
|
|
52
|
+
* @description:
|
|
53
|
+
* @return {*}
|
|
54
|
+
* @Author: WangHan
|
|
55
|
+
* @Date: 2025-04-15 11:29
|
|
56
|
+
*/
|
|
21
57
|
export declare const useAppointmentBookingResource: () => {
|
|
22
58
|
getResourceTimeSlot: (params: any) => Promise<void>;
|
|
23
|
-
getResourceList: () =>
|
|
24
|
-
autoSelectAllProductResources: (code: string) => Promise<
|
|
59
|
+
getResourceList: () => any;
|
|
60
|
+
autoSelectAllProductResources: (code: string) => Promise<any>;
|
|
25
61
|
};
|
|
@@ -39,11 +39,10 @@ __export(hooks_exports, {
|
|
|
39
39
|
useShopDiscount: () => useShopDiscount
|
|
40
40
|
});
|
|
41
41
|
module.exports = __toCommonJS(hooks_exports);
|
|
42
|
+
var import_react = require("react");
|
|
42
43
|
var import_useEngineContext = require("../../hooks/useEngineContext");
|
|
43
44
|
var import_useEngineContext2 = __toESM(require("../../hooks/useEngineContext"));
|
|
44
|
-
var import_utils = require("
|
|
45
|
-
var import_utils2 = require("./utils");
|
|
46
|
-
var import_react = require("react");
|
|
45
|
+
var import_utils = require("./utils");
|
|
47
46
|
var import_context = require("./context");
|
|
48
47
|
var useAppointmentBooking = () => {
|
|
49
48
|
const pisellOS = (0, import_useEngineContext.usePisellOS)();
|
|
@@ -76,33 +75,29 @@ var useAppointmentBookingProduct = () => {
|
|
|
76
75
|
const { productModuleParams } = appointmentBooking.otherParams;
|
|
77
76
|
(0, import_react.useEffect)(() => {
|
|
78
77
|
appointmentBooking.loadProducts(productModuleParams).then((res) => {
|
|
79
|
-
console.log(res, "loadProductsloadProducts");
|
|
80
78
|
setProducts(res || []);
|
|
81
79
|
});
|
|
82
80
|
}, []);
|
|
83
81
|
};
|
|
84
82
|
var useAppointmentBookingCart = () => {
|
|
85
|
-
var _a, _b;
|
|
86
83
|
const pisellOS = (0, import_useEngineContext.usePisellOS)();
|
|
87
84
|
const { appointmentBooking, setCarts, setSummary } = (0, import_context.useAppointmentBookingContext)();
|
|
88
|
-
const
|
|
85
|
+
const getCartAndSummary = async () => {
|
|
86
|
+
const carts = await appointmentBooking.getCart();
|
|
87
|
+
setCarts(carts || []);
|
|
88
|
+
const summary = await appointmentBooking.getSummary();
|
|
89
|
+
setSummary(summary || {});
|
|
90
|
+
console.log(carts, summary, "appointmentBooking_cart:changed");
|
|
91
|
+
};
|
|
89
92
|
(0, import_react.useEffect)(() => {
|
|
90
|
-
|
|
93
|
+
getCartAndSummary();
|
|
91
94
|
pisellOS.effects.on(
|
|
92
95
|
"appointmentBooking_cart:changed",
|
|
93
|
-
async (
|
|
94
|
-
|
|
95
|
-
setCarts(carts || []);
|
|
96
|
-
const summary = await appointmentBooking.getSummary();
|
|
97
|
-
setSummary(summary || {});
|
|
98
|
-
console.log(carts, summary, "appointmentBooking_cart:changed");
|
|
96
|
+
async () => {
|
|
97
|
+
getCartAndSummary();
|
|
99
98
|
}
|
|
100
99
|
);
|
|
101
|
-
(_a2 = appointmentBooking == null ? void 0 : appointmentBooking.getCart) == null ? void 0 : _a2.call(appointmentBooking).then((data) => {
|
|
102
|
-
setCarts(data || []);
|
|
103
|
-
});
|
|
104
100
|
}, []);
|
|
105
|
-
return { cart };
|
|
106
101
|
};
|
|
107
102
|
var useAppointmentBookingLogin = () => {
|
|
108
103
|
var _a, _b;
|
|
@@ -113,71 +108,63 @@ var useAppointmentBookingLogin = () => {
|
|
|
113
108
|
const { callback } = params || {};
|
|
114
109
|
utils.action({
|
|
115
110
|
type: "pisell1.login",
|
|
116
|
-
data: {
|
|
111
|
+
data: {
|
|
112
|
+
type: "plugin"
|
|
113
|
+
},
|
|
117
114
|
callback
|
|
118
115
|
});
|
|
119
116
|
};
|
|
120
117
|
return { isLogin, openLoginModal };
|
|
121
118
|
};
|
|
122
119
|
var useAppointmentBookingAccount = () => {
|
|
123
|
-
var _a, _b;
|
|
124
120
|
const pisellOS = (0, import_useEngineContext.usePisellOS)();
|
|
125
|
-
const context = (0, import_useEngineContext2.default)();
|
|
126
|
-
const utils = context.appHelper.utils || {};
|
|
127
121
|
const appointmentBooking = useAppointmentBooking();
|
|
128
122
|
const [accountLists, setAccountLists] = (0, import_react.useState)([]);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const currentUser = {
|
|
135
|
-
id: (userInfo == null ? void 0 : userInfo.id) || (0, import_utils.getUniqueId)(),
|
|
136
|
-
username: currentUserName
|
|
123
|
+
const getAccountLists = async () => {
|
|
124
|
+
var _a, _b, _c;
|
|
125
|
+
const data = await appointmentBooking.getAccounts();
|
|
126
|
+
setAccountLists(data || []);
|
|
127
|
+
console.log("currentUser4455777", appointmentBooking, (_c = (_b = (_a = appointmentBooking.store) == null ? void 0 : _a.accountList) == null ? void 0 : _b.store) == null ? void 0 : _c.accountList, data);
|
|
137
128
|
};
|
|
138
129
|
(0, import_react.useEffect)(() => {
|
|
139
130
|
pisellOS.effects.on(
|
|
140
131
|
"appointmentBooking_accountList:changed",
|
|
141
132
|
async (res) => {
|
|
142
133
|
if (res.path === "accounts") {
|
|
143
|
-
|
|
144
|
-
setAccountLists(data || []);
|
|
145
|
-
});
|
|
134
|
+
getAccountLists();
|
|
146
135
|
}
|
|
147
136
|
}
|
|
148
137
|
);
|
|
149
|
-
|
|
150
|
-
setAccountLists(data || []);
|
|
151
|
-
});
|
|
138
|
+
getAccountLists();
|
|
152
139
|
}, []);
|
|
153
|
-
return {
|
|
140
|
+
return { accountLists };
|
|
154
141
|
};
|
|
155
142
|
var useAppointmentBookingResource = () => {
|
|
156
143
|
const { appointmentBooking, setResources, setTimes, setResourceOtherParams, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
|
|
157
144
|
const { resourceSort } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
|
|
158
|
-
console.log(appointmentBooking, "appointmentBooking22");
|
|
159
145
|
const getResourceTimeSlot = async (params) => {
|
|
160
|
-
const data = await appointmentBooking.
|
|
146
|
+
const data = await appointmentBooking.getTimeSlotByAllResources(params);
|
|
161
147
|
setTimes(data || []);
|
|
162
148
|
};
|
|
163
|
-
const getResourceList =
|
|
149
|
+
const getResourceList = () => {
|
|
164
150
|
let resources = appointmentBooking.getResourcesList();
|
|
165
151
|
resources = resources.map((item) => {
|
|
166
152
|
return {
|
|
167
153
|
...item,
|
|
168
|
-
resources: (0,
|
|
154
|
+
resources: (0, import_utils.sortResources)((item == null ? void 0 : item.resources) || [], resourceSort)
|
|
169
155
|
};
|
|
170
156
|
});
|
|
171
157
|
setResources(resources || []);
|
|
158
|
+
console.log(resources, "resourcesresources");
|
|
172
159
|
return resources;
|
|
173
160
|
};
|
|
174
161
|
const autoSelectAllProductResources = async (code) => {
|
|
175
162
|
let res = await appointmentBooking.autoSelectAllProductResources(code);
|
|
176
|
-
console.log(res, "autoSelectAllProductResources");
|
|
177
163
|
setResourceOtherParams({
|
|
178
164
|
...resourceOtherParams,
|
|
179
165
|
...res
|
|
180
166
|
});
|
|
167
|
+
return res;
|
|
181
168
|
};
|
|
182
169
|
return { getResourceTimeSlot, getResourceList, autoSelectAllProductResources };
|
|
183
170
|
};
|