@pisell/private-materials 3.0.74 → 3.0.75

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.
Files changed (30) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/preview.js +4 -4
  6. package/build/lowcode/render/default/view.css +1 -1
  7. package/build/lowcode/render/default/view.js +3 -3
  8. package/build/lowcode/view.css +1 -1
  9. package/build/lowcode/view.js +6 -6
  10. package/es/components/booking/components/drawer/index.d.ts +1 -0
  11. package/es/components/booking/components/drawer/index.js +5 -0
  12. package/es/components/booking/components/drawer/index.less +10 -3
  13. package/es/components/booking/info/service/actions/index.js +1 -1
  14. package/es/components/booking/info/service/addTimeModal/index.js +168 -129
  15. package/es/components/booking/info/service/addTimeModal/index.less +15 -10
  16. package/es/components/booking/info/service/addTimeModal/utils.d.ts +31 -12
  17. package/es/components/booking/info/service/addTimeModal/utils.js +108 -30
  18. package/es/components/booking/locales.d.ts +3 -0
  19. package/es/components/booking/locales.js +5 -2
  20. package/lib/components/booking/components/drawer/index.d.ts +1 -0
  21. package/lib/components/booking/components/drawer/index.js +4 -0
  22. package/lib/components/booking/components/drawer/index.less +10 -3
  23. package/lib/components/booking/info/service/actions/index.js +1 -1
  24. package/lib/components/booking/info/service/addTimeModal/index.js +96 -109
  25. package/lib/components/booking/info/service/addTimeModal/index.less +15 -10
  26. package/lib/components/booking/info/service/addTimeModal/utils.d.ts +31 -12
  27. package/lib/components/booking/info/service/addTimeModal/utils.js +64 -38
  28. package/lib/components/booking/locales.d.ts +3 -0
  29. package/lib/components/booking/locales.js +5 -2
  30. package/package.json +3 -3
@@ -4,6 +4,7 @@ import "./index.less";
4
4
  export interface PisellDrawerProps extends DrawerProps {
5
5
  header?: React.ReactNode;
6
6
  titleNoWrap?: boolean;
7
+ hideScrollBar?: boolean;
7
8
  }
8
9
  /**
9
10
  * @title: 自定义抽屉
@@ -13,11 +13,16 @@ import classNames from "classnames";
13
13
  * @Date: 2024-01-30 16:51
14
14
  */
15
15
  var Drawer = function Drawer(props) {
16
+ var _props$hideScrollBar = props.hideScrollBar,
17
+ hideScrollBar = _props$hideScrollBar === void 0 ? true : _props$hideScrollBar;
16
18
  return /*#__PURE__*/React.createElement(OriginDrawer, _extends({
17
19
  width: "600px",
18
20
  closable: false,
19
21
  zIndex: 999
20
22
  }, props, {
23
+ className: classNames("pisell-lowcode__booking-drawer", props.className, {
24
+ "pisell-lowcode__booking-drawer-hide-scrollbar": hideScrollBar
25
+ }),
21
26
  title: false,
22
27
  bodyStyle: {
23
28
  padding: 0
@@ -28,12 +28,19 @@
28
28
  }
29
29
  }
30
30
 
31
- .pisell-lowcode-drawer-body {
32
- &::-webkit-scrollbar {
33
- display: block;
31
+
32
+ .pisell-lowcode__booking-drawer-hide-scrollbar {
33
+ &.pisell-lowcode-drawer-body {
34
+
35
+ &::-webkit-scrollbar {
36
+ display: none;
37
+ }
38
+
34
39
  }
35
40
  }
36
41
 
42
+
43
+
37
44
  .pisell-lowcode__booking-drawer-title-no-wrap {
38
45
  display: inline;
39
46
  }
@@ -28,7 +28,7 @@ var Actions = function Actions(_ref) {
28
28
  };
29
29
  var addTimeProducts = useMemo(function () {
30
30
  return (state.addTimeProducts || []).some(function (item) {
31
- return isUsableProduct(item.add_time.relation_product, currentService);
31
+ return isUsableProduct(item.add_time, currentService);
32
32
  });
33
33
  }, [state.addTimeProducts, currentService]);
34
34
  var showAddTimeButton = useMemo(function () {
@@ -16,14 +16,15 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
  import React, { useContext, useEffect, useMemo, useState, useRef } from "react";
17
17
  import Drawer from "../../../components/drawer";
18
18
  import { Context } from "../../model";
19
- import { Select, Button, Skeleton, message, Alert } from "antd";
19
+ import { Button, Skeleton, message, Alert } from "antd";
20
20
  import "./index.less";
21
21
  import { locales, formatAmount, createArray, formatDate } from "@pisell/utils";
22
22
  import { useUpdateEffect, useDebounceFn } from "ahooks";
23
23
  import Footer from "../../../components/footer";
24
24
  import { saveAddTimeProduct, getAddTimeProducts } from "./serve";
25
- import { getAddTimeSplits, isUsableProduct } from "./utils";
25
+ import { getAddTimeSplits, isUsableProduct, addTimeRowKey } from "./utils";
26
26
  import classNames from "classnames";
27
+ import dayjs from "dayjs";
27
28
  import BrowserSelect from "../../../components/browserSelect";
28
29
  import { isNowTime, getNowTime, getDiscountTime, getResourceTimeIsUsable, flexibleObj, isWalkIn } from "../../../utils";
29
30
  import useEngineContext from "../../../../../hooks/useEngineContext";
@@ -49,28 +50,23 @@ var AddTimeModal = function AddTimeModal() {
49
50
  _useState4 = _slicedToArray(_useState3, 2),
50
51
  loading = _useState4[0],
51
52
  setLoading = _useState4[1];
52
- var _useState5 = useState(null),
53
+ // id_time
54
+ var _useState5 = useState(""),
53
55
  _useState6 = _slicedToArray(_useState5, 2),
54
- currentProductId = _useState6[0],
55
- setCurrentProductId = _useState6[1];
56
- var _useState7 = useState(null),
56
+ recordKey = _useState6[0],
57
+ setRecordKey = _useState6[1];
58
+ var _useState7 = useState(1),
57
59
  _useState8 = _slicedToArray(_useState7, 2),
58
- currentTime = _useState8[0],
59
- setCurrentTime = _useState8[1];
60
- var _useState9 = useState(1),
61
- _useState10 = _slicedToArray(_useState9, 2),
62
- number = _useState10[0],
63
- setNumber = _useState10[1];
60
+ number = _useState8[0],
61
+ setNumber = _useState8[1];
64
62
  var originServices = useRef([]);
65
- var _useState11 = useState([]),
66
- _useState12 = _slicedToArray(_useState11, 2),
67
- renderList = _useState12[0],
68
- setRenderList = _useState12[1];
63
+ var _useState9 = useState([]),
64
+ _useState10 = _slicedToArray(_useState9, 2),
65
+ renderList = _useState10[0],
66
+ setRenderList = _useState10[1];
69
67
  var context = useEngineContext();
70
68
  var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
71
- isTerminal = _context$appHelper$ut.isTerminal,
72
- interaction = _context$appHelper$ut.interaction,
73
- store = _context$appHelper$ut.store;
69
+ interaction = _context$appHelper$ut.interaction;
74
70
  var statusMap = {
75
71
  available: {
76
72
  label: locales.getText("page.booking.text.available"),
@@ -85,11 +81,15 @@ var AddTimeModal = function AddTimeModal() {
85
81
  color: "#98A2B3"
86
82
  }
87
83
  };
84
+
85
+ // 防抖计算新的服务
88
86
  var updateServices = useDebounceFn(function () {
89
87
  createNewServices();
90
88
  }, {
91
89
  wait: 200
92
90
  });
91
+
92
+ // board配置
93
93
  var transaction_habit_selection = useMemo(function () {
94
94
  var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2;
95
95
  return (state === null || state === void 0 ? void 0 : (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 ? void 0 : (_state$bookingConfig$ = _state$bookingConfig.config) === null || _state$bookingConfig$ === void 0 ? void 0 : (_state$bookingConfig$2 = _state$bookingConfig$.information_tab) === null || _state$bookingConfig$2 === void 0 ? void 0 : _state$bookingConfig$2.transaction_habit_selection) || {
@@ -97,28 +97,34 @@ var AddTimeModal = function AddTimeModal() {
97
97
  button_rows: 1
98
98
  };
99
99
  }, [state === null || state === void 0 ? void 0 : (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 ? void 0 : (_state$bookingConfig3 = _state$bookingConfig2.config) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.information_tab]);
100
- var addTimeProducts = useMemo(function () {
101
- return (renderList || []).map(function (d) {
102
- return {
103
- label: d.title,
104
- value: d.id
105
- };
106
- });
107
- }, [renderList, state.service.cacheItem]);
100
+
101
+ // 当前商品id
102
+ var currentProductId = useMemo(function () {
103
+ return addTimeRowKey.getValue(recordKey).product_id;
104
+ }, [recordKey]);
105
+
106
+ // 当前time
107
+ var currentTime = useMemo(function () {
108
+ var _time = addTimeRowKey.getValue(recordKey).time || "";
109
+ return _time;
110
+ }, [recordKey]);
111
+
112
+ // 当前商品
108
113
  var currentProduct = useMemo(function () {
109
114
  return (renderList || []).find(function (d) {
110
- return d.id === currentProductId;
115
+ return d.id == currentProductId;
111
116
  });
112
117
  }, [renderList, currentProductId]);
118
+ var currentTimeItem = useMemo(function () {
119
+ var _currentProduct$times;
120
+ return (currentProduct === null || currentProduct === void 0 ? void 0 : (_currentProduct$times = currentProduct.times) === null || _currentProduct$times === void 0 ? void 0 : _currentProduct$times.find(function (d) {
121
+ return d.value == currentTime;
122
+ })) || {
123
+ price: 0
124
+ };
125
+ }, [currentTime, currentProduct]);
113
126
 
114
- /**
115
- * @title: 当前的资源
116
- * @description:
117
- * @param {*} useMemo
118
- * @return {*}
119
- * @Author: zhiwei.Wang
120
- * @Date: 2024-01-09 14:06
121
- */
127
+ // 当前的资源
122
128
  var currentResource = useMemo(function () {
123
129
  var _state$service;
124
130
  var list = ((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.resourcesOrigin) || [];
@@ -128,9 +134,25 @@ var AddTimeModal = function AddTimeModal() {
128
134
  });
129
135
  return item;
130
136
  }, [state.service.cacheItem, state.service.resourcesOrigin]);
137
+ var currentResourceTimeEndDate = useMemo(function () {
138
+ try {
139
+ var _state$service$cacheI3;
140
+ if (!currentResource || !((_state$service$cacheI3 = state.service.cacheItem) !== null && _state$service$cacheI3 !== void 0 && _state$service$cacheI3._extend)) {
141
+ return "";
142
+ }
143
+ var timeItem = currentResource === null || currentResource === void 0 ? void 0 : currentResource.times.find(function (_time) {
144
+ return _time.item_id === state.service.cacheItem._extend.relation_id;
145
+ });
146
+ var timeEndDate = dayjs(timeItem.end_date + " " + timeItem.end_time).add(1, "second");
147
+ return timeEndDate;
148
+ } catch (err) {
149
+ console.log("err", err);
150
+ }
151
+ return "";
152
+ }, [state.service.cacheItem, currentResource]);
131
153
  var getTimeUsableStatus = function getTimeUsableStatus(time) {
132
- var _state$service$cacheI3;
133
- if (!((_state$service$cacheI3 = state.service.cacheItem) !== null && _state$service$cacheI3 !== void 0 && _state$service$cacheI3._extend) || !currentResource) {
154
+ var _state$service$cacheI4;
155
+ if (!((_state$service$cacheI4 = state.service.cacheItem) !== null && _state$service$cacheI4 !== void 0 && _state$service$cacheI4._extend) || !currentResource) {
134
156
  return {
135
157
  status: statusMap.unavailable
136
158
  };
@@ -168,8 +190,9 @@ var AddTimeModal = function AddTimeModal() {
168
190
  }));
169
191
  if (!((_res$_extend = res._extend) !== null && _res$_extend !== void 0 && _res$_extend.isUsable)) {
170
192
  return {
193
+ // maxEndTime:
171
194
  status: statusMap.unavailable,
172
- message: locales.getText("pisell1.text.resource-error-message-2")(currentResource.room_name || currentResource.name, startText, endText)
195
+ message: "".concat(currentResource.room_name || currentResource.name, " ").concat(locales.getText("pisell2.text.status.service-error-2"))
173
196
  };
174
197
  }
175
198
  } catch (err) {}
@@ -177,37 +200,46 @@ var AddTimeModal = function AddTimeModal() {
177
200
  status: statusMap.available
178
201
  };
179
202
  };
180
- var times = useMemo(function () {
181
- var config = (currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.add_time) || {
182
- calculate_type: "select_quantity",
183
- // 最大时长
184
- max_add_time: 30,
185
- // 最小时长
186
- min_add_time: 30,
187
- // 关联产品
188
- relation_product: {
189
- type: "product_all",
190
- products: []
191
- },
192
- // 单位切片
193
- unit_duration: 30
194
- };
195
- return getAddTimeSplits(config, (currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.price) || 0).map(function (d) {
196
- return _objectSpread(_objectSpread({}, d), {}, {
197
- status: getTimeUsableStatus(d.value)
198
- });
199
- });
200
- }, [currentProduct]);
201
- useEffect(function () {
202
- if (state.service.addTimeModal && state.service.cacheItem && currentProduct && times.length) {
203
- if (!currentTime) {
204
- setCurrentTime(times[0].value);
205
- setNumber(1);
206
- setIsEdit(true);
207
- updateServices.run();
208
- }
209
- }
210
- }, [times, currentTime, state.service.addTimeModal, state.service.cacheItem, currentProduct]);
203
+
204
+ // let config = currentProduct?.add_time || {
205
+ // calculate_type: "select_quantity",
206
+ // // 最大时长
207
+ // max_add_time: 30,
208
+ // // 最小时长
209
+ // min_add_time: 30,
210
+ // // 关联产品
211
+ // relation_product: { type: "product_all", products: [] },
212
+ // // 单位切片
213
+ // unit_duration: 30,
214
+ // };
215
+ // return getAddTimeSplits(config, currentProduct?.price || 0).map((d) => {
216
+ // return {
217
+ // ...d,
218
+ // status: getTimeUsableStatus(d.value),
219
+ // };
220
+ // });
221
+ // }, [currentProduct]);
222
+ // useEffect(() => {
223
+ // if (
224
+ // state.service.addTimeModal &&
225
+ // state.service.cacheItem &&
226
+ // currentProduct
227
+ // ) {
228
+ // if (!currentTime) {
229
+ // setCurrentTime(currentProduct?.times?.[0]?.value);
230
+ // setNumber(1);
231
+ // setIsEdit(true);
232
+ // updateServices.run();
233
+ // }
234
+ // }
235
+ // }, [
236
+ // currentTime,
237
+ // state.service.addTimeModal,
238
+ // state.service.cacheItem,
239
+ // currentProduct,
240
+ // ]);
241
+
242
+ // 获取加时商品api
211
243
  var _getAddTimeProducts = /*#__PURE__*/function () {
212
244
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
213
245
  var _state$client, _state$client$value, _state$client2, _state$client2$value;
@@ -239,6 +271,8 @@ var AddTimeModal = function AddTimeModal() {
239
271
  return _ref.apply(this, arguments);
240
272
  };
241
273
  }();
274
+
275
+ // 格式化加时商品
242
276
  var getTimeProducts = /*#__PURE__*/function () {
243
277
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
244
278
  var newList, list;
@@ -251,12 +285,19 @@ var AddTimeModal = function AddTimeModal() {
251
285
  case 3:
252
286
  newList = _context2.sent;
253
287
  list = newList.map(function (d) {
254
- var isUsable = isUsableProduct(d.add_time.relation_product, state.service.cacheItem);
288
+ // 是否可用
289
+ var isUsable = isUsableProduct(d.add_time, state.service.cacheItem);
255
290
  return _objectSpread(_objectSpread({}, d), {}, {
256
- usable: isUsable
291
+ usable: isUsable,
292
+ // 可用的商品生成加时列表
293
+ times: isUsable ? getAddTimeSplits(d, state.service.cacheItem, currentResourceTimeEndDate).map(function (time) {
294
+ return _objectSpread(_objectSpread({}, time), {}, {
295
+ status: getTimeUsableStatus(time.value)
296
+ });
297
+ }) : undefined
257
298
  });
258
299
  }).filter(function (d) {
259
- return d.usable;
300
+ return d.usable && d.times.length;
260
301
  }).sort(function (a, b) {
261
302
  return b.sort - a.sort;
262
303
  });
@@ -265,7 +306,8 @@ var AddTimeModal = function AddTimeModal() {
265
306
  setDefaultProduct(list);
266
307
  }
267
308
  setLoading("");
268
- case 8:
309
+ setIsEdit(true);
310
+ case 9:
269
311
  case "end":
270
312
  return _context2.stop();
271
313
  }
@@ -275,9 +317,17 @@ var AddTimeModal = function AddTimeModal() {
275
317
  return _ref2.apply(this, arguments);
276
318
  };
277
319
  }();
320
+
321
+ // 设置默认商品
278
322
  var setDefaultProduct = function setDefaultProduct(list) {
279
- setCurrentProductId(list[0].id);
323
+ try {
324
+ var productId = list[0].id;
325
+ var time = list[0].times[0].value;
326
+ setRecordKey(addTimeRowKey.create(productId, time));
327
+ } catch (err) {}
280
328
  };
329
+
330
+ // 打开弹窗时获取数据
281
331
  useUpdateEffect(function () {
282
332
  if (state.service.addTimeModal) {
283
333
  getTimeProducts();
@@ -286,20 +336,17 @@ var AddTimeModal = function AddTimeModal() {
286
336
  updateServices.run();
287
337
  }
288
338
  }, [state.service.addTimeModal]);
289
- var onSelectItem = function onSelectItem(item) {
290
- setCurrentTime(item === null || item === void 0 ? void 0 : item.value);
339
+
340
+ // 选择
341
+ var onSelectItem = function onSelectItem(pItem, item) {
342
+ setRecordKey(addTimeRowKey.create(pItem.id, item.value));
291
343
  setIsEdit(true);
292
344
  updateServices.run();
293
345
  };
294
- var currentTimeItem = useMemo(function () {
295
- return times.find(function (d) {
296
- return d.value === currentTime;
297
- }) || {
298
- price: 0
299
- };
300
- }, [currentTime, times]);
346
+
347
+ // 临时模拟出的新服务
301
348
  var newService = useMemo(function () {
302
- if (!currentProduct || !currentProduct || !state.service.cacheItem) {
349
+ if (!currentProduct || !state.service.cacheItem) {
303
350
  return null;
304
351
  }
305
352
 
@@ -509,10 +556,6 @@ var AddTimeModal = function AddTimeModal() {
509
556
  return _ref5.apply(this, arguments);
510
557
  };
511
558
  }();
512
- var productChange = function productChange(e) {
513
- setCurrentProductId(e);
514
- setCurrentTime(null);
515
- };
516
559
  useEffect(function () {
517
560
  if (!state.modalOpen) {
518
561
  onCancel();
@@ -520,8 +563,7 @@ var AddTimeModal = function AddTimeModal() {
520
563
  }, [state.modalOpen]);
521
564
  var onCancel = function onCancel() {
522
565
  setIsEdit(false);
523
- setCurrentProductId(null);
524
- setCurrentTime(null);
566
+ setRecordKey("");
525
567
  resetService();
526
568
  setTimeout(function () {
527
569
  dispatch({
@@ -532,7 +574,6 @@ var AddTimeModal = function AddTimeModal() {
532
574
  });
533
575
  }, 50);
534
576
  };
535
- console.log("newService.duration", currentTimeItem);
536
577
  var updateTime = useMemo(function () {
537
578
  if (!newService) {
538
579
  return "";
@@ -553,21 +594,13 @@ var AddTimeModal = function AddTimeModal() {
553
594
  title: locales.getText("page.booking.text.add-time"),
554
595
  rootClassName: "booking-server-wrap",
555
596
  onClose: onCancel,
556
- header: addTimeProducts.length > 1 && /*#__PURE__*/React.createElement("div", {
557
- className: "pisell-lowcode__booking-add-time-header"
558
- }, /*#__PURE__*/React.createElement(Select, {
559
- options: addTimeProducts,
560
- style: {
561
- width: "100%"
562
- },
563
- size: "large",
564
- loading: loading === "list",
565
- value: currentProductId,
566
- onChange: productChange
567
- })),
568
597
  footerStyle: {
569
598
  padding: "10px 32px 20px"
570
599
  },
600
+ hideScrollBar: false,
601
+ bodyStyle: {
602
+ position: "relative"
603
+ },
571
604
  footer: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
572
605
  className: "pisell-lowcode__booking-add-time-total-wrap"
573
606
  }, currentTimeItem && currentTimeItem !== null && currentTimeItem !== void 0 && (_currentTimeItem$stat = currentTimeItem.status) !== null && _currentTimeItem$stat !== void 0 && _currentTimeItem$stat.message ? /*#__PURE__*/React.createElement(Alert, {
@@ -624,33 +657,39 @@ var AddTimeModal = function AddTimeModal() {
624
657
  active: true,
625
658
  round: true
626
659
  }, /*#__PURE__*/React.createElement("div", {
627
- className: "pisell-lowcode__booking-add-time-child-card-list"
628
- }, times.map(function (child, index) {
629
- var _child$status, _child$status$status, _child$status2, _child$status2$status;
630
- if (child.readonly) {
631
- return /*#__PURE__*/React.createElement("div", {
632
- className: "pisell-lowcode__booking-add-time-hours"
633
- }, child.label);
634
- }
660
+ className: ""
661
+ }, renderList.map(function (d) {
635
662
  return /*#__PURE__*/React.createElement("div", {
636
- className: classNames("pisell-lowcode__booking-add-time-child-card", {
637
- "pisell-lowcode__booking-add-time-child-card-active": currentTime === child.value
638
- }),
639
- onClick: function onClick() {
640
- onSelectItem(child);
641
- }
642
- }, /*#__PURE__*/React.createElement("div", {
643
- className: "pisell-lowcode__booking-add-time-child-card-left"
663
+ className: ""
644
664
  }, /*#__PURE__*/React.createElement("div", {
645
- className: "pisell-lowcode__booking-add-time-child-card-left-time"
646
- }, child.label), /*#__PURE__*/React.createElement("div", {
647
- className: "pisell-lowcode__booking-add-time-child-card-left-price"
648
- }, formatAmount(child.price, 2, state.amountSymbol))), /*#__PURE__*/React.createElement("div", {
649
- className: "pisell-lowcode__booking-add-time-child-card-right",
650
- style: {
651
- color: (_child$status = child.status) === null || _child$status === void 0 ? void 0 : (_child$status$status = _child$status.status) === null || _child$status$status === void 0 ? void 0 : _child$status$status.color
652
- }
653
- }, (_child$status2 = child.status) === null || _child$status2 === void 0 ? void 0 : (_child$status2$status = _child$status2.status) === null || _child$status2$status === void 0 ? void 0 : _child$status2$status.label));
665
+ className: "pisell-lowcode__booking-add-time-hours"
666
+ }, d.title), d.times ? /*#__PURE__*/React.createElement("div", {
667
+ className: "pisell-lowcode__booking-add-time-child-card-list"
668
+ }, d.times.map(function (child) {
669
+ var _child$status, _child$status$status, _child$status2, _child$status2$status;
670
+ return /*#__PURE__*/React.createElement("div", {
671
+ className: classNames("pisell-lowcode__booking-add-time-child-card", {
672
+ "pisell-lowcode__booking-add-time-child-card-active": recordKey === addTimeRowKey.create(d.id, child.value)
673
+ }),
674
+ onClick: function onClick() {
675
+ if (!child.value) {
676
+ return;
677
+ }
678
+ onSelectItem(d, child);
679
+ }
680
+ }, /*#__PURE__*/React.createElement("div", {
681
+ className: "pisell-lowcode__booking-add-time-child-card-left"
682
+ }, /*#__PURE__*/React.createElement("div", {
683
+ className: "pisell-lowcode__booking-add-time-child-card-left-time"
684
+ }, child.label), /*#__PURE__*/React.createElement("div", {
685
+ className: "pisell-lowcode__booking-add-time-child-card-left-price"
686
+ }, formatAmount(child.price, 2, state.amountSymbol))), /*#__PURE__*/React.createElement("div", {
687
+ className: "pisell-lowcode__booking-add-time-child-card-right",
688
+ style: {
689
+ color: (_child$status = child.status) === null || _child$status === void 0 ? void 0 : (_child$status$status = _child$status.status) === null || _child$status$status === void 0 ? void 0 : _child$status$status.color
690
+ }
691
+ }, (_child$status2 = child.status) === null || _child$status2 === void 0 ? void 0 : (_child$status2$status = _child$status2.status) === null || _child$status2$status === void 0 ? void 0 : _child$status2$status.label));
692
+ })) : null);
654
693
  }))), /*#__PURE__*/React.createElement("div", {
655
694
  className: ""
656
695
  })));
@@ -10,22 +10,27 @@
10
10
  width: 100%;
11
11
  height: 100%;
12
12
 
13
+ .pisell-lowcode__booking-add-time-hours {
14
+ padding: 6px;
15
+ color: var(--Gray-900, #101828);
16
+ font-size: 14px;
17
+ font-style: normal;
18
+ font-weight: 500;
19
+ background: var(--Gray-50, #F9FAFB);
20
+ margin: 10px 0;
21
+ flex: 0 0 100%;
22
+ position: sticky;
23
+ top: 95px;
24
+ z-index: 1;
25
+ }
26
+
13
27
  .pisell-lowcode__booking-add-time-child-card-list {
14
28
  width: 100%;
15
29
  display: flex;
16
30
  flex-wrap: wrap;
17
31
  gap: 10px;
18
32
 
19
- .pisell-lowcode__booking-add-time-hours {
20
- padding: 6px;
21
- color: var(--Gray-900, #101828);
22
- font-size: 14px;
23
- font-style: normal;
24
- font-weight: 500;
25
- background: var(--Gray-50, #F9FAFB);
26
- margin: 10px 0;
27
- flex: 0 0 100%;
28
- }
33
+
29
34
 
30
35
  .pisell-lowcode__booking-add-time-child-card {
31
36
  flex: 0 0 calc(50% - 5px);
@@ -1,12 +1,31 @@
1
- export declare const getAddTimeSplits: (config: any, price: number) => ({
2
- label: string;
3
- value: number;
4
- readonly: boolean;
5
- price?: undefined;
6
- } | {
7
- label: string;
8
- value: number;
9
- price: number;
10
- readonly?: undefined;
11
- })[];
12
- export declare const isUsableProduct: (relationProduct: any, currentItem: any) => any;
1
+ /**
2
+ * @title: 根据商品生成加时列表
3
+ * @description:
4
+ * @param {any} config
5
+ * @param {number} price
6
+ * @return {*}
7
+ * @Author: zhiwei.Wang
8
+ * @Date: 2024-07-01 09:34
9
+ */
10
+ export declare const getAddTimeSplits: (product: any, cacheItem: any, currentResourceTimeEndDate: any) => {
11
+ label: any;
12
+ value: any;
13
+ price: any;
14
+ }[];
15
+ /**
16
+ * @title: 判断当前商品是否可用
17
+ * @description:
18
+ * @param {any} relationProduct
19
+ * @param {any} currentItem
20
+ * @return {*}
21
+ * @Author: zhiwei.Wang
22
+ * @Date: 2024-07-01 09:33
23
+ */
24
+ export declare const isUsableProduct: (addTime: any, currentItem: any) => any;
25
+ export declare const addTimeRowKey: {
26
+ create: (product_id: number, time: number) => string;
27
+ getValue: (str: string) => {
28
+ product_id: number;
29
+ time: number | string;
30
+ };
31
+ };