@pisell/private-materials 3.3.53 → 3.3.55

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 (81) 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 +8 -8
  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 +6 -6
  11. package/es/components/appointmentBooking/components/Resource/index.js +5 -44
  12. package/es/components/appointmentBooking/hooks.js +177 -218
  13. package/es/components/appointmentBooking/locales.d.ts +0 -3
  14. package/es/components/appointmentBooking/locales.js +0 -9
  15. package/es/components/booking/components/TabProduct/productItem/index.js +2 -14
  16. package/es/components/booking/components/drawer/index.js +2 -4
  17. package/es/components/booking/components/voucher/index.js +17 -25
  18. package/es/components/booking/info/client/index.js +1 -2
  19. package/es/components/booking/info/pet/index.js +0 -3
  20. package/es/components/booking/info/service2/utils.js +27 -27
  21. package/es/components/booking/info2/index.js +3 -3
  22. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  23. package/es/components/booking/info2/service/addService/utils.js +2 -5
  24. package/es/components/booking/info2/service/editService/index.js +0 -1
  25. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +4 -23
  26. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
  27. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +6 -18
  28. package/es/components/productSelect/components/TabProduct/index.js +10 -28
  29. package/es/components/productSelect/components/productGroup/index.js +7 -20
  30. package/es/components/productSelect/components/productGroup/index.less +1 -14
  31. package/es/components/productSelect/index.less +2 -1
  32. package/es/components/ticketBooking/components/addServiceVariant/addService.js +10 -16
  33. package/es/components/ticketBooking/components/addServiceVariant/index.less +0 -10
  34. package/es/components/ticketBooking/components/ticketBooking/index.js +1 -3
  35. package/es/components/ticketBooking/index.js +1 -2
  36. package/es/components/ticketBooking/locales.d.ts +0 -3
  37. package/es/components/ticketBooking/locales.js +3 -12
  38. package/es/components/ticketBooking/utils/index.d.ts +1 -5
  39. package/es/components/ticketBooking/utils/index.js +3 -35
  40. package/lib/components/appointmentBooking/components/Resource/index.js +5 -44
  41. package/lib/components/appointmentBooking/hooks.js +3 -12
  42. package/lib/components/appointmentBooking/locales.d.ts +0 -3
  43. package/lib/components/appointmentBooking/locales.js +0 -3
  44. package/lib/components/booking/components/TabProduct/productItem/index.js +1 -8
  45. package/lib/components/booking/components/drawer/index.js +2 -2
  46. package/lib/components/booking/components/voucher/index.js +27 -31
  47. package/lib/components/booking/info/client/index.js +1 -2
  48. package/lib/components/booking/info/pet/index.js +0 -3
  49. package/lib/components/booking/info/service2/utils.js +2 -2
  50. package/lib/components/booking/info2/index.js +4 -7
  51. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  52. package/lib/components/booking/info2/service/addService/utils.js +2 -4
  53. package/lib/components/booking/info2/service/editService/index.js +0 -1
  54. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +8 -18
  55. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
  56. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +1 -8
  57. package/lib/components/productSelect/components/TabProduct/index.js +6 -19
  58. package/lib/components/productSelect/components/productGroup/index.js +4 -24
  59. package/lib/components/productSelect/components/productGroup/index.less +1 -14
  60. package/lib/components/productSelect/index.less +2 -1
  61. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +14 -25
  62. package/lib/components/ticketBooking/components/addServiceVariant/index.less +0 -10
  63. package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -3
  64. package/lib/components/ticketBooking/index.js +1 -2
  65. package/lib/components/ticketBooking/locales.d.ts +0 -3
  66. package/lib/components/ticketBooking/locales.js +3 -6
  67. package/lib/components/ticketBooking/utils/index.d.ts +1 -5
  68. package/lib/components/ticketBooking/utils/index.js +3 -35
  69. package/package.json +4 -4
  70. package/es/components/appointmentBooking/assets/resource.svg +0 -1
  71. package/es/components/productSelect/components/TabProduct/tabs/index.d.ts +0 -21
  72. package/es/components/productSelect/components/TabProduct/tabs/index.js +0 -243
  73. package/es/components/productSelect/components/TabProduct/tabs/index.less +0 -126
  74. package/es/components/productSelect/components/pisellPriceText/index.d.ts +0 -11
  75. package/es/components/productSelect/components/pisellPriceText/index.js +0 -43
  76. package/lib/components/appointmentBooking/assets/resource.svg +0 -1
  77. package/lib/components/productSelect/components/TabProduct/tabs/index.d.ts +0 -21
  78. package/lib/components/productSelect/components/TabProduct/tabs/index.js +0 -202
  79. package/lib/components/productSelect/components/TabProduct/tabs/index.less +0 -126
  80. package/lib/components/productSelect/components/pisellPriceText/index.d.ts +0 -11
  81. package/lib/components/productSelect/components/pisellPriceText/index.js +0 -72
@@ -106,7 +106,6 @@ declare const _default: {
106
106
  'pisell2.appointment.add-guests': string;
107
107
  'pisell2.appointment.policy': string;
108
108
  'pisell2.appointment.policy.confirm': string;
109
- 'pisell2.appointment.resource.tip': (val: string) => string;
110
109
  'pisell2.text.apply': string;
111
110
  'pisell2.text.goodpass': string;
112
111
  'pisell2.text.goodpass.product-vouchers': string;
@@ -224,7 +223,6 @@ declare const _default: {
224
223
  'pisell2.appointment.add-guests': string;
225
224
  'pisell2.appointment.policy': string;
226
225
  'pisell2.appointment.policy.confirm': string;
227
- 'pisell2.appointment.resource.tip': (val: string) => string;
228
226
  'pisell2.text.apply': string;
229
227
  'pisell2.text.goodpass': string;
230
228
  'pisell2.text.goodpass.product-vouchers': string;
@@ -342,7 +340,6 @@ declare const _default: {
342
340
  'pisell2.appointment.add-guests': string;
343
341
  'pisell2.appointment.policy': string;
344
342
  'pisell2.appointment.policy.confirm': string;
345
- 'pisell2.appointment.resource.tip': (val: string) => string;
346
343
  'pisell2.text.apply': string;
347
344
  'pisell2.text.goodpass': string;
348
345
  'pisell2.text.goodpass.product-vouchers': string;
@@ -122,9 +122,6 @@ export default {
122
122
  'pisell2.appointment.add-guests': 'Add guests',
123
123
  'pisell2.appointment.policy': 'You have read and agreed to this policy',
124
124
  'pisell2.appointment.policy.confirm': 'Confirm',
125
- 'pisell2.appointment.resource.tip': function pisell2AppointmentResourceTip(val) {
126
- return "Tip: Change ".concat(val || 'resource', " using the dropdown in the cart.");
127
- },
128
125
  'pisell2.text.apply': 'Apply',
129
126
  'pisell2.text.goodpass': 'GoodPass',
130
127
  'pisell2.text.goodpass.product-vouchers': 'Product Vouchers',
@@ -258,9 +255,6 @@ export default {
258
255
  'pisell2.appointment.add-guests': '添加预约人',
259
256
  'pisell2.appointment.policy': '您已仔细阅读并同意此协议',
260
257
  'pisell2.appointment.policy.confirm': '确定',
261
- 'pisell2.appointment.resource.tip': function pisell2AppointmentResourceTip(val) {
262
- return "\u63D0\u793A\uFF1A\u5728\u53F3\u4FA7\u8D2D\u7269\u8F66\u4E2D\uFF0C\u901A\u8FC7\u4E0B\u62C9\u6846\u4FEE\u6539\u201C".concat(val || '资源', "\u201D");
263
- },
264
258
  'pisell2.text.apply': '应用',
265
259
  'pisell2.text.goodpass': '商品券',
266
260
  'pisell2.text.goodpass.product-vouchers': '商品兑换券',
@@ -394,9 +388,6 @@ export default {
394
388
  'pisell2.appointment.add-guests': '添加預約人',
395
389
  'pisell2.appointment.policy': '您已仔細閱讀並同意此協議',
396
390
  'pisell2.appointment.policy.confirm': '確定',
397
- 'pisell2.appointment.resource.tip': function pisell2AppointmentResourceTip(val) {
398
- return "\u63D0\u793A\uFF1A\u5728\u53F3\u5074\u8CFC\u7269\u8ECA\u4E2D\uFF0C\u900F\u904E\u4E0B\u62C9\u6846\u4FEE\u6539\u201C".concat(val || '資源', "\u201D");
399
- },
400
391
  'pisell2.text.apply': '應用',
401
392
  'pisell2.text.goodpass': '商品券',
402
393
  'pisell2.text.goodpass.product-vouchers': '商品兌換券',
@@ -1,9 +1,7 @@
1
1
  import React, { useMemo } from 'react';
2
- import { image, locales } from '@pisell/utils';
2
+ import { formatAmount, image, locales } from '@pisell/utils';
3
3
  import classNames from 'classnames';
4
4
  import { getDiscountTime } from "../../../utils";
5
- import Decimal from 'decimal.js';
6
- import PisellPriceText from "../../../../productSelect/components/pisellPriceText";
7
5
  import "./index.less";
8
6
  var ProductItem = function ProductItem(_ref) {
9
7
  var item = _ref.item,
@@ -11,13 +9,6 @@ var ProductItem = function ProductItem(_ref) {
11
9
  amountSymbol = _ref.amountSymbol,
12
10
  style = _ref.style,
13
11
  className = _ref.className;
14
- var price = item.price,
15
- is_bundle = item.is_bundle,
16
- minimum_markup_price = item.minimum_markup_price;
17
- var _price = price;
18
- if (is_bundle) {
19
- _price = new Decimal(price).plus(new Decimal(minimum_markup_price)).toFixed(2);
20
- }
21
12
  var stockText = useMemo(function () {
22
13
  if (item.is_track === 0) {
23
14
  return false;
@@ -54,9 +45,6 @@ var ProductItem = function ProductItem(_ref) {
54
45
  className: "server-product-time"
55
46
  }, stockText), /*#__PURE__*/React.createElement("div", {
56
47
  className: "server-product-price"
57
- }, /*#__PURE__*/React.createElement(PisellPriceText, {
58
- value: _price,
59
- isMini: is_bundle
60
- }))));
48
+ }, formatAmount(item.price, 2, amountSymbol))));
61
49
  };
62
50
  export default ProductItem;
@@ -16,9 +16,7 @@ var Drawer = function Drawer(props) {
16
16
  var _props$hideScrollBar = props.hideScrollBar,
17
17
  hideScrollBar = _props$hideScrollBar === void 0 ? true : _props$hideScrollBar,
18
18
  _props$showGoBack = props.showGoBack,
19
- showGoBack = _props$showGoBack === void 0 ? true : _props$showGoBack,
20
- _props$mask = props.mask,
21
- mask = _props$mask === void 0 ? false : _props$mask;
19
+ showGoBack = _props$showGoBack === void 0 ? true : _props$showGoBack;
22
20
  return /*#__PURE__*/React.createElement(OriginDrawer, _extends({
23
21
  width: '600px',
24
22
  closable: false,
@@ -32,7 +30,7 @@ var Drawer = function Drawer(props) {
32
30
  padding: 0
33
31
  },
34
32
  push: false,
35
- mask: mask
33
+ mask: false
36
34
  }), /*#__PURE__*/React.createElement("div", {
37
35
  className: classNames('pisell-lowcode__booking-drawer-title-wrap')
38
36
  }, /*#__PURE__*/React.createElement("div", {
@@ -22,7 +22,7 @@ import useEngineContext from "../../../../hooks/useEngineContext";
22
22
  import { PisellInput, PisellGoodPassCard, PisellToast } from '@pisell/materials';
23
23
  import { useIsBooking4Shop } from "../../hooks/useIsBooking4Shop";
24
24
  import "./index.less";
25
- import { useMemoizedFn, useDebounceFn } from 'ahooks';
25
+ import { useMemoizedFn } from "ahooks";
26
26
  var ShopDiscountHooks = {
27
27
  onInited: 'shopDiscount:onInited',
28
28
  onDestroy: 'shopDiscount:onDestroy',
@@ -98,33 +98,25 @@ var VoucherCard = function VoucherCard(props) {
98
98
  });
99
99
  return val;
100
100
  }, [state.service.value]);
101
- var _useDebounceFn = useDebounceFn(function () {
102
- var _state$service;
103
- // console.log('state.service.value1', state.service.value);
104
- if (productRef.current === state.service.value || !((_state$service = state.service) !== null && _state$service !== void 0 && (_state$service = _state$service.value) !== null && _state$service !== void 0 && _state$service.length)) {
105
- return;
106
- }
107
- if (isBooking4Shop) {
108
- var val = shopDiscount.calcDiscount(state.service.value);
109
- // console.log('input: ', state.service.value);
110
- // console.log('output: ', val);
111
- productRef.current = val.productList;
112
- // console.log('val.productList', val.productList);
113
- dispatch({
114
- type: 'setService',
115
- payload: _objectSpread(_objectSpread({}, services), {}, {
116
- value: ((val === null || val === void 0 ? void 0 : val.productList) || []).filter(Boolean)
117
- })
118
- });
119
- }
120
- }, {
121
- wait: 500
122
- }),
123
- run = _useDebounceFn.run;
124
101
 
125
102
  // 更新productList
126
103
  useEffect(function () {
127
- run();
104
+ var _state$service;
105
+ if (productRef.current === state.service.value || !((_state$service = state.service) !== null && _state$service !== void 0 && (_state$service = _state$service.value) !== null && _state$service !== void 0 && _state$service.length)) {
106
+ return;
107
+ }
108
+ if (isBooking4Shop) {
109
+ var val = shopDiscount.calcDiscount(state.service.value);
110
+ console.log('input: ', state.service.value);
111
+ console.log('output: ', val);
112
+ productRef.current = val.productList;
113
+ dispatch({
114
+ type: 'setService',
115
+ payload: _objectSpread(_objectSpread({}, services), {}, {
116
+ value: ((val === null || val === void 0 ? void 0 : val.productList) || []).filter(Boolean)
117
+ })
118
+ });
119
+ }
128
120
  }, [JSON.stringify(serviceMemo), isBooking4Shop]);
129
121
  var fn = useMemoizedFn(function (result) {
130
122
  var _result$productList;
@@ -401,8 +401,7 @@ var Client = function Client() {
401
401
  isPreview: false,
402
402
  drawerProps: {
403
403
  title: locales.getText('pisell2.text.select-customer'),
404
- destroyOnClose: true,
405
- mask: state.drawerMask
404
+ destroyOnClose: true
406
405
  },
407
406
  mode: "single",
408
407
  createItemText: locales.getText('pisell2.text.create-new-customer'),
@@ -623,9 +623,6 @@ var Pet = function Pet(props) {
623
623
  form_id: formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.form_id
624
624
  })].concat(_toConsumableArray(((_state$pet11 = state.pet) === null || _state$pet11 === void 0 || (_state$pet11 = _state$pet11.formData) === null || _state$pet11 === void 0 || (_state$pet11 = _state$pet11[0]) === null || _state$pet11 === void 0 ? void 0 : _state$pet11.options) || [])));
625
625
  },
626
- drawerProps: {
627
- mask: state.drawerMask
628
- },
629
626
  getHolders: getHolders,
630
627
  addCallbackService: _addCallback,
631
628
  loading: valueLoading,
@@ -540,7 +540,7 @@ export var isAllNormalProductByState = function isAllNormalProductByState(state)
540
540
  return isAllNormalProduct(state.service.value);
541
541
  };
542
542
  var getGeneralParams = function getGeneralParams(item, state, isParallelResource) {
543
- var _formData$, _item$_extend5, _item$_extend6, _item$_extend7, _item$_extend8, _item$_extend9;
543
+ var _formData$, _item$_extend5, _item$_extend6, _item$_extend7, _item$_extend8;
544
544
  var pet = state.pet,
545
545
  service = state.service;
546
546
  var _ref8 = pet || {},
@@ -614,8 +614,7 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
614
614
  addHolderButtonText: (formData === null || formData === void 0 || (_formData$ = formData[0]) === null || _formData$ === void 0 || (_formData$ = _formData$.form) === null || _formData$ === void 0 ? void 0 : _formData$.title) || "",
615
615
  holder_id: item === null || item === void 0 || (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.holder_id,
616
616
  start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.startDate : "",
617
- end_date: !isNormalProduct ? (item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.endDate) || (item === null || item === void 0 || (_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.end_date) : "",
618
- rowKey: "rowKey-".concat(item === null || item === void 0 || (_item$_extend9 = item._extend) === null || _item$_extend9 === void 0 || (_item$_extend9 = _item$_extend9.other) === null || _item$_extend9 === void 0 ? void 0 : _item$_extend9.rowKey)
617
+ end_date: !isNormalProduct ? (item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.endDate) || (item === null || item === void 0 || (_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.end_date) : ""
619
618
  }, parallelResourceOtherParams);
620
619
  };
621
620
  var calcAddTimeTotalPrice = function calcAddTimeTotalPrice(total, addTimeProducts) {
@@ -638,49 +637,50 @@ export var formatProducts = function formatProducts(lists, state) {
638
637
  var normalList = [];
639
638
  var groupList = [];
640
639
  var formItem = function formItem(item) {
641
- 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;
640
+ var _item$_extend9, _item$_extend10, _item$_extend11, _item$_extend13, _item$_extend14, _item$_extend15, _item$_extend16, _item$_extend17, _item$_extend18, _item$_extend19, _item$_extend20, _item$_extend21, _resourceItem, _item$_extend22, _item$_extend23, _item$_extend24, _item$_extend25, _item$_extend26;
642
641
  var _isDayBookingProduct = isDayBookingProduct(item, state);
643
- var clientTitle = getHolderName(state, item === null || item === void 0 || (_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.holder_id);
644
- 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);
645
- var bundle = formatBundle(item === null || item === void 0 || (_item$_extend12 = item._extend) === null || _item$_extend12 === void 0 || (_item$_extend12 = _item$_extend12.other) === null || _item$_extend12 === void 0 ? void 0 : _item$_extend12.bundle);
642
+ var clientTitle = getHolderName(state, item === null || item === void 0 || (_item$_extend9 = item._extend) === null || _item$_extend9 === void 0 ? void 0 : _item$_extend9.holder_id);
643
+ var options = formatOptions(item === null || item === void 0 || (_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 || (_item$_extend10 = _item$_extend10.other) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.option);
644
+ var bundle = formatBundle(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.bundle);
646
645
  // 是否是普通商品
647
646
  var isNormalProduct = !appointmentTypes.includes(item === null || item === void 0 ? void 0 : item.extension_type) || (state === null || state === void 0 ? void 0 : state.renderType) === 'eventBooking';
648
647
  var resourceItem = {};
649
648
  var errorMessage = '';
650
649
  if (_isDayBookingProduct || isGeneral) {
651
- var _item$_extend13;
652
- resourceItem = getResourceItem(item === null || item === void 0 || (_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.resource, state);
650
+ var _item$_extend12;
651
+ resourceItem = getResourceItem(item === null || item === void 0 || (_item$_extend12 = item._extend) === null || _item$_extend12 === void 0 ? void 0 : _item$_extend12.resource, state);
653
652
  errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
654
653
  }
655
654
  var generalParams = isGeneral ? getGeneralParams(item, state, !!isParallelResource) : {};
655
+ console.log(isNormalProduct, 'isNormalProduct');
656
656
  return _objectSpread(_objectSpread({
657
657
  id: item === null || item === void 0 ? void 0 : item.id,
658
658
  _id: item === null || item === void 0 ? void 0 : item._id,
659
659
  name: item === null || item === void 0 ? void 0 : item.title,
660
- price: item === null || item === void 0 || (_item$_extend14 = item._extend) === null || _item$_extend14 === void 0 ? void 0 : _item$_extend14.price,
661
- total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$_extend15 = item._extend) === null || _item$_extend15 === void 0 ? void 0 : _item$_extend15.total, item === null || item === void 0 || (_item$_extend16 = item._extend) === null || _item$_extend16 === void 0 ? void 0 : _item$_extend16.relation_details),
662
- origin_total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$_extend17 = item._extend) === null || _item$_extend17 === void 0 ? void 0 : _item$_extend17.origin_total, item === null || item === void 0 || (_item$_extend18 = item._extend) === null || _item$_extend18 === void 0 ? void 0 : _item$_extend18.relation_details),
660
+ price: item === null || item === void 0 || (_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.price,
661
+ total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$_extend14 = item._extend) === null || _item$_extend14 === void 0 ? void 0 : _item$_extend14.total, item === null || item === void 0 || (_item$_extend15 = item._extend) === null || _item$_extend15 === void 0 ? void 0 : _item$_extend15.relation_details),
662
+ origin_total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$_extend16 = item._extend) === null || _item$_extend16 === void 0 ? void 0 : _item$_extend16.origin_total, item === null || item === void 0 || (_item$_extend17 = item._extend) === null || _item$_extend17 === void 0 ? void 0 : _item$_extend17.relation_details),
663
663
  num: item === null || item === void 0 ? void 0 : item._extend.quantity,
664
664
  image: item === null || item === void 0 ? void 0 : item.cover,
665
665
  isShowNote: true,
666
666
  note: item === null || item === void 0 ? void 0 : item.note,
667
- like_status: item === null || item === void 0 || (_item$_extend19 = item._extend) === null || _item$_extend19 === void 0 ? void 0 : _item$_extend19.like_status,
667
+ like_status: item === null || item === void 0 || (_item$_extend18 = item._extend) === null || _item$_extend18 === void 0 ? void 0 : _item$_extend18.like_status,
668
668
  bundle: bundle,
669
669
  options: options,
670
670
  errorMessage: errorMessage,
671
- 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,
672
- discount_reason: item === null || item === void 0 || (_item$_extend21 = item._extend) === null || _item$_extend21 === void 0 ? void 0 : _item$_extend21.discount_reason,
673
- resource_id: isNormalProduct ? 0 : item === null || item === void 0 || (_item$_extend22 = item._extend) === null || _item$_extend22 === void 0 ? void 0 : _item$_extend22.resource,
671
+ product_option_string: item === null || item === void 0 || (_item$_extend19 = item._extend) === null || _item$_extend19 === void 0 || (_item$_extend19 = _item$_extend19.other) === null || _item$_extend19 === void 0 ? void 0 : _item$_extend19.product_option_string,
672
+ discount_reason: item === null || item === void 0 || (_item$_extend20 = item._extend) === null || _item$_extend20 === void 0 ? void 0 : _item$_extend20.discount_reason,
673
+ resource_id: isNormalProduct ? 0 : item === null || item === void 0 || (_item$_extend21 = item._extend) === null || _item$_extend21 === void 0 ? void 0 : _item$_extend21.resource,
674
674
  relation_form_name: isNormalProduct ? '' : ((_resourceItem = resourceItem) === null || _resourceItem === void 0 ? void 0 : _resourceItem.labelText) || item.relation_form_name,
675
675
  holder_title: clientTitle,
676
- start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend23 = item._extend) === null || _item$_extend23 === void 0 ? void 0 : _item$_extend23.start_date : '',
677
- end_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend24 = item._extend) === null || _item$_extend24 === void 0 ? void 0 : _item$_extend24.end_date : '',
678
- holder_id: (item === null || item === void 0 || (_item$_extend25 = item._extend) === null || _item$_extend25 === void 0 ? void 0 : _item$_extend25.holder_id) || 0,
676
+ start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend22 = item._extend) === null || _item$_extend22 === void 0 ? void 0 : _item$_extend22.start_date : '',
677
+ end_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend23 = item._extend) === null || _item$_extend23 === void 0 ? void 0 : _item$_extend23.end_date : '',
678
+ holder_id: (item === null || item === void 0 || (_item$_extend24 = item._extend) === null || _item$_extend24 === void 0 ? void 0 : _item$_extend24.holder_id) || 0,
679
679
  isNormalProduct: isNormalProduct,
680
680
  locale: state.locale,
681
681
  symbol: state.amountSymbol,
682
- relation_products: (item === null || item === void 0 || (_item$_extend26 = item._extend) === null || _item$_extend26 === void 0 ? void 0 : _item$_extend26.relation_details) || [],
683
- items: isEventBooking(state) ? [] : formItems((item === null || item === void 0 || (_item$_extend27 = item._extend) === null || _item$_extend27 === void 0 ? void 0 : _item$_extend27.items) || [])
682
+ relation_products: (item === null || item === void 0 || (_item$_extend25 = item._extend) === null || _item$_extend25 === void 0 ? void 0 : _item$_extend25.relation_details) || [],
683
+ items: isEventBooking(state) ? [] : formItems((item === null || item === void 0 || (_item$_extend26 = item._extend) === null || _item$_extend26 === void 0 ? void 0 : _item$_extend26.items) || [])
684
684
  }, generalParams), {}, {
685
685
  _origin: item
686
686
  });
@@ -688,8 +688,8 @@ export var formatProducts = function formatProducts(lists, state) {
688
688
 
689
689
  // 将商品分为组商品和非组商品
690
690
  lists.forEach(function (item) {
691
- var _item$_extend28;
692
- if (!(item !== null && item !== void 0 && (_item$_extend28 = item._extend) !== null && _item$_extend28 !== void 0 && _item$_extend28.groupId)) {
691
+ var _item$_extend27;
692
+ if (!(item !== null && item !== void 0 && (_item$_extend27 = item._extend) !== null && _item$_extend27 !== void 0 && _item$_extend27.groupId)) {
693
693
  normalList.push(formItem(item));
694
694
  } else {
695
695
  groupList.push(item);
@@ -698,8 +698,8 @@ export var formatProducts = function formatProducts(lists, state) {
698
698
 
699
699
  // 根据item._extend.groupId 进行分组
700
700
  var groups = groupList.reduce(function (prev, item) {
701
- var _item$_extend29;
702
- var groupId = item === null || item === void 0 || (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.groupId;
701
+ var _item$_extend28;
702
+ var groupId = item === null || item === void 0 || (_item$_extend28 = item._extend) === null || _item$_extend28 === void 0 ? void 0 : _item$_extend28.groupId;
703
703
  if (!prev[groupId]) {
704
704
  prev[groupId] = [];
705
705
  }
@@ -869,8 +869,8 @@ export var isHasDayAppointmentProduct = function isHasDayAppointmentProduct(stat
869
869
  // 如果该购物车中没选择任何商品,则不需要验证,所以直接用1来填充
870
870
  // services: !holderProducts?.length ? [1] : holderProducts?.filter((d: any) => appointmentTypes.includes(d.extension_type))
871
871
  services: services.filter(function (item) {
872
- var _item$_extend30;
873
- return ((_item$_extend30 = item._extend) === null || _item$_extend30 === void 0 ? void 0 : _item$_extend30.holder_id) == d.form_record_id && checkType(item.extension_type);
872
+ var _item$_extend29;
873
+ return ((_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.holder_id) == d.form_record_id && checkType(item.extension_type);
874
874
  })
875
875
  });
876
876
  });
@@ -27,8 +27,8 @@ 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';
31
- import classNames from 'classnames';
30
+ import { Skeleton } from "antd";
31
+ import classNames from "classnames";
32
32
  import useCreateBookingPageHeader from "../hooks/useCreateBookingPageHeader";
33
33
  import { getLocale } from "../../../utils/locales";
34
34
  var defaultModules = {
@@ -76,7 +76,7 @@ var Info = Provider(function (props) {
76
76
  });
77
77
  }
78
78
  }, []);
79
- useMemo(function () {
79
+ useEffect(function () {
80
80
  var _context$appHelper, _context$appHelper$ge, _context$appHelper2, _context$appHelper2$i, _context$appHelper3;
81
81
  var isFranchisee = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.businessUtils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getAppByModal) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper, 'franchisee');
82
82
  modal.dispatch({
@@ -77,7 +77,7 @@ export declare const setDefaultCapacitys: ({ capacitys, cacheItem }: any) => any
77
77
  * @Author: zhiwei.Wang
78
78
  * @Date: 2024-06-01 13:25
79
79
  */
80
- export declare const getProductExtend: ({ cacheItem, state, isDisabledTime }: any) => any;
80
+ export declare const getProductExtend: ({ cacheItem, state }: any) => any;
81
81
  /**
82
82
  * @title: 格式化服务列表
83
83
  * @description: 后端列表返回的product_resource.resources 的optional_resource等不是最新数据
@@ -472,8 +472,7 @@ var getIsAutoClose = function getIsAutoClose(cacheItem) {
472
472
  */
473
473
  export var getProductExtend = function getProductExtend(_ref10) {
474
474
  var cacheItem = _ref10.cacheItem,
475
- state = _ref10.state,
476
- isDisabledTime = _ref10.isDisabledTime;
475
+ state = _ref10.state;
477
476
  // 有endDate 说明是在编辑已经保存过的商品, 没有则是编辑还没保存过的商品
478
477
  var isNew = cacheItem.new || !cacheItem._extend.endDate;
479
478
  var _cacheItem = _objectSpread({}, cacheItem);
@@ -553,9 +552,7 @@ export var getProductExtend = function getProductExtend(_ref10) {
553
552
  if (_cacheItem._extend.bundle_edit !== undefined) {
554
553
  _cacheItem._extend.bundle_edit = 1;
555
554
  }
556
- if (!isDisabledTime) {
557
- _cacheItem._time = new Date().getTime();
558
- }
555
+ _cacheItem._time = new Date().getTime();
559
556
  } else {
560
557
  // if (!_cacheItem._data.timeObj) {
561
558
  // _cacheItem._data.timeObj = getTimeObj({
@@ -539,7 +539,6 @@ var Info = function Info(_, ref) {
539
539
  ,
540
540
  zIndex: state.service.changeService ? 999 : 1000,
541
541
  forceRender: true,
542
- mask: state.drawerMask,
543
542
  open: state.service.editModal && !((_state$service$cacheI6 = state.service.cacheItem) !== null && _state$service$cacheI6 !== void 0 && _state$service$cacheI6.autoClose),
544
543
  title: locales.getText('pisell2.text.edit-service'),
545
544
  onClose: function onClose() {
@@ -3,8 +3,6 @@ import OpenCard from "../../OpenCard";
3
3
  import { PisellCheckboxGroup, PisellText } from '@pisell/materials';
4
4
  import { locales } from '@pisell/utils';
5
5
  import { useEventDetail } from "../../../../Sales";
6
- import Decimal from 'decimal.js';
7
- import PisellPriceText from "../../../../productSelect/components/pisellPriceText";
8
6
  var BookingOptions = function BookingOptions(props) {
9
7
  var _detail$bookingOption, _detail$bookingOption2;
10
8
  var _useEventDetail = useEventDetail(),
@@ -29,29 +27,12 @@ var BookingOptions = function BookingOptions(props) {
29
27
  optionClassName: "option-item ".concat((detail === null || detail === void 0 || (_detail$bookingOption2 = detail.bookingOptions) === null || _detail$bookingOption2 === void 0 ? void 0 : _detail$bookingOption2.length) > 1 ? 'option-item-pointer' : ''),
30
28
  value: currentBookingOption,
31
29
  renderOption: function renderOption(option) {
32
- var _ref = option._originData || {},
33
- price = _ref.price,
34
- is_bundle = _ref.is_bundle,
35
- minimum_markup_price = _ref.minimum_markup_price;
36
- if (!option._originData || !is_bundle) {
37
- return /*#__PURE__*/React.createElement("div", {
38
- className: "item"
39
- }, /*#__PURE__*/React.createElement("span", null, option.label), /*#__PURE__*/React.createElement(PisellText.Amount, {
40
- value: option.price,
41
- showCurrencySymbol: true,
42
- className: "price"
43
- }));
44
- }
45
- var _price = price;
46
- if (is_bundle) {
47
- _price = new Decimal(price).plus(new Decimal(minimum_markup_price)).toFixed(2);
48
- }
49
30
  return /*#__PURE__*/React.createElement("div", {
50
31
  className: "item"
51
- }, /*#__PURE__*/React.createElement("span", null, option.label), /*#__PURE__*/React.createElement(PisellPriceText, {
52
- className: "price",
53
- value: _price,
54
- isMini: true
32
+ }, /*#__PURE__*/React.createElement("span", null, option.label), /*#__PURE__*/React.createElement(PisellText.Amount, {
33
+ value: option.price,
34
+ showCurrencySymbol: true,
35
+ className: "price"
55
36
  }));
56
37
  },
57
38
  onChange: onChange
@@ -1,3 +1,3 @@
1
- import './index.less';
1
+ import "./index.less";
2
2
  declare const ProductItem: ({ item, onClick, amountSymbol, style, className, }: any) => JSX.Element;
3
3
  export default ProductItem;
@@ -1,27 +1,18 @@
1
- import React from 'react';
2
- import { image } from '@pisell/utils';
3
- import classNames from 'classnames';
4
- import Decimal from 'decimal.js';
5
- import PisellPriceText from "../../../../productSelect/components/pisellPriceText";
1
+ import React from "react";
2
+ import { formatAmount, image } from "@pisell/utils";
3
+ import classNames from "classnames";
6
4
  import "./index.less";
7
5
  var ProductItem = function ProductItem(_ref) {
8
6
  var _ref$item = _ref.item,
9
7
  item = _ref$item === void 0 ? {} : _ref$item,
10
8
  _onClick = _ref.onClick,
11
9
  _ref$amountSymbol = _ref.amountSymbol,
12
- amountSymbol = _ref$amountSymbol === void 0 ? '$' : _ref$amountSymbol,
10
+ amountSymbol = _ref$amountSymbol === void 0 ? "$" : _ref$amountSymbol,
13
11
  style = _ref.style,
14
12
  className = _ref.className;
15
- var price = item.price,
16
- is_bundle = item.is_bundle,
17
- minimum_markup_price = item.minimum_markup_price;
18
- var _price = price;
19
- if (is_bundle) {
20
- _price = new Decimal(price).plus(new Decimal(minimum_markup_price)).toFixed(2);
21
- }
22
13
  return /*#__PURE__*/React.createElement("div", {
23
14
  style: style,
24
- className: classNames('product-item-card', className),
15
+ className: classNames("product-item-card", className),
25
16
  onClick: function onClick() {
26
17
  _onClick(item);
27
18
  }
@@ -34,9 +25,6 @@ var ProductItem = function ProductItem(_ref) {
34
25
  className: "product-item-card-title"
35
26
  }, item.title), /*#__PURE__*/React.createElement("div", {
36
27
  className: "product-item-card-price"
37
- }, /*#__PURE__*/React.createElement(PisellPriceText, {
38
- value: _price,
39
- isMini: is_bundle
40
- }))));
28
+ }, formatAmount(item.price, 2, amountSymbol))));
41
29
  };
42
30
  export default ProductItem;
@@ -12,9 +12,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
12
12
  import React, { useEffect, useMemo, useRef, useState } from 'react';
13
13
  import { Skeleton } from 'antd';
14
14
  import { PisellEmpty } from '@pisell/materials';
15
- import { useMemoizedFn, useDebounceFn } from 'ahooks';
15
+ import { useMemoizedFn } from 'ahooks';
16
16
  import { locales } from '@pisell/utils';
17
- import Tabs from "./tabs";
17
+ import Tabs from "../../../booking/components/TabProduct/tabs";
18
18
  import ProductGroup, { ProductGroupSkeleton } from "../productGroup";
19
19
  var io = null;
20
20
  var TabProduct = function TabProduct(props) {
@@ -43,37 +43,19 @@ var TabProduct = function TabProduct(props) {
43
43
  });
44
44
  }
45
45
  }, [list]);
46
-
47
- // 添加防抖的scroll函数
48
- var debouncedScroll = useDebounceFn(function (id) {
49
- var _tabsRef$current;
50
- tabsRef === null || tabsRef === void 0 || (_tabsRef$current = tabsRef.current) === null || _tabsRef$current === void 0 || _tabsRef$current.scroll(id);
51
- }, {
52
- wait: 100
53
- } // 100ms防抖
54
- );
55
46
  var handleObserver = useMemoizedFn(function () {
56
47
  var _marginTop = 270;
57
48
  var _marginBottom = window.innerHeight - 70 - 200 - 70;
58
49
  var _rootMargin = "".concat(_marginTop * -1, "px 0px ").concat(_marginBottom * -1, "px 0px");
59
50
  io = new IntersectionObserver(function (entries) {
60
- var enteringEntries = entries.filter(function (entry) {
61
- return entry.isIntersecting;
62
- });
63
- if (enteringEntries.length > 0) {
64
- var _topMostEntry$target;
65
- // 选择最靠近顶部的元素
66
- var topMostEntry = enteringEntries.reduce(function (top, current) {
67
- return current.boundingClientRect.top < top.boundingClientRect.top ? current : top;
68
- });
69
- var _topMostEntry$target$ = topMostEntry === null || topMostEntry === void 0 || (_topMostEntry$target = topMostEntry.target) === null || _topMostEntry$target === void 0 || (_topMostEntry$target = _topMostEntry$target.id) === null || _topMostEntry$target === void 0 ? void 0 : _topMostEntry$target.split('-'),
70
- _topMostEntry$target$2 = _slicedToArray(_topMostEntry$target$, 2),
71
- name = _topMostEntry$target$2[0],
72
- id = _topMostEntry$target$2[1];
73
- var newGroupId = Number(id);
74
- setCurrentGroupId(newGroupId);
75
- debouncedScroll.run(id);
76
- // tabsRef?.current?.scroll(id);
51
+ if (entries[0].isIntersecting) {
52
+ var _entries$, _tabsRef$current;
53
+ var _entries$0$target$id$ = (_entries$ = entries[0]) === null || _entries$ === void 0 || (_entries$ = _entries$.target) === null || _entries$ === void 0 || (_entries$ = _entries$.id) === null || _entries$ === void 0 ? void 0 : _entries$.split('-'),
54
+ _entries$0$target$id$2 = _slicedToArray(_entries$0$target$id$, 2),
55
+ name = _entries$0$target$id$2[0],
56
+ id = _entries$0$target$id$2[1];
57
+ setCurrentGroupId(Number(id));
58
+ tabsRef === null || tabsRef === void 0 || (_tabsRef$current = tabsRef.current) === null || _tabsRef$current === void 0 || _tabsRef$current.scroll(id);
77
59
  }
78
60
  }, {
79
61
  root: null,
@@ -1,11 +1,10 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import GridLayout from "../gridLayout";
4
+ import { PisellText } from '@pisell/materials';
4
5
  import { locales } from '@pisell/utils';
5
6
  import { Skeleton } from 'antd';
6
- import Decimal from 'decimal.js';
7
7
  import "./index.less";
8
- import PisellPriceText from "../pisellPriceText";
9
8
 
10
9
  // 装修端配置项均为 isXXX,这里先适配一部分
11
10
 
@@ -56,29 +55,17 @@ var ProductGroup = function ProductGroup(_ref) {
56
55
  return "".concat(locales.getText('pisell2.product-select.stock'), "\uFF1A").concat(item.stock_quantity);
57
56
  };
58
57
  var renderPrice = function renderPrice(item) {
59
- var _price = item.price,
60
- _original_price = item.original_price,
61
- is_bundle = item.is_bundle,
62
- minimum_markup_price = item.minimum_markup_price;
63
- var price = _price;
64
- var original_price = _original_price;
65
- if (is_bundle) {
66
- price = new Decimal(price).plus(new Decimal(minimum_markup_price)).toFixed(2);
67
- original_price = new Decimal(original_price).plus(new Decimal(minimum_markup_price)).toFixed(2);
68
- }
69
- if (!showZeroPrice && !parseFloat(price)) return null;
58
+ if (!showZeroPrice && !parseFloat(item.price)) return null;
70
59
  return !!isPrice || !!isOriginPrice ? /*#__PURE__*/React.createElement("div", {
71
60
  className: "price-info"
72
61
  }, isPrice ? /*#__PURE__*/React.createElement("div", {
73
62
  className: "price"
74
- }, /*#__PURE__*/React.createElement(PisellPriceText, {
75
- value: price,
76
- isMini: is_bundle
77
- })) : null, !!isOriginPrice && parseFloat(original_price) ? /*#__PURE__*/React.createElement("div", {
63
+ }, /*#__PURE__*/React.createElement(PisellText.Amount, {
64
+ value: item.price
65
+ })) : null, !!isOriginPrice && parseFloat(item.original_price) ? /*#__PURE__*/React.createElement("div", {
78
66
  className: "original-price"
79
- }, /*#__PURE__*/React.createElement(PisellPriceText, {
80
- value: original_price,
81
- isMini: is_bundle
67
+ }, /*#__PURE__*/React.createElement(PisellText.Amount, {
68
+ value: item.original_price
82
69
  })) : null) : null;
83
70
  };
84
71
  var renderItem = function renderItem(item) {
@@ -17,7 +17,6 @@
17
17
  }
18
18
 
19
19
  .product-card {
20
- user-select: none;
21
20
  cursor: pointer;
22
21
  border-radius: 12px;
23
22
  background: var(--ps-card-bg, #fff);
@@ -196,19 +195,7 @@
196
195
  font-style: normal;
197
196
  font-weight: 400;
198
197
  line-height: 24px;
199
- // text-decoration-line: line-through;
200
- position: relative;
201
- &::before {
202
- content: '';
203
- display: block;
204
- position: absolute;
205
- top: 50%;
206
- left: 0;
207
- width: 100%;
208
- height: 1px;
209
- background-color: #4e4e4e;
210
- transform: translateY(-50%);
211
- }
198
+ text-decoration-line: line-through;
212
199
 
213
200
  > span {
214
201
  vertical-align: middle;
@@ -58,13 +58,14 @@
58
58
  .booking-pisell-tabs-tab {
59
59
  .booking-pisell-tabs-tab-content {
60
60
  background: var(--ps-tab-item-bg, #ffffff) !important;
61
- font-weight: 600;
61
+ font-weight: 400;
62
62
  }
63
63
  }
64
64
 
65
65
  .booking-pisell-tabs-tab-active {
66
66
  .booking-pisell-tabs-tab-content {
67
67
  background: var(--ps-tab-item-active-bg, #8157d5) !important;
68
+ font-weight: 600;
68
69
  }
69
70
  }
70
71
  }