@pisell/private-materials 3.0.154 → 3.0.156

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 (87) 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/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +6 -6
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/components/booking/addons/index.js +10 -7
  12. package/es/components/booking/addons/model.d.ts +2 -1
  13. package/es/components/booking/components/TabProduct/index.js +1 -1
  14. package/es/components/booking/components/customSelect/index.js +5 -1
  15. package/es/components/booking/components/drawer/index.d.ts +3 -3
  16. package/es/components/booking/components/drawer/index.js +15 -13
  17. package/es/components/booking/components/drawer/index.less +8 -6
  18. package/es/components/booking/components/footer/index.js +21 -7
  19. package/es/components/booking/deposit/EditDepositModal/index.less +3 -0
  20. package/es/components/booking/forms/model.d.ts +2 -1
  21. package/es/components/booking/info/client/index.js +35 -15
  22. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +4 -4
  23. package/es/components/booking/info/clientVariant/hooks/useClientFn.js +59 -32
  24. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +3 -0
  25. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.js +14 -0
  26. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +3 -3
  27. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +38 -34
  28. package/es/components/booking/info/clientVariant/vertical/index.d.ts +1 -1
  29. package/es/components/booking/info/clientVariant/vertical/index.js +30 -13
  30. package/es/components/booking/info/clientVariant/vertical/index.less +30 -12
  31. package/es/components/booking/info/date/index.js +1 -0
  32. package/es/components/booking/info/date/index.less +2 -0
  33. package/es/components/booking/info/header/index.js +13 -12
  34. package/es/components/booking/info/main.js +10 -1
  35. package/es/components/booking/info/service/addService/index.js +10 -8
  36. package/es/components/booking/info/service/addTimeModal/index.js +1 -0
  37. package/es/components/booking/info/service/addTimeModal/index.less +1 -1
  38. package/es/components/booking/info/service/editService/index.js +3 -2
  39. package/es/components/booking/info/service/serviceList/index.js +2 -1
  40. package/es/components/booking/info/utils.js +1 -1
  41. package/es/components/booking/info2/index.js +10 -1
  42. package/es/components/booking/info2/utilsByBooking.js +2 -3
  43. package/es/components/booking/model.d.ts +2 -0
  44. package/es/components/booking/notes/index.d.ts +1 -1
  45. package/es/components/booking/notes/model.d.ts +2 -1
  46. package/es/components/booking/payments/model.d.ts +2 -1
  47. package/es/components/schedules/index.d.ts +1 -1
  48. package/es/components/schedules/model.d.ts +2 -1
  49. package/lib/components/booking/addons/index.js +2 -5
  50. package/lib/components/booking/addons/model.d.ts +2 -1
  51. package/lib/components/booking/components/TabProduct/index.js +1 -1
  52. package/lib/components/booking/components/customSelect/index.js +2 -1
  53. package/lib/components/booking/components/drawer/index.d.ts +3 -3
  54. package/lib/components/booking/components/drawer/index.js +13 -11
  55. package/lib/components/booking/components/drawer/index.less +8 -6
  56. package/lib/components/booking/components/footer/index.js +16 -12
  57. package/lib/components/booking/deposit/EditDepositModal/index.less +3 -0
  58. package/lib/components/booking/forms/model.d.ts +2 -1
  59. package/lib/components/booking/info/client/index.js +33 -21
  60. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +4 -4
  61. package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +33 -13
  62. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +3 -0
  63. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.js +36 -0
  64. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +3 -3
  65. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +39 -9
  66. package/lib/components/booking/info/clientVariant/vertical/index.d.ts +1 -1
  67. package/lib/components/booking/info/clientVariant/vertical/index.js +52 -31
  68. package/lib/components/booking/info/clientVariant/vertical/index.less +30 -12
  69. package/lib/components/booking/info/date/index.js +1 -0
  70. package/lib/components/booking/info/date/index.less +2 -0
  71. package/lib/components/booking/info/header/index.js +14 -12
  72. package/lib/components/booking/info/main.js +14 -1
  73. package/lib/components/booking/info/service/addService/index.js +3 -1
  74. package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
  75. package/lib/components/booking/info/service/addTimeModal/index.less +1 -1
  76. package/lib/components/booking/info/service/editService/index.js +8 -7
  77. package/lib/components/booking/info/service/serviceList/index.js +4 -3
  78. package/lib/components/booking/info/utils.js +1 -1
  79. package/lib/components/booking/info2/index.js +14 -1
  80. package/lib/components/booking/info2/utilsByBooking.js +1 -2
  81. package/lib/components/booking/model.d.ts +2 -0
  82. package/lib/components/booking/notes/index.d.ts +1 -1
  83. package/lib/components/booking/notes/model.d.ts +2 -1
  84. package/lib/components/booking/payments/model.d.ts +2 -1
  85. package/lib/components/schedules/index.d.ts +1 -1
  86. package/lib/components/schedules/model.d.ts +2 -1
  87. package/package.json +4 -4
@@ -34,7 +34,7 @@ import { locales, getUniqueId } from '@pisell/utils';
34
34
  import { useMemoizedFn, useUpdateEffect } from 'ahooks';
35
35
  var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386, 6848, 6305];
36
36
  var Info = function Info(_ref) {
37
- var _state$service3, _state$service5, _state$service7, _state$service7$cache;
37
+ var _state$service3, _state$service6, _state$service8, _state$service8$cache;
38
38
  var onEdit = _ref.onEdit;
39
39
  var _useState = useState(''),
40
40
  _useState2 = _slicedToArray(_useState, 2),
@@ -292,22 +292,23 @@ var Info = function Info(_ref) {
292
292
  }, [search, (_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.services]);
293
293
  console.log('state.service.renderList', renderList);
294
294
  var isService = useMemo(function () {
295
- return state.service.value.length > 0;
295
+ var _state$service4, _state$service4$value;
296
+ return ((_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;
296
297
  }, [state.service.value]);
297
298
  useEffect(function () {
298
- var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _state$service4, _state$service4$value;
299
+ var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _state$service5, _state$service5$value;
299
300
  // Salonip 不要这个
300
301
  if (shopList.includes((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut3 === void 0 ? void 0 : (_context$appHelper$ut4 = _context$appHelper$ut3.global) === null || _context$appHelper$ut4 === void 0 ? void 0 : (_context$appHelper$ut5 = _context$appHelper$ut4.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) || state.closeAutoOpenService) {
301
302
  return;
302
303
  }
303
304
 
304
305
  // 如果弹窗打开,并且是创建, 则自动打开选择服务的弹窗
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) {
306
+ if (state.modalOpen && !state.bookingId && state.renderType !== 'eventBooking' && ((_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : (_state$service5$value = _state$service5.value) === null || _state$service5$value === void 0 ? void 0 : _state$service5$value.length) === 0) {
306
307
  setTimeout(function () {
307
308
  handleSelectService();
308
309
  }, 10);
309
310
  }
310
- }, [state.modalOpen, state.bookingId, (_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : _state$service5.value]);
311
+ }, [state.modalOpen, state.bookingId, (_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : _state$service6.value]);
311
312
  var showAddButton = useMemo(function () {
312
313
  return !state.disabledEdit && !state.channelDisabledEdit;
313
314
  }, [state.disabledEdit, state.channelDisabledEdit]);
@@ -348,12 +349,13 @@ var Info = function Info(_ref) {
348
349
  });
349
350
  }, [state.renderType, showAddButton, isService, state.service.value, loading]);
350
351
  return useMemo(function () {
351
- var _state$service6, _state$service6$cache;
352
- return /*#__PURE__*/React.createElement(React.Fragment, null, ((_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$cache.autoClose) && /*#__PURE__*/React.createElement(Skeleton, {
352
+ var _state$service7, _state$service7$cache;
353
+ return /*#__PURE__*/React.createElement(React.Fragment, null, ((_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : (_state$service7$cache = _state$service7.cacheItem) === null || _state$service7$cache === void 0 ? void 0 : _state$service7$cache.autoClose) && /*#__PURE__*/React.createElement(Skeleton, {
353
354
  loading: true,
354
355
  active: true,
355
356
  round: true
356
357
  }), addButton, /*#__PURE__*/React.createElement(Drawer, {
358
+ titleNoWrap: true,
357
359
  open: state.service.addModal,
358
360
  title: locales.getText('pisell2.text.select-service'),
359
361
  rootClassName: "booking-server-wrap",
@@ -390,6 +392,6 @@ var Info = function Info(_ref) {
390
392
  onChange: handleSelectProduct,
391
393
  scrollDom: ".booking-server-wrap .pisell-lowcode-drawer-body"
392
394
  }))));
393
- }, [(_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : (_state$service7$cache = _state$service7.cacheItem) === null || _state$service7$cache === void 0 ? void 0 : _state$service7$cache.autoClose, addButton, state.service.addModal, locales, search, renderList, state.amountSymbol]);
395
+ }, [(_state$service8 = state.service) === null || _state$service8 === void 0 ? void 0 : (_state$service8$cache = _state$service8.cacheItem) === null || _state$service8$cache === void 0 ? void 0 : _state$service8$cache.autoClose, addButton, state.service.addModal, locales, search, renderList, state.amountSymbol]);
394
396
  };
395
397
  export default Info;
@@ -584,6 +584,7 @@ var AddTimeModal = function AddTimeModal() {
584
584
  return useMemo(function () {
585
585
  var _currentTimeItem$stat, _currentProduct$add_t;
586
586
  return /*#__PURE__*/React.createElement(Drawer, {
587
+ titleNoWrap: true,
587
588
  open: state.service.addTimeModal,
588
589
  title: locales.getText('page.booking.text.add-time'),
589
590
  rootClassName: "booking-server-wrap",
@@ -20,7 +20,7 @@
20
20
  margin: 10px 0;
21
21
  flex: 0 0 100%;
22
22
  position: sticky;
23
- top: 95px;
23
+ top: 58px !important;
24
24
  z-index: 1;
25
25
  }
26
26
 
@@ -36,7 +36,7 @@ import { getNoResource } from "../../../mock";
36
36
  import { formatResources, getDurationProps, getFlexibleOption, getTimeObj } from "../addService/utils";
37
37
  var submitLock = false;
38
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$cacheI15, _state$service7, _state$service7$cache, _state$service7$cache2, _state$service$cacheI16, _state$service$cacheI17, _state$bookingConfig9, _state$bookingConfig10, _state$bookingConfig11, _state$bookingConfig12;
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, _state$date, _state$date$value, _state$date$value$for, _window$BaseMaterials, _state$service$cacheI15, _state$service7, _state$service7$cache, _state$service7$cache2, _state$service$cacheI16, _state$service$cacheI17, _state$bookingConfig9, _state$bookingConfig10, _state$bookingConfig11, _state$bookingConfig12;
40
40
  var _Form$useForm = Form.useForm(),
41
41
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
42
42
  form = _Form$useForm2[0];
@@ -563,7 +563,7 @@ var Info = function Info(_, ref) {
563
563
  setTimeout(function () {
564
564
  getResourcesData();
565
565
  }, 20);
566
- }, [state.date.value]);
566
+ }, [(_state$date = state.date) === null || _state$date === void 0 ? void 0 : (_state$date$value = _state$date.value) === null || _state$date$value === void 0 ? void 0 : (_state$date$value$for = _state$date$value.format) === null || _state$date$value$for === void 0 ? void 0 : _state$date$value$for.call(_state$date$value, 'YYYY-MM-DD')]);
567
567
 
568
568
  /**
569
569
  * @title: 编辑商品
@@ -665,6 +665,7 @@ var Info = function Info(_, ref) {
665
665
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer
666
666
  //通过zIndex的方式控制 添加商品 和 编辑服务弹窗的上下层级
667
667
  , {
668
+ titleNoWrap: true,
668
669
  zIndex: state.service.changeService ? 999 : 1000,
669
670
  forceRender: true,
670
671
  open: state.service.editModal && !((_state$service$cacheI10 = state.service.cacheItem) !== null && _state$service$cacheI10 !== void 0 && _state$service$cacheI10.autoClose),
@@ -18,6 +18,7 @@ import { getNoResource } from "../../../mock";
18
18
  import { getErrorList } from "../../../utils";
19
19
  import ServiceItem from "../serviceItem";
20
20
  var ServiceList = function ServiceList(_ref) {
21
+ var _state$service, _state$service$value;
21
22
  var onEdit = _ref.onEdit;
22
23
  var _useContext = useContext(Context),
23
24
  state = _useContext.state,
@@ -90,7 +91,7 @@ var ServiceList = function ServiceList(_ref) {
90
91
  };
91
92
  return /*#__PURE__*/React.createElement("div", {
92
93
  className: ""
93
- }, state.service.value.map(function (d) {
94
+ }, (_state$service = state.service) === null || _state$service === void 0 ? void 0 : (_state$service$value = _state$service.value) === null || _state$service$value === void 0 ? void 0 : _state$service$value.map(function (d) {
94
95
  var _d$_extend;
95
96
  var resourceItem = getResourceItem((_d$_extend = d._extend) === null || _d$_extend === void 0 ? void 0 : _d$_extend.resource);
96
97
  var errorMessage = getErrorMessage(d, resourceItem);
@@ -88,6 +88,6 @@ export var isBooking4Shop = function isBooking4Shop(shopId, renderType) {
88
88
  if (renderType === 'eventBooking') {
89
89
  return false;
90
90
  }
91
- var booking4Shops = [1350, 1401, 3013, 7154, 7572];
91
+ var booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007];
92
92
  return booking4Shops.includes(shopId);
93
93
  };
@@ -27,6 +27,7 @@ import { updateServiceDate } from "../info/date";
27
27
  import useEngineContext from "../../../hooks/useEngineContext";
28
28
  import Notes from "../info/notes";
29
29
  import "../info/index.less";
30
+ import { Skeleton } from "antd";
30
31
  var defaultModules = {
31
32
  client: 1,
32
33
  date: 1,
@@ -211,6 +212,14 @@ var Info = Provider(function (props) {
211
212
  height: context !== null && context !== void 0 && (_context$appHelper4 = context.appHelper) !== null && _context$appHelper4 !== void 0 && (_context$appHelper4$u = _context$appHelper4.utils) !== null && _context$appHelper4$u !== void 0 && _context$appHelper4$u.isMobile ? '100%' : '100vh'
212
213
  }), _defineProperty(_React$createElement, "bodyClassName", "booking-info-warp"), _React$createElement), /*#__PURE__*/React.createElement("div", {
213
214
  className: "booking-info"
214
- }, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state7 = modal.state) !== null && _modal$state7 !== void 0 && _modal$state7.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === 'form' ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, modules.service ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service, null) : null) : null, notes, slot ? slot : null)) : null);
215
+ }, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state7 = modal.state) !== null && _modal$state7 !== void 0 && _modal$state7.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === 'form' ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, /*#__PURE__*/React.createElement(Skeleton, {
216
+ loading: globalState.loading,
217
+ round: true,
218
+ active: true,
219
+ avatar: false,
220
+ style: {
221
+ paddingTop: 20
222
+ }
223
+ }, modules.service ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service, null) : null) : null, notes, slot ? slot : null))) : null);
215
224
  });
216
225
  export default Info;
@@ -135,7 +135,7 @@ export var getResourceTimeIsUsable = function getResourceTimeIsUsable(item, cach
135
135
  }
136
136
  }
137
137
 
138
- // 是否可用
138
+ // 是否可用 只判断是否在日期范围内,
139
139
  var isUsable = isDateRange && isCountRange;
140
140
 
141
141
  // 储存到拓展数据内
@@ -187,7 +187,7 @@ export var formatTimes = function formatTimes(resourceItem, cacheItem) {
187
187
  _resourceItem.times = _resourceItem.times.map(function (time) {
188
188
  var _time = getResourceTimeIsUsable(time, cacheItem, _resourceItem);
189
189
  // 取出可用的列表
190
- if (_time !== null && _time !== void 0 && _time._extend.isUsable) {
190
+ if (_time !== null && _time !== void 0 && _time._extend.isDateRange) {
191
191
  usableTimes.push(_time);
192
192
  }
193
193
  return _time;
@@ -229,7 +229,6 @@ export var getErrorList = function getErrorList(resource, cacheItem) {
229
229
  endText = locales.getText('pisell1.text.tomorrow') + endText;
230
230
  }
231
231
  var isSingle = (cacheItem === null || cacheItem === void 0 ? void 0 : (_cacheItem$_data = cacheItem._data) === null || _cacheItem$_data === void 0 ? void 0 : (_cacheItem$_data$reso = _cacheItem$_data.resourceMaps) === null || _cacheItem$_data$reso === void 0 ? void 0 : (_cacheItem$_data$reso2 = _cacheItem$_data$reso[resource === null || resource === void 0 ? void 0 : resource.form_id]) === null || _cacheItem$_data$reso2 === void 0 ? void 0 : _cacheItem$_data$reso2.type) === "single";
232
- console.log('resourceresource', resource, cacheItem);
233
232
  if (!((_resource$_extend = resource._extend) !== null && _resource$_extend !== void 0 && _resource$_extend.usableTime)) {
234
233
  if (isSingle) {
235
234
  list.push({
@@ -3,6 +3,7 @@ export interface FormState {
3
3
  amountSymbol: string;
4
4
  apis: {
5
5
  getClients: (par?: any) => any;
6
+ getClientsEs: (par?: any) => any;
6
7
  getServices: (par?: any) => any;
7
8
  getResources: (par?: any) => any;
8
9
  getProducts: (par?: any) => any;
@@ -92,6 +93,7 @@ export interface FormState {
92
93
  disableEventBookingEdit?: boolean;
93
94
  /** 关闭自动打开选择服务弹窗 */
94
95
  closeAutoOpenService?: boolean;
96
+ loading: boolean;
95
97
  }
96
98
  export declare const walkInData: {
97
99
  id: number;
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: any;
7
+ declare const Notes: (props: any) => any;
8
8
  export default Notes;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => JSX.Element;
2
+ declare const Schedules: (props: any) => any;
3
3
  export default Schedules;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarDataItem, ScheduleItem } from "./type";
2
3
  import dayjs from "dayjs";
3
4
  export interface FormState {
@@ -68,7 +69,7 @@ export interface FormState {
68
69
  };
69
70
  setGlobalState: Function | null;
70
71
  }
71
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
72
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
72
73
  state: FormState;
73
74
  } & {
74
75
  dispatch: (params: {
@@ -129,6 +129,7 @@ var Addons = (0, import_model.Provider)((props) => {
129
129
  const context = (0, import_useEngineContext.default)();
130
130
  const [modal, contextHolder] = import_antd.Modal.useModal();
131
131
  const { isTerminal, interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
132
+ import_utils2.request.setRequest(context.appHelper.utils.request);
132
133
  (0, import_react.useEffect)(() => {
133
134
  dispatch({
134
135
  type: "setState",
@@ -148,11 +149,6 @@ var Addons = (0, import_model.Provider)((props) => {
148
149
  const init = () => {
149
150
  getAddonsByOrderId();
150
151
  };
151
- (0, import_react.useEffect)(() => {
152
- if (state.bookingDetail) {
153
- init();
154
- }
155
- }, [state.bookingDetail]);
156
152
  (0, import_react.useEffect)(() => {
157
153
  var _a2;
158
154
  if (isTerminal == null ? void 0 : isTerminal()) {
@@ -439,6 +435,7 @@ var Addons = (0, import_model.Provider)((props) => {
439
435
  ), /* @__PURE__ */ import_react.default.createElement(
440
436
  import_drawer.default,
441
437
  {
438
+ titleNoWrap: true,
442
439
  open: state.addons.showModal,
443
440
  title: import_utils3.locales.getText("pisell2.text.addons"),
444
441
  onClose: () => {
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -95,7 +95,7 @@ var TabProduct = (props) => {
95
95
  {
96
96
  className: "booking-tabs-wrap",
97
97
  style: {
98
- top: "100px"
98
+ top: "67px"
99
99
  }
100
100
  },
101
101
  /* @__PURE__ */ import_react.default.createElement(import_card.default, { className: "booking-tabs", id: "product-category" }, /* @__PURE__ */ import_react.default.createElement(
@@ -262,6 +262,7 @@ var CustomSelect = (props, ref) => {
262
262
  onClose: () => {
263
263
  closeDrawer(true);
264
264
  },
265
+ titleNoWrap: true,
265
266
  header: /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
266
267
  import_antd.Input,
267
268
  {
@@ -308,7 +309,7 @@ var CustomSelect = (props, ref) => {
308
309
  {
309
310
  itemLayout: "horizontal",
310
311
  dataSource: renderList,
311
- loading,
312
+ loading: { spinning: !!loading, delay: 500 },
312
313
  loadMore,
313
314
  renderItem: (item) => /* @__PURE__ */ import_react.default.createElement(
314
315
  import_antd.List.Item,
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import { DrawerProps } from "antd";
3
- import "./index.less";
1
+ import React from 'react';
2
+ import { DrawerProps } from 'antd';
3
+ import './index.less';
4
4
  export interface PisellDrawerProps extends DrawerProps {
5
5
  header?: React.ReactNode;
6
6
  titleNoWrap?: boolean;
@@ -54,23 +54,25 @@ var Drawer = (props) => {
54
54
  push: false,
55
55
  mask: false
56
56
  },
57
- /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-lowcode__booking-drawer-title-wrap") }, showGoBack && /* @__PURE__ */ import_react.default.createElement(
58
- import_ArrowLeft.default,
57
+ /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-lowcode__booking-drawer-title-wrap") }, /* @__PURE__ */ import_react.default.createElement(
58
+ "div",
59
59
  {
60
- className: "pisell-lowcode__booking-drawer-back",
60
+ className: "pisell-lowcode__booking-drawer-title-line",
61
61
  onClick: (e) => {
62
62
  var _a;
63
63
  (_a = props.onClose) == null ? void 0 : _a.call(props, e);
64
64
  }
65
- }
66
- ), /* @__PURE__ */ import_react.default.createElement(
67
- "div",
68
- {
69
- className: (0, import_classnames.default)("pisell-lowcode__booking-drawer-title", {
70
- "pisell-lowcode__booking-drawer-title-no-wrap": props.titleNoWrap
71
- })
72
65
  },
73
- props.title
66
+ showGoBack && /* @__PURE__ */ import_react.default.createElement(import_ArrowLeft.default, { className: "pisell-lowcode__booking-drawer-back" }),
67
+ /* @__PURE__ */ import_react.default.createElement(
68
+ "div",
69
+ {
70
+ className: (0, import_classnames.default)("pisell-lowcode__booking-drawer-title", {
71
+ "pisell-lowcode__booking-drawer-title-no-wrap": props.titleNoWrap
72
+ })
73
+ },
74
+ props.title
75
+ )
74
76
  ), props.header),
75
77
  /* @__PURE__ */ import_react.default.createElement("div", null, props.children)
76
78
  );
@@ -1,5 +1,4 @@
1
1
  .pisell-lowcode__booking-drawer-title-wrap {
2
- cursor: pointer;
3
2
  position: sticky;
4
3
  top: 0;
5
4
  left: 0;
@@ -9,18 +8,21 @@
9
8
  padding: 24px 32px 0 32px;
10
9
 
11
10
 
11
+ .pisell-lowcode__booking-drawer-title-line {
12
+ cursor: pointer;
13
+ }
12
14
 
13
15
  .pisell-lowcode__booking-drawer-back {
14
- font-size: 32px;
16
+ font-size: 18px !important;
15
17
  color: #000000;
18
+ margin-right: 6px;
19
+ cursor: pointer;
16
20
  }
17
21
 
18
22
  .pisell-lowcode__booking-drawer-title {
19
23
  color: var(--base-black, #000);
20
-
21
- /* Display sm/Medium */
22
-
23
- font-size: 30px;
24
+ cursor: pointer;
25
+ font-size: 18px !important;
24
26
  font-style: normal;
25
27
  font-weight: 500;
26
28
  line-height: 38px;
@@ -49,14 +49,23 @@ var import_serve = require("./serve");
49
49
  var import_serve2 = require("../../info2/serve");
50
50
  var import_utils3 = require("../../info/utils");
51
51
  var Footer = (props) => {
52
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
52
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
53
53
  const { state, buttons, dispatch, source } = props;
54
54
  const [showDetail, setShowDetail] = (0, import_react.useState)(false);
55
55
  const [loading, setLoading] = (0, import_react.useState)(false);
56
56
  const [checkoutLoading, setCheckoutLoading] = (0, import_react.useState)(false);
57
+ const [isShowPaymentLink, setIsShowPaymentLink] = (0, import_react.useState)(false);
57
58
  const context = (0, import_useEngineContext.default)();
58
59
  const { isTerminal, interaction, store, storage } = (_a = context.appHelper) == null ? void 0 : _a.utils;
59
- const isShowPaymentLink = (_d = (_c = (_b = store == null ? void 0 : store.getState) == null ? void 0 : _b.call(store)) == null ? void 0 : _c.global) == null ? void 0 : _d.paymentLinkBtnShow;
60
+ (0, import_react.useEffect)(() => {
61
+ store == null ? void 0 : store.dispatch({
62
+ type: "global/_getMetadataMap",
63
+ callback: (data) => {
64
+ console.log(data, "data");
65
+ setIsShowPaymentLink(!!data["payment_collection_link_config_switch"]);
66
+ }
67
+ });
68
+ }, []);
60
69
  const [modal, contextHolder] = import_antd.Modal.useModal();
61
70
  const { setActiveTab } = state;
62
71
  const isTeam = (0, import_react.useMemo)(() => {
@@ -112,29 +121,24 @@ var Footer = (props) => {
112
121
  });
113
122
  }
114
123
  }, [state.bookingDetail]);
115
- (0, import_react.useEffect)(() => {
116
- store == null ? void 0 : store.dispatch({
117
- type: "global/_getPaymentLinkBtnShow"
118
- });
119
- }, []);
120
124
  const params = (0, import_react.useMemo)(() => {
121
125
  var _a2, _b2, _c2;
122
126
  return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.appointment_subject) || {};
123
- }, [(_g = (_f = (_e = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _e.config) == null ? void 0 : _f.basic) == null ? void 0 : _g.appointment_subject]);
127
+ }, [(_d = (_c = (_b = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.appointment_subject]);
124
128
  const transaction_habit_selection = (0, import_react.useMemo)(() => {
125
129
  var _a2, _b2, _c2;
126
130
  return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.information_tab) == null ? void 0 : _c2.transaction_habit_selection) || {
127
131
  type: "service_now_pay_later",
128
132
  button_rows: 1
129
133
  };
130
- }, [(_i = (_h = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _h.config) == null ? void 0 : _i.information_tab]);
134
+ }, [(_f = (_e = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _e.config) == null ? void 0 : _f.information_tab]);
131
135
  const addonsEdit = (0, import_react.useMemo)(() => {
132
136
  var _a2;
133
137
  if ((_a2 = state.addons) == null ? void 0 : _a2.edit) {
134
138
  return true;
135
139
  }
136
140
  return false;
137
- }, [(_j = state.addons) == null ? void 0 : _j.edit]);
141
+ }, [(_g = state.addons) == null ? void 0 : _g.edit]);
138
142
  const infoEdit = (0, import_react.useMemo)(() => {
139
143
  var _a2, _b2, _c2, _d2, _e2, _f2;
140
144
  if (!state.bookingId) {
@@ -726,7 +730,7 @@ var Footer = (props) => {
726
730
  }, [
727
731
  state.bookingId,
728
732
  state.bookingDetail,
729
- (_k = state.addons) == null ? void 0 : _k.load,
733
+ (_h = state.addons) == null ? void 0 : _h.load,
730
734
  state.renderType
731
735
  ]);
732
736
  const menuChange = (e) => {
@@ -787,7 +791,7 @@ var Footer = (props) => {
787
791
  },
788
792
  /* @__PURE__ */ import_react.default.createElement("div", { className: "order-total-item-border" }),
789
793
  /* @__PURE__ */ import_react.default.createElement("div", { className: "order-total-item" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "order-total-item-label" }, import_utils.locales.getText("pisell1.text.subtotal")), /* @__PURE__ */ import_react.default.createElement("span", { className: "order-total-item-value" }, (0, import_utils.formatAmount)(total.productAmount, 2, (state == null ? void 0 : state.amountSymbol) || "$"))),
790
- (((_l = state.bookingDetail) == null ? void 0 : _l.surcharge) || []).map((d) => {
794
+ (((_i = state.bookingDetail) == null ? void 0 : _i.surcharge) || []).map((d) => {
791
795
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "order-total-item", key: d.id }, /* @__PURE__ */ import_react.default.createElement("span", { className: "order-total-item-label" }, d.name[state.locale]), /* @__PURE__ */ import_react.default.createElement("span", { className: "order-total-item-value" }, (0, import_utils.formatAmount)(d.amount, 2, (state == null ? void 0 : state.amountSymbol) || "$")));
792
796
  }),
793
797
  state.bookingId ? /* @__PURE__ */ import_react.default.createElement("div", { className: "order-total-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "order-total-item-label" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, import_utils.locales.getText("pisell1.text.tax")), /* @__PURE__ */ import_react.default.createElement("div", { className: "", style: { fontSize: 14 } }, taxText)), /* @__PURE__ */ import_react.default.createElement("span", { className: "order-total-item-value" }, (0, import_utils.formatAmount)(total.tax, 2, (state == null ? void 0 : state.amountSymbol) || "$"))) : null,
@@ -3,6 +3,9 @@
3
3
  display: flex;
4
4
  gap: 12px;
5
5
  }
6
+ .pisell-lowcode-modal-header {
7
+ padding: 0 0 10px;
8
+ }
6
9
  .pisell-lowcode__edit-deposit-modal-field-list {
7
10
  display: flex;
8
11
  flex-direction: column;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -44,6 +44,7 @@ var import_utils = require("@pisell/utils");
44
44
  var import_utils2 = require("../../utils");
45
45
  var import_serve = require("./serve");
46
46
  var import_ahooks = require("ahooks");
47
+ var isLoadClient = false;
47
48
  var Client = () => {
48
49
  var _a, _b, _c, _d, _e, _f;
49
50
  const modalRef = (0, import_react.useRef)();
@@ -53,9 +54,10 @@ var Client = () => {
53
54
  const [franchiseeLoading, setFranchiseeLoading] = (0, import_react.useState)(0);
54
55
  const [params, setParams] = (0, import_react.useState)({
55
56
  skip: 1,
56
- num: 50,
57
+ num: 10,
57
58
  total: 0,
58
- search: ""
59
+ search: "",
60
+ sort_by: "id"
59
61
  });
60
62
  const menus = (0, import_react.useMemo)(() => {
61
63
  let list = [
@@ -72,9 +74,20 @@ var Client = () => {
72
74
  customer_id,
73
75
  ...resetParams
74
76
  }) => {
75
- let _setLoading = resetParams.skip === 1 ? setLoading : setLoadLoading;
77
+ var _a2, _b2;
78
+ let _setLoading;
79
+ if (resetParams.skip === 1) {
80
+ if (resetParams.search) {
81
+ _setLoading = setLoading;
82
+ } else {
83
+ _setLoading = isLoadClient || ((_b2 = (_a2 = state == null ? void 0 : state.client) == null ? void 0 : _a2.clients) == null ? void 0 : _b2.length) ? () => {
84
+ } : setLoading;
85
+ }
86
+ } else {
87
+ _setLoading = setLoadLoading;
88
+ }
76
89
  _setLoading(true);
77
- const api = state.isFranchisee ? import_serve.getFranchiseeCustomerList : state.apis.getClients;
90
+ const api = state.isFranchisee ? import_serve.getFranchiseeCustomerList : state.apis.getClientsEs;
78
91
  const data = await api({
79
92
  ...resetParams,
80
93
  ...!state.isFranchisee ? { _config: { abort: true } } : {}
@@ -111,7 +124,9 @@ var Client = () => {
111
124
  type: "setClient",
112
125
  payload: _payload
113
126
  });
114
- _setLoading(false);
127
+ setLoading(false);
128
+ setLoadLoading(false);
129
+ isLoadClient = true;
115
130
  return {};
116
131
  };
117
132
  const handleOpenClientModal = () => {
@@ -127,7 +142,8 @@ var Client = () => {
127
142
  if ((0, import_utils2.isWalkIn)(item == null ? void 0 : item.id)) {
128
143
  return import_utils.locales.getText("pisell2.text.select-a-customer");
129
144
  }
130
- return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || "";
145
+ const firstLastName = item.first_name || item.last_name ? `${item.first_name} ${item.last_name}` : "";
146
+ return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || firstLastName.trim() || "";
131
147
  },
132
148
  [import_utils.locales.localeMap]
133
149
  );
@@ -201,12 +217,16 @@ var Client = () => {
201
217
  showReceiveAddress: false,
202
218
  showAcceptsMarketing: false
203
219
  },
204
- callback: (customer_id) => {
205
- getClients({
206
- ...state.client.clientsParams,
207
- search: "",
208
- customer_id,
209
- skip: 1
220
+ callback: (customer_id, params2) => {
221
+ var _a2, _b2, _c2;
222
+ dispatch({
223
+ type: "setClient",
224
+ payload: {
225
+ clients: [
226
+ ...((_a2 = params2 == null ? void 0 : params2[0]) == null ? void 0 : _a2.customer) ? [{ ...(_b2 = params2 == null ? void 0 : params2[0]) == null ? void 0 : _b2.customer, id: customer_id }] : [],
227
+ ...((_c2 = state.client) == null ? void 0 : _c2.clients) || []
228
+ ]
229
+ }
210
230
  });
211
231
  }
212
232
  });
@@ -289,7 +309,6 @@ var Client = () => {
289
309
  mode: "single",
290
310
  createItemText: import_utils.locales.getText("pisell2.text.create-new-customer"),
291
311
  closeCallback: () => {
292
- searchChange("");
293
312
  },
294
313
  optionRender: (item) => {
295
314
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
@@ -309,14 +328,7 @@ var Client = () => {
309
328
  }
310
329
  }
311
330
  );
312
- }, [
313
- state,
314
- renderList,
315
- loading,
316
- franchiseeLoading,
317
- params.search,
318
- loadMore
319
- ]);
331
+ }, [state, renderList, loading, franchiseeLoading, params.search, loadMore]);
320
332
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
321
333
  "div",
322
334
  {
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { FormState } from "../../../model";
1
+ import React from 'react';
2
+ import { FormState } from '../../../model';
3
3
  interface useClientFnParams {
4
4
  state: any;
5
5
  setGlobalState: (val: any) => void;
@@ -7,7 +7,7 @@ interface useClientFnParams {
7
7
  onRemoveClient?: () => void;
8
8
  }
9
9
  declare const useClientFn: (_params: useClientFnParams) => {
10
- setClient: (client: Partial<FormState["client"]>) => void;
10
+ setClient: (client: Partial<FormState['client']>) => void;
11
11
  isWalkIn: boolean;
12
12
  handleSelectClient: (value: any) => Promise<unknown>;
13
13
  menuChange: (e: any) => void;
@@ -16,7 +16,7 @@ declare const useClientFn: (_params: useClientFnParams) => {
16
16
  key: string;
17
17
  label: any;
18
18
  }[];
19
- handleCreateItem: () => void;
19
+ handleCreateItem: (cb?: () => void) => void;
20
20
  getClients: ({ customer_id, customer_ids, ...resetParams }: {
21
21
  customer_id?: number | undefined;
22
22
  skip?: number | undefined;