@pisell/private-materials 3.3.16 → 3.3.17
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 +10 -2
- 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/Date/index.js +4 -0
- 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
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,21 +16,33 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/components/booking/info/hooks/useAddHolder.ts
|
|
20
30
|
var useAddHolder_exports = {};
|
|
21
31
|
__export(useAddHolder_exports, {
|
|
22
|
-
default: () => useAddHolder_default
|
|
32
|
+
default: () => useAddHolder_default,
|
|
33
|
+
useFormDataConfig: () => useFormDataConfig
|
|
23
34
|
});
|
|
24
35
|
module.exports = __toCommonJS(useAddHolder_exports);
|
|
25
36
|
var import_utils = require("../../utils");
|
|
26
37
|
var import_react = require("react");
|
|
27
|
-
var
|
|
38
|
+
var import_serve = require("../pet/serve");
|
|
39
|
+
var import_useGetHolderList = __toESM(require("./useGetHolderList"));
|
|
40
|
+
var import_utils2 = require("../service2/utils");
|
|
41
|
+
var useFormDataConfig = (state) => {
|
|
28
42
|
var _a;
|
|
29
43
|
const formDataConfig = (0, import_react.useMemo)(() => {
|
|
30
44
|
var _a2, _b, _c;
|
|
31
|
-
let _holder = (_a2 = state.bookingConfig) == null ? void 0 : _a2.holder;
|
|
45
|
+
let _holder = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.holder;
|
|
32
46
|
if (!_holder) {
|
|
33
47
|
return null;
|
|
34
48
|
}
|
|
@@ -41,33 +55,91 @@ var useAddHolder = (state, dispatch) => {
|
|
|
41
55
|
relation_type: "appointment_booking",
|
|
42
56
|
form_record: []
|
|
43
57
|
};
|
|
44
|
-
}, [(_a = state.bookingConfig) == null ? void 0 : _a.holder]);
|
|
45
|
-
const
|
|
46
|
-
var _a2
|
|
58
|
+
}, [(_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.holder]);
|
|
59
|
+
const isMinorAndWaiver = (0, import_react.useMemo)(() => {
|
|
60
|
+
var _a2;
|
|
61
|
+
if ((formDataConfig == null ? void 0 : formDataConfig.form_type) === "minors") {
|
|
62
|
+
const detail = formDataConfig == null ? void 0 : formDataConfig.form_field.find((item) => item.filed_type === "form_to_form" && item.status === "hide");
|
|
63
|
+
if (detail) {
|
|
64
|
+
return (_a2 = detail == null ? void 0 : detail.setting) == null ? void 0 : _a2.linkedTable;
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}, [formDataConfig]);
|
|
70
|
+
return {
|
|
71
|
+
formDataConfig,
|
|
72
|
+
isMinorAndWaiver
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
var useAddHolder = (state, dispatch) => {
|
|
76
|
+
const [waiverForm, setWaiverForm] = (0, import_react.useState)(null);
|
|
77
|
+
const getHolders = (0, import_useGetHolderList.default)(state, dispatch);
|
|
78
|
+
const { formDataConfig, isMinorAndWaiver } = useFormDataConfig(state);
|
|
79
|
+
(0, import_react.useEffect)(() => {
|
|
80
|
+
if (isMinorAndWaiver) {
|
|
81
|
+
(0, import_serve.getFormDetail)(isMinorAndWaiver).then((res) => {
|
|
82
|
+
setWaiverForm(res);
|
|
83
|
+
dispatch({
|
|
84
|
+
type: "setPet",
|
|
85
|
+
payload: {
|
|
86
|
+
waiverForm: res
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}, [isMinorAndWaiver]);
|
|
92
|
+
const handleAddHolder = (products, currentItem) => {
|
|
93
|
+
var _a, _b, _c, _d, _e;
|
|
47
94
|
let _data = {
|
|
48
|
-
formDataConfig: { ...formDataConfig }
|
|
95
|
+
formDataConfig: isMinorAndWaiver ? { ...waiverForm, customer_id: (_b = (_a = state.client) == null ? void 0 : _a.value) == null ? void 0 : _b.id } : { ...formDataConfig }
|
|
49
96
|
};
|
|
50
|
-
const isWalkInBol = (0, import_utils.isWalkIn)((
|
|
97
|
+
const isWalkInBol = (0, import_utils.isWalkIn)((_d = (_c = state.client) == null ? void 0 : _c.value) == null ? void 0 : _d.id);
|
|
51
98
|
if (formDataConfig.data_range === "customer" && !isWalkInBol) {
|
|
52
|
-
_data.customerId = (
|
|
99
|
+
_data.customerId = (_e = state.client) == null ? void 0 : _e.value.id;
|
|
53
100
|
}
|
|
54
101
|
state.action({
|
|
55
102
|
type: "pisell1.goCustomFormAddData",
|
|
56
103
|
data: _data,
|
|
57
|
-
callback: (res) => {
|
|
104
|
+
callback: async (res) => {
|
|
105
|
+
var _a2, _b2;
|
|
58
106
|
let obj = {};
|
|
59
107
|
for (let item of res) {
|
|
60
108
|
obj[item.key] = item.value;
|
|
61
109
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
110
|
+
if (isMinorAndWaiver) {
|
|
111
|
+
const oldList = ((_a2 = state == null ? void 0 : state.pet) == null ? void 0 : _a2.holders) || [];
|
|
112
|
+
const formValue = ((_b2 = (obj["form_to_form_value"] || []).find((item) => item.form_id === formDataConfig.form_id)) == null ? void 0 : _b2.form_data_value) || [];
|
|
113
|
+
const selectId = Math.max(...formValue);
|
|
114
|
+
const oldDetail = oldList.find((item) => item.form_record_id === selectId);
|
|
115
|
+
await getHolders();
|
|
116
|
+
if (formValue.length && !oldDetail) {
|
|
117
|
+
const value = (0, import_utils2.handleChangeHolder)(products, currentItem, { id: selectId });
|
|
118
|
+
dispatch({
|
|
119
|
+
type: "setService",
|
|
120
|
+
payload: {
|
|
121
|
+
value
|
|
122
|
+
}
|
|
123
|
+
});
|
|
66
124
|
}
|
|
67
|
-
}
|
|
125
|
+
} else {
|
|
126
|
+
dispatch({
|
|
127
|
+
type: "setPet",
|
|
128
|
+
payload: {
|
|
129
|
+
holders: !isWalkInBol ? [obj, ...state.pet.holders] : state.pet.holders
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
68
133
|
}
|
|
69
134
|
});
|
|
70
135
|
};
|
|
71
|
-
return
|
|
136
|
+
return {
|
|
137
|
+
handleAddHolder,
|
|
138
|
+
waiverForm
|
|
139
|
+
};
|
|
72
140
|
};
|
|
73
141
|
var useAddHolder_default = useAddHolder;
|
|
142
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
143
|
+
0 && (module.exports = {
|
|
144
|
+
useFormDataConfig
|
|
145
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/booking/info/hooks/useGetHolderList.ts
|
|
30
|
+
var useGetHolderList_exports = {};
|
|
31
|
+
__export(useGetHolderList_exports, {
|
|
32
|
+
default: () => useGetHolderList_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(useGetHolderList_exports);
|
|
35
|
+
var import_ahooks = require("ahooks");
|
|
36
|
+
var import_useHolderConfig = __toESM(require("./useHolderConfig"));
|
|
37
|
+
var useGetHolderList = (state, dispatch) => {
|
|
38
|
+
const { holder, appointment_subject } = (0, import_useHolderConfig.default)(state);
|
|
39
|
+
const getHolders = (0, import_ahooks.useMemoizedFn)(async () => {
|
|
40
|
+
var _a, _b, _c, _d;
|
|
41
|
+
if (holder.data_range === "customer" && !((_b = (_a = state.client) == null ? void 0 : _a.value) == null ? void 0 : _b.id)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const params = {
|
|
45
|
+
form_id: appointment_subject.form_id,
|
|
46
|
+
source_shop_customer: holder == null ? void 0 : holder.is_franchisor,
|
|
47
|
+
customer_id: holder.data_range === "customer" ? (_d = (_c = state.client) == null ? void 0 : _c.value) == null ? void 0 : _d.id : void 0,
|
|
48
|
+
skip: 1,
|
|
49
|
+
num: 100
|
|
50
|
+
};
|
|
51
|
+
const data = await state.apis.getPetsData(params);
|
|
52
|
+
dispatch({
|
|
53
|
+
type: "setPet",
|
|
54
|
+
payload: {
|
|
55
|
+
holders: data.list
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
return getHolders;
|
|
60
|
+
};
|
|
61
|
+
var useGetHolderList_default = useGetHolderList;
|
|
@@ -39,8 +39,8 @@ var useHolderConfig = (state) => {
|
|
|
39
39
|
}, [appointment_subject.type]);
|
|
40
40
|
const isWalkInBol = (0, import_react.useMemo)(() => {
|
|
41
41
|
var _a2, _b2;
|
|
42
|
-
return (0, import_utils.isWalkIn)((_b2 = (_a2 = state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.id);
|
|
43
|
-
}, [(_f = (_e = state.client) == null ? void 0 : _e.value) == null ? void 0 : _f.id]);
|
|
42
|
+
return (0, import_utils.isWalkIn)((_b2 = (_a2 = state == null ? void 0 : state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.id);
|
|
43
|
+
}, [(_f = (_e = state == null ? void 0 : state.client) == null ? void 0 : _e.value) == null ? void 0 : _f.id]);
|
|
44
44
|
const isCustomerSubject = (0, import_react.useMemo)(() => {
|
|
45
45
|
return appointment_subject.type === "customer";
|
|
46
46
|
}, [appointment_subject.type]);
|
|
@@ -32,34 +32,15 @@ __export(useInfoHolder_exports, {
|
|
|
32
32
|
default: () => useInfoHolder_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(useInfoHolder_exports);
|
|
35
|
-
var import_ahooks = require("ahooks");
|
|
36
35
|
var import_react = require("react");
|
|
37
36
|
var import_useHolderConfig = __toESM(require("./useHolderConfig"));
|
|
38
37
|
var import_utils = require("../utils");
|
|
38
|
+
var import_useGetHolderList = __toESM(require("./useGetHolderList"));
|
|
39
39
|
var useInfoHolder = (state, dispatch) => {
|
|
40
40
|
var _a, _b, _c, _d;
|
|
41
41
|
const detailRef = (0, import_react.useRef)();
|
|
42
42
|
const { holder, isFormSubject, appointment_subject } = (0, import_useHolderConfig.default)(state);
|
|
43
|
-
const getHolders = (0,
|
|
44
|
-
var _a2, _b2, _c2, _d2;
|
|
45
|
-
if (holder.data_range === "customer" && !((_b2 = (_a2 = state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.id)) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const params = {
|
|
49
|
-
form_id: appointment_subject.form_id,
|
|
50
|
-
source_shop_customer: holder == null ? void 0 : holder.is_franchisor,
|
|
51
|
-
customer_id: holder.data_range === "customer" ? (_d2 = (_c2 = state.client) == null ? void 0 : _c2.value) == null ? void 0 : _d2.id : void 0,
|
|
52
|
-
skip: 1,
|
|
53
|
-
num: 100
|
|
54
|
-
};
|
|
55
|
-
const data = await state.apis.getPetsData(params);
|
|
56
|
-
dispatch({
|
|
57
|
-
type: "setPet",
|
|
58
|
-
payload: {
|
|
59
|
-
holders: data.list
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
43
|
+
const getHolders = (0, import_useGetHolderList.default)(state, dispatch);
|
|
63
44
|
(0, import_react.useEffect)(() => {
|
|
64
45
|
if (isFormSubject) {
|
|
65
46
|
getHolders();
|
|
@@ -45,6 +45,9 @@ var import_utils3 = require("../../utils");
|
|
|
45
45
|
var import_model = require("../model");
|
|
46
46
|
var import_ChangePetModal = __toESM(require("./ChangePetModal"));
|
|
47
47
|
var import_index = require("./index.less");
|
|
48
|
+
var import_useAddHolder = __toESM(require("../hooks/useAddHolder"));
|
|
49
|
+
var import_useGetHolderList = __toESM(require("../hooks/useGetHolderList"));
|
|
50
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
48
51
|
var defaultParams = {
|
|
49
52
|
skip: 1,
|
|
50
53
|
num: 20,
|
|
@@ -70,6 +73,10 @@ var Pet = (props) => {
|
|
|
70
73
|
const changePetRef = (0, import_react.useRef)(null);
|
|
71
74
|
state = state || (props == null ? void 0 : props.state);
|
|
72
75
|
dispatch = dispatch || (props == null ? void 0 : props.dispatch);
|
|
76
|
+
const { waiverForm } = (0, import_useAddHolder.default)(state, dispatch);
|
|
77
|
+
const { isMinorAndWaiver } = (0, import_useAddHolder.useFormDataConfig)(state);
|
|
78
|
+
const getHolders = (0, import_useGetHolderList.default)(state, dispatch);
|
|
79
|
+
console.log("waiver", props, state);
|
|
73
80
|
const boardParams = (0, import_react.useMemo)(() => {
|
|
74
81
|
var _a2, _b2, _c2;
|
|
75
82
|
return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.appointment_subject) || {};
|
|
@@ -109,7 +116,14 @@ var Pet = (props) => {
|
|
|
109
116
|
if (_params.skip === 1) {
|
|
110
117
|
_list = (data == null ? void 0 : data.list) || [];
|
|
111
118
|
} else {
|
|
112
|
-
|
|
119
|
+
((data == null ? void 0 : data.list) || []).forEach((item) => {
|
|
120
|
+
const index = _list.findIndex((old) => old.id === item.id);
|
|
121
|
+
if (index > -1) {
|
|
122
|
+
_list[index] = item;
|
|
123
|
+
} else {
|
|
124
|
+
_list.push(item);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
113
127
|
}
|
|
114
128
|
setParams({
|
|
115
129
|
...params,
|
|
@@ -354,7 +368,7 @@ var Pet = (props) => {
|
|
|
354
368
|
const addCallback = (0, import_ahooks.useMemoizedFn)((_params) => {
|
|
355
369
|
var _a2, _b2;
|
|
356
370
|
let _formData = (_b2 = (_a2 = state.pet) == null ? void 0 : _a2.formData) == null ? void 0 : _b2[0];
|
|
357
|
-
getFormData({ formData: _formData }, _params);
|
|
371
|
+
getFormData({ formData: _formData }, _params || params);
|
|
358
372
|
});
|
|
359
373
|
const searchChange = (0, import_ahooks.useMemoizedFn)((keyword) => {
|
|
360
374
|
let _params = {
|
|
@@ -405,27 +419,56 @@ var Pet = (props) => {
|
|
|
405
419
|
}
|
|
406
420
|
return {};
|
|
407
421
|
}, [state.renderType, state.service.value]);
|
|
408
|
-
|
|
422
|
+
const ignoreValidity = (0, import_react.useMemo)(() => {
|
|
409
423
|
var _a2;
|
|
424
|
+
return !((_a2 = petForm == null ? void 0 : petForm.setting) == null ? void 0 : _a2.validity) || petForm.setting.validity.type === "no_expiry";
|
|
425
|
+
}, [petForm]);
|
|
426
|
+
const getExpireStatus = (expiredAt) => {
|
|
427
|
+
if (ignoreValidity || !expiredAt) return null;
|
|
428
|
+
const now = (0, import_dayjs.default)();
|
|
429
|
+
const expireDate = (0, import_dayjs.default)(expiredAt).endOf("day");
|
|
430
|
+
const diffDays = expireDate.diff(now, "day");
|
|
431
|
+
const formattedDate = expireDate.format("YYYY-MM-DD");
|
|
432
|
+
if (now.isAfter(expireDate)) {
|
|
433
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { color: "#999999", fontSize: "14px", lineHeight: "20px" } }, /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, { color: "red", style: { borderRadius: 16, marginRight: 8 } }, import_utils.locales.getText("pisell2.text.status.expired")), import_utils.locales.getText("pisell2.text.validity.expired")(formattedDate));
|
|
434
|
+
}
|
|
435
|
+
if (diffDays <= 7) {
|
|
436
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { color: "#FFA940", fontSize: "14px", lineHeight: "20px" } }, import_utils.locales.getText("pisell2.text.validity.expiring_soon")(
|
|
437
|
+
formattedDate
|
|
438
|
+
));
|
|
439
|
+
}
|
|
440
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { color: "#999999", fontSize: "14px", lineHeight: "20px" } }, import_utils.locales.getText("pisell2.text.validity.valid_through")(formattedDate));
|
|
441
|
+
};
|
|
442
|
+
return (0, import_react.useMemo)(() => {
|
|
443
|
+
var _a2, _b2, _c2;
|
|
444
|
+
let canEdit = true;
|
|
445
|
+
if ((_a2 = petForm == null ? void 0 : petForm.setting) == null ? void 0 : _a2.permissions) {
|
|
446
|
+
const { staff = [] } = ((_b2 = petForm == null ? void 0 : petForm.setting) == null ? void 0 : _b2.permissions) || {};
|
|
447
|
+
canEdit = staff.includes("edit");
|
|
448
|
+
}
|
|
410
449
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-wraps" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: valueLoading, active: true, round: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
411
450
|
import_forms.default,
|
|
412
451
|
{
|
|
452
|
+
isMinorAndWaiver,
|
|
453
|
+
waiverForm,
|
|
413
454
|
hideTitle,
|
|
414
455
|
watch: { value: state.pet.value },
|
|
415
456
|
addCallback: (formDataConfig, data) => {
|
|
416
|
-
var _a3,
|
|
457
|
+
var _a3, _b3, _c3;
|
|
417
458
|
setPetOptions([
|
|
418
459
|
{ ...data, form_id: formDataConfig == null ? void 0 : formDataConfig.form_id },
|
|
419
|
-
...((
|
|
460
|
+
...((_c3 = (_b3 = (_a3 = state.pet) == null ? void 0 : _a3.formData) == null ? void 0 : _b3[0]) == null ? void 0 : _c3.options) || []
|
|
420
461
|
]);
|
|
421
462
|
},
|
|
463
|
+
getHolders,
|
|
464
|
+
addCallbackService: addCallback,
|
|
422
465
|
loading: valueLoading,
|
|
423
466
|
forms: state.pet.formData,
|
|
424
467
|
action: state.action,
|
|
425
468
|
modalOpen: state.modalOpen,
|
|
426
469
|
value: state.pet.value,
|
|
427
470
|
onChange: onValueChange,
|
|
428
|
-
client: (
|
|
471
|
+
client: (_c2 = state.client) == null ? void 0 : _c2.value,
|
|
429
472
|
customSelectProps: {
|
|
430
473
|
loading,
|
|
431
474
|
handleViewItem,
|
|
@@ -447,6 +490,7 @@ var Pet = (props) => {
|
|
|
447
490
|
...dayCustomSelect
|
|
448
491
|
},
|
|
449
492
|
optionRender: (item) => {
|
|
493
|
+
console.log("waiver", petForm, item);
|
|
450
494
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
451
495
|
import_antd.Avatar,
|
|
452
496
|
{
|
|
@@ -454,7 +498,7 @@ var Pet = (props) => {
|
|
|
454
498
|
src: item.cover,
|
|
455
499
|
icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__booking-pet-list-item-avatar-icon" })
|
|
456
500
|
}
|
|
457
|
-
), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-list-item-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-list-item-info-name" }, item.main_field), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-list-item-info-desc" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, item.key_age))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-list-item-actions" }, /* @__PURE__ */ import_react.default.createElement(
|
|
501
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-list-item-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-list-item-info-name" }, item.main_field), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-list-item-info-desc" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, item.key_age)), /* @__PURE__ */ import_react.default.createElement("div", null, getExpireStatus(item.expired_at))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-list-item-actions" }, /* @__PURE__ */ import_react.default.createElement(
|
|
458
502
|
"div",
|
|
459
503
|
{
|
|
460
504
|
className: "pisell-lowcode__booking-pet-list-item-actions-view",
|
|
@@ -465,7 +509,7 @@ var Pet = (props) => {
|
|
|
465
509
|
}
|
|
466
510
|
},
|
|
467
511
|
import_utils.locales.getText("pisell2.text.view")
|
|
468
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
512
|
+
), canEdit ? /* @__PURE__ */ import_react.default.createElement(
|
|
469
513
|
"div",
|
|
470
514
|
{
|
|
471
515
|
className: "pisell-lowcode__booking-pet-list-item-actions-edit",
|
|
@@ -476,7 +520,7 @@ var Pet = (props) => {
|
|
|
476
520
|
}
|
|
477
521
|
},
|
|
478
522
|
import_utils.locales.getText("pisell2.text.edit")
|
|
479
|
-
)));
|
|
523
|
+
) : null));
|
|
480
524
|
},
|
|
481
525
|
addButtonProps: {
|
|
482
526
|
style: { margin: 0 },
|
|
@@ -505,7 +549,10 @@ var Pet = (props) => {
|
|
|
505
549
|
params.search,
|
|
506
550
|
loadMore,
|
|
507
551
|
addButtonProps,
|
|
508
|
-
state.isBookingCreatePage
|
|
552
|
+
state.isBookingCreatePage,
|
|
553
|
+
isMinorAndWaiver,
|
|
554
|
+
waiverForm,
|
|
555
|
+
petForm
|
|
509
556
|
]);
|
|
510
557
|
};
|
|
511
558
|
var pet_default = Pet;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getFormDetail: (id: number) => Promise<any>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/booking/info/pet/serve.ts
|
|
20
|
+
var serve_exports = {};
|
|
21
|
+
__export(serve_exports, {
|
|
22
|
+
getFormDetail: () => getFormDetail
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(serve_exports);
|
|
25
|
+
var import_utils = require("../../utils");
|
|
26
|
+
var getFormDetail = async (id) => {
|
|
27
|
+
let { data } = await import_utils.request.getRequest().get(`/shop/form/${id}`);
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
getFormDetail
|
|
33
|
+
});
|
|
@@ -45,7 +45,7 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
|
|
|
45
45
|
var _a;
|
|
46
46
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
47
47
|
const { isShowChangeHolder } = (0, import_useHolderConfig.default)(state);
|
|
48
|
-
const handleAddHolder = (0, import_useAddHolder.default)(state, dispatch);
|
|
48
|
+
const { handleAddHolder } = (0, import_useAddHolder.default)(state, dispatch);
|
|
49
49
|
const handleChange = (0, import_ahooks.useMemoizedFn)((currentItem, type, other) => {
|
|
50
50
|
if (state.disabledEdit || state.disableEventBookingEdit) {
|
|
51
51
|
return;
|
|
@@ -39,6 +39,7 @@ export declare const isBookingProduct: (extension_type: any, bol?: boolean) => b
|
|
|
39
39
|
* @Date: 2024-12-06 11:24
|
|
40
40
|
*/
|
|
41
41
|
export declare const isDayBookingProduct: (item: any, state: any) => boolean | undefined;
|
|
42
|
+
export declare const handleChangeHolder: (products: any[], currentItem: any, other: any) => any[];
|
|
42
43
|
/**
|
|
43
44
|
* @title: 更新商品数据
|
|
44
45
|
* @description:
|
|
@@ -53,6 +54,7 @@ export declare const isDayBookingProduct: (item: any, state: any) => boolean | u
|
|
|
53
54
|
*/
|
|
54
55
|
export declare const updateServices: (state: any, currentItem: any, type?: string, other?: any, actions?: any) => any;
|
|
55
56
|
export declare const formItems: (items: any[]) => any[];
|
|
57
|
+
export declare const getIsSubjectRequire: (state: any) => boolean;
|
|
56
58
|
/**
|
|
57
59
|
* @title: 格式化商品数据
|
|
58
60
|
* @description:
|
|
@@ -40,8 +40,10 @@ __export(utils_exports, {
|
|
|
40
40
|
getAppointmentService: () => getAppointmentService,
|
|
41
41
|
getDayProducts: () => getDayProducts,
|
|
42
42
|
getErrorMessage: () => getErrorMessage,
|
|
43
|
+
getIsSubjectRequire: () => getIsSubjectRequire,
|
|
43
44
|
getPets: () => getPets,
|
|
44
45
|
getResourceItem: () => getResourceItem,
|
|
46
|
+
handleChangeHolder: () => handleChangeHolder,
|
|
45
47
|
holderId: () => holderId,
|
|
46
48
|
initDate: () => initDate,
|
|
47
49
|
isAppointmentProduct: () => isAppointmentProduct,
|
|
@@ -274,7 +276,7 @@ var handleChangeResource = (products, currentItem, other, state) => {
|
|
|
274
276
|
});
|
|
275
277
|
};
|
|
276
278
|
var updateServices = (state, currentItem, type, other, actions) => {
|
|
277
|
-
var _a, _b;
|
|
279
|
+
var _a, _b, _c;
|
|
278
280
|
if (!((_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value)) return [];
|
|
279
281
|
let products = ((_b = state == null ? void 0 : state.service) == null ? void 0 : _b.value) || [];
|
|
280
282
|
const isGroup = (0, import_utils3.isGroupBooking)(currentItem._id);
|
|
@@ -299,7 +301,7 @@ var updateServices = (state, currentItem, type, other, actions) => {
|
|
|
299
301
|
products = handleChangeHolder(products, currentItem, other);
|
|
300
302
|
}
|
|
301
303
|
if (type === "add_holder") {
|
|
302
|
-
actions == null ? void 0 : actions.handleAddHolder();
|
|
304
|
+
(_c = actions == null ? void 0 : actions.handleAddHolder) == null ? void 0 : _c.call(actions, products, currentItem);
|
|
303
305
|
return products;
|
|
304
306
|
}
|
|
305
307
|
if (type === "like") {
|
|
@@ -432,10 +434,14 @@ var mapListItems = (items) => items.map((item) => ({
|
|
|
432
434
|
label: item.labelText,
|
|
433
435
|
isError: !item.usable
|
|
434
436
|
}));
|
|
437
|
+
var getIsSubjectRequire = (state) => {
|
|
438
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
439
|
+
return ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.type) === "form" && ((_g = (_f = (_e = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _e.config) == null ? void 0 : _f.basic) == null ? void 0 : _g.subject_require) === "require";
|
|
440
|
+
};
|
|
435
441
|
var getGeneralParams = (item, state, isParallelResource) => {
|
|
436
|
-
var _a, _b, _c, _d, _e;
|
|
442
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
437
443
|
const { pet, service } = state;
|
|
438
|
-
const { holders = [] } = pet || {};
|
|
444
|
+
const { holders = [], formData } = pet || {};
|
|
439
445
|
const parallelResourceOtherParams = {};
|
|
440
446
|
let multiResources;
|
|
441
447
|
if (isParallelResource) {
|
|
@@ -491,9 +497,11 @@ var getGeneralParams = (item, state, isParallelResource) => {
|
|
|
491
497
|
actionText: import_utils2.locales.getText("page.booking.text.add-time"),
|
|
492
498
|
isMultipleResource: true,
|
|
493
499
|
multiResources,
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
500
|
+
isErrorHolder: getIsSubjectRequire(state),
|
|
501
|
+
addHolderButtonText: ((_c = (_b = formData == null ? void 0 : formData[0]) == null ? void 0 : _b.form) == null ? void 0 : _c.title) || "",
|
|
502
|
+
holder_id: (_d = item == null ? void 0 : item._extend) == null ? void 0 : _d.holder_id,
|
|
503
|
+
start_date: (_e = item == null ? void 0 : item._extend) == null ? void 0 : _e.startDate,
|
|
504
|
+
end_date: ((_f = item == null ? void 0 : item._extend) == null ? void 0 : _f.endDate) || ((_g = item == null ? void 0 : item._extend) == null ? void 0 : _g.end_date),
|
|
497
505
|
...parallelResourceOtherParams
|
|
498
506
|
};
|
|
499
507
|
};
|
|
@@ -941,8 +949,10 @@ var updateServicePrice = (state) => {
|
|
|
941
949
|
getAppointmentService,
|
|
942
950
|
getDayProducts,
|
|
943
951
|
getErrorMessage,
|
|
952
|
+
getIsSubjectRequire,
|
|
944
953
|
getPets,
|
|
945
954
|
getResourceItem,
|
|
955
|
+
handleChangeHolder,
|
|
946
956
|
holderId,
|
|
947
957
|
initDate,
|
|
948
958
|
isAppointmentProduct,
|
|
@@ -22,6 +22,7 @@ export declare const getErrorList: (resource: any, cacheItem: any) => {
|
|
|
22
22
|
* @Date: 2024-01-09 13:40
|
|
23
23
|
*/
|
|
24
24
|
export declare const formatResource: (resourceItem: any, cacheItem?: any, formatLabel?: any) => any;
|
|
25
|
+
export declare const getAppointmentTimingPreference: (state: any) => any;
|
|
25
26
|
/**
|
|
26
27
|
* @title: 创建服务的开始时间和结束时间
|
|
27
28
|
* @description:
|
|
@@ -31,6 +31,7 @@ var utilsByBooking_exports = {};
|
|
|
31
31
|
__export(utilsByBooking_exports, {
|
|
32
32
|
formatResource: () => formatResource,
|
|
33
33
|
formatTimes: () => formatTimes,
|
|
34
|
+
getAppointmentTimingPreference: () => getAppointmentTimingPreference,
|
|
34
35
|
getErrorList: () => getErrorList,
|
|
35
36
|
getResourceTimeIsUsable: () => getResourceTimeIsUsable,
|
|
36
37
|
getServiceStartTimeAndEndTime: () => getServiceStartTimeAndEndTime,
|
|
@@ -198,8 +199,13 @@ var formatResource = (resourceItem, cacheItem, formatLabel) => {
|
|
|
198
199
|
}
|
|
199
200
|
return _resourceItem;
|
|
200
201
|
};
|
|
202
|
+
var getAppointmentTimingPreference = (state) => {
|
|
203
|
+
var _a, _b, _c;
|
|
204
|
+
return ((_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.information_tab) == null ? void 0 : _c.appointment_timing_preference) || "sequential";
|
|
205
|
+
};
|
|
201
206
|
var getServiceStartTimeAndEndTime = (state, cacheItem, timeObj) => {
|
|
202
207
|
var _a, _b, _c;
|
|
208
|
+
const appointmentTimingPreference = getAppointmentTimingPreference(state);
|
|
203
209
|
let lastServer = (0, import_utils2.getLastServer)(state.service.value);
|
|
204
210
|
let _extend = {
|
|
205
211
|
// 时长: 当前商品时长 > 第一个时长
|
|
@@ -215,7 +221,7 @@ var getServiceStartTimeAndEndTime = (state, cacheItem, timeObj) => {
|
|
|
215
221
|
if ((0, import_dayjs.default)(lastServerEndDate).isAfter(lastServerStartDate, "day")) {
|
|
216
222
|
_extend.start_time = timeObj.timeSlices[timeObj.timeSlices.length - 1].value;
|
|
217
223
|
} else {
|
|
218
|
-
_extend.start_time = lastServerEndDate.format("HH:mm");
|
|
224
|
+
_extend.start_time = appointmentTimingPreference === "sequential" ? lastServerEndDate.format("HH:mm") : lastServerStartDate.format("HH:mm");
|
|
219
225
|
}
|
|
220
226
|
} else {
|
|
221
227
|
let findNextSliceProps = {
|
|
@@ -260,6 +266,7 @@ var getServiceStartTimeAndEndTime = (state, cacheItem, timeObj) => {
|
|
|
260
266
|
0 && (module.exports = {
|
|
261
267
|
formatResource,
|
|
262
268
|
formatTimes,
|
|
269
|
+
getAppointmentTimingPreference,
|
|
263
270
|
getErrorList,
|
|
264
271
|
getResourceTimeIsUsable,
|
|
265
272
|
getServiceStartTimeAndEndTime,
|