@pisell/private-materials 3.3.21 → 3.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.js +4 -4
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +19 -7
- package/es/components/appointmentBooking/components/ConfirmInformation/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +2 -1
- package/es/components/appointmentBooking/components/Content/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Content/index.js +0 -1
- package/es/components/appointmentBooking/components/Date/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Date/index.js +1 -5
- package/es/components/appointmentBooking/components/Date/state.d.ts +63 -0
- package/es/components/appointmentBooking/components/Form/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Form/index.js +4 -3
- package/es/components/appointmentBooking/components/Guest/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Resource/index.d.ts +7 -0
- package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Services/index.js +21 -11
- package/es/components/appointmentBooking/components/TimeSlicing/index.d.ts +4 -0
- package/es/components/appointmentBooking/context.d.ts +35 -0
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
- package/es/components/appointmentBooking/hooks.d.ts +106 -0
- package/es/components/appointmentBooking/hooks.js +12 -18
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/appointmentBooking/index.js +3 -5
- package/es/components/appointmentBooking/locales.d.ts +354 -0
- package/es/components/appointmentBooking/utils.d.ts +114 -0
- package/es/components/appointmentBooking/utils.js +15 -15
- package/es/components/booking/addons/model.d.ts +1 -10
- 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/voucher/index.js +4 -2
- package/es/components/booking/deposit/index.d.ts +3 -0
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/addService/index.js +14 -16
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +1 -0
- package/es/components/booking/info2/service/addService/index.js +30 -17
- package/es/components/booking/materiels/startTime/index.js +1 -1
- package/es/components/booking/model.d.ts +1 -9
- 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/model.d.ts +1 -10
- package/es/components/booking/notes/model.js +5 -5
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/payments/model.js +5 -5
- package/es/components/eftposPay/amount.d.ts +2 -1
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +2 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/payo/config.d.ts +13 -0
- package/es/components/eftposPay/payo/hooks.d.ts +10 -0
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/listComponent/index.js +5 -5
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- 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/Actor/index.d.ts +1 -0
- 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/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/index.d.ts +1 -0
- 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.d.ts +1 -9
- 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.js +4 -4
- package/es/components/selectModal/index.js +2 -2
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/ticketBooking/components/timeBar/index.js +1 -0
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/es/components/wallet/model.d.ts +1 -9
- package/es/hooks/useComponents.js +1 -1
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +12 -9
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +7 -1
- package/lib/components/appointmentBooking/components/Content/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Content/index.js +1 -1
- package/lib/components/appointmentBooking/components/Date/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Date/index.js +1 -1
- package/lib/components/appointmentBooking/components/Date/state.d.ts +63 -0
- package/lib/components/appointmentBooking/components/Form/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Form/index.js +3 -2
- package/lib/components/appointmentBooking/components/Guest/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Resource/index.d.ts +7 -0
- package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Services/index.js +8 -1
- package/lib/components/appointmentBooking/components/TimeSlicing/index.d.ts +4 -0
- package/lib/components/appointmentBooking/context.d.ts +35 -0
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
- package/lib/components/appointmentBooking/hooks.d.ts +106 -0
- package/lib/components/appointmentBooking/hooks.js +2 -6
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/appointmentBooking/index.js +2 -2
- package/lib/components/appointmentBooking/locales.d.ts +354 -0
- package/lib/components/appointmentBooking/utils.d.ts +114 -0
- package/lib/components/appointmentBooking/utils.js +14 -23
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/voucher/index.js +4 -2
- package/lib/components/booking/deposit/index.d.ts +3 -0
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/addService/index.js +14 -14
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +1 -0
- package/lib/components/booking/info2/service/addService/index.js +27 -15
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/eftposPay/amount.d.ts +2 -1
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +2 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/payo/config.d.ts +13 -0
- package/lib/components/eftposPay/payo/hooks.d.ts +10 -0
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/schedules/utils.js +1 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/timeBar/index.js +1 -0
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/components/wallet/model.d.ts +1 -9
- package/package.json +3 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { IWalletListItemProps } from './serve';
|
|
3
2
|
export interface WalletCardItemProps {
|
|
4
3
|
id: string;
|
|
@@ -27,11 +26,4 @@ export interface WalletListProps {
|
|
|
27
26
|
currentSearchListItemCode?: string;
|
|
28
27
|
[key: string]: any;
|
|
29
28
|
}
|
|
30
|
-
export declare const Provider:
|
|
31
|
-
global_wallet: WalletListProps;
|
|
32
|
-
} & {
|
|
33
|
-
dispatch: (params: {
|
|
34
|
-
type: string;
|
|
35
|
-
payload: any;
|
|
36
|
-
}) => void;
|
|
37
|
-
}>;
|
|
29
|
+
export declare const Provider: any, Context: any;
|
|
@@ -8,7 +8,7 @@ var useComponents = function useComponents(params) {
|
|
|
8
8
|
var _utils$getComponents;
|
|
9
9
|
var _ref = appHelper || {},
|
|
10
10
|
utils = _ref.utils;
|
|
11
|
-
return (utils === null || utils === void 0
|
|
11
|
+
return (utils === null || utils === void 0 || (_utils$getComponents = utils.getComponents) === null || _utils$getComponents === void 0 ? void 0 : _utils$getComponents.call(utils, components)) || [];
|
|
12
12
|
}, [components]);
|
|
13
13
|
return Cpt;
|
|
14
14
|
};
|
|
@@ -43,11 +43,10 @@ var import_utils2 = require("../../../utils");
|
|
|
43
43
|
var import_Voucher = __toESM(require("../../Voucher"));
|
|
44
44
|
var import_Total = __toESM(require("./Total"));
|
|
45
45
|
var import_Deposit = __toESM(require("../../Deposit"));
|
|
46
|
-
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
47
46
|
var import_utils3 = require("../utils");
|
|
48
47
|
var import_index = require("./index.less");
|
|
49
48
|
var CartItem = ({ onNext }) => {
|
|
50
|
-
var _a, _b, _c
|
|
49
|
+
var _a, _b, _c;
|
|
51
50
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
52
51
|
const {
|
|
53
52
|
carts,
|
|
@@ -62,11 +61,12 @@ var CartItem = ({ onNext }) => {
|
|
|
62
61
|
const { getResourceList } = (0, import_hooks2.useAppointmentBookingResource)();
|
|
63
62
|
const { isFormSubject, bookingSubject } = (0, import_hooks2.useAppointmentBookingSetting)();
|
|
64
63
|
const { isLogin } = (0, import_hooks2.useAppointmentBookingLogin)();
|
|
65
|
-
const
|
|
66
|
-
const utils = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
64
|
+
const utils = (0, import_hooks2.contextUtils)();
|
|
67
65
|
const { businessUtils } = utils;
|
|
68
|
-
const currentUser = (0, import_utils2.formatCurrentUser)();
|
|
69
66
|
const { deposit } = summary;
|
|
67
|
+
const currentUser = (0, import_react.useMemo)(() => {
|
|
68
|
+
return (0, import_utils2.formatCurrentUser)(utils) || {};
|
|
69
|
+
}, []);
|
|
70
70
|
const holderIds = (0, import_react.useMemo)(() => {
|
|
71
71
|
if (isFormSubject) return [];
|
|
72
72
|
return accountLists.map((item) => item.id);
|
|
@@ -75,7 +75,7 @@ var CartItem = ({ onNext }) => {
|
|
|
75
75
|
if (isFormSubject) return [];
|
|
76
76
|
return (0, import_utils2.formatHolder)(accountLists);
|
|
77
77
|
}, [accountLists, isFormSubject]);
|
|
78
|
-
const hasGoodPassApp = !!((
|
|
78
|
+
const hasGoodPassApp = !!((_a = businessUtils == null ? void 0 : businessUtils.getAppByModal) == null ? void 0 : _a.call(businessUtils, "goodpass"));
|
|
79
79
|
const handleClickCard = (e, type, val) => {
|
|
80
80
|
console.log(e, type, val, "handleClickCard");
|
|
81
81
|
if (type === "note") {
|
|
@@ -149,6 +149,9 @@ var CartItem = ({ onNext }) => {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
|
+
const products = (0, import_react.useMemo)(() => {
|
|
153
|
+
return (0, import_utils2.formatCarts)(carts, resources, utils, accountLists);
|
|
154
|
+
}, [carts, resources, accountLists]);
|
|
152
155
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
153
156
|
"div",
|
|
154
157
|
{
|
|
@@ -158,12 +161,12 @@ var CartItem = ({ onNext }) => {
|
|
|
158
161
|
import_shoppingCart.default,
|
|
159
162
|
{
|
|
160
163
|
productParams: {
|
|
161
|
-
products
|
|
164
|
+
products,
|
|
162
165
|
hideAddBtn: false,
|
|
163
166
|
holders,
|
|
164
167
|
disabledEdit: isLastStep,
|
|
165
|
-
isShowChangeResource: ((
|
|
166
|
-
isShowDelete: ((
|
|
168
|
+
isShowChangeResource: ((_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key) === "select-resource",
|
|
169
|
+
isShowDelete: ((_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.key) === "select-service",
|
|
167
170
|
isShowPackageNote: false,
|
|
168
171
|
isShowChangeHolder: isLastStep ? false : isFormSubject && isLogin,
|
|
169
172
|
isShowHolder: isFormSubject,
|
|
@@ -104,6 +104,12 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
104
104
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
105
105
|
next: handleNext
|
|
106
106
|
}));
|
|
107
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext: handleNext }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "image" }, /* @__PURE__ */ import_react.default.createElement(
|
|
107
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext: handleNext }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "image" }, /* @__PURE__ */ import_react.default.createElement(
|
|
108
|
+
"img",
|
|
109
|
+
{
|
|
110
|
+
src: `${config == null ? void 0 : config.awsStatic}/checkout_confirm.png`,
|
|
111
|
+
loading: "lazy"
|
|
112
|
+
}
|
|
113
|
+
)), /* @__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"))));
|
|
108
114
|
});
|
|
109
115
|
var ConfirmInformation_default = ConfirmInformation;
|
|
@@ -62,7 +62,7 @@ var Layout = () => {
|
|
|
62
62
|
policyParams,
|
|
63
63
|
closePolicy
|
|
64
64
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
65
|
-
const {
|
|
65
|
+
const { isDateSelectedFirst, isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
66
66
|
const { isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
67
67
|
const { getHolders } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
68
68
|
const { removeStep, stepList } = (0, import_hooks.useAppointmentBookingStep)();
|
|
@@ -53,7 +53,7 @@ var Date = (0, import_react.forwardRef)((props, ref) => {
|
|
|
53
53
|
const [dateMonthList, setDateMonthList] = (0, import_react.useState)([]);
|
|
54
54
|
const [currentMonth, setCurrentMonth] = (0, import_react.useState)();
|
|
55
55
|
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
56
|
-
const { isDateSelectedFirst, customPageId,
|
|
56
|
+
const { isDateSelectedFirst, customPageId, channel } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
57
57
|
const { nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
58
58
|
const context = (0, import_useEngineContext.default)();
|
|
59
59
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title: 获取包括今天的后七天日期
|
|
3
|
+
* @description:
|
|
4
|
+
* @param {*}
|
|
5
|
+
* @return {*}
|
|
6
|
+
* @Author: 严文强
|
|
7
|
+
* @Date: 2024-02-01 11:00
|
|
8
|
+
*/
|
|
9
|
+
export declare const getNextSevenDaysList: (defaultDay: string) => string[];
|
|
10
|
+
/**
|
|
11
|
+
* @title: 将年月日信息只展示为天
|
|
12
|
+
* @description: 如果为今天 则返回ToDay
|
|
13
|
+
* @param {*}
|
|
14
|
+
* @return {*}
|
|
15
|
+
* @Author: 严文强
|
|
16
|
+
* @Date: 2024-02-01 11:00
|
|
17
|
+
*/
|
|
18
|
+
export declare const ShowDayOnly: (date: string) => string;
|
|
19
|
+
/**
|
|
20
|
+
* @title: 日历星期多语言
|
|
21
|
+
* @description:
|
|
22
|
+
* @param {*}
|
|
23
|
+
* @return {*}
|
|
24
|
+
* @Author: 严文强
|
|
25
|
+
* @Date: 2024-02-01 18:42
|
|
26
|
+
*/
|
|
27
|
+
export declare const weekListText: string[];
|
|
28
|
+
/**
|
|
29
|
+
* @title: 不同状态颜色值
|
|
30
|
+
* @description:
|
|
31
|
+
* @param {*}
|
|
32
|
+
* @return {*}
|
|
33
|
+
* @Author: xiangxiang.shao
|
|
34
|
+
* @Date: 2024-02-19 11:35
|
|
35
|
+
*/
|
|
36
|
+
export declare const statusColor: {
|
|
37
|
+
call_to_book: string;
|
|
38
|
+
lots_of_space: string;
|
|
39
|
+
filling_up_fast: string;
|
|
40
|
+
sold_out: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* @title: 根据预约量数据判断当前状态
|
|
44
|
+
* @description:
|
|
45
|
+
* @param {*}
|
|
46
|
+
* @return {*}
|
|
47
|
+
* @Author: xiangxiang.shao
|
|
48
|
+
* @Date: 2024-02-19 11:35
|
|
49
|
+
*/
|
|
50
|
+
export declare const getStatus: (dateLimit: any, currentDate: string, cutTime: any) => {
|
|
51
|
+
status: string;
|
|
52
|
+
disabled: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* @title: 根据当前日期以设定判断当前是否是call_to_book状态
|
|
56
|
+
* @description:
|
|
57
|
+
* @param {*}
|
|
58
|
+
* @return {*}
|
|
59
|
+
* @Author: xiangxiang.shao
|
|
60
|
+
* @Date: 2024-02-21 10:10
|
|
61
|
+
*/
|
|
62
|
+
export declare const getCallToBookStatus: (currentDate: string, dateLimitData: any, cutTime: any) => boolean;
|
|
63
|
+
export declare const localeTypes: any;
|
|
@@ -51,6 +51,7 @@ var Form = (0, import_react.forwardRef)((props, ref) => {
|
|
|
51
51
|
const { getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
|
|
52
52
|
const { setOtherData, getOtherData } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
53
53
|
const { nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
54
|
+
const utils = (0, import_hooks.contextUtils)();
|
|
54
55
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
55
56
|
next: () => {
|
|
56
57
|
var _a, _b;
|
|
@@ -64,11 +65,11 @@ var Form = (0, import_react.forwardRef)((props, ref) => {
|
|
|
64
65
|
const _resource = getResourceList();
|
|
65
66
|
return (_resource == null ? void 0 : _resource.resources) || [];
|
|
66
67
|
}, []);
|
|
67
|
-
const newCarts = (0, import_utils.formatCarts)(carts, resources);
|
|
68
68
|
const forms = (0, import_react.useMemo)(() => {
|
|
69
|
+
const newCarts = (0, import_utils.formatCarts)(carts, resources, utils);
|
|
69
70
|
if (!(newCarts == null ? void 0 : newCarts.length) || !(resources == null ? void 0 : resources.length)) return [];
|
|
70
71
|
return (0, import_utils.formatForms)(newCarts) || [];
|
|
71
|
-
}, [
|
|
72
|
+
}, [carts, resources]);
|
|
72
73
|
(0, import_react.useEffect)(() => {
|
|
73
74
|
var _a;
|
|
74
75
|
if (!(forms == null ? void 0 : forms.length)) return;
|
|
@@ -78,12 +78,19 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
78
78
|
},
|
|
79
79
|
callback: async (data) => {
|
|
80
80
|
var _a, _b;
|
|
81
|
+
if (data == null ? void 0 : data.isCancel) {
|
|
82
|
+
if (type === "session") {
|
|
83
|
+
appointmentBooking.closeProductDetail();
|
|
84
|
+
appointmentBooking.getAvailableDate();
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const session = data == null ? void 0 : data.session;
|
|
81
89
|
const product = {
|
|
82
90
|
...data,
|
|
83
91
|
options: (data == null ? void 0 : data.option) || []
|
|
84
92
|
};
|
|
85
93
|
delete product.option;
|
|
86
|
-
const session = data == null ? void 0 : data.session;
|
|
87
94
|
if (session) {
|
|
88
95
|
const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
|
|
89
96
|
const endDate = (0, import_dayjs.default)(session == null ? void 0 : session.end_at).format("YYYY-MM-DD");
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TasksManager } from '../../utils/tasks';
|
|
3
|
+
interface AppointmentBookingContextType {
|
|
4
|
+
appointmentBooking: any;
|
|
5
|
+
times: any[];
|
|
6
|
+
resources: any[];
|
|
7
|
+
setTimes: (times: any[]) => void;
|
|
8
|
+
setResources: (lists: any[]) => void;
|
|
9
|
+
carts: any[];
|
|
10
|
+
summary: any;
|
|
11
|
+
setCarts: (val: any[]) => void;
|
|
12
|
+
setSummary: (val: any) => void;
|
|
13
|
+
currentStep: any;
|
|
14
|
+
setCurrentStep: (val: any) => void;
|
|
15
|
+
appHelper?: any;
|
|
16
|
+
symbolic?: any;
|
|
17
|
+
resourceOtherParams?: any;
|
|
18
|
+
setResourceOtherParams: (val: any) => void;
|
|
19
|
+
selectedTime: any;
|
|
20
|
+
setSelectedTime: (val: any) => void;
|
|
21
|
+
isAgreeDepositPolicy: boolean;
|
|
22
|
+
setIsAgreeDepositPolicy: (val: boolean) => void;
|
|
23
|
+
isLastStep: boolean;
|
|
24
|
+
tasksManager: TasksManager;
|
|
25
|
+
policyParams: any;
|
|
26
|
+
setPolicyParams: (val: any) => void;
|
|
27
|
+
openPolicy: (content: any, callback?: any) => void;
|
|
28
|
+
closePolicy: (val?: boolean) => void;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
export declare const AppointmentBookingProvider: ({ children, }: {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}) => JSX.Element;
|
|
34
|
+
export declare const useAppointmentBookingContext: () => AppointmentBookingContextType | undefined;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export declare const useAppointmentBooking: () => any;
|
|
2
|
+
export declare const useShopDiscount: () => any;
|
|
3
|
+
export declare const contextUtils: () => any;
|
|
4
|
+
/**
|
|
5
|
+
* @title: 监听步骤发生变化
|
|
6
|
+
* @description:
|
|
7
|
+
* @return {*}
|
|
8
|
+
* @Author: WangHan
|
|
9
|
+
* @Date: 2025-04-15 11:11
|
|
10
|
+
*/
|
|
11
|
+
export declare const useAppointmentBookingStep: () => {
|
|
12
|
+
getStepIndex: (type: string, skipNumber?: number) => any;
|
|
13
|
+
stepList: any;
|
|
14
|
+
removeStep: (key: string) => any;
|
|
15
|
+
addStep: (props: any, stepKey?: string) => any;
|
|
16
|
+
updateStep: (key: string, step: any) => void;
|
|
17
|
+
nextStep: () => void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @title: 获取商品数据
|
|
21
|
+
* @description:
|
|
22
|
+
* @return {*}
|
|
23
|
+
* @Author: WangHan
|
|
24
|
+
* @Date: 2025-04-15 11:12
|
|
25
|
+
*/
|
|
26
|
+
export declare const useAppointmentBookingProduct: () => {
|
|
27
|
+
checkProductType: (productId: number) => Promise<any>;
|
|
28
|
+
getProducts: () => Promise<any>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @title: 更新购物车数据
|
|
32
|
+
* @description:
|
|
33
|
+
* @return {*}
|
|
34
|
+
* @Author: WangHan
|
|
35
|
+
* @Date: 2025-04-15 11:12
|
|
36
|
+
*/
|
|
37
|
+
export declare const useAppointmentBookingCart: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* @title: 获取登录状态
|
|
40
|
+
* @description:
|
|
41
|
+
* @return {*}
|
|
42
|
+
* @Author: WangHan
|
|
43
|
+
* @Date: 2025-04-15 11:14
|
|
44
|
+
*/
|
|
45
|
+
export declare const useAppointmentBookingLogin: () => {
|
|
46
|
+
isLogin: boolean;
|
|
47
|
+
openLoginModal: (params: {
|
|
48
|
+
callback: any;
|
|
49
|
+
}) => void;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @title: 获取账户
|
|
53
|
+
* @description:
|
|
54
|
+
* @return {*}
|
|
55
|
+
* @Author: WangHan
|
|
56
|
+
* @Date: 2025-04-15 11:15
|
|
57
|
+
*/
|
|
58
|
+
export declare const useAppointmentBookingAccount: () => {
|
|
59
|
+
accountLists: any;
|
|
60
|
+
getHolders: () => Promise<any>;
|
|
61
|
+
form_id: any;
|
|
62
|
+
addAccount: (val: any, type?: string) => Promise<any>;
|
|
63
|
+
checkAccount: (type: any) => any;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* @title: 获取资源数据
|
|
67
|
+
* @description:
|
|
68
|
+
* @return {*}
|
|
69
|
+
* @Author: WangHan
|
|
70
|
+
* @Date: 2025-04-15 11:29
|
|
71
|
+
*/
|
|
72
|
+
export declare const useAppointmentBookingResource: () => {
|
|
73
|
+
getResourceTimeSlot: (index?: number) => Promise<void>;
|
|
74
|
+
getResourceList: () => {
|
|
75
|
+
resources: any;
|
|
76
|
+
resourceCodes: any;
|
|
77
|
+
};
|
|
78
|
+
autoSelectAllProductResources: (index?: number) => Promise<any>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @title: 是否跳过资源选择步骤
|
|
82
|
+
* @description:
|
|
83
|
+
* @return {*}
|
|
84
|
+
* @Author: WangHan
|
|
85
|
+
* @Date: 2025-04-21 11:47
|
|
86
|
+
*/
|
|
87
|
+
export declare const useIsSkipResourceStep: () => {
|
|
88
|
+
checkSkipResourceStep: (isSkipUpdateFormStep?: boolean) => Promise<boolean>;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* @title: 获取预约配置
|
|
92
|
+
* @description:
|
|
93
|
+
* @return {*}
|
|
94
|
+
* @Author: WangHan
|
|
95
|
+
* @Date: 2025-04-24 18:15
|
|
96
|
+
*/
|
|
97
|
+
export declare const useAppointmentBookingSetting: () => {
|
|
98
|
+
isDateSelectedFirst: boolean;
|
|
99
|
+
isFormSubject: boolean;
|
|
100
|
+
customPageId: any;
|
|
101
|
+
channel: any;
|
|
102
|
+
bookingSubject: any;
|
|
103
|
+
setOtherData: (key: string, val: any) => any;
|
|
104
|
+
getOtherData: (key: string) => any;
|
|
105
|
+
formName: any;
|
|
106
|
+
};
|
|
@@ -221,7 +221,6 @@ var useAppointmentBookingAccount = () => {
|
|
|
221
221
|
const [accountLists, setAccountLists] = (0, import_react.useState)([]);
|
|
222
222
|
const { bookingSubject } = ((_a = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a.productModuleParams) || {};
|
|
223
223
|
const form_id = bookingSubject == null ? void 0 : bookingSubject.form_id;
|
|
224
|
-
const customer = (0, import_utils2.getCustomer)();
|
|
225
224
|
const getAccountLists = async () => {
|
|
226
225
|
const data = await appointmentBooking.getAccounts();
|
|
227
226
|
setAccountLists(data || []);
|
|
@@ -241,6 +240,7 @@ var useAppointmentBookingAccount = () => {
|
|
|
241
240
|
const getHolders = async () => {
|
|
242
241
|
var _a2, _b, _c;
|
|
243
242
|
const shop_id = (_c = (_b = (_a2 = utils.getStore().getState()) == null ? void 0 : _a2.global) == null ? void 0 : _b.shop) == null ? void 0 : _c.id;
|
|
243
|
+
const customer = (0, import_utils2.getCustomer)(utils);
|
|
244
244
|
if (!shop_id || !form_id || !(customer == null ? void 0 : customer.id)) return [];
|
|
245
245
|
const params = {
|
|
246
246
|
url: "/form/data/v1",
|
|
@@ -260,6 +260,7 @@ var useAppointmentBookingAccount = () => {
|
|
|
260
260
|
return newData || [];
|
|
261
261
|
};
|
|
262
262
|
const addAccount = async (val, type) => {
|
|
263
|
+
const customer = (0, import_utils2.getCustomer)(utils);
|
|
263
264
|
const result = await appointmentBooking.addAccount(val, { type, customerId: customer == null ? void 0 : customer.id });
|
|
264
265
|
return result;
|
|
265
266
|
};
|
|
@@ -348,10 +349,6 @@ var useAppointmentBookingSetting = () => {
|
|
|
348
349
|
const utils = contextUtils();
|
|
349
350
|
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
350
351
|
const { bookingProcess, bookingSubject, customPageId, channel } = ((_a = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a.productModuleParams) || {};
|
|
351
|
-
const getLoadAllSchedule = () => {
|
|
352
|
-
const res = appointmentBooking.loadAllSchedule();
|
|
353
|
-
console.log(res, "loadAllSchedule");
|
|
354
|
-
};
|
|
355
352
|
const setOtherData = (key, val) => {
|
|
356
353
|
return appointmentBooking.setOtherData(key, val);
|
|
357
354
|
};
|
|
@@ -368,7 +365,6 @@ var useAppointmentBookingSetting = () => {
|
|
|
368
365
|
isFormSubject: (bookingSubject == null ? void 0 : bookingSubject.type) === "form",
|
|
369
366
|
customPageId,
|
|
370
367
|
channel,
|
|
371
|
-
getLoadAllSchedule,
|
|
372
368
|
bookingSubject,
|
|
373
369
|
setOtherData,
|
|
374
370
|
getOtherData,
|
|
@@ -45,15 +45,15 @@ var AppointmentBooking = () => {
|
|
|
45
45
|
var _a, _b;
|
|
46
46
|
const context = (0, import_useEngineContext.default)();
|
|
47
47
|
import_utils.locales.init(import_locales.default, ((_b = (_a = context == null ? void 0 : context.engine) == null ? void 0 : _a.props) == null ? void 0 : _b.locale) || "en");
|
|
48
|
+
const utils = (0, import_hooks.contextUtils)();
|
|
48
49
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
49
|
-
appointmentBooking.loadAllSchedule();
|
|
50
|
-
const currentUser = (0, import_utils2.formatCurrentUser)();
|
|
51
50
|
(0, import_react.useEffect)(() => {
|
|
52
51
|
var _a2;
|
|
53
52
|
const { bookingSubject } = ((_a2 = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a2.productModuleParams) || {};
|
|
54
53
|
if ((bookingSubject == null ? void 0 : bookingSubject.type) === "form") return;
|
|
55
54
|
appointmentBooking.getAccounts().then((data) => {
|
|
56
55
|
if (!data.length) {
|
|
56
|
+
const currentUser = (0, import_utils2.formatCurrentUser)(utils);
|
|
57
57
|
appointmentBooking.addAccounts([currentUser]);
|
|
58
58
|
}
|
|
59
59
|
});
|