@pisell/private-materials 3.3.73 → 3.3.75
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 +13 -13
- 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 +7 -7
- 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/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Header/index.js +8 -14
- package/es/components/appointmentBooking/components/Services/index.js +24 -15
- package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
- package/es/components/booking/components/browserSelect/index.js +1 -1
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/materiels/startTime/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/index.js +11 -11
- package/es/components/booking/notes/model.js +5 -5
- package/es/components/booking/payments/model.js +5 -5
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/app.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +3 -3
- 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 +2 -1
- package/es/components/index.js +2 -1
- package/es/components/listComponent/index.js +5 -5
- package/es/components/productExtension/card/index.js +3 -3
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
- package/es/components/productExtension/fields/Forms/index.js +12 -12
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/server.js +2 -2
- package/es/components/ruleSetting/ruleBorder/index.js +1 -1
- package/es/components/schedules/calendar/index.js +4 -4
- package/es/components/schedules/calendar/serve.js +2 -2
- package/es/components/schedules/components/CurrentDay/index.js +5 -5
- package/es/components/schedules/components/CurrentDay/serve.js +2 -2
- package/es/components/schedules/components/DropdownSort/index.js +1 -1
- package/es/components/schedules/components/ResourceList/index.js +1 -1
- package/es/components/schedules/components/Search/index.js +5 -5
- package/es/components/schedules/model.js +5 -5
- package/es/components/schedules/openHours/index.js +1 -1
- package/es/components/schedules/openHours/serve.js +2 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
- package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
- package/es/components/schedules/products/serve.js +2 -2
- package/es/components/schedules/products/utils.js +5 -5
- package/es/components/schedules/resources/detail/detailContent.js +2 -2
- package/es/components/schedules/resources/detail/index.js +10 -10
- package/es/components/schedules/resources/list/index.js +2 -2
- package/es/components/schedules/resources/relationProduct/index.js +1 -1
- package/es/components/schedules/resources/serve.js +2 -2
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/schedules/utils.js +4 -4
- package/es/components/selectModal/index.js +2 -2
- 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/hooks/useComponents.js +1 -1
- package/es/hooks/useWindowSize.d.ts +5 -0
- package/es/hooks/useWindowSize.js +26 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/utils/index.d.ts +1 -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/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Header/index.js +2 -3
- package/lib/components/appointmentBooking/components/Services/index.js +16 -7
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/app.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- 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 +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/schedules/utils.js +1 -1
- 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/hooks/useWindowSize.d.ts +5 -0
- package/lib/hooks/useWindowSize.js +51 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/utils/index.d.ts +1 -1
- package/lowcode/step-controller/meta.ts +88 -0
- package/package.json +3 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.pisell-step-controller-footer-wrap {
|
|
2
|
+
position: sticky;
|
|
3
|
+
left: 0;
|
|
4
|
+
right: 0;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
width: 100%;
|
|
7
|
+
background: #fff;
|
|
8
|
+
// box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
|
|
9
|
+
padding: 24px;
|
|
10
|
+
z-index: 100;
|
|
11
|
+
border-top: 1px solid var(--Gray-100, #f2f4f7);
|
|
12
|
+
|
|
13
|
+
.pisell-step-controller-footer {
|
|
14
|
+
width: 1000px;
|
|
15
|
+
margin: 0 auto;
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
display: flex;
|
|
18
|
+
gap: 12px;
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
|
|
21
|
+
.pisell-section-headers-main {
|
|
22
|
+
color: var(--Gray-900, #101828);
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
line-height: 20px;
|
|
26
|
+
justify-content: start;
|
|
27
|
+
|
|
28
|
+
.select-text {
|
|
29
|
+
font-size: 18px;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
line-height: 24px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.pisell-step-controller-footer-wrap-mobile {
|
|
38
|
+
border-top: 1px solid #eaecf0;
|
|
39
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Step } from '../../types';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface HeaderProps {
|
|
5
|
+
steps: Step[];
|
|
6
|
+
currentStepIndex: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
onBack?: (key: string) => void;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
confirmCloseProps?: {
|
|
12
|
+
isConfirmClose?: boolean;
|
|
13
|
+
title?: string;
|
|
14
|
+
content?: string;
|
|
15
|
+
okText?: string;
|
|
16
|
+
cancelText?: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
declare const Header: React.FC<HeaderProps>;
|
|
20
|
+
export default Header;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { PisellHeaderProgressBar, PisellModal } from '@pisell/materials';
|
|
9
|
+
import { locales } from '@pisell/utils';
|
|
10
|
+
import "./index.less";
|
|
11
|
+
var Header = function Header(_ref) {
|
|
12
|
+
var _steps$currentStepInd;
|
|
13
|
+
var steps = _ref.steps,
|
|
14
|
+
currentStepIndex = _ref.currentStepIndex,
|
|
15
|
+
style = _ref.style,
|
|
16
|
+
onBack = _ref.onBack,
|
|
17
|
+
onClose = _ref.onClose,
|
|
18
|
+
confirmCloseProps = _ref.confirmCloseProps;
|
|
19
|
+
var _useState = useState(false),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
open = _useState2[0],
|
|
22
|
+
setOpen = _useState2[1];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @title: 点击关闭
|
|
26
|
+
* @description:
|
|
27
|
+
* @return {*}
|
|
28
|
+
* @Author: WangHan
|
|
29
|
+
* @Date: 2025-01-14 22:41
|
|
30
|
+
*/
|
|
31
|
+
var handleClose = function handleClose() {
|
|
32
|
+
// 二次确认
|
|
33
|
+
if (confirmCloseProps !== null && confirmCloseProps !== void 0 && confirmCloseProps.isConfirmClose) {
|
|
34
|
+
setOpen(true);
|
|
35
|
+
} else {
|
|
36
|
+
onClose === null || onClose === void 0 || onClose();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @title: 点击退出
|
|
42
|
+
* @description:
|
|
43
|
+
* @return {*}
|
|
44
|
+
* @Author: WangHan
|
|
45
|
+
* @Date: 2025-02-10 17:46
|
|
46
|
+
*/
|
|
47
|
+
var handleOk = function handleOk() {
|
|
48
|
+
setOpen(false);
|
|
49
|
+
onClose === null || onClose === void 0 || onClose();
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @title: 返回上一步
|
|
54
|
+
* @description:
|
|
55
|
+
* @return {*}
|
|
56
|
+
* @Author: WangHan
|
|
57
|
+
* @Date: 2025-06-12 16:44
|
|
58
|
+
*/
|
|
59
|
+
var handleBack = function handleBack() {
|
|
60
|
+
if (!steps) return;
|
|
61
|
+
if (currentStepIndex > 0) {
|
|
62
|
+
var prevKey = steps[currentStepIndex - 1].key;
|
|
63
|
+
onBack === null || onBack === void 0 || onBack(prevKey);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PisellHeaderProgressBar, {
|
|
67
|
+
className: "pisell-step-controller-header",
|
|
68
|
+
style: style,
|
|
69
|
+
stepText: locales.getText('pisell2.step.controller.step')(currentStepIndex + 1),
|
|
70
|
+
title: steps === null || steps === void 0 || (_steps$currentStepInd = steps[currentStepIndex]) === null || _steps$currentStepInd === void 0 ? void 0 : _steps$currentStepInd.description,
|
|
71
|
+
showClose: true,
|
|
72
|
+
onBack: handleBack,
|
|
73
|
+
onClose: handleClose,
|
|
74
|
+
enableBorder: true,
|
|
75
|
+
borderColor: "#EAECF0",
|
|
76
|
+
showBack: currentStepIndex > 0 || false
|
|
77
|
+
}), /*#__PURE__*/React.createElement(PisellModal.Information, {
|
|
78
|
+
open: open,
|
|
79
|
+
title: (confirmCloseProps === null || confirmCloseProps === void 0 ? void 0 : confirmCloseProps.title) || '',
|
|
80
|
+
describe: (confirmCloseProps === null || confirmCloseProps === void 0 ? void 0 : confirmCloseProps.content) || '',
|
|
81
|
+
okText: (confirmCloseProps === null || confirmCloseProps === void 0 ? void 0 : confirmCloseProps.okText) || '',
|
|
82
|
+
cancelText: (confirmCloseProps === null || confirmCloseProps === void 0 ? void 0 : confirmCloseProps.cancelText) || '',
|
|
83
|
+
closable: true,
|
|
84
|
+
okButtonProps: {
|
|
85
|
+
style: {
|
|
86
|
+
backgroundColor: '#D92D20'
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
onCancel: function onCancel() {
|
|
90
|
+
setOpen(false);
|
|
91
|
+
},
|
|
92
|
+
onOk: function onOk() {
|
|
93
|
+
return handleOk();
|
|
94
|
+
}
|
|
95
|
+
}));
|
|
96
|
+
};
|
|
97
|
+
export default Header;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.pisell-step-controller-header {
|
|
2
|
+
.pisell-section-headers-content {
|
|
3
|
+
width: 1000px;
|
|
4
|
+
margin: 0 auto;
|
|
5
|
+
max-width: 100%;
|
|
6
|
+
|
|
7
|
+
.pisell-section-headers-main {
|
|
8
|
+
color: var(--Gray-900, #101828);
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
font-weight: 400;
|
|
11
|
+
line-height: 20px;
|
|
12
|
+
justify-content: start;
|
|
13
|
+
|
|
14
|
+
.select-text {
|
|
15
|
+
font-size: 18px;
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
line-height: 24px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { locales } from '@pisell/utils';
|
|
4
|
+
import { usePisellConfig } from '@pisell/materials';
|
|
5
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
6
|
+
import { useWindowSize } from "../../hooks/useWindowSize";
|
|
7
|
+
import Header from "./components/Header";
|
|
8
|
+
import Footer from "./components/Footer";
|
|
9
|
+
import Content from "./components/Content";
|
|
10
|
+
import localeTexts from "./locales";
|
|
11
|
+
import "./index.less";
|
|
12
|
+
var StepController = function StepController(_ref) {
|
|
13
|
+
var _context$engine;
|
|
14
|
+
var steps = _ref.steps,
|
|
15
|
+
currentStep = _ref.currentStep,
|
|
16
|
+
children = _ref.children,
|
|
17
|
+
onBack = _ref.onBack,
|
|
18
|
+
confirmCloseProps = _ref.confirmCloseProps,
|
|
19
|
+
showFooter = _ref.showFooter,
|
|
20
|
+
footerContent = _ref.footerContent,
|
|
21
|
+
onClose = _ref.onClose;
|
|
22
|
+
var context = useEngineContext();
|
|
23
|
+
locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
|
|
24
|
+
|
|
25
|
+
// 监听窗口大小变化,重新计算vh
|
|
26
|
+
useWindowSize({
|
|
27
|
+
debounceMs: 200
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @title: 是否是移动端
|
|
32
|
+
* @description:
|
|
33
|
+
* @return {*}
|
|
34
|
+
* @Author: WangHan
|
|
35
|
+
* @Date: 2025-06-12 15:56
|
|
36
|
+
*/
|
|
37
|
+
var isMobile = useMemo(function () {
|
|
38
|
+
var config = usePisellConfig();
|
|
39
|
+
var platform = (config === null || config === void 0 ? void 0 : config.platform) || 'h5';
|
|
40
|
+
return platform === 'h5';
|
|
41
|
+
}, []);
|
|
42
|
+
var currentStepIndex = useMemo(function () {
|
|
43
|
+
return (steps === null || steps === void 0 ? void 0 : steps.findIndex(function (step) {
|
|
44
|
+
return step.key === currentStep;
|
|
45
|
+
})) || 0;
|
|
46
|
+
}, [steps, currentStep]);
|
|
47
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: classNames('pisell-step-controller', {
|
|
49
|
+
'pisell-step-controller-mobile': isMobile
|
|
50
|
+
})
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
|
52
|
+
steps: steps,
|
|
53
|
+
currentStepIndex: currentStepIndex,
|
|
54
|
+
confirmCloseProps: confirmCloseProps,
|
|
55
|
+
onBack: onBack,
|
|
56
|
+
onClose: onClose
|
|
57
|
+
}), /*#__PURE__*/React.createElement(Content, {
|
|
58
|
+
children: children
|
|
59
|
+
}), showFooter && footerContent ? /*#__PURE__*/React.createElement(Footer, {
|
|
60
|
+
children: footerContent,
|
|
61
|
+
isMobile: isMobile
|
|
62
|
+
}) : null);
|
|
63
|
+
};
|
|
64
|
+
export default StepController;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
en: {
|
|
3
|
+
'pisell2.step.controller.step': (step: number) => string;
|
|
4
|
+
'pisell2.step.controller.sendEmail': string;
|
|
5
|
+
'pisell2.step.controller.copy': string;
|
|
6
|
+
'pisell2.step.controller.download': string;
|
|
7
|
+
'pisell2.step.controller.preview': string;
|
|
8
|
+
'pisell2.step.controller.continue': string;
|
|
9
|
+
};
|
|
10
|
+
'zh-CN': {
|
|
11
|
+
'pisell2.step.controller.step': (step: number) => string;
|
|
12
|
+
'pisell2.step.controller.sendEmail': string;
|
|
13
|
+
'pisell2.step.controller.copy': string;
|
|
14
|
+
'pisell2.step.controller.download': string;
|
|
15
|
+
'pisell2.step.controller.preview': string;
|
|
16
|
+
'pisell2.step.controller.continue': string;
|
|
17
|
+
};
|
|
18
|
+
'zh-HK': {
|
|
19
|
+
'pisell2.step.controller.step': (step: number) => string;
|
|
20
|
+
'pisell2.step.controller.sendEmail': string;
|
|
21
|
+
'pisell2.step.controller.copy': string;
|
|
22
|
+
'pisell2.step.controller.download': string;
|
|
23
|
+
'pisell2.step.controller.preview': string;
|
|
24
|
+
'pisell2.step.controller.continue': string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
en: {
|
|
3
|
+
'pisell2.step.controller.step': function pisell2StepControllerStep(step) {
|
|
4
|
+
return "Step ".concat(step || 1);
|
|
5
|
+
},
|
|
6
|
+
'pisell2.step.controller.sendEmail': 'Send Email',
|
|
7
|
+
'pisell2.step.controller.copy': 'Copy',
|
|
8
|
+
'pisell2.step.controller.download': 'Download',
|
|
9
|
+
'pisell2.step.controller.preview': 'Preview',
|
|
10
|
+
'pisell2.step.controller.continue': 'Continue'
|
|
11
|
+
},
|
|
12
|
+
'zh-CN': {
|
|
13
|
+
'pisell2.step.controller.step': function pisell2StepControllerStep(step) {
|
|
14
|
+
return "\u6B65\u9AA4 ".concat(step || 1);
|
|
15
|
+
},
|
|
16
|
+
'pisell2.step.controller.sendEmail': '发送邮件',
|
|
17
|
+
'pisell2.step.controller.copy': '复制',
|
|
18
|
+
'pisell2.step.controller.download': '下载',
|
|
19
|
+
'pisell2.step.controller.preview': '预览',
|
|
20
|
+
'pisell2.step.controller.continue': '继续'
|
|
21
|
+
},
|
|
22
|
+
'zh-HK': {
|
|
23
|
+
'pisell2.step.controller.step': function pisell2StepControllerStep(step) {
|
|
24
|
+
return "\u6B65\u9A5F ".concat(step || 1);
|
|
25
|
+
},
|
|
26
|
+
'pisell2.step.controller.sendEmail': '發送郵件',
|
|
27
|
+
'pisell2.step.controller.copy': '複製',
|
|
28
|
+
'pisell2.step.controller.download': '下載',
|
|
29
|
+
'pisell2.step.controller.preview': '預覽',
|
|
30
|
+
'pisell2.step.controller.continue': '繼續'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface Step {
|
|
3
|
+
key: string;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
export interface StepControllerProps extends Step {
|
|
7
|
+
steps: Step[];
|
|
8
|
+
currentStep: string;
|
|
9
|
+
isLastStep?: boolean;
|
|
10
|
+
isMobile?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
onBack?: (key: string) => void;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
confirmCloseProps?: {
|
|
15
|
+
isConfirmClose?: boolean;
|
|
16
|
+
title?: string;
|
|
17
|
+
content?: string;
|
|
18
|
+
okText?: string;
|
|
19
|
+
cancelText?: string;
|
|
20
|
+
};
|
|
21
|
+
showFooter?: boolean;
|
|
22
|
+
footerContent?: React.ReactNode;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,7 +8,7 @@ var useComponents = function useComponents(params) {
|
|
|
8
8
|
var _utils$getComponents;
|
|
9
9
|
var _ref = appHelper || {},
|
|
10
10
|
utils = _ref.utils;
|
|
11
|
-
return (utils === null || utils === void 0
|
|
11
|
+
return (utils === null || utils === void 0 ? void 0 : (_utils$getComponents = utils.getComponents) === null || _utils$getComponents === void 0 ? void 0 : _utils$getComponents.call(utils, components)) || [];
|
|
12
12
|
}, [components]);
|
|
13
13
|
return Cpt;
|
|
14
14
|
};
|
|
@@ -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,4 @@ 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';
|
package/es/index.js
CHANGED
|
@@ -46,4 +46,5 @@ 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";
|
package/es/utils/index.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ declare let modal: Omit<ModalStaticFunctions, 'warn'>;
|
|
|
18
18
|
export declare const setModal: (m: Omit<ModalStaticFunctions, 'warn'>) => void;
|
|
19
19
|
export declare const saveConfirm: () => Promise<{
|
|
20
20
|
destroy: () => void;
|
|
21
|
-
update: (configUpdate: import("antd
|
|
21
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
22
22
|
}>;
|
|
23
23
|
export { modal };
|
|
@@ -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
|
});
|
|
@@ -25,7 +25,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
25
25
|
* @return {*}
|
|
26
26
|
* @Author: xiangfeng.xue
|
|
27
27
|
*/
|
|
28
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00"
|
|
28
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
|
|
29
29
|
/**
|
|
30
30
|
* 计算所有价格明细
|
|
31
31
|
* @param items - 购物车商品数组
|
|
@@ -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
|
}
|
|
@@ -122,18 +122,27 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
122
122
|
);
|
|
123
123
|
}
|
|
124
124
|
appointmentBooking.storeProduct(product);
|
|
125
|
+
if (type === "duration") {
|
|
126
|
+
await appointmentBooking.getAvailableDate();
|
|
127
|
+
}
|
|
125
128
|
}
|
|
126
129
|
appointmentBooking.closeProductDetail();
|
|
127
130
|
if (isDateSelectedFirst) {
|
|
128
131
|
const index = (currentStep == null ? void 0 : currentStep.index) + 2;
|
|
129
|
-
if (type === "duration") {
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
appointmentBooking.addStep(
|
|
134
|
-
{ index, key: "select-time", description },
|
|
135
|
-
"select-resource"
|
|
132
|
+
if (type === "duration" || appointmentBooking.isCartHasDurationProduct()) {
|
|
133
|
+
const { stepList } = (0, import_hooks.useAppointmentBookingStep)();
|
|
134
|
+
const hasResourceStep = stepList == null ? void 0 : stepList.find(
|
|
135
|
+
(item2) => (item2 == null ? void 0 : item2.key) === "select-resource"
|
|
136
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
|
+
}
|
|
137
146
|
} else {
|
|
138
147
|
removeStep("select-time");
|
|
139
148
|
}
|
|
@@ -4,6 +4,6 @@ declare const useSendModal: (bookingId?: number) => {
|
|
|
4
4
|
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
5
5
|
handleOpen: () => void;
|
|
6
6
|
handleValuesChange: (val: any) => void;
|
|
7
|
-
handleOk: (values: SendModalValues) => Promise<
|
|
7
|
+
handleOk: (values: SendModalValues) => Promise<any>;
|
|
8
8
|
};
|
|
9
9
|
export default useSendModal;
|
|
@@ -244,4 +244,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
244
244
|
* @Author: WangHan
|
|
245
245
|
* @Date: 2024-12-24 11:32
|
|
246
246
|
*/
|
|
247
|
-
export declare const updateServicePrice: (state: any) => Promise<any
|
|
247
|
+
export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
|
|
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
|
165
165
|
export declare const getDuration: (duration: number | {
|
|
166
166
|
type: string;
|
|
167
167
|
value: number;
|
|
168
|
-
}) => number |
|
|
168
|
+
}) => number | {
|
|
169
169
|
type: string;
|
|
170
170
|
value: number;
|
|
171
|
-
};
|
|
171
|
+
} | "flexible";
|
|
172
172
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
173
173
|
export declare const getIsEdit: (state: any) => boolean;
|
|
174
174
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PosProps, RouteType } from './const';
|
|
2
|
-
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "
|
|
2
|
+
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "mode" | "type" | "getApi"> & {
|
|
3
3
|
action: RouteType;
|
|
4
4
|
device_number: string | number;
|
|
5
5
|
api: ReturnType<PosProps['getApi']>;
|