@pisell/private-materials 3.3.83 → 3.3.84

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 (173) 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 +5 -5
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/businessModel/SalesModel/Sales/index.js +37 -4
  12. package/es/components/Sales/Resource/index.js +2 -2
  13. package/es/components/Sales/Resource/serve.d.ts +7 -0
  14. package/es/components/Sales/Resource/serve.js +10 -0
  15. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  16. package/es/components/appointmentBooking/components/Content/index.less +1 -1
  17. package/es/components/appointmentBooking/components/Header/index.js +8 -14
  18. package/es/components/appointmentBooking/components/Services/index.js +38 -36
  19. package/es/components/appointmentBooking/components/Voucher/index.js +1 -1
  20. package/es/components/appointmentBooking/index.js +14 -0
  21. package/es/components/appointmentBooking/index.less +1 -1
  22. package/es/components/appointmentBooking/locales.d.ts +0 -3
  23. package/es/components/appointmentBooking/locales.js +0 -3
  24. package/es/components/booking/components/footer/utils.d.ts +1 -0
  25. package/es/components/booking/components/footer/utils.js +1 -1
  26. package/es/components/booking/components/voucher/index.js +2 -2
  27. package/es/components/booking/editBookingModal/index.d.ts +5 -0
  28. package/es/components/booking/editBookingModal/index.js +386 -0
  29. package/es/components/booking/editBookingModal/index.less +8 -0
  30. package/es/components/booking/editBookingModal/locales.d.ts +21 -0
  31. package/es/components/booking/editBookingModal/locales.js +20 -0
  32. package/es/components/booking/editBookingModal/mock.d.ts +807 -0
  33. package/es/components/booking/editBookingModal/mock.js +2993 -0
  34. package/es/components/booking/editBookingModal/serve.d.ts +51 -0
  35. package/es/components/booking/editBookingModal/serve.js +288 -0
  36. package/es/components/booking/editBookingModal/type.d.ts +12 -0
  37. package/es/components/booking/editBookingModal/type.js +1 -0
  38. package/es/components/booking/editBookingModal/utils.d.ts +12 -0
  39. package/es/components/booking/editBookingModal/utils.js +157 -0
  40. package/es/components/booking/info/service2/utils.d.ts +1 -1
  41. package/es/components/booking/info/service2/utils.js +3 -2
  42. package/es/components/booking/info2/service/addService/utils.d.ts +10 -0
  43. package/es/components/booking/info2/service/addService/utils.js +44 -13
  44. package/es/components/booking/info2/service/editService/Resources/index.js +22 -8
  45. package/es/components/booking/info2/service/editService/Resources/index.less +6 -0
  46. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
  47. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +26 -0
  48. package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
  49. package/es/components/booking/info2/service/editService/ResourcesV2/index.js +308 -0
  50. package/es/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
  51. package/es/components/booking/info2/utilsByBooking.js +9 -0
  52. package/es/components/booking/locales.d.ts +3 -0
  53. package/es/components/booking/locales.js +3 -0
  54. package/es/components/booking/utils.d.ts +2 -2
  55. package/es/components/eventBooking/components/Provider/Event/index.js +13 -4
  56. package/es/components/eventBooking/components/bookingDetailModal/index.js +19 -3
  57. package/es/components/eventBooking/index.js +21 -7
  58. package/es/components/eventBooking/locales.js +3 -3
  59. package/es/components/index.d.ts +3 -1
  60. package/es/components/index.js +3 -1
  61. package/es/components/pay/toC/PaymentMethods/index.js +5 -4
  62. package/es/components/stepController/components/Content/index.d.ts +7 -0
  63. package/es/components/stepController/components/Content/index.js +9 -0
  64. package/es/components/stepController/components/Content/index.less +8 -0
  65. package/es/components/stepController/components/Footer/index.d.ts +8 -0
  66. package/es/components/stepController/components/Footer/index.js +15 -0
  67. package/es/components/stepController/components/Footer/index.less +39 -0
  68. package/es/components/stepController/components/Header/index.d.ts +20 -0
  69. package/es/components/stepController/components/Header/index.js +97 -0
  70. package/es/components/stepController/components/Header/index.less +21 -0
  71. package/es/components/stepController/index.d.ts +5 -0
  72. package/es/components/stepController/index.js +64 -0
  73. package/es/components/stepController/index.less +11 -0
  74. package/es/components/stepController/locales.d.ts +27 -0
  75. package/es/components/stepController/locales.js +32 -0
  76. package/es/components/stepController/types.d.ts +23 -0
  77. package/es/components/stepController/types.js +1 -0
  78. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  79. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  80. package/es/components/ticketBooking/components/ticketBooking/index.js +257 -138
  81. package/es/components/ticketBooking/locales.d.ts +164 -146
  82. package/es/components/ticketBooking/locales.js +195 -147
  83. package/es/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
  84. package/es/components/ticketBooking/utils/formatProductMessage.js +62 -0
  85. package/es/components/ticketBooking/utils/formatTime.d.ts +31 -0
  86. package/es/components/ticketBooking/utils/formatTime.js +144 -0
  87. package/es/hooks/useWindowSize.d.ts +5 -0
  88. package/es/hooks/useWindowSize.js +26 -0
  89. package/es/index.d.ts +2 -0
  90. package/es/index.js +3 -1
  91. package/lib/businessModel/SalesModel/Sales/index.js +22 -8
  92. package/lib/components/Sales/Resource/index.js +1 -1
  93. package/lib/components/Sales/Resource/serve.d.ts +7 -0
  94. package/lib/components/Sales/Resource/serve.js +9 -2
  95. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  96. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  97. package/lib/components/appointmentBooking/components/Header/index.js +2 -3
  98. package/lib/components/appointmentBooking/components/Services/index.js +19 -18
  99. package/lib/components/appointmentBooking/components/Voucher/index.js +1 -1
  100. package/lib/components/appointmentBooking/index.js +11 -0
  101. package/lib/components/appointmentBooking/index.less +1 -1
  102. package/lib/components/appointmentBooking/locales.d.ts +0 -3
  103. package/lib/components/appointmentBooking/locales.js +0 -3
  104. package/lib/components/booking/components/footer/utils.d.ts +1 -0
  105. package/lib/components/booking/components/footer/utils.js +2 -0
  106. package/lib/components/booking/components/voucher/index.js +11 -23
  107. package/lib/components/booking/editBookingModal/index.d.ts +5 -0
  108. package/lib/components/booking/editBookingModal/index.js +363 -0
  109. package/lib/components/booking/editBookingModal/index.less +8 -0
  110. package/lib/components/booking/editBookingModal/locales.d.ts +21 -0
  111. package/lib/components/booking/editBookingModal/locales.js +44 -0
  112. package/lib/components/booking/editBookingModal/mock.d.ts +807 -0
  113. package/lib/components/booking/editBookingModal/mock.js +3314 -0
  114. package/lib/components/booking/editBookingModal/serve.d.ts +51 -0
  115. package/lib/components/booking/editBookingModal/serve.js +178 -0
  116. package/lib/components/booking/editBookingModal/type.d.ts +12 -0
  117. package/lib/components/booking/editBookingModal/type.js +17 -0
  118. package/lib/components/booking/editBookingModal/utils.d.ts +12 -0
  119. package/lib/components/booking/editBookingModal/utils.js +158 -0
  120. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  121. package/lib/components/booking/info/service2/utils.js +2 -2
  122. package/lib/components/booking/info2/service/addService/utils.d.ts +10 -0
  123. package/lib/components/booking/info2/service/addService/utils.js +27 -4
  124. package/lib/components/booking/info2/service/editService/Resources/index.js +54 -10
  125. package/lib/components/booking/info2/service/editService/Resources/index.less +6 -0
  126. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
  127. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +53 -0
  128. package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
  129. package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +311 -0
  130. package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
  131. package/lib/components/booking/info2/utilsByBooking.js +6 -0
  132. package/lib/components/booking/locales.d.ts +3 -0
  133. package/lib/components/booking/locales.js +3 -0
  134. package/lib/components/booking/utils.d.ts +2 -2
  135. package/lib/components/eventBooking/components/Provider/Event/index.js +10 -3
  136. package/lib/components/eventBooking/components/bookingDetailModal/index.js +9 -3
  137. package/lib/components/eventBooking/index.js +11 -7
  138. package/lib/components/eventBooking/locales.js +3 -3
  139. package/lib/components/index.d.ts +3 -1
  140. package/lib/components/index.js +6 -0
  141. package/lib/components/pay/toC/PaymentMethods/index.js +10 -9
  142. package/lib/components/stepController/components/Content/index.d.ts +7 -0
  143. package/lib/components/stepController/components/Content/index.js +40 -0
  144. package/lib/components/stepController/components/Content/index.less +8 -0
  145. package/lib/components/stepController/components/Footer/index.d.ts +8 -0
  146. package/lib/components/stepController/components/Footer/index.js +49 -0
  147. package/lib/components/stepController/components/Footer/index.less +39 -0
  148. package/lib/components/stepController/components/Header/index.d.ts +20 -0
  149. package/lib/components/stepController/components/Header/index.js +104 -0
  150. package/lib/components/stepController/components/Header/index.less +21 -0
  151. package/lib/components/stepController/index.d.ts +5 -0
  152. package/lib/components/stepController/index.js +89 -0
  153. package/lib/components/stepController/index.less +11 -0
  154. package/lib/components/stepController/locales.d.ts +27 -0
  155. package/lib/components/stepController/locales.js +50 -0
  156. package/lib/components/stepController/types.d.ts +23 -0
  157. package/lib/components/stepController/types.js +17 -0
  158. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  159. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  160. package/lib/components/ticketBooking/components/ticketBooking/index.js +263 -139
  161. package/lib/components/ticketBooking/locales.d.ts +164 -146
  162. package/lib/components/ticketBooking/locales.js +22 -4
  163. package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
  164. package/lib/components/ticketBooking/utils/formatProductMessage.js +84 -0
  165. package/lib/components/ticketBooking/utils/formatTime.d.ts +31 -0
  166. package/lib/components/ticketBooking/utils/formatTime.js +139 -0
  167. package/lib/hooks/useWindowSize.d.ts +5 -0
  168. package/lib/hooks/useWindowSize.js +51 -0
  169. package/lib/index.d.ts +2 -0
  170. package/lib/index.js +6 -0
  171. package/lowcode/edit-booking-modal/meta.ts +53 -0
  172. package/lowcode/step-controller/meta.ts +88 -0
  173. package/package.json +3 -3
@@ -0,0 +1,26 @@
1
+ import { useEffect } from 'react';
2
+ export var useWindowSize = function useWindowSize() {
3
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4
+ var _options$debounceMs = options.debounceMs,
5
+ debounceMs = _options$debounceMs === void 0 ? 100 : _options$debounceMs;
6
+ useEffect(function () {
7
+ var timeoutId;
8
+ var setRealVH = function setRealVH() {
9
+ // window.innerHeight 会返回视口真实的高度(不包括工具栏)
10
+ var vh = window.innerHeight * 0.01;
11
+ document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
12
+ };
13
+ var debouncedHandleResize = function debouncedHandleResize() {
14
+ clearTimeout(timeoutId);
15
+ timeoutId = setTimeout(setRealVH, debounceMs);
16
+ };
17
+
18
+ // 页面加载和窗口大小变化时都重新计算
19
+ debouncedHandleResize();
20
+ window.addEventListener('resize', debouncedHandleResize);
21
+ return function () {
22
+ window.removeEventListener('resize', debouncedHandleResize);
23
+ clearTimeout(timeoutId);
24
+ };
25
+ }, [debounceMs]);
26
+ };
package/es/index.d.ts CHANGED
@@ -43,3 +43,5 @@ export { default as AppointmentBooking } from './components/appointmentBooking';
43
43
  export { default as AppointmentDeposit } from './components/appointmentBooking/deposit';
44
44
  export { default as TicketBooking } from './components/ticketBooking';
45
45
  export { default as SubTotal } from './components/subTotal';
46
+ export { default as StepController } from './components/stepController';
47
+ export { default as EditBookingModal } from './components/booking/editBookingModal';
package/es/index.js CHANGED
@@ -46,4 +46,6 @@ export { default as ShoppingCart } from "./components/shoppingCart";
46
46
  export { default as AppointmentBooking } from "./components/appointmentBooking";
47
47
  export { default as AppointmentDeposit } from "./components/appointmentBooking/deposit";
48
48
  export { default as TicketBooking } from "./components/ticketBooking";
49
- export { default as SubTotal } from "./components/subTotal";
49
+ export { default as SubTotal } from "./components/subTotal";
50
+ export { default as StepController } from "./components/stepController";
51
+ export { default as EditBookingModal } from "./components/booking/editBookingModal";
@@ -35,6 +35,7 @@ __export(Sales_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(Sales_exports);
37
37
  var import_react = __toESM(require("react"));
38
+ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
38
39
  var defaultData = {};
39
40
  var SALES_MODEL_SESSION_STORAGE_KEY = "shop_h5_sales_model_data";
40
41
  var SalesContext = (0, import_react.createContext)(
@@ -45,14 +46,13 @@ var SalesProvider = (props) => {
45
46
  const dataRef = (0, import_react.useRef)({});
46
47
  const [data, setData] = (0, import_react.useState)(defaultData);
47
48
  const [hooks, setHooks] = (0, import_react.useState)(props.hooks);
49
+ const context = (0, import_useEngineContext.default)();
50
+ const utils = context.appHelper.utils || {};
48
51
  const _setData = (newData) => {
49
52
  dataRef.current = { ...dataRef.current, ...newData };
50
53
  console.log("sales_model_newData", dataRef.current);
51
54
  if (config == null ? void 0 : config.useSessionStorage) {
52
- sessionStorage.setItem(
53
- SALES_MODEL_SESSION_STORAGE_KEY,
54
- JSON.stringify(dataRef.current || {})
55
- );
55
+ setSessionStorage();
56
56
  }
57
57
  setData({ ...dataRef.current });
58
58
  };
@@ -60,14 +60,28 @@ var SalesProvider = (props) => {
60
60
  return dataRef.current;
61
61
  };
62
62
  const setSessionStorage = () => {
63
+ var _a, _b, _c;
64
+ const history = ((_a = utils == null ? void 0 : utils.getHistory) == null ? void 0 : _a.call(utils)) || {};
65
+ const cacheId = ((_c = (_b = history == null ? void 0 : history.location) == null ? void 0 : _b.query) == null ? void 0 : _c.cacheId) || "";
66
+ const sessionData = { ...dataRef.current || {}, cacheId };
63
67
  sessionStorage.setItem(
64
- SALES_MODEL_SESSION_STORAGE_KEY,
65
- JSON.stringify(dataRef.current || {})
68
+ `${SALES_MODEL_SESSION_STORAGE_KEY}`,
69
+ JSON.stringify(sessionData || {})
66
70
  );
67
71
  };
68
72
  const getSessionStorage = () => {
69
- const result = sessionStorage.getItem(SALES_MODEL_SESSION_STORAGE_KEY);
70
- return JSON.parse(result || "{}");
73
+ var _a, _b, _c;
74
+ const history = ((_a = utils == null ? void 0 : utils.getHistory) == null ? void 0 : _a.call(utils)) || {};
75
+ const strResult = sessionStorage.getItem(SALES_MODEL_SESSION_STORAGE_KEY);
76
+ const result = strResult ? JSON.parse(strResult || "{}") : {};
77
+ const cacheId = ((_c = (_b = history == null ? void 0 : history.location) == null ? void 0 : _b.query) == null ? void 0 : _c.cacheId) || "";
78
+ if (!cacheId && !(result == null ? void 0 : result.cacheId)) {
79
+ return result;
80
+ }
81
+ if (cacheId && (result == null ? void 0 : result.cacheId) === cacheId) {
82
+ return result;
83
+ }
84
+ return {};
71
85
  };
72
86
  const removeSessionStorage = () => {
73
87
  sessionStorage.removeItem(SALES_MODEL_SESSION_STORAGE_KEY);
@@ -90,7 +90,7 @@ var ResourceProvider = ({
90
90
  resourceMap.forEach((v) => renderData.push(v));
91
91
  return renderData;
92
92
  };
93
- const getResourceList = (0, import_ahooks.useRequest)(import_serve.getResourceListApi, {
93
+ const getResourceList = (0, import_ahooks.useRequest)(import_serve.getSpecialResourceListApi, {
94
94
  manual: true,
95
95
  onSuccess: (res) => {
96
96
  const formatData = formatResourceList(res);
@@ -3,3 +3,10 @@ export declare const getResourceListApi: (params: {
3
3
  shop_id: string;
4
4
  form_data_status: string;
5
5
  }) => Promise<any>;
6
+ /**
7
+ * @title: 获取特殊资源列表
8
+ * @Author: xiangfeng.xue
9
+ */
10
+ export declare const getSpecialResourceListApi: (params: {
11
+ event_item_ids?: string | number[];
12
+ }) => Promise<any>;
@@ -19,14 +19,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/components/Sales/Resource/serve.ts
20
20
  var serve_exports = {};
21
21
  __export(serve_exports, {
22
- getResourceListApi: () => getResourceListApi
22
+ getResourceListApi: () => getResourceListApi,
23
+ getSpecialResourceListApi: () => getSpecialResourceListApi
23
24
  });
24
25
  module.exports = __toCommonJS(serve_exports);
25
26
  var import_utils = require("../../../utils");
26
27
  var getResourceListApi = (params) => {
27
28
  return import_utils.request.getRequest().get("/h5/form/data/v1", params, { useCache: true });
28
29
  };
30
+ var getSpecialResourceListApi = (params) => {
31
+ return import_utils.request.getRequest().get("/h5/eventbookingv2/item/specify-resources", params, {
32
+ useCache: true
33
+ });
34
+ };
29
35
  // Annotate the CommonJS export names for ESM import in node:
30
36
  0 && (module.exports = {
31
- getResourceListApi
37
+ getResourceListApi,
38
+ getSpecialResourceListApi
32
39
  });
@@ -1,5 +1,5 @@
1
1
  .appointment-cart-item-wrap {
2
- height: calc(100vh - 100px);
2
+ height: calc(var(--vh, 1vh) * 100 - 100px);
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
 
@@ -39,7 +39,7 @@
39
39
  flex-direction: column;
40
40
  align-items: start;
41
41
 
42
- >div {
42
+ > div {
43
43
  display: flex;
44
44
  align-items: center;
45
45
  justify-content: space-between;
@@ -105,4 +105,4 @@
105
105
  flex: none;
106
106
  z-index: 10;
107
107
  }
108
- }
108
+ }
@@ -107,7 +107,7 @@
107
107
  margin-top: 0;
108
108
 
109
109
  .appointment-cart-item-wrap {
110
- height: calc(100vh - 16px) !important;
110
+ height: calc(var(--vh, 1vh) * 100 - 16px) !important;
111
111
  }
112
112
  }
113
113
  }
@@ -74,7 +74,7 @@ var Header = () => {
74
74
  return ((_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.description) || "";
75
75
  }, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key, currentSelectedResources]);
76
76
  const handleBack = async () => {
77
- var _a2, _b;
77
+ var _a2;
78
78
  const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
79
79
  const types = {
80
80
  "select-time": "time",
@@ -89,8 +89,7 @@ var Header = () => {
89
89
  }
90
90
  if (key === "select-service") {
91
91
  appointmentBooking.clearCart();
92
- const type = await checkProductType((_b = carts == null ? void 0 : carts[0]) == null ? void 0 : _b.id);
93
- if (type === "duration") {
92
+ if (appointmentBooking.isCartHasDurationProduct()) {
94
93
  appointmentBooking.deleteCartItemInfo("time");
95
94
  }
96
95
  }
@@ -74,9 +74,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
74
74
  let type = "";
75
75
  if (!isRetailTemplate) {
76
76
  type = await checkProductType(item == null ? void 0 : item.id);
77
- if (type === "session") {
78
- appointmentBooking.openProductDetail(item.id);
79
- }
77
+ appointmentBooking.openProductDetail(item.id);
80
78
  }
81
79
  utils == null ? void 0 : utils.action({
82
80
  type: "pisell1.productDetail",
@@ -86,6 +84,10 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
86
84
  },
87
85
  callback: async (data) => {
88
86
  var _a, _b;
87
+ if (data.isCancel) {
88
+ appointmentBooking.closeProductDetail();
89
+ return;
90
+ }
89
91
  const product = {
90
92
  ...data,
91
93
  options: (data == null ? void 0 : data.option) || []
@@ -96,13 +98,6 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
96
98
  appointmentBooking.storeProduct(product);
97
99
  return;
98
100
  }
99
- if (data == null ? void 0 : data.isCancel) {
100
- if (type === "session") {
101
- appointmentBooking.closeProductDetail();
102
- appointmentBooking.getAvailableDate();
103
- }
104
- return;
105
- }
106
101
  const session = data == null ? void 0 : data.session;
107
102
  if (session) {
108
103
  const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
@@ -114,7 +109,6 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
114
109
  endTime: `${endDate} ${session == null ? void 0 : session.end_time}`
115
110
  }
116
111
  });
117
- appointmentBooking.closeProductDetail();
118
112
  await appointmentBooking.getAvailableDate({
119
113
  startDate,
120
114
  endDate
@@ -132,16 +126,23 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
132
126
  await appointmentBooking.getAvailableDate();
133
127
  }
134
128
  }
129
+ appointmentBooking.closeProductDetail();
135
130
  if (isDateSelectedFirst) {
136
131
  const index = (currentStep == null ? void 0 : currentStep.index) + 2;
137
- if (type === "duration") {
138
- const description = import_utils.locales.getText(
139
- "pisell2.appointment.select.time"
140
- );
141
- appointmentBooking.addStep(
142
- { index, key: "select-time", description },
143
- "select-resource"
132
+ if (type === "duration" || appointmentBooking.isCartHasDurationProduct()) {
133
+ const stepList = appointmentBooking.getStepList();
134
+ const hasResourceStep = stepList == null ? void 0 : stepList.find(
135
+ (item2) => (item2 == null ? void 0 : item2.key) === "select-resource"
144
136
  );
137
+ if (hasResourceStep) {
138
+ const description = import_utils.locales.getText(
139
+ "pisell2.appointment.select.time"
140
+ );
141
+ appointmentBooking.addStep(
142
+ { index, key: "select-time", description },
143
+ "select-resource"
144
+ );
145
+ }
145
146
  } else {
146
147
  removeStep("select-time");
147
148
  }
@@ -140,7 +140,7 @@ var VoucherCard = (props) => {
140
140
  setCode("");
141
141
  } else {
142
142
  (0, import_materials.PisellToast)({
143
- content: val.type === "server" ? import_utils.locales.getText("pisell2.text.goodpass.code-invalid") : import_utils.locales.getText("pisell2.text.goodpass.code-invalid-cart")
143
+ content: import_utils.locales.getText("pisell2.text.goodpass.code-invalid")
144
144
  });
145
145
  }
146
146
  };
@@ -58,6 +58,17 @@ var AppointmentBooking = () => {
58
58
  }
59
59
  });
60
60
  }, []);
61
+ (0, import_react.useEffect)(() => {
62
+ const setRealVH = () => {
63
+ const vh = window.innerHeight * 0.01;
64
+ document.documentElement.style.setProperty("--vh", `${vh}px`);
65
+ };
66
+ setRealVH();
67
+ window.addEventListener("resize", setRealVH);
68
+ return () => {
69
+ window.removeEventListener("resize", setRealVH);
70
+ };
71
+ }, []);
61
72
  return /* @__PURE__ */ import_react.default.createElement(
62
73
  "div",
63
74
  {
@@ -3,7 +3,7 @@
3
3
  flex-direction: column;
4
4
  align-items: center;
5
5
  background: #ffffff;
6
- height: 100vh;
6
+ height: calc(var(--vh, 1vh) * 100);
7
7
  overflow-y: auto;
8
8
 
9
9
  .pisell-section-headers {
@@ -114,7 +114,6 @@ declare const _default: {
114
114
  'pisell2.text.goodpass.code': string;
115
115
  'pisell2.text.goodpass.enter-code': string;
116
116
  'pisell2.text.goodpass.code-invalid': string;
117
- 'pisell2.text.goodpass.code-invalid-cart': string;
118
117
  'pisell2.text.goodpass.login': string;
119
118
  'pisell2.text.goodpass.login-tip': string;
120
119
  };
@@ -233,7 +232,6 @@ declare const _default: {
233
232
  'pisell2.text.goodpass.code': string;
234
233
  'pisell2.text.goodpass.enter-code': string;
235
234
  'pisell2.text.goodpass.code-invalid': string;
236
- 'pisell2.text.goodpass.code-invalid-cart': string;
237
235
  'pisell2.text.goodpass.login': string;
238
236
  'pisell2.text.goodpass.login-tip': string;
239
237
  };
@@ -352,7 +350,6 @@ declare const _default: {
352
350
  'pisell2.text.goodpass.code': string;
353
351
  'pisell2.text.goodpass.enter-code': string;
354
352
  'pisell2.text.goodpass.code-invalid': string;
355
- 'pisell2.text.goodpass.code-invalid-cart': string;
356
353
  'pisell2.text.goodpass.login': string;
357
354
  'pisell2.text.goodpass.login-tip': string;
358
355
  };
@@ -138,7 +138,6 @@ var locales_default = {
138
138
  "pisell2.text.goodpass.code": "Code",
139
139
  "pisell2.text.goodpass.enter-code": "Enter Code",
140
140
  "pisell2.text.goodpass.code-invalid": "Current code is invalid",
141
- "pisell2.text.goodpass.code-invalid-cart": "No eligible items in the cart",
142
141
  "pisell2.text.goodpass.login": "Login",
143
142
  "pisell2.text.goodpass.login-tip": " for member benefit Or use account credit"
144
143
  },
@@ -257,7 +256,6 @@ var locales_default = {
257
256
  "pisell2.text.goodpass.code": "券码",
258
257
  "pisell2.text.goodpass.enter-code": "请输入券码",
259
258
  "pisell2.text.goodpass.code-invalid": "当前券码不可用",
260
- "pisell2.text.goodpass.code-invalid-cart": "当前购物车中无可用商品",
261
259
  "pisell2.text.goodpass.login": "登录",
262
260
  "pisell2.text.goodpass.login-tip": "以获取会员福利或使用账户积分"
263
261
  },
@@ -376,7 +374,6 @@ var locales_default = {
376
374
  "pisell2.text.goodpass.code": "券碼",
377
375
  "pisell2.text.goodpass.enter-code": "請輸入券碼",
378
376
  "pisell2.text.goodpass.code-invalid": "當前券碼不可用",
379
- "pisell2.text.goodpass.code-invalid-cart": "當前購物車中無可用商品",
380
377
  "pisell2.text.goodpass.login": "登錄",
381
378
  "pisell2.text.goodpass.login-tip": "以獲取會員福利或使用賬戶積分"
382
379
  }
@@ -27,6 +27,7 @@ export interface ResourceItem {
27
27
  * @Author: jinglin.tan
28
28
  */
29
29
  export declare const checkSubResourcesCapacity: (resource: ResourceItem) => void;
30
+ export declare const checkResourcesFormat: (resources: any[], service: any, isChild?: boolean) => any[];
30
31
  /**
31
32
  * @title: 格式化商品单价
32
33
  * @description:
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  var utils_exports = {};
31
31
  __export(utils_exports, {
32
32
  checkHolderIsError: () => checkHolderIsError,
33
+ checkResourcesFormat: () => checkResourcesFormat,
33
34
  checkSubResourcesCapacity: () => checkSubResourcesCapacity,
34
35
  formatProductBundle: () => formatProductBundle,
35
36
  formatProductOption: () => formatProductOption,
@@ -476,6 +477,7 @@ var checkHolderIsError = (state) => {
476
477
  // Annotate the CommonJS export names for ESM import in node:
477
478
  0 && (module.exports = {
478
479
  checkHolderIsError,
480
+ checkResourcesFormat,
479
481
  checkSubResourcesCapacity,
480
482
  formatProductBundle,
481
483
  formatProductOption,
@@ -41,8 +41,8 @@ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContex
41
41
  var import_materials = require("@pisell/materials");
42
42
  var import_useIsBooking4Shop = require("../../hooks/useIsBooking4Shop");
43
43
  var import_index = require("./index.less");
44
- var import_utils2 = require("./utils");
45
44
  var import_ahooks = require("ahooks");
45
+ var import_utils2 = require("./utils");
46
46
  var ShopDiscountHooks = {
47
47
  onInited: "shopDiscount:onInited",
48
48
  onDestroy: "shopDiscount:onDestroy",
@@ -67,17 +67,13 @@ var VoucherCard = (props) => {
67
67
  const isBooking4Shop = (0, import_useIsBooking4Shop.useIsBooking4Shop)(state);
68
68
  const shopDiscount = pisellos.getModule("shopDiscount");
69
69
  services = state.service;
70
- (0, import_ahooks.useDebounceEffect)(
71
- () => {
72
- if (isBooking4Shop) {
73
- shopDiscount.setCustomer(state.client.value);
74
- }
75
- },
76
- [(_b = state.client.value) == null ? void 0 : _b.id, isBooking4Shop],
77
- {
78
- wait: 200
70
+ (0, import_ahooks.useDebounceEffect)(() => {
71
+ if (isBooking4Shop) {
72
+ shopDiscount.setCustomer(state.client.value);
79
73
  }
80
- );
74
+ }, [(_b = state.client.value) == null ? void 0 : _b.id, isBooking4Shop], {
75
+ wait: 200
76
+ });
81
77
  (0, import_react.useEffect)(() => {
82
78
  if (isBooking4Shop) {
83
79
  shopDiscount.setProductList([
@@ -120,9 +116,7 @@ var VoucherCard = (props) => {
120
116
  }, [state.addons.value]);
121
117
  const disabled = (0, import_react.useMemo)(() => {
122
118
  var _a2;
123
- if (["paid", "partially_paid"].includes(
124
- (_a2 = state.bookingDetail) == null ? void 0 : _a2.payment_status
125
- ) && [...addonsMemo, ...serviceMemo].every((item) => item.booking_id)) {
119
+ if (["paid", "partially_paid"].includes((_a2 = state.bookingDetail) == null ? void 0 : _a2.payment_status) && [...addonsMemo, ...serviceMemo].every((item) => item.booking_id)) {
126
120
  return true;
127
121
  }
128
122
  return false;
@@ -179,15 +173,9 @@ var VoucherCard = (props) => {
179
173
  );
180
174
  return () => {
181
175
  shopDiscount.clear();
182
- pisellos.effects.off(
183
- ShopDiscountHooks.onCustomerChange,
184
- onScanCustomerChange
185
- );
176
+ pisellos.effects.off(ShopDiscountHooks.onCustomerChange, onScanCustomerChange);
186
177
  pisellos.effects.off(ShopDiscountHooks.onLoadPrepareCalcResult, fn);
187
- pisellos.effects.off(
188
- ShopDiscountHooks.onDiscountListChange,
189
- onDiscountListChange
190
- );
178
+ pisellos.effects.off(ShopDiscountHooks.onDiscountListChange, onDiscountListChange);
191
179
  };
192
180
  }, [state.bookingId, isBooking4Shop, fn]);
193
181
  const productListToValue = (0, import_ahooks.useMemoizedFn)((list, edit) => {
@@ -274,8 +262,8 @@ var VoucherCard = (props) => {
274
262
  import_materials.PisellGoodPassCard,
275
263
  {
276
264
  style: { width: "100%" },
277
- mixedSort,
278
265
  dataSource: ((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length) ? availableData : [],
266
+ mixedSort,
279
267
  onChange: (val) => {
280
268
  const shopDiscount2 = pisellos.getModule("shopDiscount");
281
269
  const detail = shopDiscount2.setDiscountSelected({
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { EditBookingModalProps } from './type';
3
+ import './index.less';
4
+ declare const _default: React.ForwardRefExoticComponent<EditBookingModalProps & React.RefAttributes<unknown>>;
5
+ export default _default;