@pisell/private-materials 3.4.5 → 3.4.7
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/appointmentBooking/components/Cart/utils.js +8 -13
- package/es/components/appointmentBooking/components/Content/index.js +105 -19
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Services/index.js +7 -2
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -3
- package/es/components/appointmentBooking/components/Voucher/index.js +10 -10
- package/es/components/appointmentBooking/hooks.js +28 -30
- package/es/components/booking/addons/model.d.ts +1 -10
- 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/forms/model.d.ts +1 -10
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- 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/component/step/index.d.ts +0 -1
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/es/components/listComponent/index.js +5 -5
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pay/toC/model.d.ts +1 -9
- 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/productSelect/components/TabProduct/index.js +103 -39
- package/es/components/productSelect/components/TabProduct/tabs/index.less +1 -0
- package/es/components/productSelect/index.d.ts +2 -0
- 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.d.ts +1 -0
- 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/index.d.ts +1 -0
- 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/Cart/Product.d.ts +0 -1
- 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/model.d.ts +1 -9
- package/es/components/walletList/index.js +4 -4
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/es/hooks/useComponents.js +1 -1
- package/lib/components/appointmentBooking/components/Cart/utils.js +0 -10
- package/lib/components/appointmentBooking/components/Content/index.js +49 -7
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Services/index.js +6 -1
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +7 -3
- package/lib/components/appointmentBooking/components/Voucher/index.js +0 -11
- package/lib/components/appointmentBooking/hooks.js +5 -16
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- 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/component/step/index.d.ts +0 -1
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/productSelect/components/TabProduct/index.js +74 -37
- package/lib/components/productSelect/components/TabProduct/tabs/index.less +1 -0
- package/lib/components/productSelect/index.d.ts +2 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/utils.js +1 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -1
- 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/model.d.ts +1 -9
- package/lib/components/walletList/index.js +3 -3
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/package.json +3 -3
- package/es/components/appointmentBooking/components/Cart/utils.d.ts +0 -56
- package/es/components/booking/components/tabPane/index.d.ts +0 -4
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -7
- package/es/components/booking/info/index.d.ts +0 -4
- package/es/components/ticketBooking/locales.d.ts +0 -174
- package/es/components/ticketBooking/serve.d.ts +0 -287
- package/es/components/ticketBooking/utils/index.d.ts +0 -23
- package/lib/components/appointmentBooking/components/Cart/utils.d.ts +0 -56
- package/lib/components/booking/components/tabPane/index.d.ts +0 -4
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -7
- package/lib/components/booking/info/index.d.ts +0 -4
- package/lib/components/ticketBooking/locales.d.ts +0 -174
- package/lib/components/ticketBooking/serve.d.ts +0 -287
- package/lib/components/ticketBooking/utils/index.d.ts +0 -23
|
@@ -46,10 +46,14 @@ var import_Form = __toESM(require("../Form"));
|
|
|
46
46
|
var import_ConfirmInformation = __toESM(require("../ConfirmInformation"));
|
|
47
47
|
var import_context = require("../../context");
|
|
48
48
|
var import_PolicyModal = __toESM(require("../../deposit/components/PolicyModal"));
|
|
49
|
+
var import_utils2 = require("../Resource/utils");
|
|
49
50
|
var import_hooks = require("../../hooks");
|
|
50
51
|
var import_index = require("./index.less");
|
|
52
|
+
var import_useComponents = __toESM(require("../../../../hooks/useComponents"));
|
|
53
|
+
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
54
|
+
var import_utils3 = require("../../utils");
|
|
51
55
|
var Layout = () => {
|
|
52
|
-
var _a, _b, _c, _d, _e;
|
|
56
|
+
var _a, _b, _c, _d, _e, _f;
|
|
53
57
|
const stepRef = (0, import_react.useRef)();
|
|
54
58
|
const {
|
|
55
59
|
currentStep,
|
|
@@ -68,9 +72,37 @@ var Layout = () => {
|
|
|
68
72
|
const { getHolders } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
69
73
|
const { removeStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
70
74
|
const { shopDiscount } = (0, import_hooks.useShopDiscount)();
|
|
75
|
+
const { customPageData } = (_a = (0, import_useEngineContext.default)().engine) == null ? void 0 : _a.props;
|
|
76
|
+
const [CustomComponent] = (0, import_useComponents.default)({
|
|
77
|
+
components: ["CustomComponent"]
|
|
78
|
+
});
|
|
79
|
+
console.log("CustomComponent:", CustomComponent, typeof CustomComponent, CustomComponent == null ? void 0 : CustomComponent.$$typeof);
|
|
71
80
|
(0, import_hooks.useAppointmentBookingCart)();
|
|
72
81
|
(0, import_hooks.useAppointmentBookingStep)();
|
|
73
82
|
const [params, setParams] = (0, import_react.useState)({});
|
|
83
|
+
const utils = (0, import_hooks.contextUtils)();
|
|
84
|
+
const context = (0, import_useEngineContext.default)();
|
|
85
|
+
const { pubsub } = context.appHelper.utils;
|
|
86
|
+
(0, import_react.useEffect)(() => {
|
|
87
|
+
const handleLoginSuccess = async () => {
|
|
88
|
+
var _a2;
|
|
89
|
+
if (!isFormSubject) {
|
|
90
|
+
const user = JSON.parse(((_a2 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a2.get("customer")) || "{}");
|
|
91
|
+
const currentUser = (0, import_utils3.formatCustomer)(user);
|
|
92
|
+
const accountLists = await appointmentBooking.getAccounts();
|
|
93
|
+
const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
|
|
94
|
+
appointmentBooking.setLoginAccount(meAccount == null ? void 0 : meAccount.id, currentUser);
|
|
95
|
+
} else {
|
|
96
|
+
if (!isRetailTemplate) {
|
|
97
|
+
getHolders();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
pubsub.subscribe("pisell1.login.success", handleLoginSuccess);
|
|
102
|
+
return () => {
|
|
103
|
+
pubsub.unsubscribe("pisell1.login.success");
|
|
104
|
+
};
|
|
105
|
+
}, []);
|
|
74
106
|
(0, import_react.useEffect)(() => {
|
|
75
107
|
appointmentBooking.removeStep("fill-form");
|
|
76
108
|
return () => {
|
|
@@ -115,6 +147,7 @@ var Layout = () => {
|
|
|
115
147
|
}
|
|
116
148
|
}, [isFormSubject, isLogin, isRetailTemplate]);
|
|
117
149
|
(0, import_react.useEffect)(() => {
|
|
150
|
+
var _a2;
|
|
118
151
|
if (!(currentStep == null ? void 0 : currentStep.step)) return;
|
|
119
152
|
setLoading(false);
|
|
120
153
|
setResourceOtherParams({
|
|
@@ -126,7 +159,10 @@ var Layout = () => {
|
|
|
126
159
|
top: 0,
|
|
127
160
|
behavior: "smooth"
|
|
128
161
|
});
|
|
129
|
-
|
|
162
|
+
if (((_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key) === "confirm-information") {
|
|
163
|
+
(0, import_utils2.scrollToFirstErrorCard)(".pisell-lowcode-product-card-error");
|
|
164
|
+
}
|
|
165
|
+
}, [(_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key]);
|
|
130
166
|
const components = {
|
|
131
167
|
// 选择服务
|
|
132
168
|
"select-service": import_Services.default,
|
|
@@ -151,8 +187,14 @@ var Layout = () => {
|
|
|
151
187
|
} else {
|
|
152
188
|
Com2 = components[key];
|
|
153
189
|
}
|
|
154
|
-
|
|
155
|
-
|
|
190
|
+
if (key === "select-service") {
|
|
191
|
+
return /* @__PURE__ */ import_react.default.createElement(CustomComponent, { block: customPageData == null ? void 0 : customPageData.block, customComponents: {
|
|
192
|
+
product_list: /* @__PURE__ */ import_react.default.createElement(Com2, { onChange: setParams, params, ref: stepRef })
|
|
193
|
+
} });
|
|
194
|
+
} else {
|
|
195
|
+
return /* @__PURE__ */ import_react.default.createElement(Com2, { onChange: setParams, params, ref: stepRef });
|
|
196
|
+
}
|
|
197
|
+
}, [(_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.key]);
|
|
156
198
|
(0, import_react.useEffect)(() => {
|
|
157
199
|
var _a2, _b2;
|
|
158
200
|
if ((0, import_utils.isMobile)()) {
|
|
@@ -170,7 +212,7 @@ var Layout = () => {
|
|
|
170
212
|
content.style.overflowY = "auto";
|
|
171
213
|
}
|
|
172
214
|
}
|
|
173
|
-
}, [(
|
|
215
|
+
}, [(_d = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _d.key]);
|
|
174
216
|
const isShowCartCom = (0, import_react.useMemo)(() => {
|
|
175
217
|
var _a2;
|
|
176
218
|
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
@@ -182,14 +224,14 @@ var Layout = () => {
|
|
|
182
224
|
var _a3, _b2;
|
|
183
225
|
return (_b2 = (_a3 = stepRef == null ? void 0 : stepRef.current) == null ? void 0 : _a3.next) == null ? void 0 : _b2.call(_a3);
|
|
184
226
|
} }));
|
|
185
|
-
}, [isDateSelectedFirst, (
|
|
227
|
+
}, [isDateSelectedFirst, (_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.key]);
|
|
186
228
|
const isFooter = (0, import_react.useMemo)(() => {
|
|
187
229
|
var _a2;
|
|
188
230
|
if (!(0, import_utils.isMobile)()) return false;
|
|
189
231
|
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
190
232
|
if (isDateSelectedFirst && key === "select-date") return false;
|
|
191
233
|
return key !== "confirm-information";
|
|
192
|
-
}, [isDateSelectedFirst, (
|
|
234
|
+
}, [isDateSelectedFirst, (_f = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _f.key]);
|
|
193
235
|
const depositProtocolRequest = (id) => {
|
|
194
236
|
var _a2;
|
|
195
237
|
return (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.getProtocol) == null ? void 0 : _a2.call(appointmentBooking, id);
|
|
@@ -171,12 +171,17 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
171
171
|
}
|
|
172
172
|
return (productListBlock == null ? void 0 : productListBlock.setting) || {};
|
|
173
173
|
}, [context]);
|
|
174
|
+
const _isMobile = (0, import_react.useMemo)(() => {
|
|
175
|
+
if (typeof import_utils.isMobile === "function") return (0, import_utils.isMobile)();
|
|
176
|
+
return import_utils.isMobile;
|
|
177
|
+
}, import_utils.isMobile);
|
|
174
178
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-service-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
175
179
|
import_productSelect.default,
|
|
176
180
|
{
|
|
177
181
|
dataSource: products,
|
|
178
182
|
onChange: handleSelectProduct,
|
|
179
|
-
scrollDom:
|
|
183
|
+
scrollDom: _isMobile ? ".parallel-content-wrap" : ".parallel-booking-wrap",
|
|
184
|
+
offsetDom: _isMobile ? "" : ".pisell-section-headers",
|
|
180
185
|
loading: productLoading,
|
|
181
186
|
emptyDescription: import_utils.locales.getText(
|
|
182
187
|
"pisell2.appointment.booking.empty.service"
|
|
@@ -36,8 +36,9 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_materials = require("@pisell/materials");
|
|
37
37
|
var import_utils = require("@pisell/utils");
|
|
38
38
|
var import_context = require("../../context");
|
|
39
|
+
var import_utils2 = require("../Resource/utils");
|
|
39
40
|
var import_hooks = require("../../hooks");
|
|
40
|
-
var
|
|
41
|
+
var import_utils3 = require("../../utils");
|
|
41
42
|
var import_index = require("./index.less");
|
|
42
43
|
var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
43
44
|
const [selectedResource, setSelectedResource] = (0, import_react.useState)("");
|
|
@@ -54,7 +55,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
|
54
55
|
next: () => {
|
|
55
56
|
const isUnSelectedTimes = appointmentBooking.checkCartItems("date");
|
|
56
57
|
if ((isUnSelectedTimes == null ? void 0 : isUnSelectedTimes.length) > 0) {
|
|
57
|
-
(0,
|
|
58
|
+
(0, import_utils3.Toast)(import_utils.locales.getText("pisell2.appointment.unselect.time"));
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
nextStep();
|
|
@@ -65,11 +66,14 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
|
65
66
|
}, []);
|
|
66
67
|
const getAutoSelect = async (val) => {
|
|
67
68
|
setSelectedTime(val);
|
|
69
|
+
(0, import_utils2.scrollToFirstErrorCard)(".pisell-lowcode-product-card-error");
|
|
68
70
|
const result = await appointmentBooking.submitTimeSlot(val);
|
|
69
71
|
};
|
|
70
72
|
(0, import_react.useEffect)(() => {
|
|
71
73
|
var _a, _b, _c;
|
|
72
|
-
let appoimentBookingProductCart = carts.filter(
|
|
74
|
+
let appoimentBookingProductCart = carts.filter(
|
|
75
|
+
(item) => !appointmentBooking.isTargetCartIdNormalProduct(item == null ? void 0 : item._id)
|
|
76
|
+
);
|
|
73
77
|
if ((times == null ? void 0 : times.length) > 0 && (appoimentBookingProductCart == null ? void 0 : appoimentBookingProductCart.length) > 0) {
|
|
74
78
|
const startTime = ((_a = appoimentBookingProductCart == null ? void 0 : appoimentBookingProductCart[0]) == null ? void 0 : _a.start_time) || ((_b = times == null ? void 0 : times[0]) == null ? void 0 : _b.start_time);
|
|
75
79
|
setSelectedResource(startTime);
|
|
@@ -41,7 +41,6 @@ var import_utils = require("@pisell/utils");
|
|
|
41
41
|
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
42
42
|
var import_materials = require("@pisell/materials");
|
|
43
43
|
var import_hooks = require("../../hooks");
|
|
44
|
-
var import_utils2 = require("../../utils");
|
|
45
44
|
var import_voucher = require("../../../booking/components/voucher/index.less");
|
|
46
45
|
var import_index = require("./index.less");
|
|
47
46
|
var ShopDiscountHooks = {
|
|
@@ -154,16 +153,6 @@ var VoucherCard = (props) => {
|
|
|
154
153
|
if (!action) return;
|
|
155
154
|
openLoginModal({
|
|
156
155
|
callback: (status) => {
|
|
157
|
-
var _a2, _b2, _c;
|
|
158
|
-
const user = (_c = (_b2 = (_a2 = utils.store) == null ? void 0 : _a2.getState()) == null ? void 0 : _b2.global) == null ? void 0 : _c.userInfo;
|
|
159
|
-
const currentUser2 = (0, import_utils2.formatCustomer)(user);
|
|
160
|
-
const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
|
|
161
|
-
if (status === "success") {
|
|
162
|
-
appointmentBooking.setLoginAccount(
|
|
163
|
-
meAccount == null ? void 0 : meAccount.id,
|
|
164
|
-
currentUser2
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
156
|
}
|
|
168
157
|
});
|
|
169
158
|
}
|
|
@@ -265,23 +265,12 @@ var useAppointmentBookingStep = () => {
|
|
|
265
265
|
};
|
|
266
266
|
const checkLogin = async () => {
|
|
267
267
|
if (!isLogin) {
|
|
268
|
-
const
|
|
268
|
+
const { pubsub } = utils;
|
|
269
|
+
pubsub.once("pisell1.login.success", () => {
|
|
270
|
+
checkHolder();
|
|
271
|
+
});
|
|
269
272
|
return openLoginModal({
|
|
270
273
|
callback: (status) => {
|
|
271
|
-
var _a3;
|
|
272
|
-
if (status === "success") {
|
|
273
|
-
if (!isFormSubject) {
|
|
274
|
-
const user = JSON.parse(((_a3 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a3.get("customer")) || "{}");
|
|
275
|
-
const currentUser = (0, import_utils2.formatCustomer)(user);
|
|
276
|
-
const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
|
|
277
|
-
appointmentBooking.setLoginAccount(meAccount == null ? void 0 : meAccount.id, currentUser);
|
|
278
|
-
} else {
|
|
279
|
-
if (!isRetailTemplate) {
|
|
280
|
-
getHolders();
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
checkHolder();
|
|
284
|
-
}
|
|
285
274
|
}
|
|
286
275
|
});
|
|
287
276
|
} else {
|
|
@@ -390,7 +379,7 @@ var useAppointmentBookingLogin = () => {
|
|
|
390
379
|
utils.action({
|
|
391
380
|
type: "pisell1.login",
|
|
392
381
|
data: {
|
|
393
|
-
type:
|
|
382
|
+
// type: 'plugin'
|
|
394
383
|
},
|
|
395
384
|
callback
|
|
396
385
|
});
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormState } from '../model';
|
|
3
1
|
export declare const walkInData: {
|
|
4
2
|
id: number;
|
|
5
3
|
nickname: string;
|
|
6
4
|
};
|
|
7
|
-
export declare const Provider:
|
|
8
|
-
state: FormState;
|
|
9
|
-
} & {
|
|
10
|
-
dispatch: (params: {
|
|
11
|
-
type: string;
|
|
12
|
-
payload: any;
|
|
13
|
-
}) => void;
|
|
14
|
-
}>;
|
|
5
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
amountSymbol: string;
|
|
4
3
|
apis: {
|
|
@@ -105,11 +104,4 @@ export declare const walkInData: {
|
|
|
105
104
|
id: number;
|
|
106
105
|
nickname: string;
|
|
107
106
|
};
|
|
108
|
-
export declare const Provider:
|
|
109
|
-
state: FormState;
|
|
110
|
-
} & {
|
|
111
|
-
dispatch: (params: {
|
|
112
|
-
type: string;
|
|
113
|
-
payload: any;
|
|
114
|
-
}) => void;
|
|
115
|
-
}>;
|
|
107
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
4
3
|
order: any;
|
|
@@ -29,11 +28,4 @@ export interface PayGroup {
|
|
|
29
28
|
pay_number?: string;
|
|
30
29
|
_order: any;
|
|
31
30
|
}
|
|
32
|
-
export declare const Provider:
|
|
33
|
-
state: FormState;
|
|
34
|
-
} & {
|
|
35
|
-
dispatch: (params: {
|
|
36
|
-
type: string;
|
|
37
|
-
payload: any;
|
|
38
|
-
}) => void;
|
|
39
|
-
}>;
|
|
31
|
+
export declare const Provider: any, Context: any;
|
|
@@ -39,7 +39,15 @@ var import_ahooks = require("ahooks");
|
|
|
39
39
|
var import_utils = require("@pisell/utils");
|
|
40
40
|
var import_tabs = __toESM(require("./tabs"));
|
|
41
41
|
var import_productGroup = __toESM(require("../productGroup"));
|
|
42
|
-
var
|
|
42
|
+
var getOffsetTopRelativeToScrollContainer = (targetElement, scrollContainer) => {
|
|
43
|
+
if (!targetElement || !scrollContainer) return 0;
|
|
44
|
+
if (targetElement === scrollContainer) {
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
const targetRect = targetElement.getBoundingClientRect();
|
|
48
|
+
const containerRect = scrollContainer.getBoundingClientRect();
|
|
49
|
+
return targetRect.top - containerRect.top + scrollContainer.scrollTop;
|
|
50
|
+
};
|
|
43
51
|
var TabProduct = (props) => {
|
|
44
52
|
const {
|
|
45
53
|
showTab = true,
|
|
@@ -48,6 +56,7 @@ var TabProduct = (props) => {
|
|
|
48
56
|
onChange,
|
|
49
57
|
amountSymbol = "$",
|
|
50
58
|
scrollDom,
|
|
59
|
+
offsetDom,
|
|
51
60
|
value: currentProductId,
|
|
52
61
|
loading,
|
|
53
62
|
emptyDescription,
|
|
@@ -55,6 +64,8 @@ var TabProduct = (props) => {
|
|
|
55
64
|
} = props;
|
|
56
65
|
const tabsRef = (0, import_react.useRef)();
|
|
57
66
|
const [currentGroupId, setCurrentGroupId] = (0, import_react.useState)(1);
|
|
67
|
+
const tabLocatingRef = (0, import_react.useRef)(false);
|
|
68
|
+
const ioRef = (0, import_react.useRef)(null);
|
|
58
69
|
(0, import_react.useEffect)(() => {
|
|
59
70
|
if (list == null ? void 0 : list.length) {
|
|
60
71
|
setCurrentGroupId(list[0].id);
|
|
@@ -62,6 +73,9 @@ var TabProduct = (props) => {
|
|
|
62
73
|
handleObserver();
|
|
63
74
|
});
|
|
64
75
|
}
|
|
76
|
+
return () => {
|
|
77
|
+
handleUnobserver();
|
|
78
|
+
};
|
|
65
79
|
}, [list]);
|
|
66
80
|
const debouncedScroll = (0, import_ahooks.useDebounceFn)(
|
|
67
81
|
(id) => {
|
|
@@ -75,18 +89,23 @@ var TabProduct = (props) => {
|
|
|
75
89
|
const _marginTop = 270;
|
|
76
90
|
const _marginBottom = window.innerHeight - 70 - 200 - 70;
|
|
77
91
|
const _rootMargin = `${_marginTop * -1}px 0px ${_marginBottom * -1}px 0px`;
|
|
78
|
-
|
|
92
|
+
ioRef.current = new IntersectionObserver(
|
|
79
93
|
(entries) => {
|
|
80
|
-
var _a
|
|
94
|
+
var _a;
|
|
81
95
|
const enteringEntries = entries.filter((entry) => entry.isIntersecting);
|
|
82
96
|
if (enteringEntries.length > 0) {
|
|
83
97
|
const topMostEntry = enteringEntries.reduce((top, current) => {
|
|
84
98
|
return current.boundingClientRect.top < top.boundingClientRect.top ? current : top;
|
|
85
99
|
});
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
100
|
+
const targetId = (_a = topMostEntry == null ? void 0 : topMostEntry.target) == null ? void 0 : _a.id;
|
|
101
|
+
if (targetId) {
|
|
102
|
+
const [name, id] = targetId.split("-");
|
|
103
|
+
const newGroupId = Number(id);
|
|
104
|
+
if (!tabLocatingRef.current && !isNaN(newGroupId)) {
|
|
105
|
+
setCurrentGroupId(newGroupId);
|
|
106
|
+
debouncedScroll.run(id);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
90
109
|
}
|
|
91
110
|
},
|
|
92
111
|
{
|
|
@@ -94,24 +113,28 @@ var TabProduct = (props) => {
|
|
|
94
113
|
rootMargin: _rootMargin
|
|
95
114
|
}
|
|
96
115
|
);
|
|
97
|
-
if (list == null ? void 0 : list.length) {
|
|
116
|
+
if ((list == null ? void 0 : list.length) && ioRef.current) {
|
|
98
117
|
for (const item of list) {
|
|
99
118
|
const _item = document.querySelector(`#list-${item.id}`);
|
|
100
119
|
if (_item) {
|
|
101
|
-
|
|
120
|
+
ioRef.current.observe(_item);
|
|
102
121
|
}
|
|
103
122
|
}
|
|
104
123
|
}
|
|
105
124
|
});
|
|
106
125
|
const handleUnobserver = (0, import_ahooks.useMemoizedFn)(() => {
|
|
107
|
-
if ((list == null ? void 0 : list.length) &&
|
|
126
|
+
if ((list == null ? void 0 : list.length) && ioRef.current) {
|
|
108
127
|
for (const item of list) {
|
|
109
128
|
const _item = document.querySelector(`#list-${item.id}`);
|
|
110
129
|
if (_item) {
|
|
111
|
-
|
|
130
|
+
ioRef.current.unobserve(_item);
|
|
112
131
|
}
|
|
113
132
|
}
|
|
114
133
|
}
|
|
134
|
+
if (ioRef.current) {
|
|
135
|
+
ioRef.current.disconnect();
|
|
136
|
+
ioRef.current = null;
|
|
137
|
+
}
|
|
115
138
|
});
|
|
116
139
|
const renderContent = () => {
|
|
117
140
|
if (loading) {
|
|
@@ -126,7 +149,7 @@ var TabProduct = (props) => {
|
|
|
126
149
|
);
|
|
127
150
|
}
|
|
128
151
|
return list.map((item, i) => {
|
|
129
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { id: `list-${item.id}`, key:
|
|
152
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { id: `list-${item.id}`, key: `list-${item.id}` }, /* @__PURE__ */ import_react.default.createElement(
|
|
130
153
|
import_productGroup.default,
|
|
131
154
|
{
|
|
132
155
|
onSelectProduct: onChange,
|
|
@@ -148,7 +171,7 @@ var TabProduct = (props) => {
|
|
|
148
171
|
}
|
|
149
172
|
), /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-pisell-tabs-content" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton.Button, { active: true, size: "large", shape: "round" })));
|
|
150
173
|
}, []);
|
|
151
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, showTab ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-product-select-tabs-wrapper" }, loading ? tabSkeleton : /* @__PURE__ */ import_react.default.createElement(
|
|
174
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, showTab && list && list.length > 1 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-product-select-tabs-wrapper" }, loading ? tabSkeleton : /* @__PURE__ */ import_react.default.createElement(
|
|
152
175
|
import_tabs.default,
|
|
153
176
|
{
|
|
154
177
|
ref: tabsRef,
|
|
@@ -157,33 +180,47 @@ var TabProduct = (props) => {
|
|
|
157
180
|
tab: currentGroupId,
|
|
158
181
|
onChange: (e) => {
|
|
159
182
|
var _a;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
183
|
+
try {
|
|
184
|
+
const productSelectWrapper = document.querySelector(
|
|
185
|
+
".pisell-product-select-wrapper"
|
|
186
|
+
);
|
|
187
|
+
const tabsWrapper = document.querySelector(
|
|
188
|
+
".pisell-product-select-tabs-wrapper"
|
|
189
|
+
);
|
|
190
|
+
let tabsHeight = 0;
|
|
191
|
+
if (tabsWrapper) {
|
|
192
|
+
tabsHeight = tabsWrapper.offsetHeight;
|
|
193
|
+
}
|
|
194
|
+
const targetListElement = document == null ? void 0 : document.querySelector("#list-" + e);
|
|
195
|
+
const scrollContainer = scrollDom ? document == null ? void 0 : document.querySelector(scrollDom) : null;
|
|
196
|
+
const offsetElement = offsetDom ? document == null ? void 0 : document.querySelector(offsetDom) : null;
|
|
197
|
+
const extraOffset = offsetElement ? offsetElement.clientHeight : 0;
|
|
198
|
+
handleUnobserver();
|
|
199
|
+
tabLocatingRef.current = true;
|
|
200
|
+
if (targetListElement && scrollContainer) {
|
|
201
|
+
if (e === ((_a = list[0]) == null ? void 0 : _a.id)) {
|
|
202
|
+
if (productSelectWrapper) {
|
|
203
|
+
const wrapperOffsetTop = getOffsetTopRelativeToScrollContainer(productSelectWrapper, scrollContainer);
|
|
204
|
+
scrollContainer.scrollTop = wrapperOffsetTop - extraOffset;
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
const listOffsetTop = getOffsetTopRelativeToScrollContainer(targetListElement, scrollContainer);
|
|
208
|
+
scrollContainer.scrollTop = listOffsetTop - tabsHeight - extraOffset;
|
|
209
|
+
}
|
|
178
210
|
}
|
|
211
|
+
setCurrentGroupId(e);
|
|
212
|
+
debouncedScroll.run(e);
|
|
213
|
+
setTimeout(() => {
|
|
214
|
+
tabLocatingRef.current = false;
|
|
215
|
+
handleObserver();
|
|
216
|
+
}, 500);
|
|
217
|
+
} catch (error) {
|
|
218
|
+
console.error("Tab onChange error:", error);
|
|
219
|
+
tabLocatingRef.current = false;
|
|
220
|
+
setCurrentGroupId(e);
|
|
179
221
|
}
|
|
180
|
-
handleUnobserver();
|
|
181
|
-
setCurrentGroupId(e);
|
|
182
|
-
setTimeout(() => {
|
|
183
|
-
handleObserver();
|
|
184
|
-
}, 1e3);
|
|
185
222
|
}
|
|
186
223
|
}
|
|
187
|
-
)) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-product-select-product-list" }, renderContent()));
|
|
224
|
+
)) : /* @__PURE__ */ import_react.default.createElement("p", null, /* @__PURE__ */ import_react.default.createElement("br", null)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-product-select-product-list" }, renderContent()));
|
|
188
225
|
};
|
|
189
226
|
var TabProduct_default = TabProduct;
|