@pisell/private-materials 6.4.73 → 6.4.74
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 +4 -4
- 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/components/booking/components/footer/index.js +62 -53
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +178 -108
- package/es/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/es/components/checkout/components/AdditionalModule/index.js +44 -12
- package/es/components/checkout/components/AmountSummary/index.js +9 -76
- package/es/components/checkout/components/AmountSummary/index.less +1 -1
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/es/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +6 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.js +2 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +31 -8
- package/es/components/checkout/components/PaymentResultToast/index.js +6 -6
- package/es/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +3 -0
- package/es/components/checkout/locales.js +3 -0
- package/es/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/ticketBooking/components/timeBar/index.js +112 -7
- package/es/components/ticketBooking/components/timeBar/index.less +59 -0
- package/es/components/ticketBooking/locales.d.ts +6 -0
- package/es/components/ticketBooking/locales.js +9 -3
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +11 -7
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +4 -2
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +10 -1
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +5 -2
- package/es/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lib/components/booking/components/footer/index.js +15 -8
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +73 -11
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/lib/components/checkout/components/AdditionalModule/index.js +44 -11
- package/lib/components/checkout/components/AmountSummary/index.js +5 -46
- package/lib/components/checkout/components/AmountSummary/index.less +1 -1
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/lib/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +5 -1
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +6 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +23 -5
- package/lib/components/checkout/components/PaymentResultToast/index.js +4 -4
- package/lib/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +3 -0
- package/lib/components/checkout/locales.js +3 -0
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/ticketBooking/components/timeBar/index.js +105 -4
- package/lib/components/ticketBooking/components/timeBar/index.less +59 -0
- package/lib/components/ticketBooking/locales.d.ts +6 -0
- package/lib/components/ticketBooking/locales.js +9 -3
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +9 -5
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +3 -2
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +8 -1
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +3 -2
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
|
|
12
12
|
api: PayProps['api'];
|
|
13
13
|
className?: string | undefined;
|
|
14
|
-
onChange?: ((status: "success" | "page" | "
|
|
14
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
15
15
|
[keys: string]: unknown;
|
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
|
17
17
|
onClose: () => void;
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo" | "linkly">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -295,9 +295,9 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
295
295
|
name?: string | undefined;
|
|
296
296
|
symbol?: string | undefined;
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
|
-
mode?: "pay" | "
|
|
298
|
+
mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "
|
|
300
|
+
eftpos?: "tyro" | "windcave" | "stripe" | "payo" | "linkly" | undefined;
|
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
@@ -4,7 +4,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
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
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
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useMemo } from 'react';
|
|
7
|
+
import React, { useMemo, useState, useEffect } from 'react';
|
|
8
8
|
import { LeftOutlined, RightOutlined } from '@ant-design/icons';
|
|
9
9
|
import { DatePicker, SelectTime } from '@pisell/materials';
|
|
10
10
|
import { useMemoizedFn } from 'ahooks';
|
|
@@ -13,12 +13,65 @@ import dayjs from 'dayjs';
|
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { locales } from '@pisell/utils';
|
|
15
15
|
import "./index.less";
|
|
16
|
+
import { Iconfont } from '@pisell/materials';
|
|
16
17
|
var TimeBar = function TimeBar(props) {
|
|
17
|
-
var _state$
|
|
18
|
+
var _state$modalState7;
|
|
18
19
|
var state = props.globalState,
|
|
19
20
|
setGlobalState = props.setGlobalState,
|
|
20
21
|
locale = props.locale,
|
|
21
22
|
onCreateClick = props.onCreateClick;
|
|
23
|
+
var _useState = useState(true),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
collapsed = _useState2[0],
|
|
26
|
+
setCollapsed = _useState2[1];
|
|
27
|
+
var _useState3 = useState(1),
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
+
scaleCompensation = _useState4[0],
|
|
30
|
+
setScaleCompensation = _useState4[1];
|
|
31
|
+
|
|
32
|
+
// 获取 body 的 scale 值并计算补偿
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
var getBodyScale = function getBodyScale() {
|
|
35
|
+
var body = document.body;
|
|
36
|
+
var computedStyle = window.getComputedStyle(body);
|
|
37
|
+
var transform = computedStyle.transform;
|
|
38
|
+
if (transform && transform !== 'none') {
|
|
39
|
+
// 解析 transform matrix 获取 scale 值
|
|
40
|
+
// matrix(scaleX, skewY, skewX, scaleY, translateX, translateY)
|
|
41
|
+
var matrix = transform.match(/matrix\(([^)]+)\)/);
|
|
42
|
+
if (matrix) {
|
|
43
|
+
var values = matrix[1].split(',').map(function (v) {
|
|
44
|
+
return parseFloat(v.trim());
|
|
45
|
+
});
|
|
46
|
+
// scaleX 通常是 matrix 的第一个值
|
|
47
|
+
var scale = values[0] || 1;
|
|
48
|
+
return scale;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return 1;
|
|
52
|
+
};
|
|
53
|
+
var updateScale = function updateScale() {
|
|
54
|
+
var scale = getBodyScale();
|
|
55
|
+
// 目标高度是 40px,需要补偿 scale 的影响
|
|
56
|
+
// 实际设置高度 = 目标高度 / scale
|
|
57
|
+
setScaleCompensation(scale);
|
|
58
|
+
};
|
|
59
|
+
updateScale();
|
|
60
|
+
|
|
61
|
+
// 监听 body 的 transform 变化(使用 MutationObserver)
|
|
62
|
+
var observer = new MutationObserver(updateScale);
|
|
63
|
+
observer.observe(document.body, {
|
|
64
|
+
attributes: true,
|
|
65
|
+
attributeFilter: ['style', 'class']
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// 也监听窗口大小变化(某些情况下 scale 可能随窗口变化)
|
|
69
|
+
window.addEventListener('resize', updateScale);
|
|
70
|
+
return function () {
|
|
71
|
+
observer.disconnect();
|
|
72
|
+
window.removeEventListener('resize', updateScale);
|
|
73
|
+
};
|
|
74
|
+
}, []);
|
|
22
75
|
var _onClickNext = useMemoizedFn(function () {
|
|
23
76
|
var _state$modalState, _props$onDateChange, _props$setIntervalTim;
|
|
24
77
|
var currentTime = (_state$modalState = state.modalState) === null || _state$modalState === void 0 || (_state$modalState = _state$modalState.date) === null || _state$modalState === void 0 ? void 0 : _state$modalState.value;
|
|
@@ -57,8 +110,52 @@ var TimeBar = function TimeBar(props) {
|
|
|
57
110
|
});
|
|
58
111
|
(_props$setIntervalTim5 = props.setIntervalTime) === null || _props$setIntervalTim5 === void 0 || _props$setIntervalTim5.call(props, timeString === dayjs().format('HH:mm'));
|
|
59
112
|
});
|
|
113
|
+
var _onToggleCollapse = useMemoizedFn(function () {
|
|
114
|
+
setCollapsed(!collapsed);
|
|
115
|
+
});
|
|
60
116
|
return useMemo(function () {
|
|
61
|
-
var _state$
|
|
117
|
+
var _state$modalState5, _state$modalState6;
|
|
118
|
+
// 收起状态
|
|
119
|
+
if (collapsed) {
|
|
120
|
+
var _state$modalState4;
|
|
121
|
+
var currentDate = state === null || state === void 0 || (_state$modalState4 = state.modalState) === null || _state$modalState4 === void 0 || (_state$modalState4 = _state$modalState4.date) === null || _state$modalState4 === void 0 ? void 0 : _state$modalState4.value;
|
|
122
|
+
var isToday = currentDate && currentDate.isSame(dayjs(), 'day');
|
|
123
|
+
var displayText = isToday ? locales.getText('pisell2.ticket-booking.today') : (currentDate === null || currentDate === void 0 ? void 0 : currentDate.format('YYYY-MM-DD')) || '';
|
|
124
|
+
|
|
125
|
+
// 计算补偿后的高度:目标高度 / scale
|
|
126
|
+
var targetHeight = 40;
|
|
127
|
+
var compensatedHeight = targetHeight / scaleCompensation;
|
|
128
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
className: classNames('pisell-ticket-booking-time-bar', 'collapsed'),
|
|
130
|
+
style: {
|
|
131
|
+
height: "".concat(compensatedHeight, "px"),
|
|
132
|
+
minHeight: "".concat(compensatedHeight, "px"),
|
|
133
|
+
maxHeight: "".concat(compensatedHeight, "px")
|
|
134
|
+
}
|
|
135
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
className: "pisell-ticket-booking-time-bar-collapsed-content",
|
|
137
|
+
style: {
|
|
138
|
+
height: "".concat(compensatedHeight, "px")
|
|
139
|
+
}
|
|
140
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
141
|
+
className: "pisell-ticket-booking-time-bar-collapsed-today",
|
|
142
|
+
style: {
|
|
143
|
+
lineHeight: "".concat(compensatedHeight, "px")
|
|
144
|
+
}
|
|
145
|
+
}, displayText), /*#__PURE__*/React.createElement(Button, {
|
|
146
|
+
type: "link",
|
|
147
|
+
size: "small",
|
|
148
|
+
className: "pisell-ticket-booking-time-bar-collapsed-expand",
|
|
149
|
+
onClick: _onToggleCollapse,
|
|
150
|
+
style: {
|
|
151
|
+
lineHeight: "".concat(compensatedHeight, "px")
|
|
152
|
+
}
|
|
153
|
+
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.ticket-booking.expand')), /*#__PURE__*/React.createElement(Iconfont, {
|
|
154
|
+
type: "pisell2-chevron-right-double"
|
|
155
|
+
}))));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// 展开状态
|
|
62
159
|
return /*#__PURE__*/React.createElement("div", {
|
|
63
160
|
className: "pisell-ticket-booking-time-bar",
|
|
64
161
|
style: {
|
|
@@ -85,7 +182,7 @@ var TimeBar = function TimeBar(props) {
|
|
|
85
182
|
}
|
|
86
183
|
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
87
184
|
inputReadOnly: true,
|
|
88
|
-
value: state === null || state === void 0 || (_state$
|
|
185
|
+
value: state === null || state === void 0 || (_state$modalState5 = state.modalState) === null || _state$modalState5 === void 0 || (_state$modalState5 = _state$modalState5.date) === null || _state$modalState5 === void 0 ? void 0 : _state$modalState5.value,
|
|
89
186
|
format: locale === 'en' ? 'dddd, DD MMM YYYY' : 'YYYY年MM月DD日',
|
|
90
187
|
onChange: props === null || props === void 0 ? void 0 : props.onDateChange,
|
|
91
188
|
size: "large",
|
|
@@ -101,7 +198,7 @@ var TimeBar = function TimeBar(props) {
|
|
|
101
198
|
'booking-page-date-picker-select': state.isTimeChange
|
|
102
199
|
})
|
|
103
200
|
}, /*#__PURE__*/React.createElement(SelectTime, {
|
|
104
|
-
value: state === null || state === void 0 || (_state$
|
|
201
|
+
value: state === null || state === void 0 || (_state$modalState6 = state.modalState) === null || _state$modalState6 === void 0 || (_state$modalState6 = _state$modalState6.date) === null || _state$modalState6 === void 0 ? void 0 : _state$modalState6.value.format('HH:mm'),
|
|
105
202
|
onChange: _onDateTimeChange,
|
|
106
203
|
popoverProps: {
|
|
107
204
|
style: {
|
|
@@ -124,7 +221,15 @@ var TimeBar = function TimeBar(props) {
|
|
|
124
221
|
},
|
|
125
222
|
size: "large",
|
|
126
223
|
type: "primary"
|
|
127
|
-
}, locales.getText('pisell2.ticket-booking.create-new'))
|
|
128
|
-
|
|
224
|
+
}, locales.getText('pisell2.ticket-booking.create-new')), /*#__PURE__*/React.createElement(Button, {
|
|
225
|
+
type: "link",
|
|
226
|
+
style: {
|
|
227
|
+
marginLeft: 'auto'
|
|
228
|
+
},
|
|
229
|
+
onClick: _onToggleCollapse
|
|
230
|
+
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.ticket-booking.collapse')), /*#__PURE__*/React.createElement(Iconfont, {
|
|
231
|
+
type: "pisell2-chevron-left-double"
|
|
232
|
+
})));
|
|
233
|
+
}, [collapsed, (_state$modalState7 = state.modalState) === null || _state$modalState7 === void 0 || (_state$modalState7 = _state$modalState7.date) === null || _state$modalState7 === void 0 ? void 0 : _state$modalState7.value, state.intervalSetTime, state.isTimeChange, state.isDateChange, locale, _onToggleCollapse, scaleCompensation]);
|
|
129
234
|
};
|
|
130
235
|
export default TimeBar;
|
|
@@ -20,4 +20,63 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
// 收起状态
|
|
25
|
+
&.collapsed {
|
|
26
|
+
position: fixed;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
left: 86px;
|
|
29
|
+
padding: 0;
|
|
30
|
+
background-color: transparent;
|
|
31
|
+
display: block;
|
|
32
|
+
// 高度通过内联样式动态设置以补偿 body 的 scale
|
|
33
|
+
|
|
34
|
+
.pisell-ticket-booking-time-bar-collapsed-content {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
width: 100%;
|
|
39
|
+
// 高度通过内联样式动态设置以补偿 body 的 scale
|
|
40
|
+
padding: 0 16px;
|
|
41
|
+
background-color: #fff;
|
|
42
|
+
border-radius: 0 8px 8px 0;
|
|
43
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
|
|
47
|
+
.pisell-ticket-booking-time-bar-collapsed-today {
|
|
48
|
+
font-weight: 600;
|
|
49
|
+
font-size: 18px;
|
|
50
|
+
color: #000;
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
margin-right: 16px;
|
|
53
|
+
// line-height 通过内联样式动态设置
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.pisell-ticket-booking-time-bar-collapsed-expand {
|
|
57
|
+
color: #7F56DA;
|
|
58
|
+
padding: 0;
|
|
59
|
+
margin: 0;
|
|
60
|
+
height: auto;
|
|
61
|
+
font-size: 18px;
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
// line-height 通过内联样式动态设置
|
|
67
|
+
|
|
68
|
+
&:hover {
|
|
69
|
+
color: #6941c6;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
span {
|
|
73
|
+
margin-right: 2px;
|
|
74
|
+
}
|
|
75
|
+
.anticon {
|
|
76
|
+
margin-left: 0px;
|
|
77
|
+
margin-right: 0px;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
23
82
|
}
|
|
@@ -61,6 +61,8 @@ declare const _default: {
|
|
|
61
61
|
'pisell2.ticket-booking.terminal-upgrade-description': string;
|
|
62
62
|
'pisell2.ticket-booking.terminal-upgrade-ok': string;
|
|
63
63
|
'pisell2.ticket-booking.terminal-upgrade-cancel': string;
|
|
64
|
+
'pisell2.ticket-booking.collapse': string;
|
|
65
|
+
'pisell2.ticket-booking.expand': string;
|
|
64
66
|
};
|
|
65
67
|
'zh-CN': {
|
|
66
68
|
'pisell2.ticket-booking.info': string;
|
|
@@ -124,6 +126,8 @@ declare const _default: {
|
|
|
124
126
|
'pisell2.ticket-booking.terminal-upgrade-description': string;
|
|
125
127
|
'pisell2.ticket-booking.terminal-upgrade-ok': string;
|
|
126
128
|
'pisell2.ticket-booking.terminal-upgrade-cancel': string;
|
|
129
|
+
'pisell2.ticket-booking.collapse': string;
|
|
130
|
+
'pisell2.ticket-booking.expand': string;
|
|
127
131
|
};
|
|
128
132
|
'zh-HK': {
|
|
129
133
|
'pisell2.ticket-booking.info': string;
|
|
@@ -187,6 +191,8 @@ declare const _default: {
|
|
|
187
191
|
'pisell2.ticket-booking.terminal-upgrade-description': string;
|
|
188
192
|
'pisell2.ticket-booking.terminal-upgrade-ok': string;
|
|
189
193
|
'pisell2.ticket-booking.terminal-upgrade-cancel': string;
|
|
194
|
+
'pisell2.ticket-booking.collapse': string;
|
|
195
|
+
'pisell2.ticket-booking.expand': string;
|
|
190
196
|
};
|
|
191
197
|
};
|
|
192
198
|
export default _default;
|
|
@@ -73,7 +73,9 @@ export default {
|
|
|
73
73
|
'pisell2.ticket-booking.terminal-upgrade-title': 'Terminal Version Reminder',
|
|
74
74
|
'pisell2.ticket-booking.terminal-upgrade-description': 'Your Terminal version is outdated. Please upgrade Terminal to use all features.',
|
|
75
75
|
'pisell2.ticket-booking.terminal-upgrade-ok': 'I understand',
|
|
76
|
-
'pisell2.ticket-booking.terminal-upgrade-cancel': 'Cancel'
|
|
76
|
+
'pisell2.ticket-booking.terminal-upgrade-cancel': 'Cancel',
|
|
77
|
+
'pisell2.ticket-booking.collapse': 'Collapse',
|
|
78
|
+
'pisell2.ticket-booking.expand': 'Expand'
|
|
77
79
|
},
|
|
78
80
|
'zh-CN': {
|
|
79
81
|
'pisell2.ticket-booking.info': '信息',
|
|
@@ -149,7 +151,9 @@ export default {
|
|
|
149
151
|
'pisell2.ticket-booking.terminal-upgrade-title': 'Terminal版本提醒',
|
|
150
152
|
'pisell2.ticket-booking.terminal-upgrade-description': '检测到您的Terminal版本较低,请升级Terminal以使用完整功能',
|
|
151
153
|
'pisell2.ticket-booking.terminal-upgrade-ok': '我知道了',
|
|
152
|
-
'pisell2.ticket-booking.terminal-upgrade-cancel': '取消'
|
|
154
|
+
'pisell2.ticket-booking.terminal-upgrade-cancel': '取消',
|
|
155
|
+
'pisell2.ticket-booking.collapse': '收起',
|
|
156
|
+
'pisell2.ticket-booking.expand': '展开'
|
|
153
157
|
},
|
|
154
158
|
'zh-HK': {
|
|
155
159
|
'pisell2.ticket-booking.info': '資訊',
|
|
@@ -225,6 +229,8 @@ export default {
|
|
|
225
229
|
'pisell2.ticket-booking.terminal-upgrade-title': 'Terminal版本提醒',
|
|
226
230
|
'pisell2.ticket-booking.terminal-upgrade-description': '檢測到您的Terminal版本較低,請升級Terminal以使用完整功能',
|
|
227
231
|
'pisell2.ticket-booking.terminal-upgrade-ok': '我知道了',
|
|
228
|
-
'pisell2.ticket-booking.terminal-upgrade-cancel': '取消'
|
|
232
|
+
'pisell2.ticket-booking.terminal-upgrade-cancel': '取消',
|
|
233
|
+
'pisell2.ticket-booking.collapse': '收起',
|
|
234
|
+
'pisell2.ticket-booking.expand': '展開'
|
|
229
235
|
}
|
|
230
236
|
};
|
|
@@ -41,7 +41,7 @@ declare type ScanData = {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
export declare const formatScanCustomer: (data: ScanData) => {
|
|
44
|
-
searchType: "
|
|
44
|
+
searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
|
|
45
45
|
data: any;
|
|
46
46
|
scanCode: string;
|
|
47
47
|
} | null;
|
|
@@ -46,7 +46,8 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
|
46
46
|
doneText = props.doneText,
|
|
47
47
|
resetText = props.resetText,
|
|
48
48
|
disabled = props.disabled,
|
|
49
|
-
hiddenChangeDue = props.hiddenChangeDue
|
|
49
|
+
hiddenChangeDue = props.hiddenChangeDue,
|
|
50
|
+
shortcutsSize = props.shortcutsSize;
|
|
50
51
|
var _useControllableValue = useControllableValue(props),
|
|
51
52
|
_useControllableValue2 = _slicedToArray(_useControllableValue, 2),
|
|
52
53
|
internalValue = _useControllableValue2[0],
|
|
@@ -69,7 +70,7 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
|
69
70
|
setKeyboardTheme(selectType);
|
|
70
71
|
}, [selectType]);
|
|
71
72
|
|
|
72
|
-
// 变体2:末尾有三个默认预设项,总数不大于
|
|
73
|
+
// 变体2:末尾有三个默认预设项,总数不大于7个(因为支付占了 2)
|
|
73
74
|
var getDefaultPresets = function getDefaultPresets() {
|
|
74
75
|
var defaultEndPresets = [{
|
|
75
76
|
label: locales.getText('cash-keyboard-other'),
|
|
@@ -113,7 +114,8 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
|
113
114
|
value: 'pay',
|
|
114
115
|
style: {
|
|
115
116
|
color: 'white',
|
|
116
|
-
backgroundColor: '#7F56DA'
|
|
117
|
+
backgroundColor: '#7F56DA',
|
|
118
|
+
gridColumn: 'span 2'
|
|
117
119
|
},
|
|
118
120
|
onClick: function onClick() {
|
|
119
121
|
var _props$onEnter;
|
|
@@ -122,8 +124,8 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
|
122
124
|
}];
|
|
123
125
|
var userPresets = presets || [];
|
|
124
126
|
|
|
125
|
-
// 计算可用的用户预设数量(总数
|
|
126
|
-
var maxUserPresets =
|
|
127
|
+
// 计算可用的用户预设数量(总数7 - 默认3个 = 4个)
|
|
128
|
+
var maxUserPresets = 7 - defaultEndPresets.length;
|
|
127
129
|
var limitedUserPresets = userPresets.slice(0, maxUserPresets);
|
|
128
130
|
return [].concat(_toConsumableArray(limitedUserPresets), defaultEndPresets);
|
|
129
131
|
};
|
|
@@ -252,10 +254,11 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
|
252
254
|
padding: '6px 16px',
|
|
253
255
|
borderRadius: '8px',
|
|
254
256
|
backgroundColor: 'white',
|
|
255
|
-
boxShadow: '
|
|
257
|
+
boxShadow: 'inset 0 2px 4px rgba(16, 24, 40, 0.08), inset 0 -2px 4px rgba(16, 24, 40, 0.08), inset 2px 0 4px rgba(16, 24, 40, 0.08), inset -2px 0 4px rgba(16, 24, 40, 0.08)',
|
|
256
258
|
overflow: 'hidden',
|
|
257
259
|
maxWidth: 188,
|
|
258
|
-
cursor: 'pointer'
|
|
260
|
+
cursor: 'pointer',
|
|
261
|
+
border: '1px solid #7f56da'
|
|
259
262
|
}),
|
|
260
263
|
onClick: function onClick() {
|
|
261
264
|
setIsShowModal(true);
|
|
@@ -314,6 +317,7 @@ var CashKeyboardIntact = function CashKeyboardIntact(props) {
|
|
|
314
317
|
hideDecimalForWholeNumbers: false,
|
|
315
318
|
precision: 2
|
|
316
319
|
})))))), /*#__PURE__*/React.createElement(Shortcuts, {
|
|
320
|
+
size: shortcutsSize || 'default',
|
|
317
321
|
presets: getDefaultPresets(),
|
|
318
322
|
onChange: setInternalValue,
|
|
319
323
|
disabled: disabled
|
|
@@ -6,6 +6,7 @@ export interface CashKeyboardProps extends CashKeyboardBaseProps {
|
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
};
|
|
8
8
|
variant?: 'intact' | 'simple';
|
|
9
|
+
shortcutsSize?: 'default' | 'large';
|
|
9
10
|
}
|
|
10
11
|
declare const CashKeyboard: (props: CashKeyboardProps) => JSX.Element;
|
|
11
12
|
export default CashKeyboard;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["variant", "value", "onChange"];
|
|
1
|
+
var _excluded = ["variant", "value", "onChange", "shortcutsSize"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
4
|
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."); }
|
|
@@ -26,6 +26,7 @@ var CashKeyboard = function CashKeyboard(props) {
|
|
|
26
26
|
variant = _props$variant === void 0 ? 'intact' : _props$variant,
|
|
27
27
|
value = props.value,
|
|
28
28
|
onChange = props.onChange,
|
|
29
|
+
shortcutsSize = props.shortcutsSize,
|
|
29
30
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
30
31
|
var _useControllableValue = useControllableValue(props),
|
|
31
32
|
_useControllableValue2 = _slicedToArray(_useControllableValue, 2),
|
|
@@ -36,7 +37,8 @@ var CashKeyboard = function CashKeyboard(props) {
|
|
|
36
37
|
amountSymbol: amountSymbol,
|
|
37
38
|
value: internalValue,
|
|
38
39
|
placeholder: "".concat(amountSymbol, "0"),
|
|
39
|
-
onChange: setInternalValue
|
|
40
|
+
onChange: setInternalValue,
|
|
41
|
+
shortcutsSize: shortcutsSize
|
|
40
42
|
}));
|
|
41
43
|
}
|
|
42
44
|
return /*#__PURE__*/React.createElement(CashKeyboardSimple, _extends({}, otherProps, {
|
|
@@ -46,6 +46,7 @@ var DiscountKeyboardBase = function DiscountKeyboardBase(props) {
|
|
|
46
46
|
originalValue = props.originalValue,
|
|
47
47
|
_props$selectType = props.selectType,
|
|
48
48
|
selectType = _props$selectType === void 0 ? 'light' : _props$selectType,
|
|
49
|
+
tips = props.tips,
|
|
49
50
|
resetText = props.resetText,
|
|
50
51
|
doneText = props.doneText,
|
|
51
52
|
onEnter = props.onEnter,
|
|
@@ -309,9 +310,17 @@ var DiscountKeyboardBase = function DiscountKeyboardBase(props) {
|
|
|
309
310
|
value: payableAmount
|
|
310
311
|
})))));
|
|
311
312
|
};
|
|
313
|
+
var renderTipsContent = function renderTipsContent() {
|
|
314
|
+
if (tips) {
|
|
315
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
316
|
+
className: "pisell-pro-price-keyboard-tips"
|
|
317
|
+
}, tips);
|
|
318
|
+
}
|
|
319
|
+
return null;
|
|
320
|
+
};
|
|
312
321
|
return /*#__PURE__*/React.createElement("div", {
|
|
313
322
|
className: "pisell-pro-price-keyboard-discount"
|
|
314
|
-
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
323
|
+
}, renderTipsContent(), /*#__PURE__*/React.createElement(Segmented, {
|
|
315
324
|
size: "large",
|
|
316
325
|
style: {
|
|
317
326
|
padding: 6
|
|
@@ -7,6 +7,20 @@
|
|
|
7
7
|
gap: 10px;
|
|
8
8
|
background-color: var(--pisell-pro-price-keyboard-bg-color, #ffffff);
|
|
9
9
|
|
|
10
|
+
.pisell-pro-price-keyboard-tips {
|
|
11
|
+
background-color: var(
|
|
12
|
+
--pisell-pro-price-keyboard-bg-color-gray-200,
|
|
13
|
+
#eaecf0
|
|
14
|
+
);
|
|
15
|
+
color: #ffffff;
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
height: 36px;
|
|
19
|
+
line-height: 36px;
|
|
20
|
+
text-align: center;
|
|
21
|
+
border-radius: 8px;
|
|
22
|
+
}
|
|
23
|
+
|
|
10
24
|
.ellipsis {
|
|
11
25
|
overflow: hidden;
|
|
12
26
|
text-overflow: ellipsis;
|
|
@@ -12,6 +12,7 @@ export interface ShortcutsProps {
|
|
|
12
12
|
presets?: ShortcutsItem[];
|
|
13
13
|
onChange?: (val: string) => void;
|
|
14
14
|
disabled?: boolean;
|
|
15
|
+
size?: 'default' | 'large';
|
|
15
16
|
}
|
|
16
17
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<ShortcutsProps & React.RefAttributes<HTMLDivElement>>>;
|
|
17
18
|
export default _default;
|
|
@@ -4,7 +4,9 @@ import "./index.less";
|
|
|
4
4
|
var Shortcuts = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
5
5
|
var presets = props.presets,
|
|
6
6
|
onChange = props.onChange,
|
|
7
|
-
disabled = props.disabled
|
|
7
|
+
disabled = props.disabled,
|
|
8
|
+
_props$size = props.size,
|
|
9
|
+
size = _props$size === void 0 ? 'default' : _props$size;
|
|
8
10
|
var handleItemClick = function handleItemClick(item) {
|
|
9
11
|
if (disabled || item.disabled) {
|
|
10
12
|
return;
|
|
@@ -32,7 +34,8 @@ var Shortcuts = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
32
34
|
var itemProps = {
|
|
33
35
|
key: index,
|
|
34
36
|
className: classNames('pisell-virtual-keyboard-shortcut', {
|
|
35
|
-
disabled: item.disabled
|
|
37
|
+
disabled: item.disabled,
|
|
38
|
+
large: size === 'large'
|
|
36
39
|
}),
|
|
37
40
|
style: item.style,
|
|
38
41
|
onClick: function onClick() {
|
|
@@ -467,7 +467,11 @@ var Footer = (props) => {
|
|
|
467
467
|
(_l = (_k = state.client) == null ? void 0 : _k.value) == null ? void 0 : _l.id
|
|
468
468
|
]);
|
|
469
469
|
const handleCheckoutInternal = async () => {
|
|
470
|
-
|
|
470
|
+
var _a2, _b2, _c2;
|
|
471
|
+
const isToastMode = ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.payment_setting) == null ? void 0 : _c2.payment_result_display_mode) !== "modal";
|
|
472
|
+
if (isToastMode) {
|
|
473
|
+
(0, import_PaymentResultToast.closeAllPaymentResultToasts)();
|
|
474
|
+
}
|
|
471
475
|
const isNewOrder = !state.bookingId;
|
|
472
476
|
if (isEdit) {
|
|
473
477
|
if ((0, import_utils2.isDayBooking)(state)) {
|
|
@@ -494,18 +498,18 @@ var Footer = (props) => {
|
|
|
494
498
|
setIsPaymentModalOpen(true);
|
|
495
499
|
setCheckoutLoading(false);
|
|
496
500
|
setPaymentCallback(() => (paymentResult) => {
|
|
497
|
-
var
|
|
501
|
+
var _a3, _b3, _c3, _d2;
|
|
498
502
|
console.log("Payment result:", paymentResult);
|
|
499
503
|
setIsPaymentModalOpen(false);
|
|
500
504
|
if ((paymentResult == null ? void 0 : paymentResult.status) === "success") {
|
|
501
505
|
console.log("Payment completed successfully");
|
|
502
|
-
(
|
|
506
|
+
(_b3 = (_a3 = window == null ? void 0 : window.shopApi) == null ? void 0 : _a3.bookingTicket) == null ? void 0 : _b3.clearAllCart();
|
|
503
507
|
setPaymentModalData(null);
|
|
504
508
|
setPaymentCallback(null);
|
|
505
509
|
} else if ((paymentResult == null ? void 0 : paymentResult.status) === "cancelled") {
|
|
506
510
|
console.log("Payment cancelled");
|
|
507
511
|
if (res == null ? void 0 : res.order_id) {
|
|
508
|
-
(_d2 = (
|
|
512
|
+
(_d2 = (_c3 = window == null ? void 0 : window.shopApi) == null ? void 0 : _c3.booking) == null ? void 0 : _d2.voidBooking(res.order_id);
|
|
509
513
|
}
|
|
510
514
|
setPaymentModalData(null);
|
|
511
515
|
setPaymentCallback(null);
|
|
@@ -596,8 +600,11 @@ var Footer = (props) => {
|
|
|
596
600
|
messageShow = true,
|
|
597
601
|
noSubmit = false
|
|
598
602
|
}) => {
|
|
599
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
600
|
-
(0
|
|
603
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
604
|
+
const isToastMode = ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.payment_setting) == null ? void 0 : _c2.payment_result_display_mode) !== "modal";
|
|
605
|
+
if (isToastMode) {
|
|
606
|
+
(0, import_PaymentResultToast.closeAllPaymentResultToasts)();
|
|
607
|
+
}
|
|
601
608
|
if ((0, import_utils2.isDayBooking)(state)) {
|
|
602
609
|
const isHasDayProducts = handleDaySubmit();
|
|
603
610
|
if (isHasDayProducts) return;
|
|
@@ -612,7 +619,7 @@ var Footer = (props) => {
|
|
|
612
619
|
const createApi = state.renderType === "eventBooking" ? import_serve2.createEventBooking : createBooking;
|
|
613
620
|
let saveOtherValue = {};
|
|
614
621
|
if (type === "save") {
|
|
615
|
-
saveOtherValue = await ((
|
|
622
|
+
saveOtherValue = await ((_d2 = state == null ? void 0 : state.onSave) == null ? void 0 : _d2.call(state, state.client)) || {};
|
|
616
623
|
}
|
|
617
624
|
try {
|
|
618
625
|
let callbackData = null;
|
|
@@ -658,7 +665,7 @@ var Footer = (props) => {
|
|
|
658
665
|
{ key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") },
|
|
659
666
|
{
|
|
660
667
|
key: "店铺id",
|
|
661
|
-
value: (
|
|
668
|
+
value: (_h2 = (_g2 = (_f2 = (_e2 = store == null ? void 0 : store.getState) == null ? void 0 : _e2.call(store)) == null ? void 0 : _f2.global) == null ? void 0 : _g2.globalConfig) == null ? void 0 : _h2.id
|
|
662
669
|
},
|
|
663
670
|
{
|
|
664
671
|
key: "shopApi",
|
|
@@ -248,4 +248,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
248
248
|
* @Author: WangHan
|
|
249
249
|
* @Date: 2024-12-24 11:32
|
|
250
250
|
*/
|
|
251
|
-
export declare const updateServicePrice: (state: any) => Promise<any
|
|
251
|
+
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 | "flexible" | {
|
|
169
169
|
type: string;
|
|
170
170
|
value: number;
|
|
171
|
-
}
|
|
171
|
+
};
|
|
172
172
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
173
173
|
export declare const getIsEdit: (state: any) => boolean;
|
|
174
174
|
export {};
|