@pisell/private-materials 6.6.48 → 6.6.49

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 (115) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +1 -1
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +1 -1
  9. package/es/components/appointmentBooking/components/Voucher/index.js +7 -22
  10. package/es/components/booking/addons/index.js +2 -3
  11. package/es/components/booking/addons/model.d.ts +10 -1
  12. package/es/components/booking/components/footer/amount.js +1 -1
  13. package/es/components/booking/components/footer/index.js +0 -7
  14. package/es/components/booking/components/footer/utils.d.ts +1 -1
  15. package/es/components/booking/components/footer/utils.js +5 -7
  16. package/es/components/booking/components/voucher/index.js +0 -6
  17. package/es/components/booking/components/voucher/index.less +1 -4
  18. package/es/components/booking/components/voucherModal/index.less +0 -1
  19. package/es/components/booking/forms/model.d.ts +10 -1
  20. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  21. package/es/components/booking/hooks/useClearCart.d.ts +1 -1
  22. package/es/components/booking/hooks/useClearCart.js +39 -9
  23. package/es/components/booking/info/model.d.ts +10 -1
  24. package/es/components/booking/info/service/index.less +4 -2
  25. package/es/components/booking/info2/cartClientCard/index.js +82 -2
  26. package/es/components/booking/info2/serve.d.ts +8 -0
  27. package/es/components/booking/info2/serve.js +52 -0
  28. package/es/components/booking/info2/service/editService/index.js +3 -9
  29. package/es/components/booking/info2/service/index.js +4 -5
  30. package/es/components/booking/locales.d.ts +20 -0
  31. package/es/components/booking/locales.js +20 -0
  32. package/es/components/booking/model.d.ts +9 -1
  33. package/es/components/booking/notes/model.d.ts +10 -1
  34. package/es/components/booking/payments/model.d.ts +10 -1
  35. package/es/components/checkout/components/WalletPassModule/index.js +0 -1
  36. package/es/components/checkout/components/WalletPassModule/utils.d.ts +0 -1
  37. package/es/components/checkout/components/WalletPassModule/utils.js +3 -17
  38. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  39. package/es/components/checkout/hooks/useWalletPass.js +192 -316
  40. package/es/components/eftposPay/hooks.d.ts +1 -1
  41. package/es/components/eftposPay/store/index.d.ts +2 -2
  42. package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
  43. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +145 -166
  44. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
  45. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
  46. package/es/components/pay/toC/WalletPassBlock/index.js +1 -3
  47. package/es/components/pay/toC/index.js +27 -66
  48. package/es/components/pay/toC/model.d.ts +9 -2
  49. package/es/components/pay/toC/serve.d.ts +0 -18
  50. package/es/components/pay/toC/serve.js +1 -29
  51. package/es/components/pay/toC/utils.d.ts +2 -2
  52. package/es/components/pay/toC/utils.js +0 -4
  53. package/es/components/schedules/model.d.ts +9 -1
  54. package/es/components/shoppingCart/components/Cart/index.less +1 -0
  55. package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -1
  56. package/es/components/shoppingCart/hooks/useClearCart.js +41 -11
  57. package/es/components/ticketBooking/components/addServiceVariant/addService.js +4 -7
  58. package/es/components/ticketBooking/index.js +5 -2
  59. package/es/plus/clinetSearch/index.d.ts +1 -0
  60. package/es/plus/clinetSearch/index.js +9 -3
  61. package/es/plus/clinetSearch/index.less +13 -0
  62. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -10
  63. package/lib/components/booking/addons/index.js +2 -3
  64. package/lib/components/booking/addons/model.d.ts +10 -1
  65. package/lib/components/booking/components/footer/amount.js +1 -1
  66. package/lib/components/booking/components/footer/index.js +0 -9
  67. package/lib/components/booking/components/footer/utils.d.ts +1 -1
  68. package/lib/components/booking/components/footer/utils.js +3 -5
  69. package/lib/components/booking/components/voucher/index.js +0 -6
  70. package/lib/components/booking/components/voucher/index.less +1 -4
  71. package/lib/components/booking/components/voucherModal/index.less +0 -1
  72. package/lib/components/booking/forms/model.d.ts +10 -1
  73. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  74. package/lib/components/booking/hooks/useClearCart.d.ts +1 -1
  75. package/lib/components/booking/hooks/useClearCart.js +28 -6
  76. package/lib/components/booking/info/model.d.ts +10 -1
  77. package/lib/components/booking/info/service/index.less +4 -2
  78. package/lib/components/booking/info2/cartClientCard/index.js +46 -2
  79. package/lib/components/booking/info2/serve.d.ts +8 -0
  80. package/lib/components/booking/info2/serve.js +12 -0
  81. package/lib/components/booking/info2/service/editService/index.js +19 -25
  82. package/lib/components/booking/info2/service/index.js +4 -2
  83. package/lib/components/booking/locales.d.ts +20 -0
  84. package/lib/components/booking/locales.js +20 -0
  85. package/lib/components/booking/model.d.ts +9 -1
  86. package/lib/components/booking/notes/model.d.ts +10 -1
  87. package/lib/components/booking/payments/model.d.ts +10 -1
  88. package/lib/components/checkout/components/WalletPassModule/index.js +0 -1
  89. package/lib/components/checkout/components/WalletPassModule/utils.d.ts +0 -1
  90. package/lib/components/checkout/components/WalletPassModule/utils.js +2 -18
  91. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  92. package/lib/components/checkout/hooks/useWalletPass.js +108 -157
  93. package/lib/components/eftposPay/hooks.d.ts +1 -1
  94. package/lib/components/eftposPay/store/index.d.ts +2 -2
  95. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
  96. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +103 -90
  97. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
  98. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
  99. package/lib/components/pay/toC/WalletPassBlock/index.js +1 -3
  100. package/lib/components/pay/toC/index.js +11 -52
  101. package/lib/components/pay/toC/model.d.ts +9 -2
  102. package/lib/components/pay/toC/serve.d.ts +0 -18
  103. package/lib/components/pay/toC/serve.js +0 -6
  104. package/lib/components/pay/toC/utils.d.ts +2 -2
  105. package/lib/components/pay/toC/utils.js +0 -4
  106. package/lib/components/schedules/model.d.ts +9 -1
  107. package/lib/components/shoppingCart/components/Cart/index.less +1 -0
  108. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -1
  109. package/lib/components/shoppingCart/hooks/useClearCart.js +42 -11
  110. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +7 -11
  111. package/lib/components/ticketBooking/index.js +4 -2
  112. package/lib/plus/clinetSearch/index.d.ts +1 -0
  113. package/lib/plus/clinetSearch/index.js +10 -0
  114. package/lib/plus/clinetSearch/index.less +13 -0
  115. package/package.json +3 -3
@@ -43,8 +43,6 @@ var import_materials = require("@pisell/materials");
43
43
  var import_hooks = require("../../hooks");
44
44
  var import_voucher = require("../../../booking/components/voucher/index.less");
45
45
  var import_index = require("./index.less");
46
- var import_context = require("../../context");
47
- var import_ahooks = require("ahooks");
48
46
  var ShopDiscountHooks = {
49
47
  onInited: "shopDiscount:onInited",
50
48
  onDestroy: "shopDiscount:onDestroy",
@@ -68,17 +66,11 @@ var VoucherCard = (props) => {
68
66
  const productRef = (0, import_react.useRef)(products);
69
67
  const { openLoginModal } = (0, import_hooks.useAppointmentBookingLogin)();
70
68
  const { accountLists } = (0, import_hooks.useAppointmentBookingAccount)();
71
- const { summary } = (0, import_context.useAppointmentBookingContext)();
72
- const { originTotal, total } = summary;
73
69
  const cart = (_b = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _b.cart;
74
70
  const isUserLoggedIn = (0, import_react.useMemo)(() => {
75
71
  var _a2, _b2;
76
72
  return !!((_b2 = (_a2 = utils == null ? void 0 : utils.token) == null ? void 0 : _a2.get) == null ? void 0 : _b2.call(_a2)) || false;
77
73
  }, [store]);
78
- (0, import_react.useEffect)(() => {
79
- const shopDiscount2 = pisellos.getModule("shopDiscount");
80
- shopDiscount2.setOriginTotalAmount(originTotal);
81
- }, [originTotal]);
82
74
  const availableData = (0, import_react.useMemo)(() => {
83
75
  return discountList.filter((item) => !!item.isAvailable).map((discount) => {
84
76
  return {
@@ -114,7 +106,7 @@ var VoucherCard = (props) => {
114
106
  });
115
107
  (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.batchUpdateCart) == null ? void 0 : _a2.call(appointmentBooking, items);
116
108
  };
117
- const { run: onCartChange } = (0, import_ahooks.useDebounceFn)(() => {
109
+ const onCartChange = () => {
118
110
  var _a2, _b2, _c;
119
111
  const products2 = cart == null ? void 0 : cart.getItems();
120
112
  (_c = shopDiscount == null ? void 0 : shopDiscount.setBookingSubject) == null ? void 0 : _c.call(
@@ -123,7 +115,7 @@ var VoucherCard = (props) => {
123
115
  );
124
116
  const val = shopDiscount.calcDiscount(products2);
125
117
  batchUpdateCart(val.productList);
126
- }, { wait: 200 });
118
+ };
127
119
  const stringifiedHolders = (0, import_react.useMemo)(() => {
128
120
  let _ret;
129
121
  try {
@@ -68,15 +68,14 @@ var formatProducts = (values) => {
68
68
  discountway: "num",
69
69
  discount_type: "discount",
70
70
  bundle_edit: (_c = item._extend) == null ? void 0 : _c.bundle_edit,
71
- product_bundle: (0, import_utils.formatProductBundle)((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle, item.is_price_include_tax),
71
+ product_bundle: (0, import_utils.formatProductBundle)((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle),
72
72
  "product_option_item": (0, import_utils.formatProductOption)((_g = (_f = item._extend) == null ? void 0 : _f.other) == null ? void 0 : _g.option),
73
73
  "product_variant_id": ((_i = (_h = item._extend) == null ? void 0 : _h.other) == null ? void 0 : _i.product_variant_id) || 0,
74
74
  "source_product_price": (0, import_utils.getSourceProductPrice)(item),
75
75
  "main_product_selling_price": (0, import_utils.getMainProductSellingPrice)(item) ?? (0, import_utils.formatProductPrice)(item),
76
76
  "calculated_original_price": (0, import_utils.formatOriginalPrice)(item),
77
77
  "calculated_selling_price": (0, import_utils.formatSellingPrice)(item),
78
- "tax_fee": item._extend.tax_fee,
79
- is_price_include_tax: item.is_price_include_tax
78
+ "tax_fee": item._extend.tax_fee
80
79
  };
81
80
  });
82
81
  return arr;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -498,7 +498,7 @@ var getMainProductTotal = (item) => {
498
498
  if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
499
499
  const discountAmount = getDiscountAmount(bundleItem.discount_list);
500
500
  const bundleItemPrice = new import_decimal.default(bundleItem.bundle_selling_price ?? bundleItem.price ?? 0);
501
- const bundleItemTotal = bundleItemPrice;
501
+ const bundleItemTotal = bundleItemPrice.minus(discountAmount);
502
502
  total = total.add(bundleItemTotal);
503
503
  }
504
504
  }
@@ -269,15 +269,6 @@ var Footer = (props) => {
269
269
  ...getDataFromHost()
270
270
  });
271
271
  }, [state, isEdit]);
272
- (0, import_react.useEffect)(() => {
273
- window.dispatchEvent(
274
- new CustomEvent("onOriginExpectAmountWithoutDiscountChange", {
275
- detail: {
276
- originExpectAmountWithoutDiscount: total == null ? void 0 : total.originExpectAmountWithoutDiscount
277
- }
278
- })
279
- );
280
- }, [total == null ? void 0 : total.originExpectAmountWithoutDiscount]);
281
272
  (0, import_ahooks.useDebounceEffect)(() => {
282
273
  var _a2;
283
274
  if ((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.addTimeModal) {
@@ -15,7 +15,7 @@ export declare const formatProductOption: (option: any) => any;
15
15
  * @Author: zhiwei.Wang
16
16
  * @Date: 2024-02-19 09:26
17
17
  */
18
- export declare const formatProductBundle: (bundle: any, is_price_include_tax: number) => any;
18
+ export declare const formatProductBundle: (bundle: any) => any;
19
19
  /**
20
20
  * 获取子商品折扣信息
21
21
  * @param item
@@ -96,7 +96,7 @@ var log = (data) => {
96
96
  ]
97
97
  });
98
98
  };
99
- var formatProductBundle = (bundle, is_price_include_tax) => {
99
+ var formatProductBundle = (bundle) => {
100
100
  if (!bundle) {
101
101
  return;
102
102
  }
@@ -136,7 +136,6 @@ var formatProductBundle = (bundle, is_price_include_tax) => {
136
136
  "option": option,
137
137
  "bundle_selling_price": Math.abs(d == null ? void 0 : d.price),
138
138
  // "bundle_sum_price": d?.original_price || d?.original_total,
139
- is_price_include_tax,
140
139
  "metadata": {
141
140
  custom_product_bundle_map_id: d._id,
142
141
  // 子商品单数量附加费
@@ -403,7 +402,7 @@ var formatProducts = (item, quantity) => {
403
402
  "discount_per": item._extend.discount_per,
404
403
  "discount_type": item._extend.discount_type || discount_type,
405
404
  "order_detail_id": item._extend.order_detail_id || 0,
406
- "product_bundle": formatProductBundle((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle, item.is_price_include_tax),
405
+ "product_bundle": formatProductBundle((_e = (_d = item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle),
407
406
  "bundle_edit": item._extend.bundle_edit || bundleDiscountList.length ? 1 : 0,
408
407
  "product_option_item": formatProductOption((_g = (_f = item._extend) == null ? void 0 : _f.other) == null ? void 0 : _g.option),
409
408
  "product_variant_id": ((_i = (_h = item._extend) == null ? void 0 : _h.other) == null ? void 0 : _i.product_variant_id) || 0,
@@ -413,8 +412,7 @@ var formatProducts = (item, quantity) => {
413
412
  "calculated_original_price": formatOriginalPrice(item),
414
413
  "calculated_selling_price": formatSellingPrice(item),
415
414
  "tax_fee": item._extend.tax_fee,
416
- "custom_deposit_data": item.custom_deposit_data,
417
- is_price_include_tax: item.is_price_include_tax
415
+ "custom_deposit_data": item.custom_deposit_data
418
416
  };
419
417
  };
420
418
  var formatAppointmentProductLists = (data) => {
@@ -135,17 +135,11 @@ var VoucherCard = (props) => {
135
135
  }
136
136
  onScanCode(e.detail.code);
137
137
  });
138
- const onOriginExpectAmountWithoutDiscountChange = (0, import_ahooks.useMemoizedFn)((e) => {
139
- var _a2;
140
- (_a2 = shopDiscount == null ? void 0 : shopDiscount.setOriginTotalAmount) == null ? void 0 : _a2.call(shopDiscount, e.detail.originExpectAmountWithoutDiscount);
141
- });
142
138
  (0, import_react.useEffect)(() => {
143
139
  const wrappedOnScanWallPassCode = executeIfActive(onScanWallPassCode);
144
140
  window.addEventListener("onScanWallPassCode", wrappedOnScanWallPassCode);
145
- window.addEventListener("onOriginExpectAmountWithoutDiscountChange", onOriginExpectAmountWithoutDiscountChange);
146
141
  return () => {
147
142
  window.removeEventListener("onScanWallPassCode", wrappedOnScanWallPassCode);
148
- window.removeEventListener("onOriginExpectAmountWithoutDiscountChange", onOriginExpectAmountWithoutDiscountChange);
149
143
  };
150
144
  }, []);
151
145
  const addonsMemo = (0, import_react.useMemo)(() => {
@@ -1,8 +1,5 @@
1
1
  .pisell-lowcode__booking-footer-voucher-container {
2
2
  margin-bottom: 8px;
3
- width: 100%;
4
- display: flex;
5
- flex-direction: column;
6
3
  .voucher-title {
7
4
  display: flex;
8
5
  align-items: center;
@@ -50,9 +47,9 @@
50
47
  width: 100%;
51
48
  transition: 0.2s;
52
49
  max-height: 0;
50
+ overflow: hidden;
53
51
  display: flex;
54
52
  flex-direction: column;
55
- overflow: auto;
56
53
 
57
54
  &.show {
58
55
  max-height: unset;
@@ -6,7 +6,6 @@
6
6
  .pisell-voucher-modal-content {
7
7
  max-height: 70vh;
8
8
  overflow-y: auto;
9
- display: flex;
10
9
  }
11
10
 
12
11
  // 隐藏状态下的样式优化
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -4,6 +4,6 @@ declare const useSendModal: (bookingId?: number) => {
4
4
  setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
5
5
  handleOpen: () => void;
6
6
  handleValuesChange: (val: any) => void;
7
- handleOk: (values: SendModalValues) => Promise<boolean | undefined>;
7
+ handleOk: (values: SendModalValues) => Promise<any>;
8
8
  };
9
9
  export default useSendModal;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const useClearCart: (state: any, dispatch: any) => false | React.JSX.Element;
2
+ declare const useClearCart: (state: any, dispatch: any) => React.JSX.Element;
3
3
  export default useClearCart;
@@ -38,28 +38,50 @@ var import_materials = require("@pisell/materials");
38
38
  var import_utils = require("@pisell/utils");
39
39
  var useClearCart = (state, dispatch) => {
40
40
  var _a, _b;
41
- const handleClear = () => {
41
+ const [open, setOpen] = (0, import_react.useState)(false);
42
+ const handleOpenModal = (0, import_react.useCallback)(() => {
43
+ setOpen(true);
44
+ }, []);
45
+ const handleConfirm = (0, import_react.useCallback)(() => {
42
46
  dispatch({
43
47
  type: "setService",
44
48
  payload: {
45
49
  value: []
46
50
  }
47
51
  });
48
- };
52
+ setOpen(false);
53
+ }, []);
54
+ const handleCancel = (0, import_react.useCallback)(() => {
55
+ setOpen(false);
56
+ }, []);
49
57
  return (0, import_react.useMemo)(() => {
50
58
  var _a2, _b2, _c, _d;
51
- return !!((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) && !state.channelDisabledEdit && /* @__PURE__ */ import_react.default.createElement(
59
+ const showClearBtn = !!((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) && !state.channelDisabledEdit;
60
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, showClearBtn && /* @__PURE__ */ import_react.default.createElement(
52
61
  "span",
53
62
  {
54
63
  className: (0, import_classnames.default)("pisell-lowcode__booking-service-clear-btn", {
55
64
  ["pisell-lowcode__booking-service-clear-btn-disabled"]: !((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length)
56
65
  }),
57
- onClick: handleClear
66
+ onClick: handleOpenModal
58
67
  },
59
68
  /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-trash-01" }),
60
69
  " ",
61
70
  /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.booking.info.text.clear-cart"))
62
- );
63
- }, [(_b = (_a = state.service) == null ? void 0 : _a.value) == null ? void 0 : _b.length, state.channelDisabledEdit]);
71
+ ), /* @__PURE__ */ import_react.default.createElement(
72
+ import_materials.PisellModal,
73
+ {
74
+ open,
75
+ platform: "pc",
76
+ title: import_utils.locales.getText("pisell2.booking.info.text.clear-cart-modal.title"),
77
+ onOk: handleConfirm,
78
+ onCancel: handleCancel,
79
+ okText: import_utils.locales.getText("pisell2.booking.info.text.clear-cart-modal.confirm"),
80
+ cancelText: import_utils.locales.getText("pisell2.booking.info.text.clear-cart-modal.cancel"),
81
+ destroyOnClose: true
82
+ },
83
+ /* @__PURE__ */ import_react.default.createElement("div", { style: { margin: "24px 0" } }, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.booking.info.text.clear-cart-modal.content")))
84
+ ));
85
+ }, [(_b = (_a = state.service) == null ? void 0 : _a.value) == null ? void 0 : _b.length, state.channelDisabledEdit, open]);
64
86
  };
65
87
  var useClearCart_default = useClearCart;
@@ -1,5 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormState } from '../model';
1
3
  export declare const walkInData: {
2
4
  id: number;
3
5
  nickname: string;
4
6
  };
5
- export declare const Provider: any, Context: any;
7
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
+ state: FormState;
9
+ } & {
10
+ dispatch: (params: {
11
+ type: string;
12
+ payload: any;
13
+ }) => void;
14
+ }>;
@@ -8,8 +8,10 @@
8
8
  line-height: 24px; /* 150% */
9
9
  display: flex;
10
10
  align-items: center;
11
- margin-bottom: 4px;
12
- padding: 12px 0;
11
+ margin-bottom: 16px !important;
12
+ // padding: 12px 0;
13
+ padding: 0 !important;
14
+ width: max-content;
13
15
  .anticon {
14
16
  font-size: 18px;
15
17
  margin-right: 6px;
@@ -50,6 +50,7 @@ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContex
50
50
  var import_model = require("../../info/model");
51
51
  var import_index = require("./index.less");
52
52
  var import_IsActiveContext = require("../../../ticketBooking/context/IsActiveContext");
53
+ var import_serve = require("../serve");
53
54
  var CartClientCard = (0, import_react.forwardRef)(({
54
55
  clientCardProps = {},
55
56
  beforeSwitchModalOpen,
@@ -67,6 +68,7 @@ var CartClientCard = (0, import_react.forwardRef)(({
67
68
  const [keyword, setKeyword] = (0, import_react.useState)("");
68
69
  const keywordRef = (0, import_react.useRef)("");
69
70
  const isActive = (0, import_IsActiveContext.useIsActive)();
71
+ const [resultLoading, setResultLoading] = (0, import_react.useState)(false);
70
72
  keywordRef.current = keyword;
71
73
  const Toast = (0, import_materials.useToast)();
72
74
  const { openScan, closeScan } = (0, import_useScanCustomer.default)();
@@ -289,6 +291,47 @@ var CartClientCard = (0, import_react.forwardRef)(({
289
291
  (0, import_react.useImperativeHandle)(ref, () => ({
290
292
  handleSetClient
291
293
  }));
294
+ const handleRowClick = (0, import_ahooks.useMemoizedFn)(
295
+ async (record, options) => {
296
+ var _a2;
297
+ try {
298
+ if ((state == null ? void 0 : state.isFranchisee) && (record == null ? void 0 : record.is_franchisor_customer) == 1) {
299
+ setResultLoading(true);
300
+ let franchiseeCustomerId = record == null ? void 0 : record.franchisee_customer_id;
301
+ if (!franchiseeCustomerId) {
302
+ const res = await (0, import_serve.getFranchiseeCustomer)({
303
+ franchisor_customer_id: record.id
304
+ });
305
+ franchiseeCustomerId = res == null ? void 0 : res.franchisee_customer_id;
306
+ }
307
+ if (franchiseeCustomerId) {
308
+ const listRes = await (0, import_serve.getCustomerList)({
309
+ sort_by: "id",
310
+ with: [
311
+ "latestWalletDetail.wallet",
312
+ "contactsInfo",
313
+ "formRecord"
314
+ ],
315
+ search_wallet_flag: 1,
316
+ search_wallet_pass_flag: 1,
317
+ skip: 1,
318
+ num: 20,
319
+ customer_ids: [franchiseeCustomerId]
320
+ });
321
+ if ((_a2 = listRes == null ? void 0 : listRes.list) == null ? void 0 : _a2.length) {
322
+ await handleSetClient(listRes == null ? void 0 : listRes.list[0], options);
323
+ }
324
+ }
325
+ return;
326
+ }
327
+ await handleSetClient(record, options);
328
+ } catch (error) {
329
+ console.error("handleRowClick error:", error);
330
+ } finally {
331
+ setResultLoading(false);
332
+ }
333
+ }
334
+ );
292
335
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
293
336
  import_clientCard.default,
294
337
  {
@@ -329,7 +372,7 @@ var CartClientCard = (0, import_react.forwardRef)(({
329
372
  onKeywordChange: (_keyword) => {
330
373
  setKeyword(_keyword);
331
374
  },
332
- onRowClick: handleSetClient,
375
+ onRowClick: handleRowClick,
333
376
  containerProps: {
334
377
  open: searchModalVisible,
335
378
  onCancel: handleModalCancel,
@@ -342,7 +385,8 @@ var CartClientCard = (0, import_react.forwardRef)(({
342
385
  onAddClient: handleAddClientSuccess,
343
386
  onLoadMore: loadMore,
344
387
  hasMore,
345
- state
388
+ state,
389
+ resultLoading
346
390
  }
347
391
  ), /* @__PURE__ */ import_react.default.createElement(
348
392
  import_materials.PisellModal,
@@ -4,3 +4,11 @@ export declare const getResourceList: (params: any, bookingId?: number[]) => Pro
4
4
  }>;
5
5
  export declare const createBookings: (params: any) => Promise<any>;
6
6
  export declare const editBookings: (params: any, id?: number) => Promise<any>;
7
+ /**
8
+ * 获取加盟店的影子账户id(不存在则创建)
9
+ */
10
+ export declare const getFranchiseeCustomer: (params: any) => Promise<any>;
11
+ /**
12
+ * 获取客户列表(当前店铺)
13
+ */
14
+ export declare const getCustomerList: (params: any) => Promise<any>;
@@ -21,6 +21,8 @@ var serve_exports = {};
21
21
  __export(serve_exports, {
22
22
  createBookings: () => createBookings,
23
23
  editBookings: () => editBookings,
24
+ getCustomerList: () => getCustomerList,
25
+ getFranchiseeCustomer: () => getFranchiseeCustomer,
24
26
  getResourceList: () => getResourceList
25
27
  });
26
28
  module.exports = __toCommonJS(serve_exports);
@@ -38,9 +40,19 @@ var editBookings = async (params, id) => {
38
40
  let { data } = await import_utils.request.getRequest().put(`/shop/v1.1/order/appointment/${id}`, params);
39
41
  return data;
40
42
  };
43
+ var getFranchiseeCustomer = async (params) => {
44
+ let { data } = await import_utils.request.getRequest().get(`/shop/franchisee/customer/id`, params);
45
+ return data;
46
+ };
47
+ var getCustomerList = async (params) => {
48
+ let { data } = await import_utils.request.getRequest().get(`/shop/customer/select-list`, params);
49
+ return data;
50
+ };
41
51
  // Annotate the CommonJS export names for ESM import in node:
42
52
  0 && (module.exports = {
43
53
  createBookings,
44
54
  editBookings,
55
+ getCustomerList,
56
+ getFranchiseeCustomer,
45
57
  getResourceList
46
58
  });
@@ -61,13 +61,12 @@ var import_EditTabs = __toESM(require("../../../info/service/editService/EditTab
61
61
  var import_BookingList = __toESM(require("../../../info/service/editService/BookingList"));
62
62
  var import_dayjs = __toESM(require("dayjs"));
63
63
  var import_utils9 = require("../../../info/service2/Group/utils");
64
- var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
65
64
  var import_useShopDiscountModule = require("../../../../ticketBooking/hooks/pisellos/useShopDiscountModule");
66
65
  var import_DiscountChangeModal = __toESM(require("./DiscountChangeModal"));
67
66
  var import_decimal = __toESM(require("decimal.js"));
68
67
  var submitLock = false;
69
68
  var Info = (_, ref) => {
70
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L;
69
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K;
71
70
  const [form] = import_antd.Form.useForm();
72
71
  const useTotal = import_antd.Form.useWatch("total", form);
73
72
  const useResource = import_antd.Form.useWatch("resource", form);
@@ -86,10 +85,6 @@ var Info = (_, ref) => {
86
85
  const [noteModalOpen, setNoteModalOpen] = (0, import_react.useState)(false);
87
86
  const [open, setOpen] = (0, import_react.useState)(false);
88
87
  const [currentTab, setCurrentTab] = (0, import_react.useState)("batch_edit");
89
- const context = (0, import_useEngineContext.default)();
90
- const {
91
- getData
92
- } = (_a = context.appHelper) == null ? void 0 : _a.utils;
93
88
  const valuesRef = (0, import_react.useRef)({});
94
89
  const noInOriginalDiscountIdsRef = (0, import_react.useRef)([]);
95
90
  const isEditedRef = (0, import_react.useRef)(false);
@@ -107,7 +102,7 @@ var Info = (_, ref) => {
107
102
  return true;
108
103
  }
109
104
  return ((_b2 = state == null ? void 0 : state.service) == null ? void 0 : _b2.cacheItem) && (0, import_utils4.isNormalProductByDurationSchedule)((_c2 = state == null ? void 0 : state.service) == null ? void 0 : _c2.cacheItem);
110
- }, [(_b = state == null ? void 0 : state.service) == null ? void 0 : _b.cacheItem]);
105
+ }, [(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.cacheItem]);
111
106
  const getCurrentCacheItem = (0, import_ahooks.useMemoizedFn)((_cacheItem) => {
112
107
  let values = form.getFieldsValue();
113
108
  let _item = _cacheItem || state.service.cacheItem;
@@ -137,7 +132,7 @@ var Info = (_, ref) => {
137
132
  state.service.cacheItem,
138
133
  useStartTime,
139
134
  useResource,
140
- (_e = (_d = (_c = state.bookingConfig) == null ? void 0 : _c.config) == null ? void 0 : _d.basic) == null ? void 0 : _e.service_time
135
+ (_d = (_c = (_b = state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.service_time
141
136
  ]);
142
137
  const flexibleOption = (0, import_react.useMemo)(() => {
143
138
  const op = (0, import_utils7.getFlexibleOption)({
@@ -159,7 +154,7 @@ var Info = (_, ref) => {
159
154
  durationProps,
160
155
  useStartTime,
161
156
  currentResource,
162
- (_h = (_g = (_f = state.bookingConfig) == null ? void 0 : _f.config) == null ? void 0 : _g.basic) == null ? void 0 : _h.service_time,
157
+ (_g = (_f = (_e = state.bookingConfig) == null ? void 0 : _e.config) == null ? void 0 : _f.basic) == null ? void 0 : _g.service_time,
163
158
  useDuration
164
159
  ]);
165
160
  (0, import_react.useEffect)(() => {
@@ -256,7 +251,6 @@ var Info = (_, ref) => {
256
251
  }, 1500);
257
252
  let _list = [...state.service.value];
258
253
  let _item = {
259
- is_price_include_tax: getData("is_price_include_tax"),
260
254
  ...cacheItem ?? state.service.cacheItem,
261
255
  autoClose: false
262
256
  };
@@ -294,7 +288,7 @@ var Info = (_, ref) => {
294
288
  const mainProductQuantity = ((_d2 = _extend.other) == null ? void 0 : _d2.quantity) || _extend.quantity || 1;
295
289
  _extend.main_product_selling_price = mainProductTotal.div(mainProductQuantity).toNumber();
296
290
  }
297
- if (_extend.bundle_edit !== void 0) {
291
+ if ((_extend.bundle_edit !== void 0 || (cacheItem == null ? void 0 : cacheItem.edit)) && (cacheItem == null ? void 0 : cacheItem.is_bundle)) {
298
292
  _extend.bundle_edit = 1;
299
293
  }
300
294
  _item._extend = _extend;
@@ -436,7 +430,7 @@ var Info = (_, ref) => {
436
430
  let oPrice = Number(((_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend.origin_total) || 0);
437
431
  let cPrice = Number(useTotal || 0);
438
432
  return cPrice !== oPrice;
439
- }, [useTotal, (_j = (_i = state.service.cacheItem) == null ? void 0 : _i._extend) == null ? void 0 : _j.origin_total]);
433
+ }, [useTotal, (_i = (_h = state.service.cacheItem) == null ? void 0 : _h._extend) == null ? void 0 : _i.origin_total]);
440
434
  const getResources = () => {
441
435
  var _a2, _b2;
442
436
  let res = (0, import_utils7.formatResources)({
@@ -500,11 +494,11 @@ var Info = (_, ref) => {
500
494
  }, [state.service.editModal, state.isBookingCreatePage]);
501
495
  (0, import_react.useEffect)(() => {
502
496
  getDiscount();
503
- }, [useTotal, (_l = (_k = state.service.cacheItem) == null ? void 0 : _k._extend) == null ? void 0 : _l.origin_total]);
497
+ }, [useTotal, (_k = (_j = state.service.cacheItem) == null ? void 0 : _j._extend) == null ? void 0 : _k.origin_total]);
504
498
  const bundles = (0, import_react.useMemo)(() => {
505
499
  var _a2, _b2, _c2, _d2;
506
500
  return ((_d2 = (_c2 = (_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2._extend) == null ? void 0 : _c2.other) == null ? void 0 : _d2.bundle) || [];
507
- }, [(_p = (_o = (_n = (_m = state.service) == null ? void 0 : _m.cacheItem) == null ? void 0 : _n._extend) == null ? void 0 : _o.other) == null ? void 0 : _p.bundle]);
501
+ }, [(_o = (_n = (_m = (_l = state.service) == null ? void 0 : _l.cacheItem) == null ? void 0 : _m._extend) == null ? void 0 : _n.other) == null ? void 0 : _o.bundle]);
508
502
  const handleEdit = (0, import_ahooks.useMemoizedFn)((e) => {
509
503
  var _a2, _b2, _c2, _d2, _e2;
510
504
  const item = state.service.cacheItem;
@@ -635,7 +629,7 @@ var Info = (_, ref) => {
635
629
  }
636
630
  return false;
637
631
  }, [state.renderType, isNormalProduct]);
638
- const SelectTime = (_q = window.BaseMaterials) == null ? void 0 : _q.SelectTime;
632
+ const SelectTime = (_p = window.BaseMaterials) == null ? void 0 : _p.SelectTime;
639
633
  const isNoSpecAndPackage = (0, import_utilsByBooking.getIsNoSpecAndPackage)(state.service.cacheItem);
640
634
  const items = (0, import_react.useMemo)(() => {
641
635
  var _a2, _b2;
@@ -672,7 +666,7 @@ var Info = (_, ref) => {
672
666
  }
673
667
  ))));
674
668
  }, [
675
- (_t = (_s = (_r = state.service) == null ? void 0 : _r.cacheItem) == null ? void 0 : _s._extend) == null ? void 0 : _t.product_name,
669
+ (_s = (_r = (_q = state.service) == null ? void 0 : _q.cacheItem) == null ? void 0 : _r._extend) == null ? void 0 : _s.product_name,
676
670
  bundles,
677
671
  state.amountSymbol,
678
672
  state.isBookingCreatePage
@@ -717,7 +711,7 @@ var Info = (_, ref) => {
717
711
  ));
718
712
  }, [
719
713
  useTotal,
720
- (_v = (_u = state.service.cacheItem) == null ? void 0 : _u._extend) == null ? void 0 : _v.origin_total,
714
+ (_u = (_t = state.service.cacheItem) == null ? void 0 : _t._extend) == null ? void 0 : _u.origin_total,
721
715
  state.amountSymbol,
722
716
  state.channelDisabledEdit
723
717
  ]);
@@ -765,7 +759,7 @@ var Info = (_, ref) => {
765
759
  }
766
760
  ) : null
767
761
  ));
768
- }, [SelectTime, (_z = (_y = (_x = (_w = state.bookingConfig) == null ? void 0 : _w.config) == null ? void 0 : _x.basic) == null ? void 0 : _y.service_time) == null ? void 0 : _z.value, isEditGroup]);
762
+ }, [SelectTime, (_y = (_x = (_w = (_v = state.bookingConfig) == null ? void 0 : _v.config) == null ? void 0 : _w.basic) == null ? void 0 : _x.service_time) == null ? void 0 : _y.value, isEditGroup]);
769
763
  const endTime = (0, import_react.useMemo)(() => {
770
764
  if (!isEditGroup) {
771
765
  return null;
@@ -804,8 +798,8 @@ var Info = (_, ref) => {
804
798
  ));
805
799
  }, [
806
800
  state.renderType,
807
- (_B = (_A = state.service.cacheItem) == null ? void 0 : _A._data) == null ? void 0 : _B.resources,
808
- (_D = (_C = state.service.cacheItem) == null ? void 0 : _C._data) == null ? void 0 : _D.resourceMaps
801
+ (_A = (_z = state.service.cacheItem) == null ? void 0 : _z._data) == null ? void 0 : _A.resources,
802
+ (_C = (_B = state.service.cacheItem) == null ? void 0 : _B._data) == null ? void 0 : _C.resourceMaps
809
803
  ]);
810
804
  const holder = (0, import_react.useMemo)(() => {
811
805
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
@@ -843,7 +837,7 @@ var Info = (_, ref) => {
843
837
  }, [
844
838
  state.locale,
845
839
  state.isTerminal,
846
- (_G = (_F = (_E = state.service) == null ? void 0 : _E.cacheItem) == null ? void 0 : _F._data) == null ? void 0 : _G.capacitys
840
+ (_F = (_E = (_D = state.service) == null ? void 0 : _D.cacheItem) == null ? void 0 : _E._data) == null ? void 0 : _F.capacitys
847
841
  ]);
848
842
  const hiddenQuantity = (0, import_react.useMemo)(() => {
849
843
  return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "quantity" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, null));
@@ -923,10 +917,10 @@ var Info = (_, ref) => {
923
917
  import_utils.locales.getText("pisell2.text.apply")
924
918
  )
925
919
  );
926
- }, [(_H = state.service.resourcesOrigin) == null ? void 0 : _H.length, isNormalProduct]);
920
+ }, [(_G = state.service.resourcesOrigin) == null ? void 0 : _G.length, isNormalProduct]);
927
921
  console.log("render edit");
928
922
  console.log(
929
- state.service.editModal && !((_I = state.service.cacheItem) == null ? void 0 : _I.autoClose),
923
+ state.service.editModal && !((_H = state.service.cacheItem) == null ? void 0 : _H.autoClose),
930
924
  performance.now() - window.pp1,
931
925
  "打开商品1"
932
926
  );
@@ -1061,7 +1055,7 @@ var Info = (_, ref) => {
1061
1055
  zIndex: state.service.changeService ? 999 : 1e3,
1062
1056
  forceRender: true,
1063
1057
  mask: state.drawerMask,
1064
- open: !isNoSpecAndPackage && state.service.editModal && !((_J = state.service.cacheItem) == null ? void 0 : _J.autoClose),
1058
+ open: !isNoSpecAndPackage && state.service.editModal && !((_I = state.service.cacheItem) == null ? void 0 : _I.autoClose),
1065
1059
  title: import_utils.locales.getText("pisell2.text.edit-service"),
1066
1060
  onClose: () => {
1067
1061
  var _a2;
@@ -1087,7 +1081,7 @@ var Info = (_, ref) => {
1087
1081
  display: currentTab === "batch_edit" ? "block" : "none"
1088
1082
  }
1089
1083
  },
1090
- /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, productName, price, reason, val && isShowTimeAndResource && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, startTime, endTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity, !(0, import_utils4.isNormalProductByDurationSchedule)(state.service.cacheItem) && !(0, import_utils6.isWalkIn)((_L = (_K = state.client) == null ? void 0 : _K.value) == null ? void 0 : _L.id) && holder),
1084
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, productName, price, reason, val && isShowTimeAndResource && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, startTime, endTime, duration, resource, capacity, hiddenQuantity), isNormalProduct && quantity, !(0, import_utils4.isNormalProductByDurationSchedule)(state.service.cacheItem) && !(0, import_utils6.isWalkIn)((_K = (_J = state.client) == null ? void 0 : _J.value) == null ? void 0 : _K.id) && holder),
1091
1085
  /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { noStyle: true, name: "note" }, noteModalOpen && /* @__PURE__ */ import_react.default.createElement(
1092
1086
  import_noteModal.default,
1093
1087
  {
@@ -41,6 +41,7 @@ var import_addTimeModal = __toESM(require("./addTimeModal"));
41
41
  var import_useInfoHolder = __toESM(require("../../info/hooks/useInfoHolder"));
42
42
  var import_Lists = __toESM(require("../../info/service/Lists"));
43
43
  var import_useQuotation = __toESM(require("../../hooks/useQuotation"));
44
+ var import_useClearCart = __toESM(require("../../hooks/useClearCart"));
44
45
  var import_editNormalService = __toESM(require("./editNormalService"));
45
46
  var Service = () => {
46
47
  const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
@@ -55,10 +56,11 @@ var Service = () => {
55
56
  (0, import_react.useEffect)(() => {
56
57
  document.body.id = "body";
57
58
  }, []);
59
+ const clearCart = (0, import_useClearCart.default)(state, dispatch);
58
60
  const { dom } = (0, import_useQuotation.default)(state, dispatch);
59
61
  const renderMemo = (0, import_react.useMemo)(() => {
60
62
  console.log("render info22222");
61
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-wrap" }, /* @__PURE__ */ import_react.default.createElement(
63
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-wrap" }, (state == null ? void 0 : state.isBookingTicket2) ? null : clearCart, /* @__PURE__ */ import_react.default.createElement(
62
64
  import_Lists.default,
63
65
  {
64
66
  isParallelResource: true,
@@ -67,7 +69,7 @@ var Service = () => {
67
69
  onChange: (e, type) => dispatchService(type || "setService", e)
68
70
  }
69
71
  ), !state.isBookingCreatePage ? /* @__PURE__ */ import_react.default.createElement(import_addService.default, { onEdit: handleEdit }) : null), /* @__PURE__ */ import_react.default.createElement(import_editService.default, { ref: detailRef }), showAddTimeModal && /* @__PURE__ */ import_react.default.createElement(import_addTimeModal.default, null), /* @__PURE__ */ import_react.default.createElement(import_editNormalService.default, { ref: editNormalServiceRef }), dom);
70
- }, [dom, showAddTimeModal]);
72
+ }, [dom, showAddTimeModal, clearCart, state == null ? void 0 : state.isBookingTicket2]);
71
73
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderMemo);
72
74
  };
73
75
  var service_default = import_react.default.memo(Service);