@pisell/private-materials 6.2.32 → 6.2.33

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 (79) 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 +11 -11
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/booking/components/footer/index.js +15 -5
  12. package/es/components/booking/components/footer/index.less +23 -0
  13. package/es/components/booking/components/tabPane/index.less +3 -3
  14. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  15. package/es/components/booking/info/service/Lists.d.ts +0 -1
  16. package/es/components/booking/info/service/Lists.js +1 -1
  17. package/es/components/booking/info/service2/utils.js +18 -17
  18. package/es/components/booking/info2/cartClientCard/index.js +60 -67
  19. package/es/components/booking/info2/service/editService/index.js +71 -11
  20. package/es/components/booking/info2/service/editService/index.less +47 -11
  21. package/es/components/booking/locales.js +4 -4
  22. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  23. package/es/components/eftposPay/amount.d.ts +1 -1
  24. package/es/components/eftposPay/device.d.ts +1 -1
  25. package/es/components/eftposPay/store/index.d.ts +1 -1
  26. package/es/components/productSelect/components/productGroup/index.js +2 -2
  27. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  28. package/es/components/shoppingCart/components/Cart/Product.js +4 -3
  29. package/es/components/ticketBooking/components/timeBar/index.js +4 -1
  30. package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +23 -18
  31. package/es/components/ticketBooking/locales.js +3 -0
  32. package/es/plus/clientCard/locales.js +2 -2
  33. package/es/plus/clientName/index.d.ts +0 -1
  34. package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
  35. package/es/plus/clinetSearch/index.d.ts +0 -1
  36. package/es/plus/clinetSearch/index.js +6 -6
  37. package/es/plus/clinetSearch/index.less +4 -0
  38. package/es/pro/comprehensiveSearch/index.d.ts +1 -3
  39. package/es/pro/comprehensiveSearch/index.js +18 -49
  40. package/es/pro/comprehensiveSearch/index.less +1 -6
  41. package/es/pro/comprehensiveSearch/types.d.ts +2 -1
  42. package/es/pro/skuDetailModal/index.js +21 -7
  43. package/es/pro/skuDetailModal/index.less +40 -0
  44. package/lib/components/booking/components/footer/index.js +16 -9
  45. package/lib/components/booking/components/footer/index.less +23 -0
  46. package/lib/components/booking/components/tabPane/index.less +3 -3
  47. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  48. package/lib/components/booking/info/service/Lists.d.ts +0 -1
  49. package/lib/components/booking/info/service/Lists.js +1 -1
  50. package/lib/components/booking/info/service2/utils.js +12 -11
  51. package/lib/components/booking/info2/cartClientCard/index.js +23 -31
  52. package/lib/components/booking/info2/service/editService/index.js +71 -18
  53. package/lib/components/booking/info2/service/editService/index.less +47 -11
  54. package/lib/components/booking/locales.js +4 -4
  55. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  56. package/lib/components/eftposPay/amount.d.ts +1 -1
  57. package/lib/components/eftposPay/device.d.ts +1 -1
  58. package/lib/components/eftposPay/store/index.d.ts +1 -1
  59. package/lib/components/productSelect/components/productGroup/index.js +1 -1
  60. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  61. package/lib/components/shoppingCart/components/Cart/Product.js +4 -3
  62. package/lib/components/ticketBooking/components/timeBar/index.js +1 -1
  63. package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +23 -12
  64. package/lib/components/ticketBooking/locales.js +12 -3
  65. package/lib/plus/clientCard/locales.js +2 -2
  66. package/lib/plus/clientName/index.d.ts +0 -1
  67. package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
  68. package/lib/plus/clinetSearch/index.d.ts +0 -1
  69. package/lib/plus/clinetSearch/index.js +6 -7
  70. package/lib/plus/clinetSearch/index.less +4 -0
  71. package/lib/pro/comprehensiveSearch/index.d.ts +1 -3
  72. package/lib/pro/comprehensiveSearch/index.js +12 -23
  73. package/lib/pro/comprehensiveSearch/index.less +1 -6
  74. package/lib/pro/comprehensiveSearch/types.d.ts +2 -1
  75. package/lib/pro/skuDetailModal/index.js +22 -6
  76. package/lib/pro/skuDetailModal/index.less +40 -0
  77. package/package.json +2 -2
  78. package/es/pro/comprehensiveSearch/camera.svg +0 -4
  79. package/lib/pro/comprehensiveSearch/camera.svg +0 -4
@@ -39,6 +39,7 @@ import { useIsBooking4Shop } from "../../hooks/useIsBooking4Shop";
39
39
  import { sendWarningLog } from '@pisell/utils';
40
40
  import dayjs from 'dayjs';
41
41
  import useScanManager from "../../../ticketBooking/hooks/pisellos/useScanManager";
42
+ import { Iconfont } from '@pisell/materials';
42
43
  /**
43
44
  * @title: 底部
44
45
  * @description:
@@ -48,7 +49,7 @@ import useScanManager from "../../../ticketBooking/hooks/pisellos/useScanManager
48
49
  * @Date: 2024-01-30 16:51
49
50
  */
50
51
  var Footer = function Footer(props) {
51
- var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _state$bookingDetail8, _state$addons4, _state$bookingDetail16, _state$bookingDetail17, _state$notes2;
52
+ var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _state$notes3, _state$bookingDetail8, _state$addons4, _state$bookingDetail16, _state$bookingDetail17, _state$notes4;
52
53
  var state = props.state,
53
54
  buttons = props.buttons,
54
55
  dispatch = props.dispatch,
@@ -946,6 +947,11 @@ var Footer = function Footer(props) {
946
947
  // style={{ backgroundColor: '#f04438', color: '#fff' }}
947
948
  }, locales.getText('pisell2.booking.info.text.clear-all')));
948
949
  }, []);
950
+ var hasOrderNote = useMemo(function () {
951
+ var _state$notes2;
952
+ var note = (state === null || state === void 0 || (_state$notes2 = state.notes) === null || _state$notes2 === void 0 ? void 0 : _state$notes2.orderNote) || '';
953
+ return note.trim().length > 0;
954
+ }, [state === null || state === void 0 || (_state$notes3 = state.notes) === null || _state$notes3 === void 0 ? void 0 : _state$notes3.orderNote]);
949
955
  var noteButton = useMemo(function () {
950
956
  return /*#__PURE__*/React.createElement(ConfigProvider, {
951
957
  theme: {
@@ -954,11 +960,15 @@ var Footer = function Footer(props) {
954
960
  }
955
961
  }
956
962
  }, /*#__PURE__*/React.createElement(Button, {
957
- className: "pisell-lowcode__booking-footer-buttons-item",
963
+ className: "pisell-lowcode__booking-footer-buttons-item note-button",
958
964
  type: "primary",
959
965
  onClick: handleNote
960
- }, locales.getText('pisell2.ticket-booking.note')));
961
- }, []);
966
+ }, locales.getText('pisell2.ticket-booking.note'), hasOrderNote && /*#__PURE__*/React.createElement("span", {
967
+ className: "note-indicator"
968
+ }, /*#__PURE__*/React.createElement(Iconfont, {
969
+ type: "pisell2-info-circle2"
970
+ }))));
971
+ }, [hasOrderNote]);
962
972
  var buttonMap = {
963
973
  checkout: checkoutButton,
964
974
  save: saveButton,
@@ -1444,7 +1454,7 @@ var Footer = function Footer(props) {
1444
1454
  }), noteModalOpen && /*#__PURE__*/React.createElement(NoteModal, {
1445
1455
  open: noteModalOpen,
1446
1456
  title: locales.getText('pisell2.text.add-order-notes'),
1447
- value: ((_state$notes2 = state.notes) === null || _state$notes2 === void 0 ? void 0 : _state$notes2.orderNote) || '',
1457
+ value: ((_state$notes4 = state.notes) === null || _state$notes4 === void 0 ? void 0 : _state$notes4.orderNote) || '',
1448
1458
  onConfirm: handleNoteConfirm,
1449
1459
  onDelete: handleNoteDelete,
1450
1460
  onCancel: handleNoteCancel
@@ -122,6 +122,29 @@
122
122
  align-items: center;
123
123
  justify-content: center;
124
124
  flex: 1;
125
+ position: relative;
126
+
127
+ &.note-button {
128
+ .note-indicator {
129
+ position: absolute;
130
+ top: 0; // 不使用负数偏移
131
+ right: 0; // 不使用负数偏移
132
+ transform: translate(12%, -12%); // 向外溢出约 2-3px
133
+ width: 24px;
134
+ height: 24px;
135
+ border-radius: 50%;
136
+ background-color: #7F56DA; // 紫色
137
+ color: #fff;
138
+ font-weight: 700;
139
+ display: flex;
140
+ align-items: center;
141
+ justify-content: center;
142
+ line-height: 1;
143
+ font-size: 30px;
144
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
145
+ pointer-events: none;
146
+ }
147
+ }
125
148
  }
126
149
 
127
150
  .pisell-lowcode__booking-footer-buttons-item-primary {
@@ -120,9 +120,9 @@
120
120
  }
121
121
 
122
122
  .pisell-lowcode__booking-tab-pane-footer {
123
- position: sticky;
124
- bottom: 0;
125
- left: 0;
123
+ //position: sticky;
124
+ //bottom: 0;
125
+ //left: 0;
126
126
  z-index: 2;
127
127
  display: block;
128
128
  // display: flex;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { EditServiceRef } from "../service/editService";
3
2
  declare const useInfoHolder: (state: any, dispatch: any) => {
4
3
  detailRef: import("react").MutableRefObject<EditServiceRef | undefined>;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
3
2
  export default Lists;
@@ -84,7 +84,7 @@ var Lists = function Lists(_ref) {
84
84
  var _state$bookingConfig;
85
85
  return {
86
86
  hideAddBtn: state.isTerminalDayBookingPage || state.isBookingCreatePage,
87
- isShowNote: isEventBooking(state),
87
+ isShowNote: state.isBookingTicket2 ? true : isEventBooking(state),
88
88
  isShowPackageNote: false,
89
89
  accounts: [],
90
90
  isEdit: !!(state !== null && state !== void 0 && state.bookingId),
@@ -625,6 +625,7 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
625
625
  isShowChangeHolder: !isNormalProduct,
626
626
  isShowAction: isShowAddTime(state, item),
627
627
  actionText: locales.getText('page.booking.text.add-time'),
628
+ actionIcon: 'pisell2-clock-plus',
628
629
  isMultipleResource: true,
629
630
  multiResources: multiResources,
630
631
  holderMaxCount: item === null || item === void 0 ? void 0 : item._extend.quantity,
@@ -657,7 +658,7 @@ export var formatProducts = function formatProducts(lists, state) {
657
658
  var normalList = [];
658
659
  var groupList = [];
659
660
  var formItem = function formItem(item) {
660
- var _item$_extend10, _item$_extend11, _item$_extend12, _item$_extend14, _item$_extend15, _item$_extend16, _item$_extend17, _item$_extend18, _item$_extend19, _item$_extend20, _item$_extend21, _item$_extend22, _resourceItem, _item$_extend23, _item$_extend24, _item$_extend25, _item$_extend26, _item$_extend27;
661
+ var _item$_extend10, _item$_extend11, _item$_extend12, _item$_extend14, _item$_extend15, _item$_extend16, _item$_extend17, _item$_extend18, _item$_extend19, _item$_extend20, _item$_extend21, _item$_extend22, _item$_extend23, _resourceItem, _item$_extend24, _item$_extend25, _item$_extend26, _item$_extend27, _item$_extend28;
661
662
  var _isDayBookingProduct = isDayBookingProduct(item, state);
662
663
  var clientTitle = getHolderName(state, item === null || item === void 0 || (_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.holder_id);
663
664
  var options = formatOptions(item === null || item === void 0 || (_item$_extend11 = item._extend) === null || _item$_extend11 === void 0 || (_item$_extend11 = _item$_extend11.other) === null || _item$_extend11 === void 0 ? void 0 : _item$_extend11.option);
@@ -684,19 +685,19 @@ export var formatProducts = function formatProducts(lists, state) {
684
685
  num: item === null || item === void 0 ? void 0 : item._extend.quantity,
685
686
  image: item === null || item === void 0 ? void 0 : item.cover,
686
687
  isShowNote: true,
687
- note: item === null || item === void 0 ? void 0 : item.note,
688
- like_status: item === null || item === void 0 || (_item$_extend19 = item._extend) === null || _item$_extend19 === void 0 ? void 0 : _item$_extend19.like_status,
688
+ note: (item === null || item === void 0 ? void 0 : item.note) || (item === null || item === void 0 || (_item$_extend19 = item._extend) === null || _item$_extend19 === void 0 ? void 0 : _item$_extend19.note),
689
+ like_status: item === null || item === void 0 || (_item$_extend20 = item._extend) === null || _item$_extend20 === void 0 ? void 0 : _item$_extend20.like_status,
689
690
  bundle: bundle,
690
691
  options: options,
691
692
  errorMessage: errorMessage,
692
- product_option_string: item === null || item === void 0 || (_item$_extend20 = item._extend) === null || _item$_extend20 === void 0 || (_item$_extend20 = _item$_extend20.other) === null || _item$_extend20 === void 0 ? void 0 : _item$_extend20.product_option_string,
693
- discount_reason: item === null || item === void 0 || (_item$_extend21 = item._extend) === null || _item$_extend21 === void 0 ? void 0 : _item$_extend21.discount_reason,
694
- resource_id: isNormalProduct ? 0 : item === null || item === void 0 || (_item$_extend22 = item._extend) === null || _item$_extend22 === void 0 ? void 0 : _item$_extend22.resource,
693
+ product_option_string: item === null || item === void 0 || (_item$_extend21 = item._extend) === null || _item$_extend21 === void 0 || (_item$_extend21 = _item$_extend21.other) === null || _item$_extend21 === void 0 ? void 0 : _item$_extend21.product_option_string,
694
+ discount_reason: item === null || item === void 0 || (_item$_extend22 = item._extend) === null || _item$_extend22 === void 0 ? void 0 : _item$_extend22.discount_reason,
695
+ resource_id: isNormalProduct ? 0 : item === null || item === void 0 || (_item$_extend23 = item._extend) === null || _item$_extend23 === void 0 ? void 0 : _item$_extend23.resource,
695
696
  relation_form_name: isNormalProduct ? '' : ((_resourceItem = resourceItem) === null || _resourceItem === void 0 ? void 0 : _resourceItem.labelText) || item.relation_form_name,
696
697
  holder_title: clientTitle,
697
- start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend23 = item._extend) === null || _item$_extend23 === void 0 ? void 0 : _item$_extend23.start_date : '',
698
- end_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend24 = item._extend) === null || _item$_extend24 === void 0 ? void 0 : _item$_extend24.end_date : '',
699
- holder_id: (item === null || item === void 0 || (_item$_extend25 = item._extend) === null || _item$_extend25 === void 0 ? void 0 : _item$_extend25.holder_id) || 0,
698
+ start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend24 = item._extend) === null || _item$_extend24 === void 0 ? void 0 : _item$_extend24.start_date : '',
699
+ end_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend25 = item._extend) === null || _item$_extend25 === void 0 ? void 0 : _item$_extend25.end_date : '',
700
+ holder_id: (item === null || item === void 0 || (_item$_extend26 = item._extend) === null || _item$_extend26 === void 0 ? void 0 : _item$_extend26.holder_id) || 0,
700
701
  isNormalProduct: isNormalProduct,
701
702
  isCustomItem: item === null || item === void 0 ? void 0 : item.isCustomItem,
702
703
  // 添加自定义商品标识
@@ -704,8 +705,8 @@ export var formatProducts = function formatProducts(lists, state) {
704
705
  // 是否适用优惠券/折扣
705
706
  locale: state.locale,
706
707
  symbol: state.amountSymbol,
707
- relation_products: (item === null || item === void 0 || (_item$_extend26 = item._extend) === null || _item$_extend26 === void 0 ? void 0 : _item$_extend26.relation_details) || [],
708
- items: isEventBooking(state) ? [] : formItems((item === null || item === void 0 || (_item$_extend27 = item._extend) === null || _item$_extend27 === void 0 ? void 0 : _item$_extend27.items) || [])
708
+ relation_products: (item === null || item === void 0 || (_item$_extend27 = item._extend) === null || _item$_extend27 === void 0 ? void 0 : _item$_extend27.relation_details) || [],
709
+ items: isEventBooking(state) ? [] : formItems((item === null || item === void 0 || (_item$_extend28 = item._extend) === null || _item$_extend28 === void 0 ? void 0 : _item$_extend28.items) || [])
709
710
  }, generalParams), {}, {
710
711
  _origin: item
711
712
  });
@@ -714,8 +715,8 @@ export var formatProducts = function formatProducts(lists, state) {
714
715
  if (isRenderGroup) {
715
716
  // 将商品分为组商品和非组商品
716
717
  lists.forEach(function (item) {
717
- var _item$_extend28;
718
- if (!(item !== null && item !== void 0 && (_item$_extend28 = item._extend) !== null && _item$_extend28 !== void 0 && _item$_extend28.groupId)) {
718
+ var _item$_extend29;
719
+ if (!(item !== null && item !== void 0 && (_item$_extend29 = item._extend) !== null && _item$_extend29 !== void 0 && _item$_extend29.groupId)) {
719
720
  normalList.push(formItem(item));
720
721
  } else {
721
722
  groupList.push(item);
@@ -724,8 +725,8 @@ export var formatProducts = function formatProducts(lists, state) {
724
725
 
725
726
  // 根据item._extend.groupId 进行分组
726
727
  var groups = groupList.reduce(function (prev, item) {
727
- var _item$_extend29;
728
- var groupId = item === null || item === void 0 || (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.groupId;
728
+ var _item$_extend30;
729
+ var groupId = item === null || item === void 0 || (_item$_extend30 = item._extend) === null || _item$_extend30 === void 0 ? void 0 : _item$_extend30.groupId;
729
730
  if (!prev[groupId]) {
730
731
  prev[groupId] = [];
731
732
  }
@@ -893,8 +894,8 @@ export var isHasDayAppointmentProduct = function isHasDayAppointmentProduct(stat
893
894
  // 如果该购物车中没选择任何商品,则不需要验证,所以直接用1来填充
894
895
  // services: !holderProducts?.length ? [1] : holderProducts?.filter((d: any) => appointmentTypes.includes(d.extension_type))
895
896
  services: services.filter(function (item) {
896
- var _item$_extend30;
897
- return ((_item$_extend30 = item._extend) === null || _item$_extend30 === void 0 ? void 0 : _item$_extend30.holder_id) == d.form_record_id && checkType(item.extension_type);
897
+ var _item$_extend31;
898
+ return ((_item$_extend31 = item._extend) === null || _item$_extend31 === void 0 ? void 0 : _item$_extend31.holder_id) == d.form_record_id && checkType(item.extension_type);
898
899
  })
899
900
  });
900
901
  });
@@ -47,7 +47,12 @@ var CartClientCard = /*#__PURE__*/forwardRef(function (props, ref) {
47
47
  state = _ref.state,
48
48
  dispatch = _ref.dispatch;
49
49
  var translationOriginal = useTranslationOriginal();
50
+ var _useState7 = useState(''),
51
+ _useState8 = _slicedToArray(_useState7, 2),
52
+ keyword = _useState8[0],
53
+ setKeyword = _useState8[1];
50
54
  var keywordRef = useRef('');
55
+ keywordRef.current = keyword;
51
56
  var Toast = useToast();
52
57
  var _useScanCustomer = useScanCustomer(),
53
58
  openScan = _useScanCustomer.openScan,
@@ -72,17 +77,61 @@ var CartClientCard = /*#__PURE__*/forwardRef(function (props, ref) {
72
77
  selectedCustomer = _useCustomer.selectedCustomer,
73
78
  loading = _useCustomer.loading,
74
79
  pagination = _useCustomer.pagination,
75
- loadCustomers = _useCustomer.loadCustomers,
76
80
  changePage = _useCustomer.changePage,
77
81
  selectCustomer = _useCustomer.selectCustomer,
78
82
  addCustomerToFirst = _useCustomer.addCustomerToFirst,
79
83
  initLoad = _useCustomer.initLoad,
80
84
  hasMore = _useCustomer.hasMore,
81
85
  loadMore = _useCustomer.loadMore;
86
+
87
+ // 点击搜索按钮 重置列表
88
+ var handleSearchClient = /*#__PURE__*/function () {
89
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(keyword) {
90
+ var _clientSearchRef$curr, _clientSearchRef$curr2;
91
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
92
+ while (1) switch (_context.prev = _context.next) {
93
+ case 0:
94
+ _context.next = 2;
95
+ return initLoad(keyword);
96
+ case 2:
97
+ (_clientSearchRef$curr = clientSearchRef.current) === null || _clientSearchRef$curr === void 0 || (_clientSearchRef$curr2 = _clientSearchRef$curr.resetScrollPosition) === null || _clientSearchRef$curr2 === void 0 || _clientSearchRef$curr2.call(_clientSearchRef$curr);
98
+ case 3:
99
+ case "end":
100
+ return _context.stop();
101
+ }
102
+ }, _callee);
103
+ }));
104
+ return function handleSearchClient(_x) {
105
+ return _ref2.apply(this, arguments);
106
+ };
107
+ }();
108
+
109
+ // keyword 变动时触发
110
+ var _debouncedSearch = useDebounceFn( /*#__PURE__*/function () {
111
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_keyword) {
112
+ var _clientSearchRef$curr3, _clientSearchRef$curr4;
113
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
114
+ while (1) switch (_context2.prev = _context2.next) {
115
+ case 0:
116
+ _context2.next = 2;
117
+ return initLoad(keyword);
118
+ case 2:
119
+ (_clientSearchRef$curr3 = clientSearchRef.current) === null || _clientSearchRef$curr3 === void 0 || (_clientSearchRef$curr4 = _clientSearchRef$curr3.resetScrollPosition) === null || _clientSearchRef$curr4 === void 0 || _clientSearchRef$curr4.call(_clientSearchRef$curr3);
120
+ case 3:
121
+ case "end":
122
+ return _context2.stop();
123
+ }
124
+ }, _callee2);
125
+ }));
126
+ return function (_x2) {
127
+ return _ref3.apply(this, arguments);
128
+ };
129
+ }(), {
130
+ wait: 500
131
+ });
82
132
  useEffect(function () {
83
- // 加载客户列表
84
- initLoad();
85
- }, []);
133
+ _debouncedSearch.run(keyword);
134
+ }, [keyword]);
86
135
  useEffect(function () {
87
136
  if (state.action) {
88
137
  state.action({
@@ -93,15 +142,9 @@ var CartClientCard = /*#__PURE__*/forwardRef(function (props, ref) {
93
142
  });
94
143
  }
95
144
  }, []);
96
- var updateSearchKeyword = function updateSearchKeyword(newVal) {
97
- var _clientSearchRef$curr, _clientSearchRef$curr2;
98
- (_clientSearchRef$curr = clientSearchRef.current) === null || _clientSearchRef$curr === void 0 || (_clientSearchRef$curr2 = _clientSearchRef$curr.setSearchKeyword) === null || _clientSearchRef$curr2 === void 0 || _clientSearchRef$curr2.call(_clientSearchRef$curr, newVal);
99
- keywordRef.current = newVal;
100
- };
101
145
  var handleScanCustomer = function handleScanCustomer(customer) {
102
146
  if (customer !== null && customer !== void 0 && customer.scanCode) {
103
- updateSearchKeyword(customer.scanCode);
104
- handleSearchClient(customer.scanCode);
147
+ setKeyword(customer.scanCode);
105
148
  }
106
149
  };
107
150
  useEffect(function () {
@@ -111,10 +154,7 @@ var CartClientCard = /*#__PURE__*/forwardRef(function (props, ref) {
111
154
  closeScan();
112
155
  // 如果有搜索内容,则清除
113
156
  if (keywordRef.current) {
114
- var _clientSearchRef$curr3, _clientSearchRef$curr4;
115
- updateSearchKeyword('');
116
- (_clientSearchRef$curr3 = clientSearchRef.current) === null || _clientSearchRef$curr3 === void 0 || (_clientSearchRef$curr4 = _clientSearchRef$curr3.resetScrollPosition) === null || _clientSearchRef$curr4 === void 0 || _clientSearchRef$curr4.call(_clientSearchRef$curr3);
117
- initLoad();
157
+ setKeyword('');
118
158
  }
119
159
  }
120
160
  }, [searchModalVisible, initLoad]);
@@ -127,75 +167,28 @@ var CartClientCard = /*#__PURE__*/forwardRef(function (props, ref) {
127
167
  // 处理更换客户
128
168
  var handleChangeClient = function handleChangeClient(data) {
129
169
  setSearchModalVisible(true);
130
- console.log('更换客户:', data);
131
170
  };
132
171
 
133
172
  // 处理移除客户
134
173
  var handleRemoveClient = function handleRemoveClient(data) {
135
174
  selectCustomer(null);
136
- console.log('移除客户:', data);
137
175
  };
138
176
 
139
177
  // 处理查看客户
140
178
  var handleViewClient = function handleViewClient(data) {
141
- console.log('查看客户:', data);
142
179
  state.action({
143
180
  type: 'pisell1.handleOpenCustomerModal',
144
181
  data: {
145
182
  id: state.client.value.id
146
183
  },
147
- callback: function callback(data) {
148
- if (state.disabledEdit) {
149
- return;
150
- }
151
- // if (data) {
152
- // handleSelectClient([data]);
153
- // }
154
- // getHolders();
155
- // getClients({
156
- // ...state.client.clientsParams,
157
- // search: '',
158
- // customer_id: data?.id,
159
- // skip: 1,
160
- // sort_by: 'id',
161
- // });
162
- }
184
+ callback: function callback(data) {}
163
185
  });
164
186
  };
165
187
 
166
- // 处理搜索结果选择
167
- var handleRowClick = function handleRowClick(record) {
168
- // selectCustomer(record);
169
- // setSearchModalVisible(false);
170
- handleSetClient(record);
171
- };
172
-
173
188
  // 处理模态框取消
174
189
  var handleModalCancel = function handleModalCancel() {
175
190
  setSearchModalVisible(false);
176
191
  };
177
- var handleSearchClient = /*#__PURE__*/function () {
178
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(keyword) {
179
- return _regeneratorRuntime().wrap(function _callee$(_context) {
180
- while (1) switch (_context.prev = _context.next) {
181
- case 0:
182
- _context.next = 2;
183
- return loadCustomers({
184
- search: keyword
185
- });
186
- case 2:
187
- case "end":
188
- return _context.stop();
189
- }
190
- }, _callee);
191
- }));
192
- return function handleSearchClient(_x) {
193
- return _ref2.apply(this, arguments);
194
- };
195
- }();
196
- var _debouncedSearch = useDebounceFn(handleSearchClient, {
197
- wait: 500
198
- });
199
192
 
200
193
  // 处理添加客户成功
201
194
  var handleAddClientSuccess = function handleAddClientSuccess(record, isChecked) {
@@ -306,11 +299,11 @@ var CartClientCard = /*#__PURE__*/forwardRef(function (props, ref) {
306
299
  loading: loading,
307
300
  dataSource: customers,
308
301
  onSearch: handleSearchClient,
309
- onSearchTextChange: function onSearchTextChange(keyword) {
310
- keywordRef.current = keyword;
311
- _debouncedSearch.run(keyword);
302
+ keyword: keyword,
303
+ onKeywordChange: function onKeywordChange(_keyword) {
304
+ setKeyword(_keyword);
312
305
  },
313
- onRowClick: handleRowClick,
306
+ onRowClick: handleSetClient,
314
307
  containerProps: {
315
308
  open: searchModalVisible,
316
309
  onCancel: handleModalCancel
@@ -23,7 +23,7 @@ import { formatAmount, locales } from '@pisell/utils';
23
23
  import Duration from "../../../materiels/duration";
24
24
  import Capacity from "./Capacity";
25
25
  import Resources from "./Resources";
26
- import { Input, Button, Row, Col, Form, InputNumber } from 'antd';
26
+ import { Input, Button, Row, Col, Form, InputNumber, ConfigProvider } from 'antd';
27
27
  import "./index.less";
28
28
  import CollapsibleList from "../../../components/collapsibleList";
29
29
  import { renderBundles } from "../../../components/collapsibleList/utils";
@@ -32,10 +32,11 @@ import { useUpdateEffect, useMemoizedFn, useDebounceFn } from 'ahooks';
32
32
  import { getServiceTimes, deleteCacheParams, getProductTotalPrice, isSessionProduct } from "../../../utils";
33
33
  import { getErrorList, getIsNoSpecAndPackage } from "../../utilsByBooking";
34
34
  import { formatResources, getDurationProps, getFlexibleOption, getTimeObj, setDefaultCapacitys } from "../addService/utils";
35
- import { PisellAdjustPriceInputNumber } from '@pisell/materials';
35
+ import { Iconfont, PisellAdjustPriceInputNumber } from '@pisell/materials';
36
36
  import { editSessionProduct } from "../../../info/utils";
37
37
  import { isNormalProductByDurationSchedule } from "../../../info/service2/utils";
38
38
  import { addService, genServiceKey, getIsShowNumber } from "../../../../ticketBooking/utils";
39
+ import NoteModal from "../../../../../plus/noteModal";
39
40
  var submitLock = false;
40
41
  var Info = function Info(_, ref) {
41
42
  var _state$service4, _state$bookingConfig2, _state$bookingConfig3, _state$service$cacheI4, _state$service$cacheI5, _state$service6, _window$BaseMaterials, _state$service8, _state$service$cacheI10, _state$bookingConfig5, _state$service$cacheI11, _state$service$cacheI12, _state$service9, _state$service$resour2, _state$service$cacheI13, _state$service$cacheI14;
@@ -46,11 +47,16 @@ var Info = function Info(_, ref) {
46
47
  var useResource = Form.useWatch('resource', form);
47
48
  var useStartTime = Form.useWatch('start_time', form);
48
49
  var useDuration = Form.useWatch('duration', form);
50
+ var useNote = Form.useWatch('note', form);
49
51
  var _useContext = useContext(Context),
50
52
  state = _useContext.state,
51
53
  dispatch = _useContext.dispatch;
52
54
  var resourcesRef = useRef(null);
53
55
  var isChangeTotal = useRef(false);
56
+ var _useState = useState(false),
57
+ _useState2 = _slicedToArray(_useState, 2),
58
+ noteModalOpen = _useState2[0],
59
+ setNoteModalOpen = _useState2[1];
54
60
  var isNormalProduct = useMemo(function () {
55
61
  var _state$service, _state$service2, _state$service3;
56
62
  if (!(state !== null && state !== void 0 && (_state$service = state.service) !== null && _state$service !== void 0 && _state$service.cacheItem)) {
@@ -740,27 +746,57 @@ var Info = function Info(_, ref) {
740
746
  var footer = useMemo(function () {
741
747
  var _state$service$resour;
742
748
  return /*#__PURE__*/React.createElement("div", {
743
- className: "pisell-lowcode__booking-service-body-edit-footer"
749
+ className: "pisell-lowcode__booking-service-body-edit-footer",
750
+ style: state !== null && state !== void 0 && state.isBookingTicket2 ? {
751
+ justifyContent: 'space-between'
752
+ } : {}
753
+ }, /*#__PURE__*/React.createElement("div", {
754
+ className: "pisell-lowcode__booking-service-body-edit-footer-left"
744
755
  }, /*#__PURE__*/React.createElement("div", {
745
756
  className: "pisell-lowcode__booking-service-delete-wrap",
746
757
  onClick: handleDeleteProduct
747
758
  }, /*#__PURE__*/React.createElement(Delete_wght300_24px, {
748
759
  className: "pisell-lowcode__booking-service-delete-icon"
749
- })), /*#__PURE__*/React.createElement(Button, {
760
+ })), (state === null || state === void 0 ? void 0 : state.isBookingTicket2) && /*#__PURE__*/React.createElement(ConfigProvider, {
761
+ theme: {
762
+ token: {
763
+ colorPrimary: '#0d7fa9'
764
+ }
765
+ }
766
+ }, /*#__PURE__*/React.createElement(Button, {
767
+ className: "pisell-lowcode__booking-service-buttons-item note-button",
768
+ type: "primary",
769
+ size: "large",
770
+ onClick: function onClick() {
771
+ return setNoteModalOpen(true);
772
+ },
773
+ style: {
774
+ height: '48px',
775
+ width: '140px'
776
+ }
777
+ }, locales.getText('pisell2.ticket-booking.note'), useNote && /*#__PURE__*/React.createElement("span", {
778
+ className: "note-indicator"
779
+ }, /*#__PURE__*/React.createElement(Iconfont, {
780
+ type: "pisell2-info-circle2"
781
+ }))))), /*#__PURE__*/React.createElement(Button, {
750
782
  type: "primary",
751
783
  className: "pisell-lowcode__booking-service-body-edit-footer-apple",
752
784
  disabled: !isNormalProduct && !((_state$service$resour = state.service.resourcesOrigin) !== null && _state$service$resour !== void 0 && _state$service$resour.length),
753
785
  onClick: function onClick() {
754
786
  form.submit();
755
- }
787
+ },
788
+ style: state !== null && state !== void 0 && state.isBookingTicket2 ? {
789
+ width: '200px',
790
+ maxWidth: '200px'
791
+ } : {}
756
792
  }, locales.getText('pisell2.text.apply')));
757
- }, [(_state$service$resour2 = state.service.resourcesOrigin) === null || _state$service$resour2 === void 0 ? void 0 : _state$service$resour2.length]);
793
+ }, [(_state$service$resour2 = state.service.resourcesOrigin) === null || _state$service$resour2 === void 0 ? void 0 : _state$service$resour2.length, isNormalProduct]);
758
794
  console.log('render edit');
759
795
  console.log(state.service.editModal && !((_state$service$cacheI13 = state.service.cacheItem) !== null && _state$service$cacheI13 !== void 0 && _state$service$cacheI13.autoClose), performance.now() - window.pp1, '打开商品1');
760
- var _useState = useState(false),
761
- _useState2 = _slicedToArray(_useState, 2),
762
- val = _useState2[0],
763
- setVal = _useState2[1];
796
+ var _useState3 = useState(false),
797
+ _useState4 = _slicedToArray(_useState3, 2),
798
+ val = _useState4[0],
799
+ setVal = _useState4[1];
764
800
  useEffect(function () {
765
801
  if (isShowTimeAndResource) {
766
802
  setTimeout(function () {
@@ -770,6 +806,21 @@ var Info = function Info(_, ref) {
770
806
  setVal(false);
771
807
  }
772
808
  }, [isShowTimeAndResource]);
809
+ var handleNoteConfirm = function handleNoteConfirm(noteValue) {
810
+ form.setFieldsValue({
811
+ note: noteValue
812
+ });
813
+ setNoteModalOpen(false);
814
+ };
815
+ var handleNoteDelete = function handleNoteDelete() {
816
+ form.setFieldsValue({
817
+ note: ''
818
+ });
819
+ setNoteModalOpen(false);
820
+ };
821
+ var handleNoteCancel = function handleNoteCancel() {
822
+ setNoteModalOpen(false);
823
+ };
773
824
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer, {
774
825
  titleNoWrap: true
775
826
  //通过zIndex的方式控制 添加商品 和 编辑服务弹窗的上下层级
@@ -800,6 +851,15 @@ var Info = function Info(_, ref) {
800
851
  width: '100%'
801
852
  },
802
853
  gutter: [16, 0]
803
- }, productName, price, reason, val && isShowTimeAndResource && /*#__PURE__*/React.createElement(React.Fragment, null, startTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity)), footer)));
854
+ }, productName, price, reason, val && isShowTimeAndResource && /*#__PURE__*/React.createElement(React.Fragment, null, startTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity), /*#__PURE__*/React.createElement(Form.Item, {
855
+ noStyle: true,
856
+ name: "note"
857
+ }, noteModalOpen && /*#__PURE__*/React.createElement(NoteModal, {
858
+ open: noteModalOpen,
859
+ value: form.getFieldValue('note'),
860
+ onConfirm: handleNoteConfirm,
861
+ onDelete: handleNoteDelete,
862
+ onCancel: handleNoteCancel
863
+ }))), footer)));
804
864
  };
805
865
  export default /*#__PURE__*/forwardRef(Info);