@pisell/private-materials 3.2.33 → 3.2.35
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 +5 -5
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/Sales/Event/index.js +7 -7
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +86 -41
- package/es/components/appointmentBooking/components/Cart/Item/Total.js +3 -2
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +34 -16
- package/es/components/appointmentBooking/components/Cart/Item/index.less +15 -9
- package/es/components/appointmentBooking/components/Cart/index.js +2 -7
- package/es/components/appointmentBooking/components/ConfirmInformation/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +16 -0
- package/es/components/appointmentBooking/components/ConfirmInformation/index.less +24 -0
- package/es/components/appointmentBooking/components/Content/index.js +42 -6
- package/es/components/appointmentBooking/components/Date/index.js +86 -24
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/Deposit/index.js +30 -0
- package/es/components/appointmentBooking/components/Deposit/index.less +16 -0
- package/es/components/appointmentBooking/components/Form/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/Form/index.js +110 -0
- package/es/components/appointmentBooking/components/Form/index.less +3 -0
- package/es/components/appointmentBooking/components/Header/index.js +3 -2
- package/es/components/appointmentBooking/components/Resource/index.js +4 -1
- package/es/components/appointmentBooking/components/Services/index.js +103 -9
- package/es/components/appointmentBooking/context.d.ts +3 -0
- package/es/components/appointmentBooking/context.js +19 -3
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +108 -0
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
- package/es/components/appointmentBooking/deposit/index.d.ts +3 -0
- package/es/components/appointmentBooking/deposit/index.js +101 -0
- package/es/components/appointmentBooking/deposit/index.less +53 -0
- package/es/components/appointmentBooking/hooks.d.ts +16 -0
- package/es/components/appointmentBooking/hooks.js +138 -53
- package/es/components/appointmentBooking/index.js +8 -0
- package/es/components/appointmentBooking/locales.d.ts +36 -3
- package/es/components/appointmentBooking/locales.js +42 -3
- package/es/components/appointmentBooking/utils.d.ts +23 -1
- package/es/components/appointmentBooking/utils.js +112 -27
- package/es/components/booking/addons/model.js +5 -5
- package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
- package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
- package/es/components/booking/components/browserSelect/index.js +1 -1
- package/es/components/booking/components/footer/index.js +6 -4
- package/es/components/booking/components/voucher/index.js +13 -15
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/info/index.js +2 -8
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addTimeModal/index.js +3 -2
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +4 -2
- package/es/components/booking/info2/service/editService/index.js +4 -11
- package/es/components/booking/materiels/startTime/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/index.js +11 -11
- package/es/components/booking/notes/addNote/index.js +1 -1
- package/es/components/booking/notes/model.js +5 -5
- package/es/components/booking/payments/model.js +5 -5
- package/es/components/booking/utils.d.ts +2 -2
- 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 +2 -2
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
- package/es/components/eventBooking/components/Provider/SelectProduct/index.js +77 -0
- package/es/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
- package/es/components/listComponent/index.js +5 -5
- package/es/components/productExtension/card/index.js +3 -3
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
- package/es/components/productExtension/fields/Forms/index.js +12 -12
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/server.js +2 -2
- package/es/components/ruleSetting/ruleBorder/index.js +1 -1
- package/es/components/schedules/calendar/index.js +4 -4
- package/es/components/schedules/calendar/serve.js +2 -2
- package/es/components/schedules/components/CurrentDay/index.js +5 -5
- package/es/components/schedules/components/CurrentDay/serve.js +2 -2
- package/es/components/schedules/components/DropdownSort/index.js +1 -1
- package/es/components/schedules/components/ResourceList/index.js +1 -1
- package/es/components/schedules/components/Search/index.js +5 -5
- package/es/components/schedules/model.js +5 -5
- package/es/components/schedules/openHours/index.js +1 -1
- package/es/components/schedules/openHours/serve.js +2 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
- package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
- package/es/components/schedules/products/serve.js +2 -2
- package/es/components/schedules/products/utils.js +5 -5
- package/es/components/schedules/resources/detail/detailContent.js +2 -2
- package/es/components/schedules/resources/detail/index.js +10 -10
- package/es/components/schedules/resources/list/index.js +2 -2
- package/es/components/schedules/resources/relationProduct/index.js +1 -1
- package/es/components/schedules/resources/serve.js +2 -2
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/schedules/utils.js +4 -4
- package/es/components/selectModal/index.js +2 -2
- package/es/components/shoppingCart/components/Cart/Product.js +16 -3
- package/es/components/shoppingCart/status.js +4 -1
- package/es/components/shoppingCart/type.d.ts +3 -0
- package/es/components/wallet/Detail/index.js +1 -1
- package/es/components/wallet/components/WalletCard.js +1 -1
- package/es/hooks/useComponents.js +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/components/Sales/Event/index.js +5 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +56 -20
- package/lib/components/appointmentBooking/components/Cart/Item/Total.js +31 -24
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +31 -11
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +15 -9
- package/lib/components/appointmentBooking/components/Cart/index.js +2 -2
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +42 -0
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +24 -0
- package/lib/components/appointmentBooking/components/Content/index.js +31 -3
- package/lib/components/appointmentBooking/components/Date/index.js +27 -8
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/Deposit/index.js +61 -0
- package/lib/components/appointmentBooking/components/Deposit/index.less +16 -0
- package/lib/components/appointmentBooking/components/Form/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/Form/index.js +108 -0
- package/lib/components/appointmentBooking/components/Form/index.less +3 -0
- package/lib/components/appointmentBooking/components/Header/index.js +9 -6
- package/lib/components/appointmentBooking/components/Resource/index.js +2 -0
- package/lib/components/appointmentBooking/components/Services/index.js +48 -7
- package/lib/components/appointmentBooking/context.d.ts +3 -0
- package/lib/components/appointmentBooking/context.js +12 -4
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +95 -0
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
- package/lib/components/appointmentBooking/deposit/index.d.ts +3 -0
- package/lib/components/appointmentBooking/deposit/index.js +109 -0
- package/lib/components/appointmentBooking/deposit/index.less +53 -0
- package/lib/components/appointmentBooking/hooks.d.ts +16 -0
- package/lib/components/appointmentBooking/hooks.js +49 -6
- package/lib/components/appointmentBooking/index.js +5 -0
- package/lib/components/appointmentBooking/locales.d.ts +36 -3
- package/lib/components/appointmentBooking/locales.js +36 -3
- package/lib/components/appointmentBooking/utils.d.ts +23 -1
- package/lib/components/appointmentBooking/utils.js +84 -26
- package/lib/components/booking/components/footer/index.js +8 -6
- package/lib/components/booking/components/voucher/index.js +11 -15
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/info/index.js +4 -6
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addTimeModal/index.js +4 -3
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +2 -1
- package/lib/components/booking/info2/service/editService/index.js +4 -11
- package/lib/components/booking/utils.d.ts +2 -2
- 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 +2 -2
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +69 -0
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/schedules/utils.js +1 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +14 -3
- package/lib/components/shoppingCart/status.js +4 -1
- package/lib/components/shoppingCart/type.d.ts +3 -0
- package/lib/components/wallet/Detail/index.js +1 -1
- package/lib/components/wallet/components/WalletCard.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/utils/index.d.ts +1 -1
- package/lowcode/appointment-deposit/meta.ts +58 -0
- package/package.json +4 -4
- package/es/components/ticketBooking/data.d.ts +0 -0
- package/es/components/ticketBooking/data.js +0 -82
- package/es/components/ticketBooking/index.d.ts +0 -2
- package/es/components/ticketBooking/index.js +0 -6
- package/lib/components/ticketBooking/data.d.ts +0 -0
- package/lib/components/ticketBooking/data.js +0 -0
- package/lib/components/ticketBooking/index.d.ts +0 -2
- package/lib/components/ticketBooking/index.js +0 -28
package/es/utils/index.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ declare let modal: Omit<ModalStaticFunctions, 'warn'>;
|
|
|
18
18
|
export declare const setModal: (m: Omit<ModalStaticFunctions, 'warn'>) => void;
|
|
19
19
|
export declare const saveConfirm: () => Promise<{
|
|
20
20
|
destroy: () => void;
|
|
21
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
21
|
+
update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
|
|
22
22
|
}>;
|
|
23
23
|
export { modal };
|
|
@@ -104,7 +104,11 @@ var EventProvider = ({ children }) => {
|
|
|
104
104
|
setEventData({
|
|
105
105
|
currentEventItem: eventItem
|
|
106
106
|
});
|
|
107
|
-
|
|
107
|
+
if (currentCartItem) {
|
|
108
|
+
updateCurrentCartItem({ eventItem });
|
|
109
|
+
} else {
|
|
110
|
+
createCartItemFromEvent(eventItem);
|
|
111
|
+
}
|
|
108
112
|
};
|
|
109
113
|
const contextValue = {
|
|
110
114
|
eventData,
|
|
@@ -25,7 +25,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
25
25
|
* @return {*}
|
|
26
26
|
* @Author: xiangfeng.xue
|
|
27
27
|
*/
|
|
28
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00"
|
|
28
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
|
|
29
29
|
/**
|
|
30
30
|
* 计算所有价格明细
|
|
31
31
|
* @param items - 购物车商品数组
|
|
@@ -54,7 +54,12 @@ var ContinueButton = () => {
|
|
|
54
54
|
carts,
|
|
55
55
|
appointmentBooking,
|
|
56
56
|
resourceOtherParams,
|
|
57
|
-
summary
|
|
57
|
+
summary,
|
|
58
|
+
isAgreeDepositPolicy,
|
|
59
|
+
setIsAgreeDepositPolicy,
|
|
60
|
+
resources,
|
|
61
|
+
currentResource,
|
|
62
|
+
setCurrentResource
|
|
58
63
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
59
64
|
const {
|
|
60
65
|
getResourceTimeSlot,
|
|
@@ -62,7 +67,7 @@ var ContinueButton = () => {
|
|
|
62
67
|
autoSelectAllProductResources
|
|
63
68
|
} = (0, import_hooks.useAppointmentBookingResource)();
|
|
64
69
|
const { checkSkipResourceStep } = (0, import_hooks.useIsSkipResourceStep)();
|
|
65
|
-
const { getStepIndex } = (0, import_hooks.useAppointmentBookingStep)();
|
|
70
|
+
const { getStepIndex, stepList } = (0, import_hooks.useAppointmentBookingStep)();
|
|
66
71
|
const disabled = (0, import_react.useMemo)(() => {
|
|
67
72
|
if (!carts.length) return true;
|
|
68
73
|
return false;
|
|
@@ -72,31 +77,42 @@ var ContinueButton = () => {
|
|
|
72
77
|
accountLists,
|
|
73
78
|
resourceOtherParams == null ? void 0 : resourceOtherParams.errorList
|
|
74
79
|
]);
|
|
80
|
+
console.log((0, import_utils2.formatCarts)(carts, resources), "wh98987");
|
|
75
81
|
const clearData = () => {
|
|
76
82
|
var _a2;
|
|
77
83
|
appointmentBooking.destroy();
|
|
78
84
|
(_a2 = shopDiscount == null ? void 0 : shopDiscount.destroy) == null ? void 0 : _a2.call(shopDiscount);
|
|
85
|
+
setIsAgreeDepositPolicy(false);
|
|
86
|
+
};
|
|
87
|
+
const goPaymentFinish = (order_id, amount) => {
|
|
88
|
+
var _a2;
|
|
89
|
+
const url = `/payment-finish/success?order_id=${order_id}&amount=${Number(
|
|
90
|
+
amount
|
|
91
|
+
)}`;
|
|
92
|
+
(_a2 = utils == null ? void 0 : utils.history) == null ? void 0 : _a2.replace(url);
|
|
79
93
|
};
|
|
80
94
|
const handleNextStep = async () => {
|
|
81
|
-
var _a2
|
|
95
|
+
var _a2;
|
|
82
96
|
if (isLastStep) {
|
|
97
|
+
const { deposit } = summary;
|
|
83
98
|
setLoading(true);
|
|
84
99
|
try {
|
|
85
|
-
const
|
|
86
|
-
|
|
100
|
+
const { data } = await appointmentBooking.submitOrder();
|
|
101
|
+
const { is_deposit, deposit_amount, total_amount, order_id } = data || {};
|
|
102
|
+
const _total = is_deposit ? deposit_amount : total_amount;
|
|
103
|
+
if (_total > 0) {
|
|
87
104
|
utils.action({
|
|
88
105
|
type: "pisell1.payment",
|
|
89
|
-
data
|
|
106
|
+
data
|
|
90
107
|
});
|
|
91
108
|
} else {
|
|
92
|
-
|
|
109
|
+
if (deposit == null ? void 0 : deposit.hasDeposit) {
|
|
110
|
+
return goPaymentFinish(order_id, _total);
|
|
111
|
+
}
|
|
93
112
|
const freeResult = await appointmentBooking.getFreeProduct(order_id);
|
|
94
113
|
console.log(freeResult, "freeResult");
|
|
95
114
|
if (freeResult == null ? void 0 : freeResult.status) {
|
|
96
|
-
|
|
97
|
-
total_amount
|
|
98
|
-
)}`;
|
|
99
|
-
(_a2 = utils == null ? void 0 : utils.history) == null ? void 0 : _a2.replace(url);
|
|
115
|
+
goPaymentFinish(order_id, total_amount);
|
|
100
116
|
} else {
|
|
101
117
|
(0, import_materials.PisellToast)({
|
|
102
118
|
content: freeResult == null ? void 0 : freeResult.message
|
|
@@ -110,21 +126,26 @@ var ContinueButton = () => {
|
|
|
110
126
|
}
|
|
111
127
|
return;
|
|
112
128
|
}
|
|
113
|
-
if (((
|
|
129
|
+
if (((_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key) === "select-resource") {
|
|
114
130
|
getResourceTimeSlot();
|
|
115
131
|
}
|
|
116
132
|
return appointmentBooking.next();
|
|
117
133
|
};
|
|
118
134
|
const handleContinue = async () => {
|
|
119
|
-
var _a2;
|
|
135
|
+
var _a2, _b;
|
|
120
136
|
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
121
137
|
console.log(currentStep, isLastStep, isLogin, accountLists, "wh9896788222");
|
|
122
138
|
if (isLastStep) {
|
|
139
|
+
if (((_b = summary == null ? void 0 : summary.deposit) == null ? void 0 : _b.hasDeposit) && !isAgreeDepositPolicy) {
|
|
140
|
+
return (0, import_materials.PisellToast)({
|
|
141
|
+
content: import_utils.locales.getText("pisell2.appointment.deposit.agree.policy")
|
|
142
|
+
});
|
|
143
|
+
}
|
|
123
144
|
if (!isLogin) {
|
|
124
145
|
return openLoginModal({
|
|
125
146
|
callback: (status) => {
|
|
126
|
-
var _a3,
|
|
127
|
-
const user = ((_d = (_c = (
|
|
147
|
+
var _a3, _b2, _c, _d, _e;
|
|
148
|
+
const user = ((_d = (_c = (_b2 = (_a3 = utils == null ? void 0 : utils.store) == null ? void 0 : _a3.getState) == null ? void 0 : _b2.call(_a3)) == null ? void 0 : _c.global) == null ? void 0 : _d.userInfo) || JSON.parse(((_e = utils == null ? void 0 : utils.storage) == null ? void 0 : _e.get("customer")) || {});
|
|
128
149
|
const currentUser = (0, import_utils2.formatCustomer)(user);
|
|
129
150
|
const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
|
|
130
151
|
if (status === "success") {
|
|
@@ -145,11 +166,26 @@ var ContinueButton = () => {
|
|
|
145
166
|
return;
|
|
146
167
|
}
|
|
147
168
|
}
|
|
148
|
-
if (key === "select-resource"
|
|
149
|
-
(0,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
169
|
+
if (key === "select-resource") {
|
|
170
|
+
if ((0, import_utils2.isEmptyCartsResourceId)(carts)) {
|
|
171
|
+
(0, import_materials.PisellToast)({
|
|
172
|
+
content: import_utils.locales.getText("pisell2.appointment.no.available.time")
|
|
173
|
+
});
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
console.log(
|
|
177
|
+
23423232344,
|
|
178
|
+
(0, import_utils2.hasResourceFormId)((0, import_utils2.formatCarts)(carts, resources))
|
|
179
|
+
);
|
|
180
|
+
if ((0, import_utils2.hasResourceFormId)((0, import_utils2.formatCarts)(carts, resources))) {
|
|
181
|
+
appointmentBooking.addStep({
|
|
182
|
+
// index: stepList - 2,
|
|
183
|
+
key: "fill-form",
|
|
184
|
+
description: import_utils.locales.getText("pisell2.appointment.fill-form")
|
|
185
|
+
});
|
|
186
|
+
} else {
|
|
187
|
+
appointmentBooking.removeStep("fill-form");
|
|
188
|
+
}
|
|
153
189
|
}
|
|
154
190
|
handleNextStep();
|
|
155
191
|
};
|
|
@@ -40,34 +40,41 @@ var import_classnames = __toESM(require("classnames"));
|
|
|
40
40
|
var import_context = require("../../../context");
|
|
41
41
|
var Total = ({ className, isFooter }) => {
|
|
42
42
|
const { summary, symbolic } = (0, import_context.useAppointmentBookingContext)();
|
|
43
|
-
const { taxTitle, totalTaxFee, isPriceIncludeTax, total } = summary;
|
|
43
|
+
const { taxTitle, totalTaxFee, isPriceIncludeTax, total, deposit } = summary;
|
|
44
44
|
console.log(summary, "summarysummary");
|
|
45
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
45
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
|
-
className: (0
|
|
49
|
-
[["total-gst-wrap"]]: !isPriceIncludeTax && Number(totalTaxFee) > 0
|
|
50
|
-
})
|
|
48
|
+
className: `appointment-total-wrap ${className} ${(deposit == null ? void 0 : deposit.hasDeposit) ? "appointment-total-deposit-wrap" : ""}`
|
|
51
49
|
},
|
|
52
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "
|
|
53
|
-
|
|
50
|
+
!isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "gst-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", null, taxTitle, isFooter ? ": " : ""), /* @__PURE__ */ import_react.default.createElement(import_materials.PisellText.Amount, { value: totalTaxFee, showCurrencySymbol: true })) : null,
|
|
51
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
52
|
+
"div",
|
|
54
53
|
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
className: (0, import_classnames.default)("event-total", {
|
|
55
|
+
[["total-gst-wrap"]]: !isPriceIncludeTax && Number(totalTaxFee) > 0
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "left" }, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.event.total"), isFooter ? ": " : ""), isFooter ? /* @__PURE__ */ import_react.default.createElement(
|
|
59
|
+
import_materials.PisellText.Amount,
|
|
60
|
+
{
|
|
61
|
+
value: total,
|
|
62
|
+
showCurrencySymbol: true,
|
|
63
|
+
className: "event-amount"
|
|
64
|
+
}
|
|
65
|
+
) : null), isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ import_react.default.createElement("span", { className: "gst" }, import_utils.locales.getText("pisell2.event.total.gst")(
|
|
66
|
+
`${isFooter ? `${taxTitle}: ` : taxTitle}`,
|
|
67
|
+
`${symbolic}${totalTaxFee}`
|
|
68
|
+
)) : null),
|
|
69
|
+
!isFooter ? /* @__PURE__ */ import_react.default.createElement(
|
|
70
|
+
import_materials.PisellText.Amount,
|
|
71
|
+
{
|
|
72
|
+
value: total,
|
|
73
|
+
showCurrencySymbol: true,
|
|
74
|
+
className: "event-amount"
|
|
75
|
+
}
|
|
76
|
+
) : null
|
|
77
|
+
)
|
|
78
|
+
);
|
|
72
79
|
};
|
|
73
80
|
var Total_default = Total;
|
|
@@ -42,9 +42,10 @@ var import_hooks2 = require("../../../hooks");
|
|
|
42
42
|
var import_utils2 = require("../../../utils");
|
|
43
43
|
var import_Voucher = __toESM(require("../../Voucher"));
|
|
44
44
|
var import_Total = __toESM(require("./Total"));
|
|
45
|
+
var import_Deposit = __toESM(require("../../Deposit"));
|
|
45
46
|
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
46
47
|
var import_index = require("./index.less");
|
|
47
|
-
var CartItem = (
|
|
48
|
+
var CartItem = () => {
|
|
48
49
|
var _a, _b, _c, _d;
|
|
49
50
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
50
51
|
const {
|
|
@@ -53,21 +54,30 @@ var CartItem = ({ onConfirm }) => {
|
|
|
53
54
|
currentStep,
|
|
54
55
|
resources,
|
|
55
56
|
setResourceOtherParams,
|
|
56
|
-
resourceOtherParams
|
|
57
|
+
resourceOtherParams,
|
|
58
|
+
summary
|
|
57
59
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
58
|
-
const { accountLists } = (0, import_hooks2.useAppointmentBookingAccount)();
|
|
60
|
+
const { accountLists, getHolders } = (0, import_hooks2.useAppointmentBookingAccount)();
|
|
59
61
|
const { getResourceList } = (0, import_hooks2.useAppointmentBookingResource)();
|
|
62
|
+
const { isFormSubject } = (0, import_hooks2.useAppointmentBookingSetting)();
|
|
63
|
+
const { isLogin } = (0, import_hooks2.useAppointmentBookingLogin)();
|
|
60
64
|
const context = (0, import_useEngineContext.default)();
|
|
61
65
|
const { businessUtils } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
62
66
|
const currentUser = (0, import_utils2.formatCurrentUser)();
|
|
67
|
+
const { deposit } = summary;
|
|
68
|
+
console.log(deposit, accountLists, "deposit");
|
|
63
69
|
const holderIds = (0, import_react.useMemo)(() => {
|
|
70
|
+
if (isFormSubject) return [];
|
|
64
71
|
return accountLists.map((item) => item.id);
|
|
65
|
-
}, [accountLists]);
|
|
72
|
+
}, [accountLists, isFormSubject]);
|
|
66
73
|
const holders = (0, import_react.useMemo)(() => {
|
|
74
|
+
if (isFormSubject) return [];
|
|
67
75
|
return (0, import_utils2.formatHolder)(accountLists);
|
|
68
|
-
}, [accountLists]);
|
|
69
|
-
const hasGoodPassApp =
|
|
70
|
-
|
|
76
|
+
}, [accountLists, isFormSubject]);
|
|
77
|
+
const hasGoodPassApp = (0, import_react.useMemo)(() => {
|
|
78
|
+
var _a2;
|
|
79
|
+
return !!((_a2 = businessUtils == null ? void 0 : businessUtils.getAppByModal) == null ? void 0 : _a2.call(businessUtils, "goodpass"));
|
|
80
|
+
}, []);
|
|
71
81
|
const handleClickCard = (e, type, val) => {
|
|
72
82
|
if (type === "note") {
|
|
73
83
|
return appointmentBooking.updateCart({
|
|
@@ -86,12 +96,19 @@ var CartItem = ({ onConfirm }) => {
|
|
|
86
96
|
...resourceOtherParams,
|
|
87
97
|
errorList: null
|
|
88
98
|
});
|
|
89
|
-
|
|
99
|
+
appointmentBooking.updateCart({
|
|
90
100
|
_id: e == null ? void 0 : e._id,
|
|
91
101
|
resources: [val]
|
|
92
102
|
});
|
|
103
|
+
getResourceList();
|
|
104
|
+
return;
|
|
93
105
|
}
|
|
94
106
|
};
|
|
107
|
+
console.log(
|
|
108
|
+
((_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key) === "select-resource",
|
|
109
|
+
holders,
|
|
110
|
+
"select-resource"
|
|
111
|
+
);
|
|
95
112
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
96
113
|
"div",
|
|
97
114
|
{
|
|
@@ -101,13 +118,16 @@ var CartItem = ({ onConfirm }) => {
|
|
|
101
118
|
import_shoppingCart.default,
|
|
102
119
|
{
|
|
103
120
|
productParams: {
|
|
104
|
-
products: (0, import_utils2.formatCarts)(carts, resources),
|
|
121
|
+
products: (0, import_utils2.formatCarts)(carts, resources, accountLists),
|
|
105
122
|
hideAddBtn: false,
|
|
106
123
|
holders,
|
|
107
124
|
disabledEdit: isLastStep,
|
|
108
125
|
isShowChangeResource: ((_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.key) === "select-resource",
|
|
109
126
|
isShowDelete: ((_d = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _d.key) === "select-service",
|
|
110
|
-
isShowPackageNote: false
|
|
127
|
+
isShowPackageNote: false,
|
|
128
|
+
isShowChangeHolder: isFormSubject && isLogin,
|
|
129
|
+
isShowHolder: isFormSubject,
|
|
130
|
+
isShowAddHolderButton: true
|
|
111
131
|
},
|
|
112
132
|
collapseParams: {
|
|
113
133
|
activeKey: holderIds,
|
|
@@ -120,7 +140,7 @@ var CartItem = ({ onConfirm }) => {
|
|
|
120
140
|
onChange: (e, type, key) => handleClickCard(e, type, key)
|
|
121
141
|
}
|
|
122
142
|
)),
|
|
123
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-footer" }, hasGoodPassApp ? /* @__PURE__ */ import_react.default.createElement(import_Voucher.default, { currentUser, products: carts }) : null, /* @__PURE__ */ import_react.default.createElement(import_Total.default, null), /* @__PURE__ */ import_react.default.createElement(import_ContinueButton.default, null))
|
|
143
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-footer" }, hasGoodPassApp ? /* @__PURE__ */ import_react.default.createElement(import_Voucher.default, { currentUser, products: carts }) : null, /* @__PURE__ */ import_react.default.createElement(import_Total.default, null), (carts == null ? void 0 : carts.length) > 0 && (deposit == null ? void 0 : deposit.hasDeposit) ? /* @__PURE__ */ import_react.default.createElement(import_Deposit.default, null) : null, /* @__PURE__ */ import_react.default.createElement(import_ContinueButton.default, null))
|
|
124
144
|
));
|
|
125
145
|
};
|
|
126
146
|
var Item_default = CartItem;
|
|
@@ -74,26 +74,32 @@
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
.appointment-total-deposit-wrap {
|
|
78
|
+
color: var(--Text-Text_1, #1b1b1b);
|
|
79
|
+
font-size: 20px;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
line-height: 28px;
|
|
82
|
+
}
|
|
83
|
+
|
|
77
84
|
.appointment-cart-mobile-item-wrap {
|
|
85
|
+
height: 100%;
|
|
78
86
|
display: flex;
|
|
79
87
|
flex-direction: column;
|
|
80
|
-
|
|
81
|
-
height: 100%;
|
|
88
|
+
overflow: hidden;
|
|
82
89
|
|
|
83
90
|
.content {
|
|
84
91
|
flex: 1;
|
|
85
92
|
overflow-y: auto;
|
|
86
|
-
padding:
|
|
87
|
-
max-height: 100%;
|
|
93
|
+
padding: 16px 16px 0;
|
|
88
94
|
}
|
|
95
|
+
|
|
89
96
|
.appointment-footer {
|
|
90
|
-
|
|
91
|
-
position: fixed;
|
|
92
|
-
bottom: 0;
|
|
93
|
-
left: 0;
|
|
94
|
-
right: 0;
|
|
97
|
+
background: #fff;
|
|
95
98
|
border-top: 1px solid #eaecf0;
|
|
96
99
|
padding: 14px 24px 24px;
|
|
97
100
|
margin-top: 0;
|
|
101
|
+
position: relative;
|
|
102
|
+
flex: none;
|
|
103
|
+
z-index: 10;
|
|
98
104
|
}
|
|
99
105
|
}
|
|
@@ -47,14 +47,14 @@ var Cart = ({ open, onCancel }) => {
|
|
|
47
47
|
closable: true,
|
|
48
48
|
onCancel: () => onCancel(),
|
|
49
49
|
bodyStyle: {
|
|
50
|
-
padding:
|
|
50
|
+
padding: 0
|
|
51
51
|
},
|
|
52
52
|
destroyOnClose: true,
|
|
53
53
|
className: `appointment-cart-modal`,
|
|
54
54
|
footer: null,
|
|
55
55
|
forceRender: true
|
|
56
56
|
},
|
|
57
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
57
|
+
/* @__PURE__ */ import_react.default.createElement(import_Item.default, null)
|
|
58
58
|
);
|
|
59
59
|
};
|
|
60
60
|
var Cart_default = Cart;
|
|
@@ -0,0 +1,42 @@
|
|
|
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/appointmentBooking/components/ConfirmInformation/index.tsx
|
|
30
|
+
var ConfirmInformation_exports = {};
|
|
31
|
+
__export(ConfirmInformation_exports, {
|
|
32
|
+
default: () => ConfirmInformation_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ConfirmInformation_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_Item = __toESM(require("../Cart/Item"));
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var ConfirmInformation = () => {
|
|
40
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, null) : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "tips" }, import_utils.locales.getText("pisell2.appointment.tips")), /* @__PURE__ */ import_react.default.createElement("span", { className: "tips-content" }, import_utils.locales.getText("pisell2.appointment.tips.content")("确认"))));
|
|
41
|
+
};
|
|
42
|
+
var ConfirmInformation_default = ConfirmInformation;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.appointment-confirm-information-wrap {
|
|
2
|
+
padding-top: 20px;
|
|
3
|
+
|
|
4
|
+
.appointment-confirm-information-content {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
|
|
8
|
+
.tips {
|
|
9
|
+
margin-top: 24px;
|
|
10
|
+
color: var(--Gray-900, #101828);
|
|
11
|
+
font-size: 18px;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.tips-content {
|
|
17
|
+
margin-top: 4px;
|
|
18
|
+
color: var(--Gray-900, #101828);
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
font-style: normal;
|
|
21
|
+
font-weight: 400;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -42,15 +42,30 @@ var import_Date = __toESM(require("../Date"));
|
|
|
42
42
|
var import_Resource = __toESM(require("../Resource"));
|
|
43
43
|
var import_TimeSlicing = __toESM(require("../TimeSlicing"));
|
|
44
44
|
var import_Guest = __toESM(require("../Guest"));
|
|
45
|
+
var import_Form = __toESM(require("../Form"));
|
|
46
|
+
var import_ConfirmInformation = __toESM(require("../ConfirmInformation"));
|
|
45
47
|
var import_context = require("../../context");
|
|
46
48
|
var import_hooks = require("../../hooks");
|
|
47
49
|
var import_index = require("./index.less");
|
|
48
50
|
var Layout = () => {
|
|
49
|
-
var _a, _b, _c;
|
|
51
|
+
var _a, _b, _c, _d;
|
|
50
52
|
const { currentStep, setResourceOtherParams, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
|
|
53
|
+
const { getLoadAllSchedule, isDateSelectedFirst, isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
54
|
+
const { isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
55
|
+
const { getHolders } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
51
56
|
(0, import_hooks.useAppointmentBookingCart)();
|
|
52
57
|
(0, import_hooks.useAppointmentBookingStep)();
|
|
53
58
|
const [params, setParams] = (0, import_react.useState)({});
|
|
59
|
+
(0, import_react.useEffect)(() => {
|
|
60
|
+
if (isFormSubject && isLogin) {
|
|
61
|
+
getHolders();
|
|
62
|
+
}
|
|
63
|
+
}, [isFormSubject, isLogin]);
|
|
64
|
+
(0, import_react.useEffect)(() => {
|
|
65
|
+
if (isDateSelectedFirst) {
|
|
66
|
+
getLoadAllSchedule();
|
|
67
|
+
}
|
|
68
|
+
}, [isDateSelectedFirst]);
|
|
54
69
|
(0, import_react.useEffect)(() => {
|
|
55
70
|
setResourceOtherParams({
|
|
56
71
|
...resourceOtherParams,
|
|
@@ -75,7 +90,11 @@ var Layout = () => {
|
|
|
75
90
|
// 选择资源
|
|
76
91
|
"select-resource": import_Resource.default,
|
|
77
92
|
// 时间切片
|
|
78
|
-
"select-time": import_TimeSlicing.default
|
|
93
|
+
"select-time": import_TimeSlicing.default,
|
|
94
|
+
// 填写表单
|
|
95
|
+
"fill-form": import_Form.default,
|
|
96
|
+
// 确认信息
|
|
97
|
+
"confirm-information": import_ConfirmInformation.default
|
|
79
98
|
};
|
|
80
99
|
let Com2 = components[key];
|
|
81
100
|
return /* @__PURE__ */ import_react.default.createElement(Com2, { onChange: setParams, params });
|
|
@@ -98,13 +117,22 @@ var Layout = () => {
|
|
|
98
117
|
}
|
|
99
118
|
}
|
|
100
119
|
}, [(_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.key]);
|
|
120
|
+
const isShowCartCom = (0, import_react.useMemo)(() => {
|
|
121
|
+
var _a2;
|
|
122
|
+
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
123
|
+
if ((0, import_utils.isMobile)()) return null;
|
|
124
|
+
if (isDateSelectedFirst && key === "select-date") {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "parallel-content-right" }, /* @__PURE__ */ import_react.default.createElement(import_Item.default, null));
|
|
128
|
+
}, [isDateSelectedFirst, (_d = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _d.key]);
|
|
101
129
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Header.default, null), /* @__PURE__ */ import_react.default.createElement(
|
|
102
130
|
"div",
|
|
103
131
|
{
|
|
104
132
|
className: `parallel-content-wrap ${(0, import_utils.isMobile)() ? "parallel-content-mobile-wrap" : ""}`
|
|
105
133
|
},
|
|
106
134
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "parallel-content-left" }, Com),
|
|
107
|
-
|
|
135
|
+
isShowCartCom
|
|
108
136
|
), (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Footer.default, null) : null);
|
|
109
137
|
};
|
|
110
138
|
var Content_default = Layout;
|
|
@@ -40,6 +40,7 @@ var import_classnames = __toESM(require("classnames"));
|
|
|
40
40
|
var import_utils = require("@pisell/utils");
|
|
41
41
|
var import_icons = require("@ant-design/icons");
|
|
42
42
|
var import_context = require("../../context");
|
|
43
|
+
var import_hooks = require("../../hooks");
|
|
43
44
|
var import_index = require("./index.less");
|
|
44
45
|
import_dayjs.default.extend(import_isSameOrBefore.default);
|
|
45
46
|
var CalendarDate = (props) => {
|
|
@@ -50,6 +51,7 @@ var CalendarDate = (props) => {
|
|
|
50
51
|
return (0, import_dayjs.default)();
|
|
51
52
|
});
|
|
52
53
|
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
54
|
+
const { isDateSelectedFirst, customPageId } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
53
55
|
const weekListText = [
|
|
54
56
|
import_utils.locales.getText("pisell2.appointment.sunday"),
|
|
55
57
|
import_utils.locales.getText("pisell2.appointment.monday"),
|
|
@@ -89,7 +91,18 @@ var CalendarDate = (props) => {
|
|
|
89
91
|
let lastDate = (0, import_dayjs.default)(newCurrentMonth).subtract(1, "month");
|
|
90
92
|
return lastDate.isBefore((0, import_dayjs.default)(), "month");
|
|
91
93
|
};
|
|
94
|
+
const getDateData = async (params) => {
|
|
95
|
+
console.log(isDateSelectedFirst, customPageId, "wh7868");
|
|
96
|
+
if (isDateSelectedFirst) {
|
|
97
|
+
return appointmentBooking.loadScheduleAvailableDate({
|
|
98
|
+
...params,
|
|
99
|
+
custom_page_id: customPageId
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return await appointmentBooking.getAvailableDate(params);
|
|
103
|
+
};
|
|
92
104
|
const getDates = async (date) => {
|
|
105
|
+
var _a;
|
|
93
106
|
try {
|
|
94
107
|
const startDate = (0, import_dayjs.default)(date).startOf("month").format("YYYY-MM-DD");
|
|
95
108
|
const endDate = (0, import_dayjs.default)(date).endOf("month").format("YYYY-MM-DD");
|
|
@@ -97,13 +110,14 @@ var CalendarDate = (props) => {
|
|
|
97
110
|
startDate,
|
|
98
111
|
endDate
|
|
99
112
|
};
|
|
100
|
-
const data = await
|
|
113
|
+
const data = await getDateData(params);
|
|
101
114
|
const selected = await appointmentBooking.getDateRange();
|
|
115
|
+
console.log(data, selected, customPageId, "getDates");
|
|
102
116
|
if ((selected == null ? void 0 : selected.length) > 0) {
|
|
103
|
-
setCurrentDate(selected[0].date);
|
|
117
|
+
setCurrentDate((_a = selected == null ? void 0 : selected[0]) == null ? void 0 : _a.date);
|
|
104
118
|
} else {
|
|
105
119
|
if (date.format("YYYY-MM") === (0, import_dayjs.default)().format("YYYY-MM")) {
|
|
106
|
-
const firstAvailableDate = data.find(
|
|
120
|
+
const firstAvailableDate = (data || []).find(
|
|
107
121
|
(d) => d.status === "available"
|
|
108
122
|
);
|
|
109
123
|
setCurrentDate(firstAvailableDate == null ? void 0 : firstAvailableDate.date);
|
|
@@ -126,6 +140,7 @@ var CalendarDate = (props) => {
|
|
|
126
140
|
setDateMonthList(updatedDates);
|
|
127
141
|
} catch (error) {
|
|
128
142
|
setLoading(false);
|
|
143
|
+
setDateMonthList([]);
|
|
129
144
|
console.log(error, "wh978968234234");
|
|
130
145
|
}
|
|
131
146
|
};
|
|
@@ -143,6 +158,14 @@ var CalendarDate = (props) => {
|
|
|
143
158
|
setCurrentMonth(newNextMonth);
|
|
144
159
|
setLoading(true);
|
|
145
160
|
};
|
|
161
|
+
const handleClick = (day, date) => {
|
|
162
|
+
if (day == null ? void 0 : day.disabled) return;
|
|
163
|
+
setCurrentDate(date);
|
|
164
|
+
appointmentBooking.setDateRange([day]);
|
|
165
|
+
if (isDateSelectedFirst) {
|
|
166
|
+
appointmentBooking.next();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
146
169
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
147
170
|
"div",
|
|
148
171
|
{
|
|
@@ -176,11 +199,7 @@ var CalendarDate = (props) => {
|
|
|
176
199
|
["other-month-days"]: !isCurrentMonth,
|
|
177
200
|
["loading-item"]: loading
|
|
178
201
|
}),
|
|
179
|
-
onClick: () =>
|
|
180
|
-
if (day == null ? void 0 : day.disabled) return;
|
|
181
|
-
setCurrentDate(date);
|
|
182
|
-
appointmentBooking.setDateRange([day]);
|
|
183
|
-
}
|
|
202
|
+
onClick: () => handleClick(day, date)
|
|
184
203
|
},
|
|
185
204
|
isCurrentMonth && /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("day-text") }, (0, import_dayjs.default)(day.date).format("D"))
|
|
186
205
|
);
|