@pisell/private-materials 3.4.8 → 3.4.10
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 +4 -4
- package/build/lowcode/view.js +4 -4
- package/es/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/forms/single/RenderValueById.js +2 -2
- 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.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.js +16 -9
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/Lists.js +36 -26
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.js +20 -21
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/index.js +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.js +8 -4
- 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/info2/utilsByBooking.js +3 -2
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.js +2 -2
- package/es/components/booking/utils.js +3 -3
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- 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/forms/single/RenderValueById.js +6 -6
- 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.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.js +10 -9
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.js +35 -23
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.js +17 -17
- package/lib/components/booking/info/utils.js +2 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.js +7 -5
- 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/info2/utilsByBooking.js +4 -4
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.js +1 -1
- package/lib/components/booking/utils.js +3 -3
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- 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
|
@@ -328,7 +328,7 @@ export var getServiceStartTimeAndEndTime = function getServiceStartTimeAndEndTim
|
|
|
328
328
|
// 下一个商品的扩展参数
|
|
329
329
|
var _extend = {
|
|
330
330
|
// 时长: 当前商品时长 > 第一个时长
|
|
331
|
-
duration: findNextDuration(cacheItem.duration, timeObj.durationSlicesBasedOnTime, cacheItem === null || cacheItem === void 0 || (_cacheItem$duration = cacheItem.duration) === null || _cacheItem$duration === void 0 ? void 0 : _cacheItem$duration.value)
|
|
331
|
+
duration: findNextDuration(cacheItem.duration, timeObj === null || timeObj === void 0 ? void 0 : timeObj.durationSlicesBasedOnTime, cacheItem === null || cacheItem === void 0 || (_cacheItem$duration = cacheItem.duration) === null || _cacheItem$duration === void 0 ? void 0 : _cacheItem$duration.value)
|
|
332
332
|
};
|
|
333
333
|
|
|
334
334
|
// 如果有上一个商品, 将上一个商品的某些参数 设置到新商品上
|
|
@@ -342,7 +342,8 @@ export var getServiceStartTimeAndEndTime = function getServiceStartTimeAndEndTim
|
|
|
342
342
|
} else {
|
|
343
343
|
// 如果上个服务商品的结束时间跨天, 那么设置为最后一个时间段, 不跨天则取上一个的结束时间
|
|
344
344
|
if (dayjs(lastServerEndDate).isAfter(lastServerStartDate, "day")) {
|
|
345
|
-
|
|
345
|
+
var _timeObj$timeSlices;
|
|
346
|
+
_extend.start_time = timeObj === null || timeObj === void 0 ? void 0 : timeObj.timeSlices[(timeObj === null || timeObj === void 0 || (_timeObj$timeSlices = timeObj.timeSlices) === null || _timeObj$timeSlices === void 0 ? void 0 : _timeObj$timeSlices.length) - 1].value;
|
|
346
347
|
} else {
|
|
347
348
|
_extend.start_time = lastServerEndDate.format("HH:mm");
|
|
348
349
|
}
|
|
@@ -20,6 +20,9 @@ var Duration = function Duration(props) {
|
|
|
20
20
|
startDate = props.startDate,
|
|
21
21
|
timeObj = props.timeObj,
|
|
22
22
|
resetProps = _objectWithoutProperties(props, _excluded);
|
|
23
|
+
var startDateStr = useMemo(function () {
|
|
24
|
+
return dayjs(startDate).format('YYYY-MM-DD HH:mm:ss');
|
|
25
|
+
}, [startDate]);
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
28
|
* @title: 时间切片
|
|
@@ -57,7 +60,7 @@ var Duration = function Duration(props) {
|
|
|
57
60
|
});
|
|
58
61
|
}
|
|
59
62
|
return durationSlicesBasedOnTime;
|
|
60
|
-
}, [timeObj, slice, locale, duration,
|
|
63
|
+
}, [timeObj === null || timeObj === void 0 ? void 0 : timeObj.durationSlicesBasedOnTime, slice, locale, duration, startDateStr, usableTime === null || usableTime === void 0 ? void 0 : usableTime.end_at]);
|
|
61
64
|
useEffect(function () {
|
|
62
65
|
timeObjChange === null || timeObjChange === void 0 || timeObjChange(times);
|
|
63
66
|
}, [times]);
|
|
@@ -72,6 +75,10 @@ var Duration = function Duration(props) {
|
|
|
72
75
|
}, d[label]);
|
|
73
76
|
});
|
|
74
77
|
}, []);
|
|
75
|
-
|
|
78
|
+
var options = useMemo(function () {
|
|
79
|
+
console.log('render form options');
|
|
80
|
+
return renderOptions(times);
|
|
81
|
+
}, [times]);
|
|
82
|
+
return /*#__PURE__*/React.createElement(Select, _extends({}, selectProps, resetProps), options);
|
|
76
83
|
};
|
|
77
84
|
export default Duration;
|
|
@@ -25,7 +25,7 @@ var StartTime = function StartTime(props) {
|
|
|
25
25
|
return sliceDayIntoFiveMinutes(slice, locale);
|
|
26
26
|
}, [slice, locale]);
|
|
27
27
|
useEffect(function () {
|
|
28
|
-
timeObjChange === null || timeObjChange === void 0
|
|
28
|
+
timeObjChange === null || timeObjChange === void 0 || timeObjChange(timeObj);
|
|
29
29
|
}, [timeObj]);
|
|
30
30
|
var renderOptions = useCallback(function (array) {
|
|
31
31
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "value";
|
|
@@ -37,6 +37,6 @@ var StartTime = function StartTime(props) {
|
|
|
37
37
|
}, d[label]);
|
|
38
38
|
});
|
|
39
39
|
}, []);
|
|
40
|
-
return /*#__PURE__*/React.createElement(Select, _extends({}, selectProps, resetProps), renderOptions(timeObj.timeSlices));
|
|
40
|
+
return /*#__PURE__*/React.createElement(Select, _extends({}, selectProps, resetProps), renderOptions(timeObj === null || timeObj === void 0 ? void 0 : timeObj.timeSlices));
|
|
41
41
|
};
|
|
42
42
|
export default StartTime;
|
|
@@ -670,7 +670,7 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
|
|
|
670
670
|
if (isSession) {
|
|
671
671
|
return getDays(cacheItem, 'minutes');
|
|
672
672
|
}
|
|
673
|
-
return findNextDuration(cacheItem.duration, timeObj.durationSlicesBasedOnTime, cacheItem === null || cacheItem === void 0 || (_cacheItem$duration = cacheItem.duration) === null || _cacheItem$duration === void 0 ? void 0 : _cacheItem$duration.value);
|
|
673
|
+
return findNextDuration(cacheItem.duration, timeObj === null || timeObj === void 0 ? void 0 : timeObj.durationSlicesBasedOnTime, cacheItem === null || cacheItem === void 0 || (_cacheItem$duration = cacheItem.duration) === null || _cacheItem$duration === void 0 ? void 0 : _cacheItem$duration.value);
|
|
674
674
|
};
|
|
675
675
|
|
|
676
676
|
// 获取上一个服务商品
|
|
@@ -694,7 +694,7 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
|
|
|
694
694
|
} else {
|
|
695
695
|
// 如果上个服务商品的结束时间跨天, 那么设置为最后一个时间段, 不跨天则取上一个的结束时间
|
|
696
696
|
if (dayjs(lastServerEndDate).isAfter(lastServerStartDate, 'day')) {
|
|
697
|
-
_extend.start_time = timeObj.timeSlices[timeObj.timeSlices.length - 1].value;
|
|
697
|
+
_extend.start_time = timeObj === null || timeObj === void 0 ? void 0 : timeObj.timeSlices[(timeObj === null || timeObj === void 0 ? void 0 : timeObj.timeSlices.length) - 1].value;
|
|
698
698
|
} else {
|
|
699
699
|
_extend.start_time = lastServerEndDate.format("HH:mm");
|
|
700
700
|
}
|
|
@@ -704,7 +704,7 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
|
|
|
704
704
|
// _extend.resource = 0;
|
|
705
705
|
|
|
706
706
|
var findNextSliceProps = {
|
|
707
|
-
timeSlices: timeObj.timeSlices,
|
|
707
|
+
timeSlices: timeObj === null || timeObj === void 0 ? void 0 : timeObj.timeSlices,
|
|
708
708
|
index: 0,
|
|
709
709
|
date: ''
|
|
710
710
|
};
|
|
@@ -5,6 +5,7 @@ import { ProductCard } from '@pisell/materials';
|
|
|
5
5
|
import useClearCart from "../../hooks/useClearCart";
|
|
6
6
|
import { useContext } from "../../hooks/useContext";
|
|
7
7
|
import useAddService from "../../hooks/useAddService";
|
|
8
|
+
import { useMemoizedFn, useTrackedEffect } from "ahooks";
|
|
8
9
|
var Product = function Product(props) {
|
|
9
10
|
var id = props.id,
|
|
10
11
|
lists = props.lists,
|
|
@@ -35,10 +36,10 @@ var Product = function Product(props) {
|
|
|
35
36
|
* @Author: WangHan
|
|
36
37
|
* @Date: 2024-11-28 22:02
|
|
37
38
|
*/
|
|
38
|
-
var handleChange = function
|
|
39
|
+
var handleChange = useMemoizedFn(function (item, type, other) {
|
|
39
40
|
if (disabledEdit && !(other !== null && other !== void 0 && other.disabled)) return;
|
|
40
41
|
onChange(item, type, other);
|
|
41
|
-
};
|
|
42
|
+
});
|
|
42
43
|
var productParams = useMemo(function () {
|
|
43
44
|
return {
|
|
44
45
|
isShowNote: isShowNote,
|
|
@@ -52,44 +53,50 @@ var Product = function Product(props) {
|
|
|
52
53
|
isShowEditProduct: isShowEditProduct
|
|
53
54
|
};
|
|
54
55
|
}, [isShowNote, isShowPackageNote, disabledEdit, isShowChangeResource, isShowDelete, isShowHolder, isShowAddHolderButton, isShowChangeHolder, isShowEditProduct]);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, clearCart, lists
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
56
|
+
useTrackedEffect(function (changes) {
|
|
57
|
+
console.log('Index of changed dependencies: ', changes);
|
|
58
|
+
}, [clearCart, lists, productParams, hideAddBtn, isAdd, platform]);
|
|
59
|
+
return useMemo(function () {
|
|
60
|
+
console.log('render cart');
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: "pisell-lowcode__shopping-cart-content"
|
|
63
|
+
}, clearCart, lists === null || lists === void 0 ? void 0 : lists.map(function (item) {
|
|
64
|
+
return /*#__PURE__*/React.createElement(ProductCard, _extends({
|
|
65
|
+
key: item._id,
|
|
66
|
+
dataSource: item,
|
|
67
|
+
onAction: function onAction(e) {
|
|
68
|
+
return _onAction === null || _onAction === void 0 ? void 0 : _onAction(e);
|
|
69
|
+
},
|
|
70
|
+
onDelete: function onDelete(e) {
|
|
71
|
+
return handleChange(e, 'delete', item);
|
|
72
|
+
},
|
|
73
|
+
onNote: function onNote(e) {
|
|
74
|
+
return handleChange(e, 'note', {
|
|
75
|
+
note: e.note
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
onLike: function onLike(e) {
|
|
79
|
+
return handleChange(e, 'like', {
|
|
80
|
+
like_status: e.like_status
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
onEditProduct: function onEditProduct(e) {
|
|
84
|
+
return handleChange === null || handleChange === void 0 ? void 0 : handleChange(e, 'edit_product');
|
|
85
|
+
},
|
|
86
|
+
onCard: function onCard(e) {
|
|
87
|
+
return handleChange === null || handleChange === void 0 ? void 0 : handleChange(e, 'view');
|
|
88
|
+
},
|
|
89
|
+
onChangeResource: function onChangeResource(e) {
|
|
90
|
+
return handleChange(item, 'change_resource', e);
|
|
91
|
+
},
|
|
92
|
+
onChangeHolder: function onChangeHolder(e) {
|
|
93
|
+
return handleChange(item, 'change_holder', e);
|
|
94
|
+
},
|
|
95
|
+
onAddHolder: function onAddHolder(e) {
|
|
96
|
+
return handleChange(item, 'add_holder', e);
|
|
97
|
+
}
|
|
98
|
+
}, productParams));
|
|
99
|
+
}), !hideAddBtn && platform !== 'h5' && isAdd ? useAddService(id, 'more') : null);
|
|
100
|
+
}, [clearCart, lists, productParams, hideAddBtn, isAdd, platform]);
|
|
94
101
|
};
|
|
95
102
|
export default Product;
|
|
@@ -51,23 +51,26 @@ var Cart = function Cart() {
|
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
}, [carts, platform]);
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
return useMemo(function () {
|
|
55
|
+
console.log('render cart 22222');
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: classNames('pisell-lowcode__shopping-cart')
|
|
58
|
+
}, isProductList ? /*#__PURE__*/React.createElement(Product, {
|
|
59
|
+
id: undefined,
|
|
60
|
+
lists: state === null || state === void 0 ? void 0 : state.products
|
|
61
|
+
}) : /*#__PURE__*/React.createElement(Collapse, _extends({
|
|
62
|
+
items: cartsMap,
|
|
63
|
+
showHeader: true,
|
|
64
|
+
panelBackground: "#ffffff",
|
|
65
|
+
collapsible: platform !== 'shop' ? 'disabled' : '-',
|
|
66
|
+
accordion: platform === 'shop',
|
|
67
|
+
onChange: function onChange(key) {
|
|
68
|
+
updateState({
|
|
69
|
+
activeKey: key
|
|
70
|
+
});
|
|
71
|
+
onActiveKey(key);
|
|
72
|
+
}
|
|
73
|
+
}, collapseParams)));
|
|
74
|
+
}, [isProductList, cartsMap, platform, collapseParams, state === null || state === void 0 ? void 0 : state.products]);
|
|
72
75
|
};
|
|
73
76
|
export default Cart;
|