@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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +5 -5
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/businessModel/SalesModel/Sales/index.js +37 -4
- package/es/components/Sales/Resource/index.js +2 -2
- package/es/components/Sales/Resource/serve.d.ts +7 -0
- package/es/components/Sales/Resource/serve.js +10 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/es/components/appointmentBooking/components/Content/index.less +1 -1
- package/es/components/appointmentBooking/components/Header/index.js +8 -14
- package/es/components/appointmentBooking/components/Services/index.js +38 -36
- package/es/components/appointmentBooking/components/Voucher/index.js +1 -1
- package/es/components/appointmentBooking/index.js +14 -0
- package/es/components/appointmentBooking/index.less +1 -1
- package/es/components/appointmentBooking/locales.d.ts +0 -3
- package/es/components/appointmentBooking/locales.js +0 -3
- package/es/components/booking/components/footer/utils.d.ts +1 -0
- package/es/components/booking/components/footer/utils.js +1 -1
- package/es/components/booking/components/voucher/index.js +2 -2
- package/es/components/booking/editBookingModal/index.d.ts +5 -0
- package/es/components/booking/editBookingModal/index.js +386 -0
- package/es/components/booking/editBookingModal/index.less +8 -0
- package/es/components/booking/editBookingModal/locales.d.ts +21 -0
- package/es/components/booking/editBookingModal/locales.js +20 -0
- package/es/components/booking/editBookingModal/mock.d.ts +807 -0
- package/es/components/booking/editBookingModal/mock.js +2993 -0
- package/es/components/booking/editBookingModal/serve.d.ts +51 -0
- package/es/components/booking/editBookingModal/serve.js +288 -0
- package/es/components/booking/editBookingModal/type.d.ts +12 -0
- package/es/components/booking/editBookingModal/type.js +1 -0
- package/es/components/booking/editBookingModal/utils.d.ts +12 -0
- package/es/components/booking/editBookingModal/utils.js +157 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +3 -2
- package/es/components/booking/info2/service/addService/utils.d.ts +10 -0
- package/es/components/booking/info2/service/addService/utils.js +44 -13
- package/es/components/booking/info2/service/editService/Resources/index.js +22 -8
- package/es/components/booking/info2/service/editService/Resources/index.less +6 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +26 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.js +308 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
- package/es/components/booking/info2/utilsByBooking.js +9 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +3 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eventBooking/components/Provider/Event/index.js +13 -4
- package/es/components/eventBooking/components/bookingDetailModal/index.js +19 -3
- package/es/components/eventBooking/index.js +21 -7
- package/es/components/eventBooking/locales.js +3 -3
- package/es/components/index.d.ts +3 -1
- package/es/components/index.js +3 -1
- package/es/components/pay/toC/PaymentMethods/index.js +5 -4
- package/es/components/stepController/components/Content/index.d.ts +7 -0
- package/es/components/stepController/components/Content/index.js +9 -0
- package/es/components/stepController/components/Content/index.less +8 -0
- package/es/components/stepController/components/Footer/index.d.ts +8 -0
- package/es/components/stepController/components/Footer/index.js +15 -0
- package/es/components/stepController/components/Footer/index.less +39 -0
- package/es/components/stepController/components/Header/index.d.ts +20 -0
- package/es/components/stepController/components/Header/index.js +97 -0
- package/es/components/stepController/components/Header/index.less +21 -0
- package/es/components/stepController/index.d.ts +5 -0
- package/es/components/stepController/index.js +64 -0
- package/es/components/stepController/index.less +11 -0
- package/es/components/stepController/locales.d.ts +27 -0
- package/es/components/stepController/locales.js +32 -0
- package/es/components/stepController/types.d.ts +23 -0
- package/es/components/stepController/types.js +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +257 -138
- package/es/components/ticketBooking/locales.d.ts +164 -146
- package/es/components/ticketBooking/locales.js +195 -147
- package/es/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
- package/es/components/ticketBooking/utils/formatProductMessage.js +62 -0
- package/es/components/ticketBooking/utils/formatTime.d.ts +31 -0
- package/es/components/ticketBooking/utils/formatTime.js +144 -0
- package/es/hooks/useWindowSize.d.ts +5 -0
- package/es/hooks/useWindowSize.js +26 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/businessModel/SalesModel/Sales/index.js +22 -8
- package/lib/components/Sales/Resource/index.js +1 -1
- package/lib/components/Sales/Resource/serve.d.ts +7 -0
- package/lib/components/Sales/Resource/serve.js +9 -2
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/lib/components/appointmentBooking/components/Content/index.less +1 -1
- package/lib/components/appointmentBooking/components/Header/index.js +2 -3
- package/lib/components/appointmentBooking/components/Services/index.js +19 -18
- package/lib/components/appointmentBooking/components/Voucher/index.js +1 -1
- package/lib/components/appointmentBooking/index.js +11 -0
- package/lib/components/appointmentBooking/index.less +1 -1
- package/lib/components/appointmentBooking/locales.d.ts +0 -3
- package/lib/components/appointmentBooking/locales.js +0 -3
- package/lib/components/booking/components/footer/utils.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.js +2 -0
- package/lib/components/booking/components/voucher/index.js +11 -23
- package/lib/components/booking/editBookingModal/index.d.ts +5 -0
- package/lib/components/booking/editBookingModal/index.js +363 -0
- package/lib/components/booking/editBookingModal/index.less +8 -0
- package/lib/components/booking/editBookingModal/locales.d.ts +21 -0
- package/lib/components/booking/editBookingModal/locales.js +44 -0
- package/lib/components/booking/editBookingModal/mock.d.ts +807 -0
- package/lib/components/booking/editBookingModal/mock.js +3314 -0
- package/lib/components/booking/editBookingModal/serve.d.ts +51 -0
- package/lib/components/booking/editBookingModal/serve.js +178 -0
- package/lib/components/booking/editBookingModal/type.d.ts +12 -0
- package/lib/components/booking/editBookingModal/type.js +17 -0
- package/lib/components/booking/editBookingModal/utils.d.ts +12 -0
- package/lib/components/booking/editBookingModal/utils.js +158 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +2 -2
- package/lib/components/booking/info2/service/addService/utils.d.ts +10 -0
- package/lib/components/booking/info2/service/addService/utils.js +27 -4
- package/lib/components/booking/info2/service/editService/Resources/index.js +54 -10
- package/lib/components/booking/info2/service/editService/Resources/index.less +6 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +53 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +311 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
- package/lib/components/booking/info2/utilsByBooking.js +6 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +3 -0
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eventBooking/components/Provider/Event/index.js +10 -3
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +9 -3
- package/lib/components/eventBooking/index.js +11 -7
- package/lib/components/eventBooking/locales.js +3 -3
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +6 -0
- package/lib/components/pay/toC/PaymentMethods/index.js +10 -9
- package/lib/components/stepController/components/Content/index.d.ts +7 -0
- package/lib/components/stepController/components/Content/index.js +40 -0
- package/lib/components/stepController/components/Content/index.less +8 -0
- package/lib/components/stepController/components/Footer/index.d.ts +8 -0
- package/lib/components/stepController/components/Footer/index.js +49 -0
- package/lib/components/stepController/components/Footer/index.less +39 -0
- package/lib/components/stepController/components/Header/index.d.ts +20 -0
- package/lib/components/stepController/components/Header/index.js +104 -0
- package/lib/components/stepController/components/Header/index.less +21 -0
- package/lib/components/stepController/index.d.ts +5 -0
- package/lib/components/stepController/index.js +89 -0
- package/lib/components/stepController/index.less +11 -0
- package/lib/components/stepController/locales.d.ts +27 -0
- package/lib/components/stepController/locales.js +50 -0
- package/lib/components/stepController/types.d.ts +23 -0
- package/lib/components/stepController/types.js +17 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +263 -139
- package/lib/components/ticketBooking/locales.d.ts +164 -146
- package/lib/components/ticketBooking/locales.js +22 -4
- package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
- package/lib/components/ticketBooking/utils/formatProductMessage.js +84 -0
- package/lib/components/ticketBooking/utils/formatTime.d.ts +31 -0
- package/lib/components/ticketBooking/utils/formatTime.js +139 -0
- package/lib/hooks/useWindowSize.d.ts +5 -0
- package/lib/hooks/useWindowSize.js +51 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/edit-booking-modal/meta.ts +53 -0
- package/lowcode/step-controller/meta.ts +88 -0
- 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
|
-
|
|
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(
|
|
68
|
+
`${SALES_MODEL_SESSION_STORAGE_KEY}`,
|
|
69
|
+
JSON.stringify(sessionData || {})
|
|
66
70
|
);
|
|
67
71
|
};
|
|
68
72
|
const getSessionStorage = () => {
|
|
69
|
-
|
|
70
|
-
|
|
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.
|
|
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(
|
|
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
|
+
}
|
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
139
|
-
|
|
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:
|
|
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
|
{
|
|
@@ -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
|
-
|
|
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({
|