@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
@@ -20,6 +20,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
20
  import { getUniqueId, locales } from '@pisell/utils';
21
21
  import React, { useEffect, useMemo, useRef, useState } from 'react';
22
22
  import { useMemoizedFn } from 'ahooks';
23
+ import { PisellToast } from '@pisell/materials';
23
24
  import useEngineContext from "../../../../hooks/useEngineContext";
24
25
  import { isSessionProduct, request, getProductTotalPrice, getIsEject } from "../../../booking/utils";
25
26
  import { getProductExtend } from "../../../booking/info2/service/addService/utils";
@@ -30,16 +31,16 @@ import { getProductDetail } from "../../../booking/info/service/serve";
30
31
  import { useService } from "../../../booking/info/service/serviceManager";
31
32
  import ProductSelect from "../../../productSelect";
32
33
  import "./index.less";
33
- import { addService, addServiceScroll } from "../../utils";
34
+ import { addService } from "../../utils";
34
35
  import NotAvailable from "../notAvailable";
35
36
  var AddSerivce = function AddSerivce(props) {
36
- var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _state$bookingConfig2, _state$client2, _state$service5, _state$service6;
37
+ var _context$appHelper$ut, _context$appHelper$ut2, _state$bookingConfig2, _state$client2, _state$service5, _state$service6;
37
38
  var onEdit = props.onEdit,
38
39
  state = props.state,
39
40
  dispatch = props.dispatch,
40
41
  _props$renderMode = props.renderMode,
41
42
  renderMode = _props$renderMode === void 0 ? 'current' : _props$renderMode;
42
- var _useState = useState(true),
43
+ var _useState = useState(false),
43
44
  _useState2 = _slicedToArray(_useState, 2),
44
45
  loading = _useState2[0],
45
46
  setLoading = _useState2[1];
@@ -47,7 +48,6 @@ var AddSerivce = function AddSerivce(props) {
47
48
  var notAvailableRef = useRef(null);
48
49
  var isLoadedServiceRef = useRef(false);
49
50
  request.setRequest(context.appHelper.utils.request);
50
- var Toast = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.Toast;
51
51
  var _useService = useService({
52
52
  renderMode: renderMode,
53
53
  onEdit: onEdit,
@@ -287,7 +287,7 @@ var AddSerivce = function AddSerivce(props) {
287
287
  },
288
288
  callback: function () {
289
289
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e, extension_type, detail) {
290
- var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _Toast$success, _addService, _list, quantity;
290
+ var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _list;
291
291
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
292
292
  while (1) switch (_context3.prev = _context3.next) {
293
293
  case 0:
@@ -356,23 +356,17 @@ var AddSerivce = function AddSerivce(props) {
356
356
  }
357
357
  cacheItem = getProductExtend({
358
358
  cacheItem: cacheItem,
359
- state: state,
360
- isDisabledTime: true
359
+ state: state
361
360
  });
362
361
  if (state.renderType === 'eventBooking') {
363
362
  cacheItem.autoClose = false;
364
363
  }
365
364
  if (cacheItem.autoClose) {
366
365
  cacheItem.autoClose = false;
367
- _addService = addService(state.service.value, cacheItem), _list = _addService.list, quantity = _addService.quantity;
368
- Toast === null || Toast === void 0 || (_Toast$success = Toast.success) === null || _Toast$success === void 0 || _Toast$success.call(Toast, /*#__PURE__*/React.createElement("div", {
369
- className: "add-toast-wrap"
370
- }, /*#__PURE__*/React.createElement("div", {
371
- className: "add-toast-title"
372
- }, cacheItem.title), /*#__PURE__*/React.createElement("div", {
373
- className: "add-toast-quantity"
374
- }, locales.getText('pisell2.ticket-booking.in-cart')(quantity || 1))));
375
- addServiceScroll(e.rowKey, cacheItem);
366
+ _list = addService(state.service.value, cacheItem);
367
+ PisellToast({
368
+ content: locales.getText('pisell2.ticket-booking.add-to-cart')
369
+ });
376
370
  dispatch({
377
371
  type: 'setService',
378
372
  payload: {
@@ -1,10 +0,0 @@
1
- .add-toast-wrap {
2
- width: 190px;
3
- .add-toast-title {
4
- margin-bottom: 12px;
5
- line-height: 22px;
6
- }
7
- .add-toast-quantity {
8
- font-size: 14px;
9
- }
10
- }
@@ -286,7 +286,6 @@ var TicketBooking = function TicketBooking() {
286
286
  }
287
287
  }
288
288
  }
289
- _modalState.service.value = [];
290
289
  _modalState.service.cacheItem = null;
291
290
  _modalState.service.addTimeModal = false;
292
291
  _modalState.service.changeService = false;
@@ -809,8 +808,7 @@ var TicketBooking = function TicketBooking() {
809
808
  locale: engineProps.locale,
810
809
  refreshData: _refreshData,
811
810
  setActiveTab: _setActiveTab,
812
- clearAllValue: _clearAllValue,
813
- drawerMask: true
811
+ clearAllValue: _clearAllValue
814
812
  }),
815
813
  setGlobalState: _setModalState,
816
814
  setState: setState,
@@ -8,7 +8,6 @@ import React, { useLayoutEffect, useMemo, useRef } from 'react';
8
8
  import { Provider, createStore } from "./miniRedux";
9
9
  import { locales } from '@pisell/utils';
10
10
  import dayjs from 'dayjs';
11
- import { cloneDeep } from 'lodash';
12
11
  import TicketBooking from "./components/ticketBooking/index";
13
12
  import { request } from "../../utils";
14
13
  import useEngineContext from "../../hooks/useEngineContext";
@@ -142,7 +141,7 @@ export default (function (props) {
142
141
  request.setRequest(context.appHelper.utils.request);
143
142
  }, []);
144
143
  useMemo(function () {
145
- var store = createStore(_objectSpread(_objectSpread({}, cloneDeep(initialState)), {}, {
144
+ var store = createStore(_objectSpread(_objectSpread({}, initialState), {}, {
146
145
  bookingConfigParams: bookingConfigParams,
147
146
  productExtensionType: productExtensionType
148
147
  }));
@@ -47,7 +47,6 @@ declare const _default: {
47
47
  "pisell2.ticket-booking.add-to-cart": string;
48
48
  "pisell2.ticket-booking.not-available-title": string;
49
49
  "pisell2.ticket-booking.not-available-ok": string;
50
- "pisell2.ticket-booking.in-cart": (number: number) => string;
51
50
  };
52
51
  "zh-CN": {
53
52
  "pisell2.ticket-booking.info": string;
@@ -97,7 +96,6 @@ declare const _default: {
97
96
  "pisell2.ticket-booking.add-to-cart": string;
98
97
  "pisell2.ticket-booking.not-available-title": string;
99
98
  "pisell2.ticket-booking.not-available-ok": string;
100
- "pisell2.ticket-booking.in-cart": (number: number) => string;
101
99
  };
102
100
  "zh-HK": {
103
101
  "pisell2.ticket-booking.info": string;
@@ -147,7 +145,6 @@ declare const _default: {
147
145
  "pisell2.ticket-booking.add-to-cart": string;
148
146
  "pisell2.ticket-booking.not-available-title": string;
149
147
  "pisell2.ticket-booking.not-available-ok": string;
150
- "pisell2.ticket-booking.in-cart": (number: number) => string;
151
148
  };
152
149
  };
153
150
  export default _default;
@@ -46,10 +46,7 @@ export default {
46
46
  "pisell2.ticket-booking.create-new": "Create new",
47
47
  "pisell2.ticket-booking.add-to-cart": "Added to Cart",
48
48
  "pisell2.ticket-booking.not-available-title": "Sorry, Not available at current time.",
49
- "pisell2.ticket-booking.not-available-ok": "OK",
50
- "pisell2.ticket-booking.in-cart": function pisell2TicketBookingInCart(number) {
51
- return "".concat(number, " in cart");
52
- }
49
+ "pisell2.ticket-booking.not-available-ok": "OK"
53
50
  },
54
51
  "zh-CN": {
55
52
  "pisell2.ticket-booking.info": "信息",
@@ -98,10 +95,7 @@ export default {
98
95
  "pisell2.ticket-booking.create-new": "新建",
99
96
  "pisell2.ticket-booking.add-to-cart": "已加入购物车",
100
97
  "pisell2.ticket-booking.not-available-title": "抱歉,目前不在可售时间。",
101
- "pisell2.ticket-booking.not-available-ok": "好的",
102
- "pisell2.ticket-booking.in-cart": function pisell2TicketBookingInCart(number) {
103
- return "\u5DF2\u6709".concat(number, "\u4EF6");
104
- }
98
+ "pisell2.ticket-booking.not-available-ok": "好的"
105
99
  },
106
100
  "zh-HK": {
107
101
  "pisell2.ticket-booking.info": "資訊",
@@ -150,9 +144,6 @@ export default {
150
144
  "pisell2.ticket-booking.create-new": "新建",
151
145
  "pisell2.ticket-booking.add-to-cart": "已加入购物车",
152
146
  "pisell2.ticket-booking.not-available-title": "抱歉,目前不在可售時間。",
153
- "pisell2.ticket-booking.not-available-ok": "好的",
154
- "pisell2.ticket-booking.in-cart": function pisell2TicketBookingInCart(number) {
155
- return "\u5DF2\u6709".concat(number, "\u4EF6");
156
- }
147
+ "pisell2.ticket-booking.not-available-ok": "好的"
157
148
  }
158
149
  };
@@ -12,8 +12,4 @@ export declare const restoreProductOtherData: (data: any) => {
12
12
  product_variant_id: number;
13
13
  quantity: number;
14
14
  } | undefined;
15
- export declare const addService: (list: any[], addItem: any) => {
16
- list: any[];
17
- quantity: any;
18
- };
19
- export declare const addServiceScroll: (rowKey: string, cacheItem: any) => void;
15
+ export declare const addService: (list: any[], addItem: any) => any[];
@@ -109,26 +109,19 @@ var isSameProduct = function isSameProduct(a, b) {
109
109
  };
110
110
  export var addService = function addService(list, addItem) {
111
111
  var value = list;
112
- var count;
113
112
  // 预约商品直接添加
114
113
  if (!isNormalProductByDurationSchedule(addItem)) {
115
114
  value.push(addItem);
116
- count = addItem._extend.quantity;
117
115
  } else {
118
116
  // 非预约商品判断是否相同,相同合并
119
117
  var isNotSame = true;
120
118
  value = list.map(function (item) {
121
119
  if (isSameProduct(item, addItem)) {
122
- var _item$_extend, _addItem$_extend, _item$_extend2;
120
+ var _item$_extend, _addItem$_extend;
123
121
  isNotSame = false;
124
- var quantity = ((item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.quantity) || 1) + ((addItem === null || addItem === void 0 || (_addItem$_extend = addItem._extend) === null || _addItem$_extend === void 0 ? void 0 : _addItem$_extend.quantity) || 1);
125
- count = quantity;
126
122
  return _objectSpread(_objectSpread({}, item), {}, {
127
123
  _extend: _objectSpread(_objectSpread({}, item._extend), {}, {
128
- quantity: quantity,
129
- other: _objectSpread(_objectSpread({}, ((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.other) || {}), {}, {
130
- quantity: quantity
131
- })
124
+ quantity: ((item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.quantity) || 1) + ((addItem === null || addItem === void 0 || (_addItem$_extend = addItem._extend) === null || _addItem$_extend === void 0 ? void 0 : _addItem$_extend.quantity) || 1)
132
125
  })
133
126
  });
134
127
  }
@@ -136,32 +129,7 @@ export var addService = function addService(list, addItem) {
136
129
  });
137
130
  if (isNotSame) {
138
131
  value.push(addItem);
139
- count = addItem._extend.quantity;
140
132
  }
141
133
  }
142
- return {
143
- list: value,
144
- quantity: count
145
- };
146
- };
147
- export var addServiceScroll = function addServiceScroll(rowKey, cacheItem) {
148
- var list = document.querySelectorAll("#rowKey-".concat(rowKey));
149
- setTimeout(function () {
150
- if (list.length && isNormalProductByDurationSchedule(cacheItem)) {
151
- list[list.length - 1].scrollIntoView({
152
- behavior: 'smooth',
153
- block: 'center'
154
- });
155
- } else {
156
- setTimeout(function () {
157
- var bookingWrap = document.querySelectorAll(".booking-info-warp");
158
- if (bookingWrap.length) {
159
- bookingWrap[0].scrollTo({
160
- top: 99999,
161
- behavior: 'smooth'
162
- });
163
- }
164
- }, 100);
165
- }
166
- });
134
+ return value;
167
135
  };
@@ -40,7 +40,6 @@ var import_hooks = require("../../hooks");
40
40
  var import_context = require("../../context");
41
41
  var import_utils = require("../../utils");
42
42
  var import_guests = __toESM(require("../../assets/guests.svg"));
43
- var import_resource = __toESM(require("../../assets/resource.svg"));
44
43
  var import_utils2 = require("@pisell/utils");
45
44
  var import_index = require("./index.less");
46
45
  var Resource = (0, import_react.forwardRef)((props, ref) => {
@@ -51,14 +50,11 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
51
50
  resourceOtherParams,
52
51
  currentStep,
53
52
  setResourceOtherParams,
54
- currentStepParams,
55
- currentSelectedResources
53
+ currentStepParams
56
54
  } = (0, import_context.useAppointmentBookingContext)();
57
55
  const { getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
58
56
  const { checkSkipResourceStep } = (0, import_hooks.useIsSkipResourceStep)();
59
57
  const { updateStep, nextStep } = (0, import_hooks.useAppointmentBookingStep)();
60
- const [loading, setLoading] = (0, import_react.useState)(false);
61
- const utils = (0, import_hooks.contextUtils)();
62
58
  (0, import_react.useImperativeHandle)(ref, () => ({
63
59
  next: async () => {
64
60
  setResourceOtherParams({
@@ -72,9 +68,6 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
72
68
  const { resources: resources2 } = getResourceList();
73
69
  return resources2 || [];
74
70
  }, []);
75
- (0, import_react.useEffect)(() => {
76
- setLoading(true);
77
- }, []);
78
71
  (0, import_react.useEffect)(() => {
79
72
  const checkAndSkipResourceStep = async () => {
80
73
  var _a;
@@ -111,9 +104,7 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
111
104
  );
112
105
  }, [currentStepParams.key, resources]);
113
106
  const renderLists = (0, import_react.useMemo)(() => {
114
- const appointmentCarts = carts.filter(
115
- (n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id))
116
- );
107
+ const appointmentCarts = carts.filter((n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id)));
117
108
  if (appointmentCarts.length > 1 || !(appointmentCarts == null ? void 0 : appointmentCarts.length)) {
118
109
  return [];
119
110
  }
@@ -151,9 +142,7 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
151
142
  var _a;
152
143
  setSelectedResource(e.id);
153
144
  if (e.id) {
154
- const index = carts.findIndex(
155
- (n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id))
156
- );
145
+ const index = carts.findIndex((n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id)));
157
146
  return appointmentBooking.updateCart({
158
147
  _id: (_a = carts == null ? void 0 : carts[index]) == null ? void 0 : _a._id,
159
148
  resources: (0, import_utils.updateCartResources)(carts == null ? void 0 : carts[index], e)
@@ -162,41 +151,13 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
162
151
  };
163
152
  (0, import_react.useEffect)(() => {
164
153
  var _a, _b, _c;
165
- const index = carts.findIndex(
166
- (n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id))
167
- );
154
+ const index = carts.findIndex((n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id)));
168
155
  const selectedResource2 = (_c = (_b = (_a = carts == null ? void 0 : carts[index]) == null ? void 0 : _a._origin) == null ? void 0 : _b.resources) == null ? void 0 : _c.find(
169
156
  (item) => (item == null ? void 0 : item.form_id) === (appointmentBoard == null ? void 0 : appointmentBoard.form_id)
170
157
  );
171
158
  setSelectedResource((selectedResource2 == null ? void 0 : selectedResource2.id) || 0);
172
159
  }, [carts, appointmentBoard == null ? void 0 : appointmentBoard.form_id]);
173
- (0, import_react.useEffect)(() => {
174
- if (resourcesResult) {
175
- setLoading(false);
176
- }
177
- }, [resourcesResult]);
178
- const currentResourceName = (0, import_react.useMemo)(() => {
179
- var _a;
180
- const currentResource = (_a = currentSelectedResources == null ? void 0 : currentSelectedResources[0]) == null ? void 0 : _a.currentSelectedResource;
181
- const resourceItem = (currentResource == null ? void 0 : currentResource.resourceItem) || {};
182
- const name = (0, import_utils.getResourceTitle)(
183
- appointmentBooking,
184
- resourceItem == null ? void 0 : resourceItem.code,
185
- utils,
186
- resourceItem
187
- );
188
- return name;
189
- }, [currentSelectedResources]);
190
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-resource-wrap" }, loading ? /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true }) : !(resourcesResult == null ? void 0 : resourcesResult.length) ? /* @__PURE__ */ import_react.default.createElement(
191
- import_materials.PisellEmpty,
192
- {
193
- description: import_utils2.locales.getText("pisell2.appointment.resource.tip")(
194
- currentResourceName
195
- ),
196
- maxWidth: 400,
197
- icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Image, { src: import_resource.default, preview: false, width: 44 })
198
- }
199
- ) : /* @__PURE__ */ import_react.default.createElement(
160
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-resource-wrap" }, !(resourcesResult == null ? void 0 : resourcesResult.length) ? /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true }) : /* @__PURE__ */ import_react.default.createElement(
200
161
  import_materials.PisellCustomCheckboxGroup,
201
162
  {
202
163
  dataSource: resourcesResult,
@@ -197,7 +197,6 @@ var useAppointmentBookingStep = () => {
197
197
  (0, import_utils3.scrollToFirstErrorCard)();
198
198
  return;
199
199
  }
200
- let preKey = "";
201
200
  currentSelectedResources == null ? void 0 : currentSelectedResources.forEach((cart) => {
202
201
  var _a3, _b3;
203
202
  const selectedResource2 = cart == null ? void 0 : cart.currentSelectedResource;
@@ -208,8 +207,7 @@ var useAppointmentBookingStep = () => {
208
207
  if (formId) {
209
208
  const description = import_utils.locales.getText("pisell2.appointment.fill-form");
210
209
  const beforeKey = (0, import_utils2.getFormInsertBeforeKey)(currentKey, stepList2);
211
- appointmentBooking.addStep({ key: formKey, description }, preKey || beforeKey);
212
- preKey = formKey;
210
+ appointmentBooking.addStep({ key: formKey, description }, beforeKey);
213
211
  } else {
214
212
  appointmentBooking.removeStep(formKey);
215
213
  }
@@ -237,19 +235,12 @@ var useAppointmentBookingStep = () => {
237
235
  if (((_f = nextStep2 == null ? void 0 : nextStep2.key) == null ? void 0 : _f.startsWith("select-resource_")) || (nextStep2 == null ? void 0 : nextStep2.key) === "confirm-information") {
238
236
  const selectedResource = ((_g = currentSelectedResources == null ? void 0 : currentSelectedResources[0]) == null ? void 0 : _g.currentSelectedResource) || {};
239
237
  const renderItem = (selectedResource == null ? void 0 : selectedResource.renderItem) || {};
240
- const checkHolder = async () => {
238
+ const checkHolder = () => {
241
239
  setLoading(false);
242
240
  if (isRetailTemplate || (appointmentBooking == null ? void 0 : appointmentBooking.isCartAllNormalProducts())) {
243
241
  return appointmentBooking.next();
244
242
  }
245
- let cartLists = carts || [];
246
- if (!(carts == null ? void 0 : carts.length)) {
247
- const newCarts = await appointmentBooking.getCart();
248
- cartLists = newCarts || [];
249
- } else {
250
- cartLists = carts || [];
251
- }
252
- const appoimentCarts = cartLists.filter((n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id)));
243
+ const appoimentCarts = carts.filter((n) => !(appointmentBooking == null ? void 0 : appointmentBooking.isTargetCartIdNormalProduct(n._id)));
253
244
  const { hasError } = (0, import_utils2.checkAndGoNext)(isFormSubject, checkAccount, appoimentCarts);
254
245
  setIsErrorHolder(hasError);
255
246
  if (hasError) {
@@ -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;
@@ -130,7 +130,6 @@ var locales_default = {
130
130
  "pisell2.appointment.add-guests": "Add guests",
131
131
  "pisell2.appointment.policy": "You have read and agreed to this policy",
132
132
  "pisell2.appointment.policy.confirm": "Confirm",
133
- "pisell2.appointment.resource.tip": (val) => `Tip: Change ${val || "resource"} using the dropdown in the cart.`,
134
133
  "pisell2.text.apply": "Apply",
135
134
  "pisell2.text.goodpass": "GoodPass",
136
135
  "pisell2.text.goodpass.product-vouchers": "Product Vouchers",
@@ -248,7 +247,6 @@ var locales_default = {
248
247
  "pisell2.appointment.add-guests": "添加预约人",
249
248
  "pisell2.appointment.policy": "您已仔细阅读并同意此协议",
250
249
  "pisell2.appointment.policy.confirm": "确定",
251
- "pisell2.appointment.resource.tip": (val) => `提示:在右侧购物车中,通过下拉框修改“${val || "资源"}”`,
252
250
  "pisell2.text.apply": "应用",
253
251
  "pisell2.text.goodpass": "商品券",
254
252
  "pisell2.text.goodpass.product-vouchers": "商品兑换券",
@@ -366,7 +364,6 @@ var locales_default = {
366
364
  "pisell2.appointment.add-guests": "添加預約人",
367
365
  "pisell2.appointment.policy": "您已仔細閱讀並同意此協議",
368
366
  "pisell2.appointment.policy.confirm": "確定",
369
- "pisell2.appointment.resource.tip": (val) => `提示:在右側購物車中,透過下拉框修改“${val || "資源"}”`,
370
367
  "pisell2.text.apply": "應用",
371
368
  "pisell2.text.goodpass": "商品券",
372
369
  "pisell2.text.goodpass.product-vouchers": "商品兌換券",
@@ -36,8 +36,6 @@ var import_react = __toESM(require("react"));
36
36
  var import_utils = require("@pisell/utils");
37
37
  var import_classnames = __toESM(require("classnames"));
38
38
  var import_utils2 = require("../../../utils");
39
- var import_decimal = __toESM(require("decimal.js"));
40
- var import_pisellPriceText = __toESM(require("../../../../productSelect/components/pisellPriceText"));
41
39
  var import_index = require("./index.less");
42
40
  var ProductItem = ({
43
41
  item,
@@ -46,11 +44,6 @@ var ProductItem = ({
46
44
  style,
47
45
  className
48
46
  }) => {
49
- const { price, is_bundle, minimum_markup_price } = item;
50
- let _price = price;
51
- if (is_bundle) {
52
- _price = new import_decimal.default(price).plus(new import_decimal.default(minimum_markup_price)).toFixed(2);
53
- }
54
47
  const stockText = (0, import_react.useMemo)(() => {
55
48
  if (item.is_track === 0) {
56
49
  return false;
@@ -80,7 +73,7 @@ var ProductItem = ({
80
73
  className: "server-product-title"
81
74
  },
82
75
  item.title
83
- ), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, (0, import_utils2.getDiscountTime)(item.service_times)), stockText && /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, stockText), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-price" }, /* @__PURE__ */ import_react.default.createElement(import_pisellPriceText.default, { value: _price, isMini: is_bundle })))
76
+ ), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, (0, import_utils2.getDiscountTime)(item.service_times)), stockText && /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, stockText), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-price" }, (0, import_utils.formatAmount)(item.price, 2, amountSymbol)))
84
77
  );
85
78
  };
86
79
  var productItem_default = ProductItem;
@@ -38,7 +38,7 @@ var import_ArrowLeft = __toESM(require("@pisell/icon/es/ArrowLeft"));
38
38
  var import_index = require("./index.less");
39
39
  var import_classnames = __toESM(require("classnames"));
40
40
  var Drawer = (props) => {
41
- const { hideScrollBar = true, showGoBack = true, mask = false } = props;
41
+ const { hideScrollBar = true, showGoBack = true } = props;
42
42
  return /* @__PURE__ */ import_react.default.createElement(
43
43
  import_antd.Drawer,
44
44
  {
@@ -52,7 +52,7 @@ var Drawer = (props) => {
52
52
  title: false,
53
53
  bodyStyle: { padding: 0 },
54
54
  push: false,
55
- mask
55
+ mask: false
56
56
  },
57
57
  /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-lowcode__booking-drawer-title-wrap") }, /* @__PURE__ */ import_react.default.createElement(
58
58
  "div",
@@ -101,28 +101,24 @@ var VoucherCard = (props) => {
101
101
  });
102
102
  return val;
103
103
  }, [state.service.value]);
104
- const { run } = (0, import_ahooks.useDebounceFn)(
105
- () => {
106
- var _a2, _b2;
107
- if (productRef.current === state.service.value || !((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length)) {
108
- return;
109
- }
110
- if (isBooking4Shop) {
111
- const val = shopDiscount.calcDiscount(state.service.value);
112
- productRef.current = val.productList;
113
- dispatch({
114
- type: "setService",
115
- payload: {
116
- ...services,
117
- value: ((val == null ? void 0 : val.productList) || []).filter(Boolean)
118
- }
119
- });
120
- }
121
- },
122
- { wait: 500 }
123
- );
124
104
  (0, import_react.useEffect)(() => {
125
- run();
105
+ var _a2, _b2;
106
+ if (productRef.current === state.service.value || !((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length)) {
107
+ return;
108
+ }
109
+ if (isBooking4Shop) {
110
+ const val = shopDiscount.calcDiscount(state.service.value);
111
+ console.log("input: ", state.service.value);
112
+ console.log("output: ", val);
113
+ productRef.current = val.productList;
114
+ dispatch({
115
+ type: "setService",
116
+ payload: {
117
+ ...services,
118
+ value: ((val == null ? void 0 : val.productList) || []).filter(Boolean)
119
+ }
120
+ });
121
+ }
126
122
  }, [JSON.stringify(serviceMemo), isBooking4Shop]);
127
123
  const fn = (0, import_ahooks.useMemoizedFn)((result) => {
128
124
  var _a2;
@@ -139,18 +135,18 @@ var VoucherCard = (props) => {
139
135
  });
140
136
  (0, import_react.useEffect)(() => {
141
137
  if (!isBooking4Shop) return;
138
+ pisellos.effects.on(ShopDiscountHooks.onScanCustomerChange, (customer) => {
139
+ dispatch({
140
+ type: "setClient",
141
+ payload: {
142
+ value: customer
143
+ }
144
+ });
145
+ });
142
146
  pisellos.effects.on(
143
- ShopDiscountHooks.onScanCustomerChange,
144
- (customer) => {
145
- dispatch({
146
- type: "setClient",
147
- payload: {
148
- value: customer
149
- }
150
- });
151
- }
147
+ ShopDiscountHooks.onLoadPrepareCalcResult,
148
+ fn
152
149
  );
153
- pisellos.effects.on(ShopDiscountHooks.onLoadPrepareCalcResult, fn);
154
150
  pisellos.effects.on(
155
151
  ShopDiscountHooks.onDiscountListChange,
156
152
  (discount) => {
@@ -306,8 +306,7 @@ var Client = () => {
306
306
  isPreview: false,
307
307
  drawerProps: {
308
308
  title: import_utils.locales.getText("pisell2.text.select-customer"),
309
- destroyOnClose: true,
310
- mask: state.drawerMask
309
+ destroyOnClose: true
311
310
  },
312
311
  mode: "single",
313
312
  createItemText: import_utils.locales.getText("pisell2.text.create-new-customer"),
@@ -463,9 +463,6 @@ var Pet = (props) => {
463
463
  ...((_c3 = (_b3 = (_a3 = state.pet) == null ? void 0 : _a3.formData) == null ? void 0 : _b3[0]) == null ? void 0 : _c3.options) || []
464
464
  ]);
465
465
  },
466
- drawerProps: {
467
- mask: state.drawerMask
468
- },
469
466
  getHolders,
470
467
  addCallbackService: addCallback,
471
468
  loading: valueLoading,
@@ -454,7 +454,7 @@ var isAllNormalProductByState = (state) => {
454
454
  return isAllNormalProduct(state.service.value);
455
455
  };
456
456
  var getGeneralParams = (item, state, isParallelResource) => {
457
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
457
+ var _a, _b, _c, _d, _e, _f, _g;
458
458
  const { pet, service } = state;
459
459
  const { holders = [], formData } = pet || {};
460
460
  const parallelResourceOtherParams = {};
@@ -519,7 +519,6 @@ var getGeneralParams = (item, state, isParallelResource) => {
519
519
  holder_id: (_d = item == null ? void 0 : item._extend) == null ? void 0 : _d.holder_id,
520
520
  start_date: !isNormalProduct ? (_e = item == null ? void 0 : item._extend) == null ? void 0 : _e.startDate : "",
521
521
  end_date: !isNormalProduct ? ((_f = item == null ? void 0 : item._extend) == null ? void 0 : _f.endDate) || ((_g = item == null ? void 0 : item._extend) == null ? void 0 : _g.end_date) : "",
522
- rowKey: `rowKey-${(_i = (_h = item == null ? void 0 : item._extend) == null ? void 0 : _h.other) == null ? void 0 : _i.rowKey}`,
523
522
  ...parallelResourceOtherParams
524
523
  };
525
524
  };
@@ -544,6 +543,7 @@ var formatProducts = (lists, state, isRenderGroup = true, isGeneral, isParallelR
544
543
  errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
545
544
  }
546
545
  const generalParams = isGeneral ? getGeneralParams(item, state, !!isParallelResource) : {};
546
+ console.log(isNormalProduct, "isNormalProduct");
547
547
  return {
548
548
  id: item == null ? void 0 : item.id,
549
549
  _id: item == null ? void 0 : item._id,
@@ -92,7 +92,7 @@ var Info = (0, import_model.Provider)((props) => {
92
92
  });
93
93
  }
94
94
  }, []);
95
- (0, import_react.useMemo)(() => {
95
+ (0, import_react.useEffect)(() => {
96
96
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m;
97
97
  const isFranchisee = (_d2 = (_c2 = (_b2 = (_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.utils) == null ? void 0 : _b2.businessUtils) == null ? void 0 : _c2.getAppByModal) == null ? void 0 : _d2.call(_c2, "franchisee");
98
98
  modal.dispatch({
@@ -165,12 +165,9 @@ var Info = (0, import_model.Provider)((props) => {
165
165
  try {
166
166
  setTimeout(async () => {
167
167
  var _a2;
168
- let data = await (0, import_serve.getResourceList)(
169
- {
170
- date: currentDate
171
- },
172
- (_a2 = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a2.bookingId
173
- );
168
+ let data = await (0, import_serve.getResourceList)({
169
+ date: currentDate
170
+ }, (_a2 = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a2.bookingId);
174
171
  data.date = currentDate;
175
172
  localStorage.setItem("bookingResourceList", JSON.stringify(data));
176
173
  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等不是最新数据