@pisell/private-materials 3.0.118 → 3.0.120

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 (65) 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/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/render/default/view.css +1 -1
  7. package/build/lowcode/render/default/view.js +11 -11
  8. package/build/lowcode/view.css +1 -1
  9. package/build/lowcode/view.js +10 -10
  10. package/es/components/booking/addons/model.d.ts +1 -2
  11. package/es/components/booking/components/TabProduct/productItem/index.d.ts +2 -2
  12. package/es/components/booking/components/TabProduct/productItem/index.js +8 -7
  13. package/es/components/booking/forms/forms.d.ts +1 -1
  14. package/es/components/booking/forms/model.d.ts +1 -2
  15. package/es/components/booking/info/header/index.d.ts +2 -2
  16. package/es/components/booking/info/header/index.js +436 -44
  17. package/es/components/booking/info/header/index.less +110 -1
  18. package/es/components/booking/info/index.d.ts +1 -1
  19. package/es/components/booking/info/service/addService/index.d.ts +3 -1
  20. package/es/components/booking/info/service/addService/index.js +14 -8
  21. package/es/components/booking/info/service/editService/index.d.ts +5 -2
  22. package/es/components/booking/info/service/editService/index.js +155 -66
  23. package/es/components/booking/info/service/editService/index.less +13 -4
  24. package/es/components/booking/info/service/index.js +15 -2
  25. package/es/components/booking/info/service/serviceList/index.d.ts +5 -3
  26. package/es/components/booking/info/service/serviceList/index.js +15 -11
  27. package/es/components/booking/info/utils.js +1 -1
  28. package/es/components/booking/locales.d.ts +42 -0
  29. package/es/components/booking/locales.js +54 -6
  30. package/es/components/booking/model.d.ts +3 -2
  31. package/es/components/booking/model.js +9 -9
  32. package/es/components/booking/notes/index.d.ts +1 -1
  33. package/es/components/booking/notes/model.d.ts +1 -2
  34. package/es/components/booking/payments/index.d.ts +1 -1
  35. package/es/components/booking/payments/model.d.ts +1 -2
  36. package/es/components/schedules/index.d.ts +1 -1
  37. package/es/components/schedules/model.d.ts +1 -2
  38. package/lib/components/booking/addons/model.d.ts +1 -2
  39. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +2 -2
  40. package/lib/components/booking/components/TabProduct/productItem/index.js +2 -1
  41. package/lib/components/booking/forms/forms.d.ts +1 -1
  42. package/lib/components/booking/forms/model.d.ts +1 -2
  43. package/lib/components/booking/info/header/index.d.ts +2 -2
  44. package/lib/components/booking/info/header/index.js +212 -11
  45. package/lib/components/booking/info/header/index.less +110 -1
  46. package/lib/components/booking/info/index.d.ts +1 -1
  47. package/lib/components/booking/info/service/addService/index.d.ts +3 -1
  48. package/lib/components/booking/info/service/addService/index.js +9 -4
  49. package/lib/components/booking/info/service/editService/index.d.ts +5 -2
  50. package/lib/components/booking/info/service/editService/index.js +107 -62
  51. package/lib/components/booking/info/service/editService/index.less +13 -4
  52. package/lib/components/booking/info/service/index.js +8 -1
  53. package/lib/components/booking/info/service/serviceList/index.d.ts +5 -3
  54. package/lib/components/booking/info/service/serviceList/index.js +2 -1
  55. package/lib/components/booking/info/utils.js +1 -1
  56. package/lib/components/booking/locales.d.ts +42 -0
  57. package/lib/components/booking/locales.js +48 -6
  58. package/lib/components/booking/model.d.ts +3 -2
  59. package/lib/components/booking/notes/index.d.ts +1 -1
  60. package/lib/components/booking/notes/model.d.ts +1 -2
  61. package/lib/components/booking/payments/index.d.ts +1 -1
  62. package/lib/components/booking/payments/model.d.ts +1 -2
  63. package/lib/components/schedules/index.d.ts +1 -1
  64. package/lib/components/schedules/model.d.ts +1 -2
  65. package/package.json +4 -4
@@ -48,7 +48,7 @@
48
48
  display: flex;
49
49
  align-items: center;
50
50
  gap: 10px;
51
- color: var(--Base-White, #FFF);
51
+ color: var(--Base-White, #FFF) !important;
52
52
  font-size: 18px;
53
53
  font-style: normal;
54
54
  font-weight: 400;
@@ -57,10 +57,119 @@
57
57
  padding: 4px 12px;
58
58
  border-radius: 24px;
59
59
 
60
+ span {
61
+ color: var(--Base-White, #FFF) !important;
62
+ }
60
63
 
61
64
  .booking-header-right-status-icon {
62
65
  font-size: 20px;
63
66
  }
64
67
  }
65
68
  }
69
+ }
70
+
71
+ .go-payments-modal-wrap {
72
+ padding: 0;
73
+ }
74
+
75
+ .go-payments-modal-content {
76
+ margin: 0 -24px;
77
+
78
+ .go-payments-modal-content-title {
79
+ color: var(--Gray-900, #101828);
80
+ font-size: 24px;
81
+ font-style: normal;
82
+ font-weight: 600;
83
+ line-height: 32px;
84
+ padding: 0 24px;
85
+ }
86
+
87
+ .go-payments-modal-content-desc {
88
+ color: var(--Gray-900, #101828);
89
+ font-size: 16px;
90
+ font-style: normal;
91
+ font-weight: 500;
92
+ line-height: 24px;
93
+ padding: 0 24px;
94
+ margin-top: 4px;
95
+ }
96
+
97
+ .cancelled-modal-content-title {
98
+ color: var(--Gray-900, #101828);
99
+ font-size: 24px;
100
+ font-style: normal;
101
+ font-weight: 600;
102
+ line-height: 32px;
103
+ padding: 0 24px;
104
+ }
105
+
106
+ .cancelled-modal-content-desc {
107
+ margin-top: 4px;
108
+ color: #101828;
109
+ font-size: 16px;
110
+ font-style: normal;
111
+ font-weight: 500;
112
+ line-height: 24px;
113
+ padding: 0 24px;
114
+
115
+ &.cancelled-modal-content-desc-red {
116
+ color: var(--Error-600, #D92D20);
117
+ }
118
+ }
119
+
120
+ .cancelled-modal-content-list-wrap {
121
+ padding: 0 24px;
122
+
123
+ .cancelled-modal-content-list-title {
124
+ color: var(--Gray-900, #101828);
125
+ font-size: 16px;
126
+ font-style: normal;
127
+ font-weight: 500;
128
+ line-height: 24px;
129
+ margin-top: 4px;
130
+ }
131
+
132
+ .cancelled-modal-content-ul {
133
+ margin-top: 4px;
134
+
135
+ .cancelled-modal-content-li {
136
+ color: var(--Gray-900, #101828);
137
+ font-size: 16px;
138
+ font-style: normal;
139
+ font-weight: 500;
140
+ line-height: 24px;
141
+ }
142
+
143
+ }
144
+
145
+ }
146
+
147
+ .go-payments-footer {
148
+ display: flex;
149
+ align-items: center;
150
+ gap: 12px;
151
+ border-top: 1px solid var(--Gray-200, #EAECF0);
152
+ margin-top: 16px;
153
+ padding: 24px 24px 4px;
154
+ width: 100%;
155
+
156
+ .go-payments-footer-btn {
157
+ flex: 1;
158
+ font-size: 16px;
159
+ font-style: normal;
160
+ font-weight: 600;
161
+ }
162
+
163
+ &.go-payments-footer-column {
164
+ flex-direction: column;
165
+ gap: 12px;
166
+
167
+ .go-payments-footer-btn {
168
+ width: 100%;
169
+ }
170
+ }
171
+
172
+
173
+ }
174
+
66
175
  }
@@ -8,5 +8,5 @@ export interface InfoProps {
8
8
  slot: any;
9
9
  setState: any;
10
10
  }
11
- declare const Info: (props: any) => any;
11
+ declare const Info: any;
12
12
  export default Info;
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
- declare const Info: () => React.JSX.Element;
3
+ declare const Info: ({ onEdit }: {
4
+ onEdit: any;
5
+ }) => React.JSX.Element;
4
6
  export default Info;
@@ -33,8 +33,9 @@ import { formatProductListByCategory, getProductTotalPrice, request } from "../.
33
33
  import { locales, getUniqueId } from '@pisell/utils';
34
34
  import { useUpdateEffect } from 'ahooks';
35
35
  var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386, 6848, 6305];
36
- var Info = function Info() {
36
+ var Info = function Info(_ref) {
37
37
  var _state$service3, _state$service5, _state$service6, _state$service6$cache;
38
+ var onEdit = _ref.onEdit;
38
39
  var _useState = useState(''),
39
40
  _useState2 = _slicedToArray(_useState, 2),
40
41
  search = _useState2[0],
@@ -59,7 +60,7 @@ var Info = function Info() {
59
60
  * @Date: 2024-05-14 13:55
60
61
  */
61
62
  var setDefaultService = /*#__PURE__*/function () {
62
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(list) {
63
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(list) {
63
64
  var _list, product, detail, isBundleOrCombination, _item;
64
65
  return _regeneratorRuntime().wrap(function _callee$(_context) {
65
66
  while (1) switch (_context.prev = _context.next) {
@@ -139,11 +140,11 @@ var Info = function Info() {
139
140
  }, _callee);
140
141
  }));
141
142
  return function setDefaultService(_x2) {
142
- return _ref.apply(this, arguments);
143
+ return _ref2.apply(this, arguments);
143
144
  };
144
145
  }();
145
146
  var getServices = /*#__PURE__*/function () {
146
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
147
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
147
148
  var _state$eventOtherPara;
148
149
  var data;
149
150
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -186,7 +187,7 @@ var Info = function Info() {
186
187
  }, _callee2);
187
188
  }));
188
189
  return function getServices() {
189
- return _ref2.apply(this, arguments);
190
+ return _ref3.apply(this, arguments);
190
191
  };
191
192
  }();
192
193
  var handleSelectService = function handleSelectService() {
@@ -270,9 +271,11 @@ var Info = function Info() {
270
271
  payload: {
271
272
  editModal: true,
272
273
  cacheItem: cacheItem,
273
- addModal: !cacheItem.autoClose
274
+ addModal: !cacheItem.autoClose,
275
+ changeService: false
274
276
  }
275
277
  });
278
+ onEdit === null || onEdit === void 0 ? void 0 : onEdit(cacheItem);
276
279
  }
277
280
  });
278
281
  };
@@ -300,7 +303,9 @@ var Info = function Info() {
300
303
 
301
304
  // 如果弹窗打开,并且是创建, 则自动打开选择服务的弹窗
302
305
  if (state.modalOpen && !state.bookingId && state.renderType !== 'eventBooking' && ((_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : (_state$service4$value = _state$service4.value) === null || _state$service4$value === void 0 ? void 0 : _state$service4$value.length) === 0) {
303
- handleSelectService();
306
+ setTimeout(function () {
307
+ handleSelectService();
308
+ }, 10);
304
309
  }
305
310
  }, [state.modalOpen, state.bookingId, (_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : _state$service5.value]);
306
311
  var showAddButton = useMemo(function () {
@@ -354,7 +359,8 @@ var Info = function Info() {
354
359
  dispatch({
355
360
  type: 'setService',
356
361
  payload: {
357
- addModal: false
362
+ addModal: false,
363
+ changeService: false
358
364
  }
359
365
  });
360
366
  },
@@ -1,4 +1,7 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
- declare const Info: () => React.JSX.Element;
4
- export default Info;
3
+ export interface EditServiceRef {
4
+ init: (cacheItem?: any) => void;
5
+ }
6
+ declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
7
+ export default _default;
@@ -18,7 +18,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
18
18
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
19
19
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
20
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
- import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
21
+ import React, { useCallback, useContext, useEffect, useMemo, useState, useImperativeHandle, forwardRef } from 'react';
22
22
  import Delete_wght300_24px from '@pisell/icon/es/Delete_wght300_24px';
23
23
  import Drawer from "../../../components/drawer";
24
24
  import { Context } from "../../model";
@@ -30,13 +30,13 @@ import CollapsibleList from "../../../components/collapsibleList";
30
30
  import { renderBundles } from "../../../components/collapsibleList/utils";
31
31
  import { useUpdateEffect, useMemoizedFn } from 'ahooks';
32
32
  // import SelectTime from "../../../../../../../materials/src/components/select-time";
33
- import { getErrorList, getServiceTimes, deleteCacheParams } from "../../../utils";
33
+ import { getErrorList, getServiceTimes, deleteCacheParams, getProductTotalPrice } from "../../../utils";
34
34
  import Like from "../like";
35
35
  import { getNoResource } from "../../../mock";
36
36
  import { formatResources, getDurationProps, getFlexibleOption, getTimeObj } from "../addService/utils";
37
37
  var submitLock = false;
38
- var Info = function Info() {
39
- var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI6, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _window$BaseMaterials, _state$service$cacheI7, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI8, _state$service$cacheI9, _state$service$cacheI10, _state$service$cacheI11, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8;
38
+ var Info = function Info(_, ref) {
39
+ var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI4, _state$service$cacheI5, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _window$BaseMaterials, _state$service$cacheI10, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI11, _state$service$cacheI12, _state$service$cacheI13, _state$service$cacheI14, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8;
40
40
  var _Form$useForm = Form.useForm(),
41
41
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
42
42
  form = _Form$useForm2[0];
@@ -59,12 +59,12 @@ var Info = function Info() {
59
59
  setSelectOpen = _useState4[1];
60
60
 
61
61
  // 当前商品信息+ 表单信息
62
- var getCurrentCacheItem = function getCurrentCacheItem() {
62
+ var getCurrentCacheItem = function getCurrentCacheItem(_cacheItem) {
63
63
  // 获取当前表单数据
64
64
  var values = form.getFieldsValue();
65
- var _cacheItem = state.service.cacheItem;
66
- return _objectSpread(_objectSpread({}, _cacheItem), {}, {
67
- _extend: _objectSpread(_objectSpread({}, _cacheItem === null || _cacheItem === void 0 ? void 0 : _cacheItem._extend), values)
65
+ var _item = _cacheItem || state.service.cacheItem;
66
+ return _objectSpread(_objectSpread({}, _item), {}, {
67
+ _extend: _objectSpread(_objectSpread({}, _item === null || _item === void 0 ? void 0 : _item._extend), values)
68
68
  });
69
69
  };
70
70
 
@@ -156,7 +156,7 @@ var Info = function Info() {
156
156
  */
157
157
  var getResources = /*#__PURE__*/function () {
158
158
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(cacheItem) {
159
- var _state$service$cacheI, _list, autoClose, _cacheItem;
159
+ var _list, _cacheItem, autoClose;
160
160
  return _regeneratorRuntime().wrap(function _callee$(_context) {
161
161
  while (1) switch (_context.prev = _context.next) {
162
162
  case 0:
@@ -164,8 +164,8 @@ var Info = function Info() {
164
164
  _context.prev = 1;
165
165
  // 合并无资源
166
166
  _list = state.service.resourcesOrigin || [];
167
- autoClose = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI.autoClose;
168
167
  _cacheItem = cacheItem || getCurrentCacheItem();
168
+ autoClose = _cacheItem === null || _cacheItem === void 0 ? void 0 : _cacheItem.autoClose;
169
169
  if (_cacheItem._extend) {
170
170
  _context.next = 7;
171
171
  break;
@@ -219,12 +219,12 @@ var Info = function Info() {
219
219
  * @Date: 2024-01-09 13:59
220
220
  */
221
221
  var handleDeleteProduct = function handleDeleteProduct() {
222
- var _state$service$cacheI2;
222
+ var _state$service$cacheI;
223
223
  if (state.channelDisabledEdit) {
224
224
  return;
225
225
  }
226
226
  var _list = _toConsumableArray(state.service.value);
227
- var _id = (_state$service$cacheI2 = state.service.cacheItem) === null || _state$service$cacheI2 === void 0 ? void 0 : _state$service$cacheI2._id;
227
+ var _id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
228
228
  _list = _list.filter(function (d) {
229
229
  return d._id !== _id;
230
230
  });
@@ -305,8 +305,9 @@ var Info = function Info() {
305
305
  * @Date: 2024-01-09 14:03
306
306
  */
307
307
  var getDiscount = function getDiscount() {
308
- var _state$service$cacheI3;
309
- var oPrice = Number(((_state$service$cacheI3 = state.service.cacheItem) === null || _state$service$cacheI3 === void 0 ? void 0 : _state$service$cacheI3._extend.origin_total) || 0);
308
+ var _state$service$cacheI2;
309
+ console.log('折扣内', state.service.cacheItem);
310
+ var oPrice = Number(((_state$service$cacheI2 = state.service.cacheItem) === null || _state$service$cacheI2 === void 0 ? void 0 : _state$service$cacheI2._extend.origin_total) || 0);
310
311
  var cPrice = Number(useTotal || 0);
311
312
  var discount = '';
312
313
  // 原价 = 现价 为无折扣
@@ -395,22 +396,18 @@ var Info = function Info() {
395
396
  addModal: false,
396
397
  value: _list,
397
398
  edit: true,
398
- cacheItem: null
399
+ cacheItem: null,
400
+ changeService: false
399
401
  }
400
402
  });
401
403
  };
402
- var setEditData = useMemoizedFn(function () {
403
- if (state.service.editModal) {
404
- var cacheItem = state.service.cacheItem;
405
- var values = cacheItem._extend;
406
- form.setFieldsValue(values);
407
- if (state.renderType !== 'eventBooking') {
408
- // 获取资源列表
409
- getResources();
410
- }
411
- } else {
412
- setSelectOpen(undefined);
413
- form.resetFields();
404
+ var setEditData = useMemoizedFn(function (_cacheItem) {
405
+ var cacheItem = _cacheItem || state.service.cacheItem;
406
+ var values = cacheItem._extend;
407
+ form.setFieldsValue(values);
408
+ if (state.renderType !== 'eventBooking') {
409
+ // 获取资源列表
410
+ getResources(_cacheItem);
414
411
  }
415
412
  });
416
413
 
@@ -423,12 +420,12 @@ var Info = function Info() {
423
420
  * @Date: 2024-01-09 14:06
424
421
  */
425
422
  var isReason = useMemo(function () {
426
- var _state$service$cacheI4;
427
- var oPrice = Number(((_state$service$cacheI4 = state.service.cacheItem) === null || _state$service$cacheI4 === void 0 ? void 0 : _state$service$cacheI4._extend.origin_total) || 0);
423
+ var _state$service$cacheI3;
424
+ var oPrice = Number(((_state$service$cacheI3 = state.service.cacheItem) === null || _state$service$cacheI3 === void 0 ? void 0 : _state$service$cacheI3._extend.origin_total) || 0);
428
425
  var cPrice = Number(useTotal || 0);
429
426
  // 原价 !== 现价
430
427
  return cPrice !== oPrice;
431
- }, [useTotal, state.service.cacheItem]);
428
+ }, [useTotal, (_state$service$cacheI4 = state.service.cacheItem) === null || _state$service$cacheI4 === void 0 ? void 0 : (_state$service$cacheI5 = _state$service$cacheI4._extend) === null || _state$service$cacheI5 === void 0 ? void 0 : _state$service$cacheI5.origin_total]);
432
429
 
433
430
  /**
434
431
  * @title: 错误信息列表
@@ -450,25 +447,22 @@ var Info = function Info() {
450
447
  * @Date: 2024-01-09 14:07
451
448
  */
452
449
  useUpdateEffect(function () {
453
- var _state$service$cacheI5;
450
+ var _state$service$cacheI6;
454
451
  // autoClose 不执行下面逻辑
455
- if (state.service.cacheItem && !((_state$service$cacheI5 = state.service.cacheItem) !== null && _state$service$cacheI5 !== void 0 && _state$service$cacheI5.autoClose)) {
452
+ if (state.service.cacheItem && !((_state$service$cacheI6 = state.service.cacheItem) !== null && _state$service$cacheI6 !== void 0 && _state$service$cacheI6.autoClose)) {
456
453
  if (useStartTime && useDuration && state.renderType !== 'eventBooking') {
457
454
  getResources();
458
455
  }
459
456
  }
460
- }, [useStartTime, useDuration, state.renderType, state.service.resourcesOrigin, (_state$service$cacheI6 = state.service.cacheItem) === null || _state$service$cacheI6 === void 0 ? void 0 : _state$service$cacheI6.autoClose]);
461
-
462
- /**
463
- * @title: 打开弹窗时 设置数据
464
- * @description:
465
- * @return {*}
466
- * @Author: zhiwei.Wang
467
- * @Date: 2024-01-09 14:07
468
- */
457
+ }, [useStartTime, useDuration, state.renderType, state.service.resourcesOrigin, (_state$service$cacheI7 = state.service.cacheItem) === null || _state$service$cacheI7 === void 0 ? void 0 : _state$service$cacheI7.autoClose]);
469
458
  useEffect(function () {
470
- setEditData();
471
- }, [state.service.editModal, setEditData]);
459
+ // if (!state.service.editModal) {
460
+ // setTimeout(() => {
461
+ // setSelectOpen(undefined);
462
+ // form.resetFields();
463
+ // }, 200);
464
+ // }
465
+ }, [state.service.editModal]);
472
466
 
473
467
  /**
474
468
  * @title: 资源 时间 发生变化时, 重新计算错误信息
@@ -490,7 +484,7 @@ var Info = function Info() {
490
484
  */
491
485
  useEffect(function () {
492
486
  getDiscount();
493
- }, [useTotal, state.service.cacheItem]);
487
+ }, [useTotal, (_state$service$cacheI8 = state.service.cacheItem) === null || _state$service$cacheI8 === void 0 ? void 0 : (_state$service$cacheI9 = _state$service$cacheI8._extend) === null || _state$service$cacheI9 === void 0 ? void 0 : _state$service$cacheI9.origin_total]);
494
488
 
495
489
  // useEffect(() => {
496
490
  // handleLikeResource("common");
@@ -566,20 +560,121 @@ var Info = function Info() {
566
560
  };
567
561
  }();
568
562
  useEffect(function () {
569
- getResourcesData();
563
+ setTimeout(function () {
564
+ getResourcesData();
565
+ }, 20);
570
566
  }, [state.date.value]);
567
+
568
+ /**
569
+ * @title: 编辑商品
570
+ * @description:
571
+ * @param {any} e
572
+ * @return {*}
573
+ * @Author: zhiwei.Wang
574
+ * @Date: 2024-08-28 17:08
575
+ */
576
+ var handleEdit = function handleEdit(e) {
577
+ // 当前商品
578
+ var item = state.service.cacheItem;
579
+
580
+ // 表单数据
581
+ var values = form.getFieldsValue();
582
+
583
+ // 打开商品详情弹窗
584
+ state.action({
585
+ type: 'pisell1.handleOpenProductModal',
586
+ data: {
587
+ id: item.id,
588
+ date: state.date.value.format('YYYY-MM-DD'),
589
+ showConfig: {
590
+ option: false,
591
+ session: false,
592
+ variant: false,
593
+ package: true
594
+ },
595
+ value: item._extend.other
596
+ },
597
+ callback: function callback(e) {
598
+ // 重新生成商品
599
+ var cacheItem = _objectSpread(_objectSpread({}, item), {}, {
600
+ product_id: item.id,
601
+ _id: item === null || item === void 0 ? void 0 : item._id,
602
+ _key: e.key,
603
+ _extend: _objectSpread(_objectSpread(_objectSpread({}, item._extend), values), {}, {
604
+ // 覆盖选择的规格和套餐
605
+ other: JSON.parse(JSON.stringify(e))
606
+ }),
607
+ new: 0
608
+ });
609
+
610
+ // 获取商品总价
611
+ var _total = getProductTotalPrice(cacheItem);
612
+
613
+ // 用于折扣 可修改
614
+ cacheItem._extend.total = _total;
615
+
616
+ // 用于储存原价
617
+ cacheItem._extend.origin_total = _total;
618
+
619
+ // 覆盖商品
620
+ dispatch({
621
+ type: 'setService',
622
+ payload: {
623
+ cacheItem: cacheItem
624
+ }
625
+ });
626
+
627
+ // 更新表单内的商品价格
628
+ form.setFieldsValue({
629
+ total: _total
630
+ });
631
+ }
632
+ });
633
+ };
634
+
635
+ /**
636
+ * @title: 更换商品
637
+ * @description:
638
+ * @param {any} e
639
+ * @return {*}
640
+ * @Author: zhiwei.Wang
641
+ * @Date: 2024-08-28 17:10
642
+ */
643
+ var handleChange = function handleChange(e) {
644
+ if (state.channelDisabledEdit) {
645
+ return;
646
+ }
647
+ dispatch({
648
+ type: 'setService',
649
+ payload: {
650
+ addModal: true,
651
+ editModal: true,
652
+ //用于控制 添加商品 和 编辑服务弹窗的上下层级
653
+ changeService: true
654
+ }
655
+ });
656
+ };
657
+ useImperativeHandle(ref, function () {
658
+ return {
659
+ init: setEditData
660
+ };
661
+ });
662
+ console.log('state.service.value', state.service.value);
571
663
  var SelectTime = (_window$BaseMaterials = window.BaseMaterials) === null || _window$BaseMaterials === void 0 ? void 0 : _window$BaseMaterials.SelectTime;
572
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer, {
573
- zIndex: 1000,
664
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer
665
+ //通过zIndex的方式控制 添加商品 和 编辑服务弹窗的上下层级
666
+ , {
667
+ zIndex: state.service.changeService ? 999 : 1000,
574
668
  forceRender: true,
575
- open: state.service.editModal && !((_state$service$cacheI7 = state.service.cacheItem) !== null && _state$service$cacheI7 !== void 0 && _state$service$cacheI7.autoClose),
669
+ open: state.service.editModal && !((_state$service$cacheI10 = state.service.cacheItem) !== null && _state$service$cacheI10 !== void 0 && _state$service$cacheI10.autoClose),
576
670
  title: locales.getText('pisell2.text.edit-service'),
577
671
  onClose: function onClose() {
578
672
  dispatch({
579
673
  type: 'setService',
580
674
  payload: {
581
675
  editModal: false,
582
- cacheItem: null
676
+ cacheItem: null,
677
+ changeService: false
583
678
  }
584
679
  });
585
680
  }
@@ -599,22 +694,16 @@ var Info = function Info() {
599
694
  }, /*#__PURE__*/React.createElement(Form.Item, {
600
695
  name: "product_name"
601
696
  }, /*#__PURE__*/React.createElement("div", {
602
- className: "current-service-info",
603
- onClick: function onClick() {
604
- if (state.channelDisabledEdit) {
605
- return;
606
- }
607
- dispatch({
608
- type: 'setService',
609
- payload: {
610
- addModal: true,
611
- editModal: false
612
- }
613
- });
614
- }
697
+ className: "current-service-info"
698
+ }, /*#__PURE__*/React.createElement("div", {
699
+ className: "current-service-info-name-wrap"
615
700
  }, /*#__PURE__*/React.createElement("div", {
616
701
  className: "current-service-info-name"
617
- }, ((_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : (_state$service6$cache = _state$service6.cacheItem) === null || _state$service6$cache === void 0 ? void 0 : (_state$service6$cache2 = _state$service6$cache._extend) === null || _state$service6$cache2 === void 0 ? void 0 : _state$service6$cache2.product_name) || '-'), /*#__PURE__*/React.createElement(CollapsibleList, {
702
+ }, ((_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : (_state$service6$cache = _state$service6.cacheItem) === null || _state$service6$cache === void 0 ? void 0 : (_state$service6$cache2 = _state$service6$cache._extend) === null || _state$service6$cache2 === void 0 ? void 0 : _state$service6$cache2.product_name) || '-'), /*#__PURE__*/React.createElement(Button, {
703
+ onClick: handleEdit
704
+ }, locales.getText('pisell2.text.edit')), /*#__PURE__*/React.createElement(Button, {
705
+ onClick: handleChange
706
+ }, locales.getText('pisell2.text.change'))), /*#__PURE__*/React.createElement(CollapsibleList, {
618
707
  style: {
619
708
  marginTop: bundles.length ? '8px' : 0
620
709
  },
@@ -639,8 +728,8 @@ var Info = function Info() {
639
728
  width: '100%'
640
729
  },
641
730
  min: 0,
642
- max: ((_state$service$cacheI8 = state.service.cacheItem) === null || _state$service$cacheI8 === void 0 ? void 0 : (_state$service$cacheI9 = _state$service$cacheI8._extend) === null || _state$service$cacheI9 === void 0 ? void 0 : _state$service$cacheI9.origin_total) || 0,
643
- placeholder: ((_state$service$cacheI10 = state.service.cacheItem) === null || _state$service$cacheI10 === void 0 ? void 0 : (_state$service$cacheI11 = _state$service$cacheI10._extend) === null || _state$service$cacheI11 === void 0 ? void 0 : _state$service$cacheI11.origin_total) || '0'
731
+ max: ((_state$service$cacheI11 = state.service.cacheItem) === null || _state$service$cacheI11 === void 0 ? void 0 : (_state$service$cacheI12 = _state$service$cacheI11._extend) === null || _state$service$cacheI12 === void 0 ? void 0 : _state$service$cacheI12.origin_total) || 0,
732
+ placeholder: ((_state$service$cacheI13 = state.service.cacheItem) === null || _state$service$cacheI13 === void 0 ? void 0 : (_state$service$cacheI14 = _state$service$cacheI13._extend) === null || _state$service$cacheI14 === void 0 ? void 0 : _state$service$cacheI14.origin_total) || '0'
644
733
  }))), /*#__PURE__*/React.createElement(Col, {
645
734
  span: 12
646
735
  }, /*#__PURE__*/React.createElement(Form.Item, {
@@ -759,4 +848,4 @@ var Info = function Info() {
759
848
  }
760
849
  }, locales.getText('pisell2.text.apply'))))));
761
850
  };
762
- export default Info;
851
+ export default /*#__PURE__*/forwardRef(Info);
@@ -97,10 +97,19 @@
97
97
  overflow: hidden;
98
98
  padding: 11px;
99
99
 
100
- .current-service-info-name {
101
- font-size: 16px;
102
- color: #101828;
103
- font-weight: 650;
100
+ .current-service-info-name-wrap {
101
+ display: flex;
102
+ align-items: center;
103
+ gap: 12px;
104
+
105
+ .current-service-info-name {
106
+ font-size: 16px;
107
+ color: #101828;
108
+ font-weight: 650;
109
+ flex: 1;
110
+ }
111
+
112
+ .current-service-info-change-btn {}
104
113
  }
105
114
 
106
115
  &:hover {
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useContext, useMemo } from 'react';
1
+ import React, { useEffect, useContext, useMemo, useRef } from 'react';
2
2
  import AddService from "./addService";
3
3
  import { Context } from "../model";
4
4
  import EditService from "./editService";
@@ -9,6 +9,7 @@ var Service = function Service() {
9
9
  var _state$bookingConfig2, _state$bookingConfig3;
10
10
  var _useContext = useContext(Context),
11
11
  state = _useContext.state;
12
+ var detailRef = useRef();
12
13
  useEffect(function () {
13
14
  document.body.id = 'body';
14
15
  }, []);
@@ -35,8 +36,20 @@ var Service = function Service() {
35
36
  }
36
37
  return true;
37
38
  }, [state, appointment_card.quick_time]);
39
+ var handleEdit = function handleEdit(cacheItem) {
40
+ setTimeout(function () {
41
+ var _detailRef$current, _detailRef$current$in;
42
+ (_detailRef$current = detailRef.current) === null || _detailRef$current === void 0 ? void 0 : (_detailRef$current$in = _detailRef$current.init) === null || _detailRef$current$in === void 0 ? void 0 : _detailRef$current$in.call(_detailRef$current, cacheItem);
43
+ }, 100);
44
+ };
38
45
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
39
46
  className: "pisell-lowcode__booking-service-wrap"
40
- }, /*#__PURE__*/React.createElement(ServiceList, null), /*#__PURE__*/React.createElement(AddService, null)), /*#__PURE__*/React.createElement(EditService, null), showAddTimeModal && /*#__PURE__*/React.createElement(AddTimeModal, null));
47
+ }, /*#__PURE__*/React.createElement(ServiceList, {
48
+ onEdit: handleEdit
49
+ }), /*#__PURE__*/React.createElement(AddService, {
50
+ onEdit: handleEdit
51
+ })), /*#__PURE__*/React.createElement(EditService, {
52
+ ref: detailRef
53
+ }), showAddTimeModal && /*#__PURE__*/React.createElement(AddTimeModal, null));
41
54
  };
42
55
  export default Service;
@@ -1,4 +1,6 @@
1
- import React from "react";
2
- import "./index.less";
3
- declare const ServiceList: () => React.JSX.Element;
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const ServiceList: ({ onEdit }: {
4
+ onEdit: any;
5
+ }) => React.JSX.Element;
4
6
  export default ServiceList;