@pisell/private-materials 3.3.45 → 3.3.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.js +3 -3
- 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 +3 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.js +7 -1
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.js +2 -2
- package/es/components/appointmentBooking/components/Resource/index.js +30 -12
- package/es/components/appointmentBooking/components/Services/index.js +5 -2
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -4
- package/es/components/appointmentBooking/components/Voucher/index.js +1 -0
- package/es/components/appointmentBooking/context.js +7 -3
- package/es/components/appointmentBooking/hooks.js +129 -68
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/appointmentBooking/utils.js +6 -1
- package/es/components/booking/addons/index.js +31 -26
- package/es/components/booking/components/footer/amount.js +2 -2
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/utils.d.ts +9 -0
- package/es/components/booking/components/footer/utils.js +32 -10
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.js +2 -2
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +4 -1
- package/es/components/booking/info/service2/utils.js +21 -2
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/addService/index.js +9 -6
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +56 -18
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/utils.d.ts +3 -2
- package/es/components/booking/utils.js +5 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- 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/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- 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/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/ruleSetting/index.d.ts +1 -0
- 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/shoppingCart/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +75 -26
- package/es/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
- package/es/components/ticketBooking/components/notAvailable/index.js +39 -0
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.js +1 -1
- package/es/components/ticketBooking/locales.d.ts +6 -0
- package/es/components/ticketBooking/locales.js +9 -3
- package/es/components/ticketBooking/serve.js +98 -92
- package/es/components/ticketBooking/utils/index.d.ts +1 -0
- package/es/components/ticketBooking/utils/index.js +33 -0
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- 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 +3 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.js +3 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.js +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +15 -9
- package/lib/components/appointmentBooking/components/Services/index.js +3 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +4 -3
- package/lib/components/appointmentBooking/components/Voucher/index.js +1 -0
- package/lib/components/appointmentBooking/context.js +7 -3
- package/lib/components/appointmentBooking/hooks.js +73 -12
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/appointmentBooking/utils.js +2 -0
- package/lib/components/booking/addons/index.js +27 -21
- package/lib/components/booking/components/footer/amount.js +1 -1
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.d.ts +9 -0
- package/lib/components/booking/components/footer/utils.js +24 -7
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.js +1 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +4 -1
- package/lib/components/booking/info/service2/utils.js +21 -2
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/addService/index.js +8 -5
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +59 -23
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/utils.d.ts +3 -2
- package/lib/components/booking/utils.js +6 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- 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/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/ruleSetting/index.d.ts +1 -0
- 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/shoppingCart/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +74 -20
- package/lib/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
- package/lib/components/ticketBooking/components/notAvailable/index.js +61 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.js +1 -1
- package/lib/components/ticketBooking/locales.d.ts +6 -0
- package/lib/components/ticketBooking/locales.js +9 -3
- package/lib/components/ticketBooking/serve.js +6 -2
- package/lib/components/ticketBooking/utils/index.d.ts +1 -0
- package/lib/components/ticketBooking/utils/index.js +33 -0
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/package.json +4 -4
|
@@ -46,11 +46,15 @@ var import_serve = require("../../../booking/info/service/serve");
|
|
|
46
46
|
var import_serviceManager = require("../../../booking/info/service/serviceManager");
|
|
47
47
|
var import_productSelect = __toESM(require("../../../productSelect"));
|
|
48
48
|
var import_index = require("./index.less");
|
|
49
|
+
var import_utils6 = require("../../utils");
|
|
50
|
+
var import_notAvailable = __toESM(require("../notAvailable"));
|
|
49
51
|
var AddSerivce = (props) => {
|
|
50
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
51
53
|
const { onEdit, state, dispatch, renderMode = "current" } = props;
|
|
52
54
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
53
55
|
const context = (0, import_useEngineContext.default)();
|
|
56
|
+
const notAvailableRef = (0, import_react.useRef)(null);
|
|
57
|
+
const isLoadedServiceRef = (0, import_react.useRef)(false);
|
|
54
58
|
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
55
59
|
const { createBookingData, createBooking } = (0, import_serviceManager.useService)({
|
|
56
60
|
renderMode,
|
|
@@ -63,10 +67,14 @@ var AddSerivce = (props) => {
|
|
|
63
67
|
state == null ? void 0 : state.renderType
|
|
64
68
|
);
|
|
65
69
|
const [currentProduct, setCurrentProduct] = (0, import_react.useState)(null);
|
|
70
|
+
const menuList = (0, import_react.useMemo)(() => {
|
|
71
|
+
var _a2, _b2, _c2;
|
|
72
|
+
return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.menu_list_tab) == null ? void 0 : _c2.menu_list) || [];
|
|
73
|
+
}, [(_f = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _f.config]);
|
|
66
74
|
const customerId = (0, import_react.useMemo)(() => {
|
|
67
75
|
var _a2, _b2;
|
|
68
76
|
return ((_b2 = (_a2 = state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.id) || void 0;
|
|
69
|
-
}, [(
|
|
77
|
+
}, [(_h = (_g = state.client) == null ? void 0 : _g.value) == null ? void 0 : _h.id]);
|
|
70
78
|
const setDefaultService = async (list) => {
|
|
71
79
|
if (state.renderType !== "eventBooking") {
|
|
72
80
|
return;
|
|
@@ -115,8 +123,24 @@ var AddSerivce = (props) => {
|
|
|
115
123
|
}
|
|
116
124
|
});
|
|
117
125
|
};
|
|
126
|
+
const removeNotAvailableService = (list) => {
|
|
127
|
+
var _a2, _b2, _c2;
|
|
128
|
+
if (!((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length)) return;
|
|
129
|
+
const listMap = list.reduce((acc, cur) => {
|
|
130
|
+
acc[cur.id] = cur;
|
|
131
|
+
return acc;
|
|
132
|
+
}, {});
|
|
133
|
+
const newValue = (((_c2 = state.service) == null ? void 0 : _c2.value) || []).filter((item) => listMap[item.product_id]);
|
|
134
|
+
dispatch({
|
|
135
|
+
type: "setService",
|
|
136
|
+
payload: {
|
|
137
|
+
value: newValue,
|
|
138
|
+
edit: true
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
};
|
|
118
142
|
const getServices = async (params) => {
|
|
119
|
-
var _a2, _b2;
|
|
143
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
120
144
|
setLoading(true);
|
|
121
145
|
if (state.renderType === "eventBooking" && !((_b2 = (_a2 = state.eventOtherParams) == null ? void 0 : _a2.productIds) == null ? void 0 : _b2.length)) {
|
|
122
146
|
dispatch({
|
|
@@ -131,7 +155,15 @@ var AddSerivce = (props) => {
|
|
|
131
155
|
let data = await state.apis.getServices({
|
|
132
156
|
skip: 1,
|
|
133
157
|
num: 500,
|
|
134
|
-
extension_type: state.productExtensionType,
|
|
158
|
+
// extension_type: state.productExtensionType,
|
|
159
|
+
exclude_extension_type: [
|
|
160
|
+
"product_party",
|
|
161
|
+
"product_event",
|
|
162
|
+
"product_series_event",
|
|
163
|
+
"product_package_ticket",
|
|
164
|
+
"ticket",
|
|
165
|
+
"event_item"
|
|
166
|
+
],
|
|
135
167
|
with: ["category"],
|
|
136
168
|
open_quotation: 1,
|
|
137
169
|
with_schedule: 1,
|
|
@@ -139,23 +171,36 @@ var AddSerivce = (props) => {
|
|
|
139
171
|
order_by_string: "sort:desc",
|
|
140
172
|
status: "published",
|
|
141
173
|
schedule_date: params == null ? void 0 : params.schedule_date,
|
|
142
|
-
|
|
174
|
+
schedule_datetime: params == null ? void 0 : params.schedule_datetime,
|
|
175
|
+
customer_id: params == null ? void 0 : params.customer_id,
|
|
176
|
+
menu_list_ids: params == null ? void 0 : params.menu_list_ids,
|
|
177
|
+
_config: {
|
|
178
|
+
fullResult: true,
|
|
179
|
+
customResponse: true
|
|
180
|
+
}
|
|
143
181
|
});
|
|
144
182
|
setLoading(false);
|
|
183
|
+
if ((data == null ? void 0 : data.code) === 607100) {
|
|
184
|
+
if (!isLoadedServiceRef.current || ((_d2 = (_c2 = state.service) == null ? void 0 : _c2.services) == null ? void 0 : _d2.length)) {
|
|
185
|
+
(_e2 = notAvailableRef.current) == null ? void 0 : _e2.open();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
145
188
|
if (!state.service.addModal) {
|
|
146
|
-
setDefaultService(data == null ? void 0 : data.list);
|
|
189
|
+
setDefaultService((_f2 = data == null ? void 0 : data.data) == null ? void 0 : _f2.list);
|
|
147
190
|
}
|
|
191
|
+
removeNotAvailableService((_g2 = data == null ? void 0 : data.data) == null ? void 0 : _g2.list);
|
|
192
|
+
isLoadedServiceRef.current = true;
|
|
148
193
|
dispatch({
|
|
149
194
|
type: "setService",
|
|
150
195
|
payload: {
|
|
151
|
-
services: (data == null ? void 0 : data.list) || []
|
|
196
|
+
services: ((_h2 = data == null ? void 0 : data.data) == null ? void 0 : _h2.list) || []
|
|
152
197
|
}
|
|
153
198
|
});
|
|
154
199
|
};
|
|
155
200
|
const handleSelectProduct = (0, import_ahooks.useMemoizedFn)(
|
|
156
201
|
(item, type = "select") => {
|
|
157
202
|
const isSession = (0, import_utils2.isSessionProduct)(item);
|
|
158
|
-
const isEject =
|
|
203
|
+
const isEject = (0, import_utils2.getIsEject)(item, type);
|
|
159
204
|
let lock = false;
|
|
160
205
|
if (isEject) {
|
|
161
206
|
setCurrentProduct(item);
|
|
@@ -168,10 +213,11 @@ var AddSerivce = (props) => {
|
|
|
168
213
|
id: item.id,
|
|
169
214
|
date: state.date.value.format("YYYY-MM-DD"),
|
|
170
215
|
showConfig: {
|
|
171
|
-
option:
|
|
216
|
+
option: true,
|
|
172
217
|
session: isSession,
|
|
173
|
-
variant:
|
|
174
|
-
package: true
|
|
218
|
+
variant: true,
|
|
219
|
+
package: true,
|
|
220
|
+
number: (0, import_utils4.isNormalProductByDurationSchedule)(item)
|
|
175
221
|
},
|
|
176
222
|
is_eject: isEject ? 1 : 0,
|
|
177
223
|
customer_id: customerId,
|
|
@@ -207,7 +253,7 @@ var AddSerivce = (props) => {
|
|
|
207
253
|
_key: e.key,
|
|
208
254
|
_extend: {
|
|
209
255
|
start_date: state.date.value,
|
|
210
|
-
quantity: 1,
|
|
256
|
+
quantity: (e == null ? void 0 : e.quantity) || 1,
|
|
211
257
|
price: _detail.price,
|
|
212
258
|
product_name: item.title,
|
|
213
259
|
other
|
|
@@ -231,7 +277,7 @@ var AddSerivce = (props) => {
|
|
|
231
277
|
}
|
|
232
278
|
if (cacheItem.autoClose) {
|
|
233
279
|
cacheItem.autoClose = false;
|
|
234
|
-
let _list =
|
|
280
|
+
let _list = (0, import_utils6.addService)(state.service.value, cacheItem);
|
|
235
281
|
(0, import_materials.PisellToast)({
|
|
236
282
|
content: import_utils.locales.getText("pisell2.ticket-booking.add-to-cart")
|
|
237
283
|
});
|
|
@@ -271,18 +317,26 @@ var AddSerivce = (props) => {
|
|
|
271
317
|
}
|
|
272
318
|
}
|
|
273
319
|
return _list;
|
|
274
|
-
}, [(
|
|
320
|
+
}, [(_i = state.service) == null ? void 0 : _i.services, state == null ? void 0 : state.activeCartId]);
|
|
275
321
|
const currentDate = (0, import_react.useMemo)(() => {
|
|
276
322
|
return state.date.value.format("YYYY-MM-DD");
|
|
277
323
|
}, [state.date.value]);
|
|
324
|
+
const currentDatetime = (0, import_react.useMemo)(() => {
|
|
325
|
+
return state.date.value.format("YYYY-MM-DD HH:mm:ss");
|
|
326
|
+
}, [state.date.value]);
|
|
278
327
|
(0, import_react.useEffect)(() => {
|
|
279
|
-
if (renderMode === "current") {
|
|
280
|
-
getServices({
|
|
328
|
+
if (renderMode === "current" && state.bookingConfig) {
|
|
329
|
+
getServices({
|
|
330
|
+
schedule_date: currentDate,
|
|
331
|
+
customer_id: customerId,
|
|
332
|
+
menu_list_ids: menuList,
|
|
333
|
+
schedule_datetime: currentDatetime
|
|
334
|
+
});
|
|
281
335
|
}
|
|
282
|
-
}, [renderMode, currentDate, customerId]);
|
|
336
|
+
}, [renderMode, currentDate, customerId, menuList, currentDatetime]);
|
|
283
337
|
return (0, import_react.useMemo)(() => {
|
|
284
338
|
if (renderMode === "current") {
|
|
285
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
339
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
286
340
|
import_productSelect.default,
|
|
287
341
|
{
|
|
288
342
|
dataSource: renderList,
|
|
@@ -302,11 +356,11 @@ var AddSerivce = (props) => {
|
|
|
302
356
|
isStock: 1
|
|
303
357
|
}
|
|
304
358
|
}
|
|
305
|
-
);
|
|
359
|
+
), /* @__PURE__ */ import_react.default.createElement(import_notAvailable.default, { ref: notAvailableRef }));
|
|
306
360
|
}
|
|
307
361
|
return null;
|
|
308
362
|
}, [
|
|
309
|
-
(
|
|
363
|
+
(_k = (_j = state.service) == null ? void 0 : _j.cacheItem) == null ? void 0 : _k.autoClose,
|
|
310
364
|
state.service.addModal,
|
|
311
365
|
import_utils.locales,
|
|
312
366
|
renderList,
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/ticketBooking/components/notAvailable/index.tsx
|
|
30
|
+
var notAvailable_exports = {};
|
|
31
|
+
__export(notAvailable_exports, {
|
|
32
|
+
default: () => notAvailable_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(notAvailable_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_materials = require("@pisell/materials");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var NotAvailable = (props, ref) => {
|
|
39
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
40
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
41
|
+
open: () => {
|
|
42
|
+
setOpen(true);
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
46
|
+
import_materials.PisellModal.Information,
|
|
47
|
+
{
|
|
48
|
+
open,
|
|
49
|
+
platform: "pc",
|
|
50
|
+
title: import_utils.locales.getText("pisell2.ticket-booking.not-available-title"),
|
|
51
|
+
describe: "",
|
|
52
|
+
cancelText: import_utils.locales.getText("pisell2.text.cancel"),
|
|
53
|
+
okText: import_utils.locales.getText("pisell2.ticket-booking.not-available-ok"),
|
|
54
|
+
cancelVisible: false,
|
|
55
|
+
closable: true,
|
|
56
|
+
onOk: () => setOpen(false),
|
|
57
|
+
onCancel: () => setOpen(false)
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
var notAvailable_default = (0, import_react.forwardRef)(NotAvailable);
|
|
@@ -171,7 +171,7 @@ var initialState = {
|
|
|
171
171
|
bookingConfigParams: {
|
|
172
172
|
item_type: "appointment_booking"
|
|
173
173
|
},
|
|
174
|
-
productExtensionType: ["appointment_ticket", "session_ticket"]
|
|
174
|
+
productExtensionType: ["appointment_ticket", "session_ticket", "product_appointment", "service_product", "session_product", "normal", "product_appointment"]
|
|
175
175
|
};
|
|
176
176
|
var ticketBooking_default = (props) => {
|
|
177
177
|
var _a, _b;
|
|
@@ -45,6 +45,8 @@ declare const _default: {
|
|
|
45
45
|
"pisell2.ticket-booking.scan": string;
|
|
46
46
|
"pisell2.ticket-booking.create-new": string;
|
|
47
47
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
48
|
+
"pisell2.ticket-booking.not-available-title": string;
|
|
49
|
+
"pisell2.ticket-booking.not-available-ok": string;
|
|
48
50
|
};
|
|
49
51
|
"zh-CN": {
|
|
50
52
|
"pisell2.ticket-booking.info": string;
|
|
@@ -92,6 +94,8 @@ declare const _default: {
|
|
|
92
94
|
"pisell2.ticket-booking.scan": string;
|
|
93
95
|
"pisell2.ticket-booking.create-new": string;
|
|
94
96
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
97
|
+
"pisell2.ticket-booking.not-available-title": string;
|
|
98
|
+
"pisell2.ticket-booking.not-available-ok": string;
|
|
95
99
|
};
|
|
96
100
|
"zh-HK": {
|
|
97
101
|
"pisell2.ticket-booking.info": string;
|
|
@@ -139,6 +143,8 @@ declare const _default: {
|
|
|
139
143
|
"pisell2.ticket-booking.scan": string;
|
|
140
144
|
"pisell2.ticket-booking.create-new": string;
|
|
141
145
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
146
|
+
"pisell2.ticket-booking.not-available-title": string;
|
|
147
|
+
"pisell2.ticket-booking.not-available-ok": string;
|
|
142
148
|
};
|
|
143
149
|
};
|
|
144
150
|
export default _default;
|
|
@@ -68,7 +68,9 @@ var locales_default = {
|
|
|
68
68
|
"pisell2.ticket-booking.appointment-not-found": "Appointment not found",
|
|
69
69
|
"pisell2.ticket-booking.scan": "Scan",
|
|
70
70
|
"pisell2.ticket-booking.create-new": "Create new",
|
|
71
|
-
"pisell2.ticket-booking.add-to-cart": "Added to Cart"
|
|
71
|
+
"pisell2.ticket-booking.add-to-cart": "Added to Cart",
|
|
72
|
+
"pisell2.ticket-booking.not-available-title": "Sorry, Not available at current time.",
|
|
73
|
+
"pisell2.ticket-booking.not-available-ok": "OK"
|
|
72
74
|
},
|
|
73
75
|
"zh-CN": {
|
|
74
76
|
"pisell2.ticket-booking.info": "信息",
|
|
@@ -115,7 +117,9 @@ var locales_default = {
|
|
|
115
117
|
"pisell2.ticket-booking.appointment-not-found": "没有发现此预约",
|
|
116
118
|
"pisell2.ticket-booking.scan": "",
|
|
117
119
|
"pisell2.ticket-booking.create-new": "新建",
|
|
118
|
-
"pisell2.ticket-booking.add-to-cart": "已加入购物车"
|
|
120
|
+
"pisell2.ticket-booking.add-to-cart": "已加入购物车",
|
|
121
|
+
"pisell2.ticket-booking.not-available-title": "抱歉,目前不在可售时间。",
|
|
122
|
+
"pisell2.ticket-booking.not-available-ok": "好的"
|
|
119
123
|
},
|
|
120
124
|
"zh-HK": {
|
|
121
125
|
"pisell2.ticket-booking.info": "資訊",
|
|
@@ -162,6 +166,8 @@ var locales_default = {
|
|
|
162
166
|
"pisell2.ticket-booking.appointment-not-found": "没有發現此預約",
|
|
163
167
|
"pisell2.ticket-booking.scan": "扫码",
|
|
164
168
|
"pisell2.ticket-booking.create-new": "新建",
|
|
165
|
-
"pisell2.ticket-booking.add-to-cart": "已加入购物车"
|
|
169
|
+
"pisell2.ticket-booking.add-to-cart": "已加入购物车",
|
|
170
|
+
"pisell2.ticket-booking.not-available-title": "抱歉,目前不在可售時間。",
|
|
171
|
+
"pisell2.ticket-booking.not-available-ok": "好的"
|
|
166
172
|
}
|
|
167
173
|
};
|
|
@@ -58,8 +58,12 @@ var getClients = async (params) => {
|
|
|
58
58
|
return data;
|
|
59
59
|
};
|
|
60
60
|
var getServices = async (params) => {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
const { _config } = params;
|
|
62
|
+
let res = await import_utils.request.getRequest().post(prefix + "/product/query", params, _config);
|
|
63
|
+
if (_config == null ? void 0 : _config.fullResult) {
|
|
64
|
+
return res;
|
|
65
|
+
}
|
|
66
|
+
return res.data;
|
|
63
67
|
};
|
|
64
68
|
var getResources = async (params) => {
|
|
65
69
|
let { data } = await import_utils.request.getRequest().get(prefix + "/form/schedule", params);
|
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/components/ticketBooking/utils/index.ts
|
|
30
30
|
var utils_exports = {};
|
|
31
31
|
__export(utils_exports, {
|
|
32
|
+
addService: () => addService,
|
|
32
33
|
formatBookingList: () => formatBookingList,
|
|
33
34
|
formatDateToStr: () => formatDateToStr,
|
|
34
35
|
getDefaultStartParam: () => getDefaultStartParam,
|
|
@@ -38,6 +39,7 @@ __export(utils_exports, {
|
|
|
38
39
|
});
|
|
39
40
|
module.exports = __toCommonJS(utils_exports);
|
|
40
41
|
var import_dayjs = __toESM(require("dayjs"));
|
|
42
|
+
var import_utils = require("../../booking/info/service2/utils");
|
|
41
43
|
var formatDateToStr = (date) => {
|
|
42
44
|
const format = (val) => {
|
|
43
45
|
return (0, import_dayjs.default)(val).format("YYYY-MM-DD HH:mm:ss");
|
|
@@ -120,8 +122,39 @@ var restoreProductOtherData = (data) => {
|
|
|
120
122
|
quantity: Number(detail.product_quantity)
|
|
121
123
|
};
|
|
122
124
|
};
|
|
125
|
+
var isSameProduct = (a, b) => {
|
|
126
|
+
var _a, _b, _c, _d;
|
|
127
|
+
return ((_b = (_a = a._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.rowKey) === ((_d = (_c = b._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.rowKey);
|
|
128
|
+
};
|
|
129
|
+
var addService = (list, addItem) => {
|
|
130
|
+
let value = list;
|
|
131
|
+
if (!(0, import_utils.isNormalProductByDurationSchedule)(addItem)) {
|
|
132
|
+
value.push(addItem);
|
|
133
|
+
} else {
|
|
134
|
+
let isNotSame = true;
|
|
135
|
+
value = list.map((item) => {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
if (isSameProduct(item, addItem)) {
|
|
138
|
+
isNotSame = false;
|
|
139
|
+
return {
|
|
140
|
+
...item,
|
|
141
|
+
_extend: {
|
|
142
|
+
...item._extend,
|
|
143
|
+
quantity: (((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.quantity) || 1) + (((_b = addItem == null ? void 0 : addItem._extend) == null ? void 0 : _b.quantity) || 1)
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return item;
|
|
148
|
+
});
|
|
149
|
+
if (isNotSame) {
|
|
150
|
+
value.push(addItem);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return value;
|
|
154
|
+
};
|
|
123
155
|
// Annotate the CommonJS export names for ESM import in node:
|
|
124
156
|
0 && (module.exports = {
|
|
157
|
+
addService,
|
|
125
158
|
formatBookingList,
|
|
126
159
|
formatDateToStr,
|
|
127
160
|
getDefaultStartParam,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.47",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
62
|
"@pisell/utils": "1.0.42",
|
|
63
|
-
"@pisell/materials": "3.3.
|
|
64
|
-
"@pisell/
|
|
65
|
-
"@pisell/
|
|
63
|
+
"@pisell/materials": "3.3.16",
|
|
64
|
+
"@pisell/icon": "0.0.11",
|
|
65
|
+
"@pisell/date-picker": "3.0.2"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0",
|