@pisell/private-materials 3.4.8 → 3.4.9
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/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/hooks/useClearCart.js +11 -8
- package/es/components/booking/hooks/useQuotation.js +1 -1
- package/es/components/booking/info/client/index.js +3 -2
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.js +16 -9
- package/es/components/booking/info/service/Lists.js +36 -26
- package/es/components/booking/info/service2/utils.js +20 -21
- package/es/components/booking/info2/index.js +1 -0
- package/es/components/booking/info2/service/addService/utils.js +6 -3
- package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
- package/es/components/booking/info2/service/editService/index.js +266 -170
- package/es/components/booking/info2/service/index.js +19 -15
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/shoppingCart/components/Cart/Product.js +48 -41
- package/es/components/shoppingCart/components/Cart/index.js +21 -18
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +249 -158
- package/es/components/ticketBooking/components/timeBar/index.js +78 -71
- package/es/components/ticketBooking/utils/index.d.ts +2 -0
- package/es/components/ticketBooking/utils/index.js +18 -1
- package/lib/components/booking/components/customSelect/index.js +1 -0
- package/lib/components/booking/hooks/useClearCart.js +16 -13
- package/lib/components/booking/hooks/useQuotation.js +1 -1
- package/lib/components/booking/info/client/index.js +5 -4
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.js +10 -9
- package/lib/components/booking/info/service/Lists.js +35 -23
- package/lib/components/booking/info/service2/utils.js +17 -17
- package/lib/components/booking/info2/service/addService/utils.js +4 -2
- package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
- package/lib/components/booking/info2/service/editService/index.js +139 -74
- package/lib/components/booking/info2/service/index.js +13 -9
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/shoppingCart/components/Cart/Product.js +31 -21
- package/lib/components/shoppingCart/components/Cart/index.js +18 -15
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +196 -127
- package/lib/components/ticketBooking/components/timeBar/index.js +95 -88
- package/lib/components/ticketBooking/utils/index.d.ts +2 -0
- package/lib/components/ticketBooking/utils/index.js +22 -0
- package/package.json +4 -4
|
@@ -54,7 +54,7 @@ var import_utils6 = require("../../../info/service2/utils");
|
|
|
54
54
|
var import_utils7 = require("../../../../ticketBooking/utils");
|
|
55
55
|
var submitLock = false;
|
|
56
56
|
var Info = (_, ref) => {
|
|
57
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
|
|
57
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I;
|
|
58
58
|
const [form] = import_antd.Form.useForm();
|
|
59
59
|
const useTotal = import_antd.Form.useWatch("total", form);
|
|
60
60
|
const useResource = import_antd.Form.useWatch("resource", form);
|
|
@@ -64,10 +64,13 @@ var Info = (_, ref) => {
|
|
|
64
64
|
const resourcesRef = (0, import_react.useRef)(null);
|
|
65
65
|
const isChangeTotal = (0, import_react.useRef)(false);
|
|
66
66
|
const isNormalProduct = (0, import_react.useMemo)(() => {
|
|
67
|
-
var _a2, _b2;
|
|
68
|
-
|
|
67
|
+
var _a2, _b2, _c2;
|
|
68
|
+
if (!((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.cacheItem)) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return ((_b2 = state == null ? void 0 : state.service) == null ? void 0 : _b2.cacheItem) && (0, import_utils6.isNormalProductByDurationSchedule)((_c2 = state == null ? void 0 : state.service) == null ? void 0 : _c2.cacheItem);
|
|
69
72
|
}, [(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.cacheItem]);
|
|
70
|
-
const getCurrentCacheItem = (_cacheItem) => {
|
|
73
|
+
const getCurrentCacheItem = (0, import_ahooks.useMemoizedFn)((_cacheItem) => {
|
|
71
74
|
let values = form.getFieldsValue();
|
|
72
75
|
let _item = _cacheItem || state.service.cacheItem;
|
|
73
76
|
return {
|
|
@@ -77,40 +80,43 @@ var Info = (_, ref) => {
|
|
|
77
80
|
...values
|
|
78
81
|
}
|
|
79
82
|
};
|
|
80
|
-
};
|
|
83
|
+
});
|
|
81
84
|
const currentResource = (0, import_react.useMemo)(() => {
|
|
82
85
|
return null;
|
|
83
|
-
}, [
|
|
86
|
+
}, []);
|
|
84
87
|
const durationProps = (0, import_react.useMemo)(() => {
|
|
85
88
|
var _a2, _b2, _c2;
|
|
86
89
|
let _cacheItem = getCurrentCacheItem();
|
|
87
|
-
|
|
90
|
+
const val2 = (0, import_utils4.getDurationProps)({
|
|
88
91
|
cacheItem: _cacheItem,
|
|
89
92
|
useStartTime,
|
|
90
|
-
currentResource,
|
|
93
|
+
// currentResource,
|
|
91
94
|
slice: (_c2 = (_b2 = (_a2 = state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.service_time
|
|
92
95
|
});
|
|
96
|
+
return val2;
|
|
93
97
|
}, [
|
|
94
|
-
currentResource,
|
|
98
|
+
// currentResource,
|
|
95
99
|
state.service.cacheItem,
|
|
96
100
|
useStartTime,
|
|
97
101
|
useResource,
|
|
98
102
|
(_d = (_c = (_b = state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.service_time
|
|
99
103
|
]);
|
|
100
104
|
const flexibleOption = (0, import_react.useMemo)(() => {
|
|
101
|
-
|
|
105
|
+
const op = (0, import_utils4.getFlexibleOption)({
|
|
102
106
|
durationProps
|
|
103
107
|
});
|
|
108
|
+
return op;
|
|
104
109
|
}, [durationProps, import_utils.locales.locale]);
|
|
105
110
|
const timeObj = (0, import_react.useMemo)(() => {
|
|
106
|
-
|
|
111
|
+
const val2 = (0, import_utils4.getTimeObj)({
|
|
107
112
|
durationProps,
|
|
108
113
|
useStartTime,
|
|
109
114
|
currentResource,
|
|
110
115
|
state,
|
|
111
116
|
useDuration
|
|
112
117
|
});
|
|
113
|
-
|
|
118
|
+
return val2;
|
|
119
|
+
}, [durationProps, useStartTime, currentResource, (_g = (_f = (_e = state.bookingConfig) == null ? void 0 : _e.config) == null ? void 0 : _f.basic) == null ? void 0 : _g.service_time, useDuration]);
|
|
114
120
|
(0, import_react.useEffect)(() => {
|
|
115
121
|
try {
|
|
116
122
|
if (useDuration.indexOf("flexible_") == 0) {
|
|
@@ -123,7 +129,7 @@ var Info = (_, ref) => {
|
|
|
123
129
|
} catch (err) {
|
|
124
130
|
}
|
|
125
131
|
}, [useDuration, flexibleOption]);
|
|
126
|
-
const handleDeleteProduct = () => {
|
|
132
|
+
const handleDeleteProduct = (0, import_ahooks.useMemoizedFn)(() => {
|
|
127
133
|
var _a2;
|
|
128
134
|
if (state.channelDisabledEdit) {
|
|
129
135
|
return;
|
|
@@ -140,7 +146,7 @@ var Info = (_, ref) => {
|
|
|
140
146
|
cacheItem: null
|
|
141
147
|
}
|
|
142
148
|
});
|
|
143
|
-
};
|
|
149
|
+
});
|
|
144
150
|
const getDiscount = () => {
|
|
145
151
|
var _a2;
|
|
146
152
|
let oPrice = Number(((_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend.origin_total) || 0);
|
|
@@ -218,13 +224,32 @@ var Info = (_, ref) => {
|
|
|
218
224
|
}
|
|
219
225
|
});
|
|
220
226
|
};
|
|
227
|
+
const { run: setEditDataRun } = (0, import_ahooks.useDebounceFn)(
|
|
228
|
+
(...params) => {
|
|
229
|
+
setEditData(...params);
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
wait: 50,
|
|
233
|
+
leading: true,
|
|
234
|
+
trailing: false
|
|
235
|
+
}
|
|
236
|
+
);
|
|
221
237
|
const setEditData = (0, import_ahooks.useMemoizedFn)(
|
|
222
238
|
(_cacheItem, open, openProductDetail) => {
|
|
223
|
-
|
|
239
|
+
console.timeEnd("handleChange");
|
|
240
|
+
console.log("setEditDatasetEditData", _cacheItem, open);
|
|
224
241
|
isChangeTotal.current = false;
|
|
225
242
|
let cacheItem = _cacheItem || state.service.cacheItem;
|
|
226
243
|
let values = cacheItem._extend;
|
|
244
|
+
const startTime2 = performance.now();
|
|
245
|
+
console.log(startTime2, "startTime");
|
|
246
|
+
form.resetFields();
|
|
227
247
|
form.setFieldsValue(values);
|
|
248
|
+
const endTime = performance.now();
|
|
249
|
+
console.log(endTime - window.pp1, "打开商品5");
|
|
250
|
+
console.log("执行时间", endTime - startTime2, values);
|
|
251
|
+
setTimeout(() => {
|
|
252
|
+
}, 20);
|
|
228
253
|
if (openProductDetail) {
|
|
229
254
|
setTimeout(() => {
|
|
230
255
|
handleEdit({});
|
|
@@ -237,7 +262,7 @@ var Info = (_, ref) => {
|
|
|
237
262
|
let oPrice = Number(((_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend.origin_total) || 0);
|
|
238
263
|
let cPrice = Number(useTotal || 0);
|
|
239
264
|
return cPrice !== oPrice;
|
|
240
|
-
}, [useTotal, (
|
|
265
|
+
}, [useTotal, (_i = (_h = state.service.cacheItem) == null ? void 0 : _h._extend) == null ? void 0 : _i.origin_total]);
|
|
241
266
|
const getResources = () => {
|
|
242
267
|
let res = (0, import_utils4.formatResources)({
|
|
243
268
|
cacheItem: getCurrentCacheItem(),
|
|
@@ -259,9 +284,9 @@ var Info = (_, ref) => {
|
|
|
259
284
|
updateResourceErrors(res.maps);
|
|
260
285
|
};
|
|
261
286
|
const updateResourceErrors = (resourceMaps) => {
|
|
262
|
-
let { resource } = form.getFieldsValue();
|
|
263
|
-
if (
|
|
264
|
-
let _resource = { ...
|
|
287
|
+
let { resource: resource2 } = form.getFieldsValue();
|
|
288
|
+
if (resource2) {
|
|
289
|
+
let _resource = { ...resource2 };
|
|
265
290
|
for (let form_id in _resource) {
|
|
266
291
|
_resource[form_id] = _resource[form_id].map((d) => {
|
|
267
292
|
var _a2, _b2;
|
|
@@ -295,24 +320,17 @@ var Info = (_, ref) => {
|
|
|
295
320
|
]);
|
|
296
321
|
(0, import_react.useEffect)(() => {
|
|
297
322
|
if (state.isBookingCreatePage && state.service.editModal) {
|
|
298
|
-
|
|
323
|
+
setEditDataRun(null);
|
|
299
324
|
}
|
|
300
325
|
}, [state.service.editModal, state.isBookingCreatePage]);
|
|
301
326
|
(0, import_react.useEffect)(() => {
|
|
302
327
|
getDiscount();
|
|
303
|
-
}, [useTotal, (
|
|
304
|
-
const isDiscount = (0, import_react.useMemo)(() => {
|
|
305
|
-
var _a2, _b2, _c2;
|
|
306
|
-
if (!((_a2 = state.service) == null ? void 0 : _a2.cacheItem)) {
|
|
307
|
-
return false;
|
|
308
|
-
}
|
|
309
|
-
return useTotal != ((_c2 = (_b2 = state.service) == null ? void 0 : _b2.cacheItem) == null ? void 0 : _c2._extend.origin_total);
|
|
310
|
-
}, [useTotal, (_j = (_i = state.service) == null ? void 0 : _i.cacheItem) == null ? void 0 : _j._extend.origin_total]);
|
|
328
|
+
}, [useTotal, (_k = (_j = state.service.cacheItem) == null ? void 0 : _j._extend) == null ? void 0 : _k.origin_total]);
|
|
311
329
|
const bundles = (0, import_react.useMemo)(() => {
|
|
312
330
|
var _a2, _b2, _c2, _d2;
|
|
313
331
|
return ((_d2 = (_c2 = (_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2._extend) == null ? void 0 : _c2.other) == null ? void 0 : _d2.bundle) || [];
|
|
314
|
-
}, [(
|
|
315
|
-
const handleEdit = (e) => {
|
|
332
|
+
}, [(_o = (_n = (_m = (_l = state.service) == null ? void 0 : _l.cacheItem) == null ? void 0 : _m._extend) == null ? void 0 : _n.other) == null ? void 0 : _o.bundle]);
|
|
333
|
+
const handleEdit = (0, import_ahooks.useMemoizedFn)((e) => {
|
|
316
334
|
var _a2, _b2, _c2, _d2, _e2;
|
|
317
335
|
const item = state.service.cacheItem;
|
|
318
336
|
let values = form.getFieldsValue();
|
|
@@ -398,8 +416,8 @@ var Info = (_, ref) => {
|
|
|
398
416
|
});
|
|
399
417
|
}
|
|
400
418
|
});
|
|
401
|
-
};
|
|
402
|
-
const handleChange = (e) => {
|
|
419
|
+
});
|
|
420
|
+
const handleChange = (0, import_ahooks.useMemoizedFn)((e) => {
|
|
403
421
|
if (state.channelDisabledEdit) {
|
|
404
422
|
return;
|
|
405
423
|
}
|
|
@@ -413,10 +431,10 @@ var Info = (_, ref) => {
|
|
|
413
431
|
// changeService: true,
|
|
414
432
|
}
|
|
415
433
|
});
|
|
416
|
-
};
|
|
434
|
+
});
|
|
417
435
|
(0, import_react.useImperativeHandle)(ref, () => {
|
|
418
436
|
return {
|
|
419
|
-
init:
|
|
437
|
+
init: setEditDataRun
|
|
420
438
|
};
|
|
421
439
|
});
|
|
422
440
|
const handleTotalChange = (number) => {
|
|
@@ -428,43 +446,30 @@ var Info = (_, ref) => {
|
|
|
428
446
|
}
|
|
429
447
|
return false;
|
|
430
448
|
}, [state.renderType, isNormalProduct]);
|
|
431
|
-
const SelectTime = (
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
zIndex: state.service.changeService ? 999 : 1e3,
|
|
437
|
-
forceRender: true,
|
|
438
|
-
mask: state.drawerMask,
|
|
439
|
-
open: state.service.editModal && !((_p = state.service.cacheItem) == null ? void 0 : _p.autoClose),
|
|
440
|
-
title: import_utils.locales.getText("pisell2.text.edit-service"),
|
|
441
|
-
onClose: () => {
|
|
442
|
-
dispatch({
|
|
443
|
-
type: "setService",
|
|
444
|
-
payload: {
|
|
445
|
-
editModal: false,
|
|
446
|
-
cacheItem: null,
|
|
447
|
-
changeService: false
|
|
448
|
-
}
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
},
|
|
452
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { layout: "vertical", form, onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "product_name" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_s = (_r = (_q = state.service) == null ? void 0 : _q.cacheItem) == null ? void 0 : _r._extend) == null ? void 0 : _s.product_name) || "-"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleEdit }, import_utils.locales.getText("pisell2.text.edit")), !state.isBookingCreatePage && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleChange }, import_utils.locales.getText("pisell2.text.change"))), /* @__PURE__ */ import_react.default.createElement(
|
|
449
|
+
const SelectTime = (_p = window.BaseMaterials) == null ? void 0 : _p.SelectTime;
|
|
450
|
+
console.log(isShowTimeAndResource, "isShowTimeAndResource");
|
|
451
|
+
const productName = (0, import_react.useMemo)(() => {
|
|
452
|
+
var _a2, _b2, _c2;
|
|
453
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "product_name" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_c2 = (_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2._extend) == null ? void 0 : _c2.product_name) || "-"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleEdit }, import_utils.locales.getText("pisell2.text.edit")), !state.isBookingCreatePage && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleChange }, import_utils.locales.getText("pisell2.text.change"))), /* @__PURE__ */ import_react.default.createElement(
|
|
453
454
|
import_collapsibleList.default,
|
|
454
455
|
{
|
|
455
456
|
style: { marginTop: bundles.length ? "8px" : 0 },
|
|
456
457
|
list: bundles,
|
|
457
458
|
renderItem: (item) => (0, import_utils2.renderBundles)(item, state.amountSymbol)
|
|
458
459
|
}
|
|
459
|
-
))))
|
|
460
|
+
))));
|
|
461
|
+
}, [(_s = (_r = (_q = state.service) == null ? void 0 : _q.cacheItem) == null ? void 0 : _r._extend) == null ? void 0 : _s.product_name, bundles, state.amountSymbol, state.isBookingCreatePage]);
|
|
462
|
+
const price = (0, import_react.useMemo)(() => {
|
|
463
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
464
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
460
465
|
import_antd.Form.Item,
|
|
461
466
|
{
|
|
462
467
|
label: import_utils.locales.getText("pisell2.text.price"),
|
|
463
468
|
name: "total",
|
|
464
469
|
rules: [{ required: true }],
|
|
465
|
-
extra: useTotal !== ((
|
|
470
|
+
extra: useTotal !== ((_b2 = (_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend) == null ? void 0 : _b2.origin_total) && import_utils.locales.getText("page.booking.text.price-extra")(
|
|
466
471
|
(0, import_utils.formatAmount)(
|
|
467
|
-
(
|
|
472
|
+
(_d2 = (_c2 = state.service.cacheItem) == null ? void 0 : _c2._extend) == null ? void 0 : _d2.origin_total,
|
|
468
473
|
2,
|
|
469
474
|
state.amountSymbol
|
|
470
475
|
),
|
|
@@ -480,18 +485,25 @@ var Info = (_, ref) => {
|
|
|
480
485
|
prefix: state.amountSymbol,
|
|
481
486
|
onChange: handleTotalChange,
|
|
482
487
|
disabled: state.channelDisabledEdit,
|
|
483
|
-
originValue: ((
|
|
484
|
-
placeholder: ((
|
|
488
|
+
originValue: ((_f2 = (_e2 = state.service.cacheItem) == null ? void 0 : _e2._extend) == null ? void 0 : _f2.origin_total) || 0,
|
|
489
|
+
placeholder: ((_h2 = (_g2 = state.service.cacheItem) == null ? void 0 : _g2._extend) == null ? void 0 : _h2.origin_total) || "0"
|
|
485
490
|
}
|
|
486
491
|
)
|
|
487
|
-
))
|
|
492
|
+
));
|
|
493
|
+
}, [useTotal, (_u = (_t = state.service.cacheItem) == null ? void 0 : _t._extend) == null ? void 0 : _u.origin_total, state.amountSymbol, state.channelDisabledEdit]);
|
|
494
|
+
const reason = (0, import_react.useMemo)(() => {
|
|
495
|
+
return isReason ? /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
488
496
|
import_antd.Form.Item,
|
|
489
497
|
{
|
|
490
498
|
label: import_utils.locales.getText("pisell2.text.discount-reason"),
|
|
491
499
|
name: "discount_reason"
|
|
492
500
|
},
|
|
493
501
|
/* @__PURE__ */ import_react.default.createElement(import_antd.Input.TextArea, { size: "large" })
|
|
494
|
-
)) : null
|
|
502
|
+
)) : null;
|
|
503
|
+
}, [isReason]);
|
|
504
|
+
const startTime = (0, import_react.useMemo)(() => {
|
|
505
|
+
var _a2, _b2, _c2, _d2;
|
|
506
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
|
|
495
507
|
import_antd.Form.Item,
|
|
496
508
|
{
|
|
497
509
|
label: import_utils.locales.getText("pisell2.text.start_time"),
|
|
@@ -501,7 +513,7 @@ var Info = (_, ref) => {
|
|
|
501
513
|
SelectTime ? /* @__PURE__ */ import_react.default.createElement(
|
|
502
514
|
SelectTime,
|
|
503
515
|
{
|
|
504
|
-
slice: (
|
|
516
|
+
slice: (_d2 = (_c2 = (_b2 = (_a2 = state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.service_time) == null ? void 0 : _d2.value,
|
|
505
517
|
timePickerProps: {
|
|
506
518
|
style: { width: "100%" }
|
|
507
519
|
},
|
|
@@ -510,7 +522,11 @@ var Info = (_, ref) => {
|
|
|
510
522
|
}
|
|
511
523
|
}
|
|
512
524
|
) : null
|
|
513
|
-
))
|
|
525
|
+
));
|
|
526
|
+
}, [SelectTime, (_y = (_x = (_w = (_v = state.bookingConfig) == null ? void 0 : _v.config) == null ? void 0 : _w.basic) == null ? void 0 : _x.service_time) == null ? void 0 : _y.value]);
|
|
527
|
+
const duration = (0, import_react.useMemo)(() => {
|
|
528
|
+
console.log("render form duration");
|
|
529
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
|
|
514
530
|
import_antd.Form.Item,
|
|
515
531
|
{
|
|
516
532
|
label: import_utils.locales.getText("pisell2.text.duration"),
|
|
@@ -518,23 +534,34 @@ var Info = (_, ref) => {
|
|
|
518
534
|
rules: [{ required: true }]
|
|
519
535
|
},
|
|
520
536
|
/* @__PURE__ */ import_react.default.createElement(import_duration.default, { ...durationProps, timeObj })
|
|
521
|
-
))
|
|
537
|
+
));
|
|
538
|
+
}, [durationProps, timeObj]);
|
|
539
|
+
const resource = (0, import_react.useMemo)(() => {
|
|
540
|
+
console.log("render form resource");
|
|
541
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { noStyle: true, name: "resource" }, /* @__PURE__ */ import_react.default.createElement(
|
|
522
542
|
import_Resources.default,
|
|
523
543
|
{
|
|
524
544
|
ref: resourcesRef,
|
|
525
545
|
state,
|
|
526
546
|
cacheItem: state.service.cacheItem,
|
|
527
|
-
getCurrentCacheItem
|
|
528
|
-
useDuration,
|
|
529
|
-
useStartTime
|
|
547
|
+
getCurrentCacheItem
|
|
530
548
|
}
|
|
531
|
-
))
|
|
549
|
+
));
|
|
550
|
+
}, [state.renderType, (_A = (_z = state.service.cacheItem) == null ? void 0 : _z._data) == null ? void 0 : _A.resources, (_C = (_B = state.service.cacheItem) == null ? void 0 : _B._data) == null ? void 0 : _C.resourceMaps]);
|
|
551
|
+
const capacity = (0, import_react.useMemo)(() => {
|
|
552
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { noStyle: true, name: "capacity" }, /* @__PURE__ */ import_react.default.createElement(
|
|
532
553
|
import_Capacity.default,
|
|
533
554
|
{
|
|
534
555
|
state,
|
|
535
556
|
cacheItem: state.service.cacheItem
|
|
536
557
|
}
|
|
537
|
-
))
|
|
558
|
+
));
|
|
559
|
+
}, [state.locale, state.isTerminal, (_F = (_E = (_D = state.service) == null ? void 0 : _D.cacheItem) == null ? void 0 : _E._data) == null ? void 0 : _F.capacitys]);
|
|
560
|
+
const hiddenQuantity = (0, import_react.useMemo)(() => {
|
|
561
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "quantity" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, null));
|
|
562
|
+
}, []);
|
|
563
|
+
const quantity = (0, import_react.useMemo)(() => {
|
|
564
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
538
565
|
import_antd.Form.Item,
|
|
539
566
|
{
|
|
540
567
|
label: import_utils.locales.getText("pisell2.text.quantity"),
|
|
@@ -556,7 +583,11 @@ var Info = (_, ref) => {
|
|
|
556
583
|
}
|
|
557
584
|
}
|
|
558
585
|
)
|
|
559
|
-
))
|
|
586
|
+
));
|
|
587
|
+
}, []);
|
|
588
|
+
const footer = (0, import_react.useMemo)(() => {
|
|
589
|
+
var _a2;
|
|
590
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit-footer" }, /* @__PURE__ */ import_react.default.createElement(
|
|
560
591
|
"div",
|
|
561
592
|
{
|
|
562
593
|
className: "pisell-lowcode__booking-service-delete-wrap",
|
|
@@ -568,13 +599,47 @@ var Info = (_, ref) => {
|
|
|
568
599
|
{
|
|
569
600
|
type: "primary",
|
|
570
601
|
className: "pisell-lowcode__booking-service-body-edit-footer-apple",
|
|
571
|
-
disabled: !isNormalProduct && !((
|
|
602
|
+
disabled: !isNormalProduct && !((_a2 = state.service.resourcesOrigin) == null ? void 0 : _a2.length),
|
|
572
603
|
onClick: () => {
|
|
573
604
|
form.submit();
|
|
574
605
|
}
|
|
575
606
|
},
|
|
576
607
|
import_utils.locales.getText("pisell2.text.apply")
|
|
577
|
-
))
|
|
608
|
+
));
|
|
609
|
+
}, [(_G = state.service.resourcesOrigin) == null ? void 0 : _G.length, isNormalProduct]);
|
|
610
|
+
console.log("render edit");
|
|
611
|
+
console.log(state.service.editModal && !((_H = state.service.cacheItem) == null ? void 0 : _H.autoClose), performance.now() - window.pp1, "打开商品1");
|
|
612
|
+
const [val, setVal] = (0, import_react.useState)(false);
|
|
613
|
+
(0, import_react.useEffect)(() => {
|
|
614
|
+
if (isShowTimeAndResource) {
|
|
615
|
+
setTimeout(() => {
|
|
616
|
+
setVal(true);
|
|
617
|
+
}, 200);
|
|
618
|
+
} else {
|
|
619
|
+
setVal(false);
|
|
620
|
+
}
|
|
621
|
+
}, [isShowTimeAndResource]);
|
|
622
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
623
|
+
import_drawer.default,
|
|
624
|
+
{
|
|
625
|
+
titleNoWrap: true,
|
|
626
|
+
zIndex: state.service.changeService ? 999 : 1e3,
|
|
627
|
+
forceRender: true,
|
|
628
|
+
mask: state.drawerMask,
|
|
629
|
+
open: state.service.editModal && !((_I = state.service.cacheItem) == null ? void 0 : _I.autoClose),
|
|
630
|
+
title: import_utils.locales.getText("pisell2.text.edit-service"),
|
|
631
|
+
onClose: () => {
|
|
632
|
+
dispatch({
|
|
633
|
+
type: "setService",
|
|
634
|
+
payload: {
|
|
635
|
+
editModal: false,
|
|
636
|
+
cacheItem: null,
|
|
637
|
+
changeService: false
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { layout: "vertical", form, onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, productName, price, reason, val && isShowTimeAndResource && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, startTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity)), footer)
|
|
578
643
|
));
|
|
579
644
|
};
|
|
580
645
|
var editService_default = (0, import_react.forwardRef)(Info);
|
|
@@ -56,14 +56,18 @@ var Service = () => {
|
|
|
56
56
|
}, []);
|
|
57
57
|
const clearCart = (0, import_useClearCart.default)(state, dispatch);
|
|
58
58
|
const { dom } = (0, import_useQuotation.default)(state, dispatch);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
const renderMemo = (0, import_react.useMemo)(() => {
|
|
60
|
+
console.log("render info22222");
|
|
61
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-wrap" }, clearCart, /* @__PURE__ */ import_react.default.createElement(
|
|
62
|
+
import_Lists.default,
|
|
63
|
+
{
|
|
64
|
+
isParallelResource: true,
|
|
65
|
+
onEdit: handleEdit,
|
|
66
|
+
onAction: handleAction,
|
|
67
|
+
onChange: (e, type) => dispatchService(type || "setService", e)
|
|
68
|
+
}
|
|
69
|
+
), !state.isBookingCreatePage ? /* @__PURE__ */ import_react.default.createElement(import_addService.default, { onEdit: handleEdit }) : null), /* @__PURE__ */ import_react.default.createElement(import_editService.default, { ref: detailRef }), showAddTimeModal && /* @__PURE__ */ import_react.default.createElement(import_addTimeModal.default, null), dom);
|
|
70
|
+
}, [clearCart, dom, showAddTimeModal, clearCart]);
|
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderMemo);
|
|
68
72
|
};
|
|
69
73
|
var service_default = import_react.default.memo(Service);
|
|
@@ -49,6 +49,7 @@ var Duration = (props) => {
|
|
|
49
49
|
timeObj,
|
|
50
50
|
...resetProps
|
|
51
51
|
} = props;
|
|
52
|
+
const startDateStr = (0, import_react.useMemo)(() => (0, import_dayjs.default)(startDate).format("YYYY-MM-DD HH:mm:ss"), [startDate]);
|
|
52
53
|
const times = (0, import_react.useMemo)(() => {
|
|
53
54
|
if (timeObj) {
|
|
54
55
|
return timeObj.durationSlicesBasedOnTime;
|
|
@@ -76,7 +77,7 @@ var Duration = (props) => {
|
|
|
76
77
|
});
|
|
77
78
|
}
|
|
78
79
|
return durationSlicesBasedOnTime;
|
|
79
|
-
}, [timeObj, slice, locale, duration,
|
|
80
|
+
}, [timeObj.durationSlicesBasedOnTime, slice, locale, duration, startDateStr, usableTime == null ? void 0 : usableTime.end_at]);
|
|
80
81
|
(0, import_react.useEffect)(() => {
|
|
81
82
|
timeObjChange == null ? void 0 : timeObjChange(times);
|
|
82
83
|
}, [times]);
|
|
@@ -88,6 +89,10 @@ var Duration = (props) => {
|
|
|
88
89
|
},
|
|
89
90
|
[]
|
|
90
91
|
);
|
|
91
|
-
|
|
92
|
+
const options = (0, import_react.useMemo)(() => {
|
|
93
|
+
console.log("render form options");
|
|
94
|
+
return renderOptions(times);
|
|
95
|
+
}, [times]);
|
|
96
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Select, { ...selectProps, ...resetProps }, options);
|
|
92
97
|
};
|
|
93
98
|
var duration_default = Duration;
|
|
@@ -37,6 +37,7 @@ var import_materials = require("@pisell/materials");
|
|
|
37
37
|
var import_useClearCart = __toESM(require("../../hooks/useClearCart"));
|
|
38
38
|
var import_useContext = require("../../hooks/useContext");
|
|
39
39
|
var import_useAddService = __toESM(require("../../hooks/useAddService"));
|
|
40
|
+
var import_ahooks = require("ahooks");
|
|
40
41
|
var Product = (props) => {
|
|
41
42
|
const { id, lists, isAdd = true } = props;
|
|
42
43
|
const { state, onAction, onChange } = (0, import_useContext.useContext)();
|
|
@@ -54,10 +55,10 @@ var Product = (props) => {
|
|
|
54
55
|
isShowEditProduct
|
|
55
56
|
} = state;
|
|
56
57
|
const clearCart = (0, import_useClearCart.default)(id);
|
|
57
|
-
const handleChange = (item, type, other) => {
|
|
58
|
+
const handleChange = (0, import_ahooks.useMemoizedFn)((item, type, other) => {
|
|
58
59
|
if (disabledEdit && !(other == null ? void 0 : other.disabled)) return;
|
|
59
60
|
onChange(item, type, other);
|
|
60
|
-
};
|
|
61
|
+
});
|
|
61
62
|
const productParams = (0, import_react.useMemo)(() => {
|
|
62
63
|
return {
|
|
63
64
|
isShowNote,
|
|
@@ -81,24 +82,33 @@ var Product = (props) => {
|
|
|
81
82
|
isShowChangeHolder,
|
|
82
83
|
isShowEditProduct
|
|
83
84
|
]);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
85
|
+
(0, import_ahooks.useTrackedEffect)(
|
|
86
|
+
(changes) => {
|
|
87
|
+
console.log("Index of changed dependencies: ", changes);
|
|
88
|
+
},
|
|
89
|
+
[clearCart, lists, productParams, hideAddBtn, isAdd, platform]
|
|
90
|
+
);
|
|
91
|
+
return (0, import_react.useMemo)(() => {
|
|
92
|
+
console.log("render cart");
|
|
93
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__shopping-cart-content" }, clearCart, lists == null ? void 0 : lists.map((item) => {
|
|
94
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
95
|
+
import_materials.ProductCard,
|
|
96
|
+
{
|
|
97
|
+
key: item._id,
|
|
98
|
+
dataSource: item,
|
|
99
|
+
onAction: (e) => onAction == null ? void 0 : onAction(e),
|
|
100
|
+
onDelete: (e) => handleChange(e, "delete", item),
|
|
101
|
+
onNote: (e) => handleChange(e, "note", { note: e.note }),
|
|
102
|
+
onLike: (e) => handleChange(e, "like", { like_status: e.like_status }),
|
|
103
|
+
onEditProduct: (e) => handleChange == null ? void 0 : handleChange(e, "edit_product"),
|
|
104
|
+
onCard: (e) => handleChange == null ? void 0 : handleChange(e, "view"),
|
|
105
|
+
onChangeResource: (e) => handleChange(item, "change_resource", e),
|
|
106
|
+
onChangeHolder: (e) => handleChange(item, "change_holder", e),
|
|
107
|
+
onAddHolder: (e) => handleChange(item, "add_holder", e),
|
|
108
|
+
...productParams
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}), !hideAddBtn && platform !== "h5" && isAdd ? (0, import_useAddService.default)(id, "more") : null);
|
|
112
|
+
}, [clearCart, lists, productParams, hideAddBtn, isAdd, platform]);
|
|
103
113
|
};
|
|
104
114
|
var Product_default = Product;
|
|
@@ -66,20 +66,23 @@ var Cart = () => {
|
|
|
66
66
|
};
|
|
67
67
|
});
|
|
68
68
|
}, [carts, platform]);
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
69
|
+
return (0, import_react.useMemo)(() => {
|
|
70
|
+
console.log("render cart 22222");
|
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-lowcode__shopping-cart") }, isProductList ? /* @__PURE__ */ import_react.default.createElement(import_Product.default, { id: void 0, lists: state == null ? void 0 : state.products }) : /* @__PURE__ */ import_react.default.createElement(
|
|
72
|
+
import_materials.Collapse,
|
|
73
|
+
{
|
|
74
|
+
items: cartsMap,
|
|
75
|
+
showHeader: true,
|
|
76
|
+
panelBackground: "#ffffff",
|
|
77
|
+
collapsible: platform !== "shop" ? "disabled" : "-",
|
|
78
|
+
accordion: platform === "shop",
|
|
79
|
+
onChange: (key) => {
|
|
80
|
+
updateState({ activeKey: key });
|
|
81
|
+
onActiveKey(key);
|
|
82
|
+
},
|
|
83
|
+
...collapseParams
|
|
84
|
+
}
|
|
85
|
+
));
|
|
86
|
+
}, [isProductList, cartsMap, platform, collapseParams, state == null ? void 0 : state.products]);
|
|
84
87
|
};
|
|
85
88
|
var Cart_default = Cart;
|