@pisell/private-materials 6.2.25 → 6.2.26
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 +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
- package/es/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/hooks/useClearCart.js +11 -8
- package/es/components/booking/info/client/index.js +3 -2
- package/es/components/booking/info/hooks/useInfoHolder.js +13 -14
- package/es/components/booking/info/service/Lists.js +37 -27
- package/es/components/booking/info/service/editService/constants.d.ts +1 -0
- package/es/components/booking/info/service/editService/constants.js +3 -0
- package/es/components/booking/info/service/editService/index.js +15 -10
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- 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 +265 -170
- package/es/components/booking/info2/service/index.js +22 -19
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +51 -47
- package/es/components/shoppingCart/components/Cart/index.js +21 -18
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +171 -151
- package/es/components/ticketBooking/components/timeBar/index.js +77 -73
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
- package/lib/components/booking/components/customSelect/index.js +1 -0
- package/lib/components/booking/hooks/useClearCart.js +16 -13
- package/lib/components/booking/info/client/index.js +5 -4
- package/lib/components/booking/info/hooks/useInfoHolder.js +12 -13
- package/lib/components/booking/info/service/Lists.js +36 -24
- package/lib/components/booking/info/service/editService/constants.d.ts +1 -0
- package/lib/components/booking/info/service/editService/constants.js +31 -0
- package/lib/components/booking/info/service/editService/index.js +7 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- 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 +138 -74
- package/lib/components/booking/info2/service/index.js +14 -10
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +32 -28
- package/lib/components/shoppingCart/components/Cart/index.js +18 -15
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +140 -122
- package/lib/components/ticketBooking/components/timeBar/index.js +98 -94
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/package.json +3 -3
- package/es/components/Sales/Cart/index.d.ts +0 -53
- package/es/components/booking/addons/index.d.ts +0 -17
- package/es/components/booking/components/actionButtons/index.d.ts +0 -29
- package/es/components/booking/components/clearCartModal/index.d.ts +0 -10
- package/es/components/booking/components/customiseItemModal/index.d.ts +0 -28
- package/es/components/booking/components/tabPane/index.d.ts +0 -4
- package/es/components/booking/components/voucher/index.d.ts +0 -3
- package/es/components/booking/dashboard/index.d.ts +0 -20
- package/es/components/booking/info/service/serviceItem/index.d.ts +0 -3
- package/es/components/booking/info2/cartClientCard/index.d.ts +0 -6
- package/es/components/booking/info2/cartClientCard/locales.d.ts +0 -21
- package/es/components/booking/info2/cartClientCard/types.d.ts +0 -13
- package/es/components/booking/info2/cartClientCard/utils.d.ts +0 -3
- package/es/components/booking/info2/service/editNormalService/index.d.ts +0 -3
- package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -3
- package/es/components/booking/locales.d.ts +0 -903
- package/es/components/booking/notes/addNote/index.d.ts +0 -3
- package/es/components/shoppingCart/type.d.ts +0 -49
- package/es/components/ticketBooking/components/addServiceVariant/utils.d.ts +0 -8
- package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -7
- package/es/components/ticketBooking/components/bookingDataPanel/bookingList/index.d.ts +0 -12
- package/es/components/ticketBooking/components/bookingDataPanel/bookingList/utils.d.ts +0 -6
- package/es/components/ticketBooking/components/bookingDataPanel/constants.d.ts +0 -22
- package/es/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -9
- package/es/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.d.ts +0 -14
- package/es/components/ticketBooking/components/bookingDataPanel/serve.d.ts +0 -0
- package/es/components/ticketBooking/components/floatButtons/index.d.ts +0 -11
- package/es/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +0 -1
- package/es/components/ticketBooking/hooks/pisellos/index.d.ts +0 -3
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +0 -25
- package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -12
- package/es/components/ticketBooking/hooks/pisellos/useScanGlobalHandle.d.ts +0 -2
- package/es/components/ticketBooking/locales.d.ts +0 -177
- package/es/components/ticketBooking/serve.d.ts +0 -287
- package/es/hooks/useToast.d.ts +0 -2
- package/es/hooks/useTranslationOriginal.d.ts +0 -1
- package/es/index.d.ts +0 -51
- package/es/plus/clientCard/index.d.ts +0 -7
- package/es/plus/clientCard/line/index.d.ts +0 -9
- package/es/plus/clientCard/locales.d.ts +0 -18
- package/es/plus/clientCard/types.d.ts +0 -126
- package/es/plus/clientCard/utils.d.ts +0 -8
- package/es/plus/clientName/index.d.ts +0 -5
- package/es/plus/clientName/type.d.ts +0 -13
- package/es/plus/clientName/utils.d.ts +0 -2
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -2
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +0 -2
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -2
- package/es/plus/clinetSearch/Add/PhoneField/serve.d.ts +0 -2
- package/es/plus/clinetSearch/Add/index.d.ts +0 -18
- package/es/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +0 -5
- package/es/plus/clinetSearch/InfiniteScroll/index.d.ts +0 -2
- package/es/plus/clinetSearch/InfiniteScroll/types.d.ts +0 -46
- package/es/plus/clinetSearch/index.d.ts +0 -18
- package/es/plus/clinetSearch/locales.d.ts +0 -102
- package/es/plus/clinetSearch/serve.d.ts +0 -1
- package/es/plus/clinetSearch/types.d.ts +0 -49
- package/es/plus/noteModal/AddTempModal.d.ts +0 -7
- package/es/plus/noteModal/index.d.ts +0 -4
- package/es/plus/noteModal/locales.d.ts +0 -33
- package/es/plus/noteModal/types.d.ts +0 -17
- package/es/pro/comprehensiveSearch/hooks/useNativeScanner.d.ts +0 -5
- package/es/pro/comprehensiveSearch/hooks/useTerminalPeripherals.d.ts +0 -9
- package/es/pro/comprehensiveSearch/index.d.ts +0 -9
- package/es/pro/comprehensiveSearch/locales.d.ts +0 -18
- package/es/pro/comprehensiveSearch/types.d.ts +0 -31
- package/es/pro/numberKeyboard/index.d.ts +0 -28
- package/es/pro/numberKeyboard/locales.d.ts +0 -12
- package/es/pro/pisellNumberSelector/example.d.ts +0 -3
- package/es/pro/pisellNumberSelector/index.d.ts +0 -26
- package/es/pro/pisellPhoneKeyboard/index.d.ts +0 -12
- package/es/pro/pisellPhoneKeyboard/locales.d.ts +0 -12
- package/es/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.d.ts +0 -5
- package/es/pro/pisellPriceKeyboardModal/index.d.ts +0 -2
- package/es/pro/pisellPriceKeyboardModal/types.d.ts +0 -25
- package/es/pro/pisellPriceRadio/index.d.ts +0 -26
- package/es/pro/skuDetailModal/index.d.ts +0 -5
- package/es/pro/skuDetailModal/locales.d.ts +0 -48
- package/es/pro/skuDetailModal/types.d.ts +0 -347
- package/lib/components/Sales/Cart/index.d.ts +0 -53
- package/lib/components/booking/addons/index.d.ts +0 -17
- package/lib/components/booking/components/actionButtons/index.d.ts +0 -29
- package/lib/components/booking/components/clearCartModal/index.d.ts +0 -10
- package/lib/components/booking/components/customiseItemModal/index.d.ts +0 -28
- package/lib/components/booking/components/tabPane/index.d.ts +0 -4
- package/lib/components/booking/components/voucher/index.d.ts +0 -3
- package/lib/components/booking/dashboard/index.d.ts +0 -20
- package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -3
- package/lib/components/booking/info2/cartClientCard/index.d.ts +0 -6
- package/lib/components/booking/info2/cartClientCard/locales.d.ts +0 -21
- package/lib/components/booking/info2/cartClientCard/types.d.ts +0 -13
- package/lib/components/booking/info2/cartClientCard/utils.d.ts +0 -3
- package/lib/components/booking/info2/service/editNormalService/index.d.ts +0 -3
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -3
- package/lib/components/booking/locales.d.ts +0 -903
- package/lib/components/booking/notes/addNote/index.d.ts +0 -3
- package/lib/components/shoppingCart/type.d.ts +0 -49
- package/lib/components/ticketBooking/components/addServiceVariant/utils.d.ts +0 -8
- package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -7
- package/lib/components/ticketBooking/components/bookingDataPanel/bookingList/index.d.ts +0 -12
- package/lib/components/ticketBooking/components/bookingDataPanel/bookingList/utils.d.ts +0 -6
- package/lib/components/ticketBooking/components/bookingDataPanel/constants.d.ts +0 -22
- package/lib/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -9
- package/lib/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.d.ts +0 -14
- package/lib/components/ticketBooking/components/bookingDataPanel/serve.d.ts +0 -0
- package/lib/components/ticketBooking/components/floatButtons/index.d.ts +0 -11
- package/lib/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +0 -1
- package/lib/components/ticketBooking/hooks/pisellos/index.d.ts +0 -3
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +0 -25
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -12
- package/lib/components/ticketBooking/hooks/pisellos/useScanGlobalHandle.d.ts +0 -2
- package/lib/components/ticketBooking/locales.d.ts +0 -177
- package/lib/components/ticketBooking/serve.d.ts +0 -287
- package/lib/hooks/useToast.d.ts +0 -2
- package/lib/hooks/useTranslationOriginal.d.ts +0 -1
- package/lib/index.d.ts +0 -51
- package/lib/plus/clientCard/index.d.ts +0 -7
- package/lib/plus/clientCard/line/index.d.ts +0 -9
- package/lib/plus/clientCard/locales.d.ts +0 -18
- package/lib/plus/clientCard/types.d.ts +0 -126
- package/lib/plus/clientCard/utils.d.ts +0 -8
- package/lib/plus/clientName/index.d.ts +0 -5
- package/lib/plus/clientName/type.d.ts +0 -13
- package/lib/plus/clientName/utils.d.ts +0 -2
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -2
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +0 -2
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -2
- package/lib/plus/clinetSearch/Add/PhoneField/serve.d.ts +0 -2
- package/lib/plus/clinetSearch/Add/index.d.ts +0 -18
- package/lib/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +0 -5
- package/lib/plus/clinetSearch/InfiniteScroll/index.d.ts +0 -2
- package/lib/plus/clinetSearch/InfiniteScroll/types.d.ts +0 -46
- package/lib/plus/clinetSearch/index.d.ts +0 -18
- package/lib/plus/clinetSearch/locales.d.ts +0 -102
- package/lib/plus/clinetSearch/serve.d.ts +0 -1
- package/lib/plus/clinetSearch/types.d.ts +0 -49
- package/lib/plus/noteModal/AddTempModal.d.ts +0 -7
- package/lib/plus/noteModal/index.d.ts +0 -4
- package/lib/plus/noteModal/locales.d.ts +0 -33
- package/lib/plus/noteModal/types.d.ts +0 -17
- package/lib/pro/comprehensiveSearch/hooks/useNativeScanner.d.ts +0 -5
- package/lib/pro/comprehensiveSearch/hooks/useTerminalPeripherals.d.ts +0 -9
- package/lib/pro/comprehensiveSearch/index.d.ts +0 -9
- package/lib/pro/comprehensiveSearch/locales.d.ts +0 -18
- package/lib/pro/comprehensiveSearch/types.d.ts +0 -31
- package/lib/pro/numberKeyboard/index.d.ts +0 -28
- package/lib/pro/numberKeyboard/locales.d.ts +0 -12
- package/lib/pro/pisellNumberSelector/example.d.ts +0 -3
- package/lib/pro/pisellNumberSelector/index.d.ts +0 -26
- package/lib/pro/pisellPhoneKeyboard/index.d.ts +0 -12
- package/lib/pro/pisellPhoneKeyboard/locales.d.ts +0 -12
- package/lib/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.d.ts +0 -5
- package/lib/pro/pisellPriceKeyboardModal/index.d.ts +0 -2
- package/lib/pro/pisellPriceKeyboardModal/types.d.ts +0 -25
- package/lib/pro/pisellPriceRadio/index.d.ts +0 -26
- package/lib/pro/skuDetailModal/index.d.ts +0 -5
- package/lib/pro/skuDetailModal/locales.d.ts +0 -48
- package/lib/pro/skuDetailModal/types.d.ts +0 -347
@@ -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,44 +446,30 @@ var Info = (_, ref) => {
|
|
428
446
|
}
|
429
447
|
return false;
|
430
448
|
}, [state.renderType, isNormalProduct]);
|
431
|
-
const SelectTime = (
|
449
|
+
const SelectTime = (_p = window.BaseMaterials) == null ? void 0 : _p.SelectTime;
|
432
450
|
const isNoSpecAndPackage = (0, import_utilsByBooking.getIsNoSpecAndPackage)(state.service.cacheItem);
|
433
|
-
|
434
|
-
|
435
|
-
{
|
436
|
-
titleNoWrap: true,
|
437
|
-
zIndex: state.service.changeService ? 999 : 1e3,
|
438
|
-
forceRender: true,
|
439
|
-
mask: state.drawerMask,
|
440
|
-
open: !isNoSpecAndPackage && state.service.editModal && !((_p = state.service.cacheItem) == null ? void 0 : _p.autoClose),
|
441
|
-
title: import_utils.locales.getText("pisell2.text.edit-service"),
|
442
|
-
onClose: () => {
|
443
|
-
dispatch({
|
444
|
-
type: "setService",
|
445
|
-
payload: {
|
446
|
-
editModal: false,
|
447
|
-
cacheItem: null,
|
448
|
-
changeService: false
|
449
|
-
}
|
450
|
-
});
|
451
|
-
}
|
452
|
-
},
|
453
|
-
/* @__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(
|
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(
|
454
454
|
import_collapsibleList.default,
|
455
455
|
{
|
456
456
|
style: { marginTop: bundles.length ? "8px" : 0 },
|
457
457
|
list: bundles,
|
458
458
|
renderItem: (item) => (0, import_utils2.renderBundles)(item, state.amountSymbol)
|
459
459
|
}
|
460
|
-
))))
|
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(
|
461
465
|
import_antd.Form.Item,
|
462
466
|
{
|
463
467
|
label: import_utils.locales.getText("pisell2.text.price"),
|
464
468
|
name: "total",
|
465
469
|
rules: [{ required: true }],
|
466
|
-
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")(
|
467
471
|
(0, import_utils.formatAmount)(
|
468
|
-
(
|
472
|
+
(_d2 = (_c2 = state.service.cacheItem) == null ? void 0 : _c2._extend) == null ? void 0 : _d2.origin_total,
|
469
473
|
2,
|
470
474
|
state.amountSymbol
|
471
475
|
),
|
@@ -481,18 +485,25 @@ var Info = (_, ref) => {
|
|
481
485
|
prefix: state.amountSymbol,
|
482
486
|
onChange: handleTotalChange,
|
483
487
|
disabled: state.channelDisabledEdit,
|
484
|
-
originValue: ((
|
485
|
-
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"
|
486
490
|
}
|
487
491
|
)
|
488
|
-
))
|
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(
|
489
496
|
import_antd.Form.Item,
|
490
497
|
{
|
491
498
|
label: import_utils.locales.getText("pisell2.text.discount-reason"),
|
492
499
|
name: "discount_reason"
|
493
500
|
},
|
494
501
|
/* @__PURE__ */ import_react.default.createElement(import_antd.Input.TextArea, { size: "large" })
|
495
|
-
)) : 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(
|
496
507
|
import_antd.Form.Item,
|
497
508
|
{
|
498
509
|
label: import_utils.locales.getText("pisell2.text.start_time"),
|
@@ -502,7 +513,7 @@ var Info = (_, ref) => {
|
|
502
513
|
SelectTime ? /* @__PURE__ */ import_react.default.createElement(
|
503
514
|
SelectTime,
|
504
515
|
{
|
505
|
-
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,
|
506
517
|
timePickerProps: {
|
507
518
|
style: { width: "100%" }
|
508
519
|
},
|
@@ -511,7 +522,11 @@ var Info = (_, ref) => {
|
|
511
522
|
}
|
512
523
|
}
|
513
524
|
) : null
|
514
|
-
))
|
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(
|
515
530
|
import_antd.Form.Item,
|
516
531
|
{
|
517
532
|
label: import_utils.locales.getText("pisell2.text.duration"),
|
@@ -519,23 +534,34 @@ var Info = (_, ref) => {
|
|
519
534
|
rules: [{ required: true }]
|
520
535
|
},
|
521
536
|
/* @__PURE__ */ import_react.default.createElement(import_duration.default, { ...durationProps, timeObj })
|
522
|
-
))
|
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(
|
523
542
|
import_Resources.default,
|
524
543
|
{
|
525
544
|
ref: resourcesRef,
|
526
545
|
state,
|
527
546
|
cacheItem: state.service.cacheItem,
|
528
|
-
getCurrentCacheItem
|
529
|
-
useDuration,
|
530
|
-
useStartTime
|
547
|
+
getCurrentCacheItem
|
531
548
|
}
|
532
|
-
))
|
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(
|
533
553
|
import_Capacity.default,
|
534
554
|
{
|
535
555
|
state,
|
536
556
|
cacheItem: state.service.cacheItem
|
537
557
|
}
|
538
|
-
))
|
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(
|
539
565
|
import_antd.Form.Item,
|
540
566
|
{
|
541
567
|
label: import_utils.locales.getText("pisell2.text.quantity"),
|
@@ -557,7 +583,11 @@ var Info = (_, ref) => {
|
|
557
583
|
}
|
558
584
|
}
|
559
585
|
)
|
560
|
-
))
|
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(
|
561
591
|
"div",
|
562
592
|
{
|
563
593
|
className: "pisell-lowcode__booking-service-delete-wrap",
|
@@ -569,13 +599,47 @@ var Info = (_, ref) => {
|
|
569
599
|
{
|
570
600
|
type: "primary",
|
571
601
|
className: "pisell-lowcode__booking-service-body-edit-footer-apple",
|
572
|
-
disabled: !isNormalProduct && !((
|
602
|
+
disabled: !isNormalProduct && !((_a2 = state.service.resourcesOrigin) == null ? void 0 : _a2.length),
|
573
603
|
onClick: () => {
|
574
604
|
form.submit();
|
575
605
|
}
|
576
606
|
},
|
577
607
|
import_utils.locales.getText("pisell2.text.apply")
|
578
|
-
))
|
608
|
+
));
|
609
|
+
}, [(_G = state.service.resourcesOrigin) == null ? void 0 : _G.length]);
|
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: !isNoSpecAndPackage && 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)
|
579
643
|
));
|
580
644
|
};
|
581
645
|
var editService_default = (0, import_react.forwardRef)(Info);
|
@@ -40,8 +40,8 @@ var import_service = require("../../info/service/index.less");
|
|
40
40
|
var import_addTimeModal = __toESM(require("./addTimeModal"));
|
41
41
|
var import_useInfoHolder = __toESM(require("../../info/hooks/useInfoHolder"));
|
42
42
|
var import_Lists = __toESM(require("../../info/service/Lists"));
|
43
|
-
var import_useQuotation = __toESM(require("../../hooks/useQuotation"));
|
44
43
|
var import_editNormalService = __toESM(require("./editNormalService"));
|
44
|
+
var import_useQuotation = __toESM(require("../../hooks/useQuotation"));
|
45
45
|
var Service = () => {
|
46
46
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
47
47
|
const {
|
@@ -56,14 +56,18 @@ var Service = () => {
|
|
56
56
|
document.body.id = "body";
|
57
57
|
}, []);
|
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" }, /* @__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), /* @__PURE__ */ import_react.default.createElement(import_editNormalService.default, { ref: editNormalServiceRef }), dom);
|
70
|
+
}, [dom, showAddTimeModal]);
|
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;
|
@@ -38,6 +38,7 @@ 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
40
|
var import_utils = require("../../../booking/info/service2/utils");
|
41
|
+
var import_ahooks = require("ahooks");
|
41
42
|
var Product = (props) => {
|
42
43
|
const { id, lists, isAdd = true } = props;
|
43
44
|
const { state, onAction, onChange } = (0, import_useContext.useContext)();
|
@@ -56,10 +57,10 @@ var Product = (props) => {
|
|
56
57
|
productCardStyleConfig = {}
|
57
58
|
} = state;
|
58
59
|
const clearCart = (0, import_useClearCart.default)(id);
|
59
|
-
const handleChange = (item, type, other) => {
|
60
|
+
const handleChange = (0, import_ahooks.useMemoizedFn)((item, type, other) => {
|
60
61
|
if (disabledEdit && !(other == null ? void 0 : other.disabled)) return;
|
61
62
|
onChange(item, type, other);
|
62
|
-
};
|
63
|
+
});
|
63
64
|
const productParams = (0, import_react.useMemo)(() => {
|
64
65
|
return {
|
65
66
|
isShowNote,
|
@@ -90,32 +91,35 @@ var Product = (props) => {
|
|
90
91
|
isShowDelete: conf == null ? void 0 : conf.show_remove_button
|
91
92
|
};
|
92
93
|
};
|
93
|
-
return
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
isRetail
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
Comp,
|
102
|
-
{
|
103
|
-
type: isRetail ? "a2" : void 0,
|
104
|
-
key: item._id,
|
105
|
-
dataSource: item,
|
106
|
-
onAction: (e) => onAction == null ? void 0 : onAction(e),
|
107
|
-
onDelete: (e) => handleChange(e, "delete", item),
|
108
|
-
onNote: (e) => handleChange(e, "note", { note: e.note }),
|
109
|
-
onLike: (e) => handleChange(e, "like", { like_status: e.like_status }),
|
110
|
-
onEditProduct: (e) => handleChange == null ? void 0 : handleChange(e, "edit_product"),
|
111
|
-
onCard: (e) => handleChange == null ? void 0 : handleChange(e, "view"),
|
112
|
-
onChangeResource: (e) => handleChange(item, "change_resource", e),
|
113
|
-
onChangeHolder: (e) => handleChange(item, "change_holder", e),
|
114
|
-
onAddHolder: (e) => handleChange(item, "add_holder", e),
|
115
|
-
...productParams,
|
116
|
-
...getProductCardStyleProps(isRetail ? "retail" : "appointment")
|
94
|
+
return (0, import_react.useMemo)(() => {
|
95
|
+
console.log("render cart");
|
96
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__shopping-cart-content" }, clearCart, lists == null ? void 0 : lists.map((item) => {
|
97
|
+
let Comp = import_materials.ProductCard;
|
98
|
+
let isRetail;
|
99
|
+
if (state.scenario === "booking2") {
|
100
|
+
isRetail = (0, import_utils.isNormalProductByDurationSchedule)(item == null ? void 0 : item._origin);
|
101
|
+
Comp = isRetail ? import_materials.ProductCard.V2 : import_materials.ProductCard;
|
117
102
|
}
|
118
|
-
|
119
|
-
|
103
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
104
|
+
Comp,
|
105
|
+
{
|
106
|
+
type: isRetail ? "a2" : void 0,
|
107
|
+
key: item._id,
|
108
|
+
dataSource: item,
|
109
|
+
onAction: (e) => onAction == null ? void 0 : onAction(e),
|
110
|
+
onDelete: (e) => handleChange(e, "delete", item),
|
111
|
+
onNote: (e) => handleChange(e, "note", { note: e.note }),
|
112
|
+
onLike: (e) => handleChange(e, "like", { like_status: e.like_status }),
|
113
|
+
onEditProduct: (e) => handleChange == null ? void 0 : handleChange(e, "edit_product"),
|
114
|
+
onCard: (e) => handleChange == null ? void 0 : handleChange(e, "view"),
|
115
|
+
onChangeResource: (e) => handleChange(item, "change_resource", e),
|
116
|
+
onChangeHolder: (e) => handleChange(item, "change_holder", e),
|
117
|
+
onAddHolder: (e) => handleChange(item, "add_holder", e),
|
118
|
+
...productParams,
|
119
|
+
...getProductCardStyleProps(isRetail ? "retail" : "appointment")
|
120
|
+
}
|
121
|
+
);
|
122
|
+
}), !hideAddBtn && platform !== "h5" && isAdd ? (0, import_useAddService.default)(id, "more") : null);
|
123
|
+
}, [clearCart, lists, productParams, hideAddBtn, isAdd, platform]);
|
120
124
|
};
|
121
125
|
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;
|