@pisell/private-materials 3.0.186 → 3.0.188
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 +3 -3
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/eftposPay/amount.d.ts +4 -3
- package/es/components/eftposPay/amount.js +5 -4
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -1
- package/es/components/eftposPay/component/fail/failCustom.js +14 -6
- package/es/components/eftposPay/component/fail/index.d.ts +1 -1
- package/es/components/eftposPay/component/fail/index.js +14 -5
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -1
- package/es/components/eftposPay/component/fail/unknow.js +17 -7
- package/es/components/eftposPay/const.d.ts +8 -2
- package/es/components/eftposPay/const.js +5 -0
- package/es/components/eftposPay/device.d.ts +4 -3
- package/es/components/eftposPay/device.js +5 -4
- package/es/components/eftposPay/hooks.d.ts +4 -3
- package/es/components/eftposPay/hooks.js +31 -6
- package/es/components/eftposPay/index.js +57 -23
- package/es/components/eftposPay/index.less +1 -0
- package/es/components/eftposPay/locales.d.ts +6 -0
- package/es/components/eftposPay/locales.js +6 -0
- package/es/components/eftposPay/pay.d.ts +3 -2
- package/es/components/eftposPay/pay.js +8 -7
- package/es/components/eftposPay/payo/config.d.ts +3 -1
- package/es/components/eftposPay/payo/config.js +11 -9
- package/es/components/eftposPay/payo/const.js +4 -2
- package/es/components/eftposPay/payo/index.js +3 -1
- package/es/components/eftposPay/store/index.d.ts +17 -2
- package/es/components/eftposPay/store/index.js +20 -0
- package/es/components/eftposPay/tyro/const.js +4 -2
- package/es/components/eftposPay/tyro/index.js +70 -20
- package/es/components/eftposPay/windcave/const.js +4 -2
- package/es/components/eftposPay/windcave/helper.js +19 -28
- package/es/components/eftposPay/windcave/windcave.js +2 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +10 -4
- package/es/components/pisellSelectCustomerModal/RightPanel/index.js +5 -3
- package/es/components/pisellSelectCustomerModal/RightPanel/index.less +7 -0
- package/es/components/pisellSelectCustomerModal/index.js +7 -1
- package/es/components/pisellSelectCustomerModal/index.less +6 -0
- package/es/components/pisellSelectCustomerModal/locales.d.ts +6 -0
- package/es/components/pisellSelectCustomerModal/locales.js +9 -3
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/eftposPay/amount.d.ts +4 -3
- package/lib/components/eftposPay/amount.js +4 -3
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -1
- package/lib/components/eftposPay/component/fail/failCustom.js +16 -4
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -1
- package/lib/components/eftposPay/component/fail/index.js +17 -4
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -1
- package/lib/components/eftposPay/component/fail/unknow.js +15 -3
- package/lib/components/eftposPay/const.d.ts +8 -2
- package/lib/components/eftposPay/const.js +7 -0
- package/lib/components/eftposPay/device.d.ts +4 -3
- package/lib/components/eftposPay/device.js +5 -4
- package/lib/components/eftposPay/hooks.d.ts +4 -3
- package/lib/components/eftposPay/hooks.js +30 -8
- package/lib/components/eftposPay/index.js +46 -18
- package/lib/components/eftposPay/index.less +1 -0
- package/lib/components/eftposPay/locales.d.ts +6 -0
- package/lib/components/eftposPay/locales.js +6 -0
- package/lib/components/eftposPay/pay.d.ts +3 -2
- package/lib/components/eftposPay/pay.js +7 -6
- package/lib/components/eftposPay/payo/config.d.ts +3 -1
- package/lib/components/eftposPay/payo/config.js +8 -8
- package/lib/components/eftposPay/payo/const.js +2 -0
- package/lib/components/eftposPay/payo/index.js +1 -1
- package/lib/components/eftposPay/store/index.d.ts +17 -2
- package/lib/components/eftposPay/store/index.js +14 -0
- package/lib/components/eftposPay/tyro/const.js +2 -0
- package/lib/components/eftposPay/tyro/index.js +63 -6
- package/lib/components/eftposPay/windcave/const.js +2 -0
- package/lib/components/eftposPay/windcave/helper.js +23 -28
- package/lib/components/eftposPay/windcave/windcave.js +2 -1
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.js +5 -3
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.less +7 -0
- package/lib/components/pisellSelectCustomerModal/index.js +7 -0
- package/lib/components/pisellSelectCustomerModal/index.less +6 -0
- package/lib/components/pisellSelectCustomerModal/locales.d.ts +6 -0
- package/lib/components/pisellSelectCustomerModal/locales.js +9 -3
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/package.json +2 -2
|
@@ -19,12 +19,12 @@ import React, { useEffect, useState, useMemo, useRef, useCallback } from 'react'
|
|
|
19
19
|
import { useNetwork } from 'ahooks';
|
|
20
20
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
21
21
|
import Amount from "./amount";
|
|
22
|
-
import { RouteEnum, ModeEnum } from "./const";
|
|
22
|
+
import { RouteEnum, ModeEnum, ClientEnum } from "./const";
|
|
23
23
|
import Device from "./device";
|
|
24
24
|
import localeTexts from "./locales";
|
|
25
25
|
import { getInitState } from "./manufacturer";
|
|
26
26
|
import Pay from "./pay";
|
|
27
|
-
import { Provider, useContextData, useDispatch, updateState } from "./store";
|
|
27
|
+
import { Provider, useContextData, useDispatch, updateState, updateClient } from "./store";
|
|
28
28
|
import "./index.less";
|
|
29
29
|
locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
|
|
30
30
|
var App = function App(_ref) {
|
|
@@ -50,12 +50,16 @@ var App = function App(_ref) {
|
|
|
50
50
|
formatAmount: function formatAmount(number, precision, symbol) {
|
|
51
51
|
return "".concat(symbol).concat(number);
|
|
52
52
|
},
|
|
53
|
-
|
|
54
|
-
return
|
|
53
|
+
storage: function storage() {
|
|
54
|
+
return {
|
|
55
|
+
get: function get() {
|
|
56
|
+
return '';
|
|
57
|
+
}
|
|
58
|
+
};
|
|
55
59
|
}
|
|
56
60
|
},
|
|
57
61
|
formatAmount = _ref2.formatAmount,
|
|
58
|
-
|
|
62
|
+
storage = _ref2.storage;
|
|
59
63
|
|
|
60
64
|
// 外部网络数据
|
|
61
65
|
var network = useMemo(function () {
|
|
@@ -86,9 +90,36 @@ var App = function App(_ref) {
|
|
|
86
90
|
useEffect(function () {
|
|
87
91
|
statusRef.current = data.status;
|
|
88
92
|
}, [data.status]);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* terminal : terminal 内嵌
|
|
96
|
+
* android_kiosk : kiosk 内嵌
|
|
97
|
+
*/
|
|
98
|
+
var channel = useMemo(function () {
|
|
99
|
+
var _storage$get;
|
|
100
|
+
var channel = (storage === null || storage === void 0 ? void 0 : (_storage$get = storage.get) === null || _storage$get === void 0 ? void 0 : _storage$get.call(storage, 'channel')) || '';
|
|
101
|
+
if (channel === 'terminal') {
|
|
102
|
+
return 'terminal';
|
|
103
|
+
}
|
|
104
|
+
if (channel === 'android_kiosk') {
|
|
105
|
+
return 'kiosk';
|
|
106
|
+
}
|
|
107
|
+
return '';
|
|
108
|
+
}, []);
|
|
109
|
+
var client = useMemo(function () {
|
|
110
|
+
if (channel === 'kiosk') {
|
|
111
|
+
return ClientEnum.User;
|
|
112
|
+
}
|
|
113
|
+
return ClientEnum.Merchant;
|
|
114
|
+
}, [channel]);
|
|
115
|
+
useEffect(function () {
|
|
116
|
+
dispatch(updateClient(client));
|
|
117
|
+
}, [client]);
|
|
118
|
+
|
|
119
|
+
// 内嵌在 terminal 或者 kiosk 的移动端 做特定移动端(大屏)适配
|
|
120
|
+
var isMobile = useMemo(function () {
|
|
121
|
+
return Boolean(channel);
|
|
122
|
+
}, [channel]);
|
|
92
123
|
|
|
93
124
|
/**
|
|
94
125
|
* @title: api 接口 数据
|
|
@@ -123,7 +154,7 @@ var App = function App(_ref) {
|
|
|
123
154
|
* @Author: hongbing.wang
|
|
124
155
|
* @Date: 2024-08-20 13:10
|
|
125
156
|
*/
|
|
126
|
-
var onChange = useCallback(function (status, params) {
|
|
157
|
+
var onChange = useCallback(function (status, params, other) {
|
|
127
158
|
if (status === 'page' && typeof params === 'string') {
|
|
128
159
|
if (['amount', 'deviceList', 'pay'].includes(params)) {
|
|
129
160
|
setCurrent(params);
|
|
@@ -132,8 +163,8 @@ var App = function App(_ref) {
|
|
|
132
163
|
}));
|
|
133
164
|
}
|
|
134
165
|
}
|
|
135
|
-
console.log('状态切换 = ', status, params);
|
|
136
|
-
props.onChangeStatus(status, params);
|
|
166
|
+
console.log('状态切换 = ', status, params, other);
|
|
167
|
+
props.onChangeStatus(status, params, other);
|
|
137
168
|
}, []);
|
|
138
169
|
|
|
139
170
|
/**
|
|
@@ -153,11 +184,12 @@ var App = function App(_ref) {
|
|
|
153
184
|
api: api,
|
|
154
185
|
onChange: onChange,
|
|
155
186
|
onClose: onClose,
|
|
156
|
-
|
|
157
|
-
className:
|
|
187
|
+
isMobile: isMobile,
|
|
188
|
+
className: isMobile ? 'pisell-lowcode__eft-pay-terminal' : '',
|
|
158
189
|
net: net,
|
|
159
190
|
device_number: device_number,
|
|
160
|
-
formatAmount: formatAmount
|
|
191
|
+
formatAmount: formatAmount,
|
|
192
|
+
client: client
|
|
161
193
|
});
|
|
162
194
|
}
|
|
163
195
|
if (current === RouteEnum.Amount) {
|
|
@@ -165,9 +197,10 @@ var App = function App(_ref) {
|
|
|
165
197
|
onChange: onChange,
|
|
166
198
|
onClose: onClose,
|
|
167
199
|
formatAmount: formatAmount,
|
|
168
|
-
|
|
169
|
-
className:
|
|
170
|
-
net: net
|
|
200
|
+
isMobile: isMobile,
|
|
201
|
+
className: isMobile ? 'pisell-lowcode__eft-pay-terminal' : '',
|
|
202
|
+
net: net,
|
|
203
|
+
client: client
|
|
171
204
|
});
|
|
172
205
|
}
|
|
173
206
|
return /*#__PURE__*/React.createElement(Pay, {
|
|
@@ -175,11 +208,12 @@ var App = function App(_ref) {
|
|
|
175
208
|
tyroUrl: tyroUrl,
|
|
176
209
|
tyroVersion: tyroVersion,
|
|
177
210
|
onChange: onChange,
|
|
178
|
-
className:
|
|
211
|
+
className: isMobile ? 'pisell-lowcode__eft-pay-terminal' : '',
|
|
179
212
|
terminal: terminal,
|
|
180
|
-
|
|
213
|
+
isMobile: isMobile,
|
|
181
214
|
net: net,
|
|
182
|
-
formatAmount: formatAmount
|
|
215
|
+
formatAmount: formatAmount,
|
|
216
|
+
client: client
|
|
183
217
|
});
|
|
184
218
|
};
|
|
185
219
|
export default (function (props) {
|
|
@@ -226,8 +260,8 @@ export default (function (props) {
|
|
|
226
260
|
symbol: current
|
|
227
261
|
});
|
|
228
262
|
}, [mode, props.params, props.type, symbol]);
|
|
229
|
-
var onChangeStatus = useCallback(function (status, params) {
|
|
230
|
-
props.onChangeStatus(status, params);
|
|
263
|
+
var onChangeStatus = useCallback(function (status, params, other) {
|
|
264
|
+
props.onChangeStatus(status, params, other);
|
|
231
265
|
}, []);
|
|
232
266
|
var action = useMemo(function () {
|
|
233
267
|
var act = function () {
|
|
@@ -262,7 +296,7 @@ export default (function (props) {
|
|
|
262
296
|
}, [mode, state]);
|
|
263
297
|
useEffect(function () {
|
|
264
298
|
// document.body.id = 'body';
|
|
265
|
-
console.log('初始化 ........');
|
|
299
|
+
console.log('初始化 ........11221801');
|
|
266
300
|
}, []);
|
|
267
301
|
|
|
268
302
|
// console.log('action = ', action);
|
|
@@ -256,6 +256,7 @@
|
|
|
256
256
|
.pisell-lowcode__eft-pay-terminal {
|
|
257
257
|
width: var(--pisel-lc-pos-terminal-width, 100%) !important;
|
|
258
258
|
height: var(--pisel-lc-pos-terminal-height, 100%) !important;
|
|
259
|
+
max-height: var(--pisel-lc-pos-terminal-max-height, unset) !important;
|
|
259
260
|
display: flex;
|
|
260
261
|
flex-direction: column;
|
|
261
262
|
}
|
|
@@ -37,6 +37,7 @@ declare const _default: {
|
|
|
37
37
|
'page.eftpos-pay.text.manual.diff': string;
|
|
38
38
|
'page.eftpos-pay.text.manual.tip': string;
|
|
39
39
|
'page.eftpos-pay.text.manual.cancel': string;
|
|
40
|
+
'page.eftpos-pay.text.manual.print_receipt': string;
|
|
40
41
|
'page.eftpos-pay.text.modify.payment.info': (mode: string) => "Modify payment info" | "Modify refund information";
|
|
41
42
|
'page.eftpos-pay.text.successful': (mode: string) => string;
|
|
42
43
|
'page.eftpos-pay.text.failed': (mode: string) => string;
|
|
@@ -85,6 +86,7 @@ declare const _default: {
|
|
|
85
86
|
'page.eftpos-pay.text.transaction.eftpos.fail.device': string;
|
|
86
87
|
'page.eftpos-pay.text.transaction.eftpos.fail.network': string;
|
|
87
88
|
'page.eftpos-pay.text.transaction.eftpos.fail.if': (mode: string) => "If you have confirmed the payment status of this order, please click on Manual marking." | "If you have confirmed the refund status of this order, please click on Manual Marking.";
|
|
89
|
+
'page.eftpos-pay.text.transaction.eftpos.fail.other': string;
|
|
88
90
|
'page.eftpos-pay.text.application': string;
|
|
89
91
|
'page.eftpos-pay.text.approved': string;
|
|
90
92
|
'page.eftpos-pay.text.device.no.title': string;
|
|
@@ -139,6 +141,7 @@ declare const _default: {
|
|
|
139
141
|
'page.eftpos-pay.text.manual.diff': string;
|
|
140
142
|
'page.eftpos-pay.text.manual.tip': string;
|
|
141
143
|
'page.eftpos-pay.text.manual.cancel': string;
|
|
144
|
+
'page.eftpos-pay.text.manual.print_receipt': string;
|
|
142
145
|
'page.eftpos-pay.text.modify.payment.info': (mode: string) => "修改支付信息" | "修改退款信息";
|
|
143
146
|
'page.eftpos-pay.text.successful': (mode: string) => string;
|
|
144
147
|
'page.eftpos-pay.text.failed': (mode: string) => string;
|
|
@@ -187,6 +190,7 @@ declare const _default: {
|
|
|
187
190
|
'page.eftpos-pay.text.transaction.eftpos.fail.device': string;
|
|
188
191
|
'page.eftpos-pay.text.transaction.eftpos.fail.network': string;
|
|
189
192
|
'page.eftpos-pay.text.transaction.eftpos.fail.if': (mode: string) => "如果您已确认此交易的付款状态,请点击手动标记" | "如果您已确认此订单的退款状态,请点击手动标记。";
|
|
193
|
+
'page.eftpos-pay.text.transaction.eftpos.fail.other': string;
|
|
190
194
|
'page.eftpos-pay.text.application': string;
|
|
191
195
|
'page.eftpos-pay.text.approved': string;
|
|
192
196
|
'page.eftpos-pay.text.device.no.title': string;
|
|
@@ -241,6 +245,7 @@ declare const _default: {
|
|
|
241
245
|
'page.eftpos-pay.text.manual.diff': string;
|
|
242
246
|
'page.eftpos-pay.text.manual.tip': string;
|
|
243
247
|
'page.eftpos-pay.text.manual.cancel': string;
|
|
248
|
+
'page.eftpos-pay.text.manual.print_receipt': string;
|
|
244
249
|
'page.eftpos-pay.text.modify.payment.info': (mode: string) => "修改支付信息" | "修改退款信息";
|
|
245
250
|
'page.eftpos-pay.text.successful': (mode: string) => string;
|
|
246
251
|
'page.eftpos-pay.text.failed': (mode: string) => string;
|
|
@@ -289,6 +294,7 @@ declare const _default: {
|
|
|
289
294
|
'page.eftpos-pay.text.transaction.eftpos.fail.device': string;
|
|
290
295
|
'page.eftpos-pay.text.transaction.eftpos.fail.network': string;
|
|
291
296
|
'page.eftpos-pay.text.transaction.eftpos.fail.if': (mode: string) => "如果您已確認此交易的付款狀態,請點擊手動標記" | "如果您已確認此訂單的退款狀態,請點擊手動標記。";
|
|
297
|
+
'page.eftpos-pay.text.transaction.eftpos.fail.other': string;
|
|
292
298
|
'page.eftpos-pay.text.application': string;
|
|
293
299
|
'page.eftpos-pay.text.approved': string;
|
|
294
300
|
'page.eftpos-pay.text.device.no.title': string;
|
|
@@ -59,6 +59,7 @@ export default {
|
|
|
59
59
|
'page.eftpos-pay.text.manual.diff': "If it doesn't match, please enter the actual transaction amount in the input box below.",
|
|
60
60
|
'page.eftpos-pay.text.manual.tip': "Amount tendered (incl. surcharge)",
|
|
61
61
|
'page.eftpos-pay.text.manual.cancel': 'Cancel current transaction',
|
|
62
|
+
'page.eftpos-pay.text.manual.print_receipt': 'Print Receipt',
|
|
62
63
|
'page.eftpos-pay.text.modify.payment.info': function pageEftposPayTextModifyPaymentInfo(mode) {
|
|
63
64
|
return mode === 'pay' || mode === 'fullPay' ? 'Modify payment info' : 'Modify refund information';
|
|
64
65
|
},
|
|
@@ -120,6 +121,7 @@ export default {
|
|
|
120
121
|
'page.eftpos-pay.text.transaction.eftpos.fail.if': function pageEftposPayTextTransactionEftposFailIf(mode) {
|
|
121
122
|
return mode === 'pay' || mode === 'fullPay' ? 'If you have confirmed the payment status of this order, please click on Manual marking.' : 'If you have confirmed the refund status of this order, please click on Manual Marking.';
|
|
122
123
|
},
|
|
124
|
+
'page.eftpos-pay.text.transaction.eftpos.fail.other': 'Payment issue detected. Please print the receipt and contact staff for assistance.',
|
|
123
125
|
'page.eftpos-pay.text.application': 'Waiting for customer to select application',
|
|
124
126
|
'page.eftpos-pay.text.approved': 'Approved',
|
|
125
127
|
'page.eftpos-pay.text.device.no.title': 'No devices added yet. Please add devices to proceed.',
|
|
@@ -204,6 +206,7 @@ export default {
|
|
|
204
206
|
'page.eftpos-pay.text.manual.diff': "如不一致请在下方输入框内输入真实的交易金额。",
|
|
205
207
|
'page.eftpos-pay.text.manual.tip': "实付金额(含附加费)",
|
|
206
208
|
'page.eftpos-pay.text.manual.cancel': '取消当前交易',
|
|
209
|
+
'page.eftpos-pay.text.manual.print_receipt': '打印收据',
|
|
207
210
|
'page.eftpos-pay.text.modify.payment.info': function pageEftposPayTextModifyPaymentInfo(mode) {
|
|
208
211
|
return mode === 'pay' || mode === 'fullPay' ? '修改支付信息' : '修改退款信息';
|
|
209
212
|
},
|
|
@@ -273,6 +276,7 @@ export default {
|
|
|
273
276
|
'page.eftpos-pay.text.transaction.eftpos.fail.if': function pageEftposPayTextTransactionEftposFailIf(mode) {
|
|
274
277
|
return mode === 'pay' || mode === 'fullPay' ? '如果您已确认此交易的付款状态,请点击手动标记' : '如果您已确认此订单的退款状态,请点击手动标记。';
|
|
275
278
|
},
|
|
279
|
+
'page.eftpos-pay.text.transaction.eftpos.fail.other': '刷卡机支付出现问题,请打印收据后联系店员处理。',
|
|
276
280
|
'page.eftpos-pay.text.application': '等待客户选择应用',
|
|
277
281
|
'page.eftpos-pay.text.approved': '已接受',
|
|
278
282
|
'page.eftpos-pay.text.device.no.title': '您还没有添加任何设备。请添加设备后使用',
|
|
@@ -495,6 +499,7 @@ export default {
|
|
|
495
499
|
'page.eftpos-pay.text.manual.diff': "如不一致請在下方輸入框內輸入真實的交易金額。",
|
|
496
500
|
'page.eftpos-pay.text.manual.tip': "實付金額(含附加費)",
|
|
497
501
|
'page.eftpos-pay.text.manual.cancel': '取消當前交易',
|
|
502
|
+
'page.eftpos-pay.text.manual.print_receipt': '打印收據',
|
|
498
503
|
'page.eftpos-pay.text.modify.payment.info': function pageEftposPayTextModifyPaymentInfo(mode) {
|
|
499
504
|
return mode === 'pay' || mode === 'fullPay' ? '修改支付信息' : '修改退款信息';
|
|
500
505
|
},
|
|
@@ -564,6 +569,7 @@ export default {
|
|
|
564
569
|
'page.eftpos-pay.text.transaction.eftpos.fail.if': function pageEftposPayTextTransactionEftposFailIf(mode) {
|
|
565
570
|
return mode === 'pay' || mode === 'fullPay' ? '如果您已確認此交易的付款狀態,請點擊手動標記' : '如果您已確認此訂單的退款狀態,請點擊手動標記。';
|
|
566
571
|
},
|
|
572
|
+
'page.eftpos-pay.text.transaction.eftpos.fail.other': '刷卡機支付出現問題,請打印收據後聯繫店員處理。',
|
|
567
573
|
'page.eftpos-pay.text.application': '等待客户選擇應用',
|
|
568
574
|
'page.eftpos-pay.text.approved': '已接受',
|
|
569
575
|
'page.eftpos-pay.text.device.no.title': '您還沒有添加任何設備。請添加設備後使用',
|
|
@@ -7,14 +7,15 @@ import './index.less';
|
|
|
7
7
|
* @Author: hongbing.wang
|
|
8
8
|
* @Date: 2024-08-20 14:59
|
|
9
9
|
*/
|
|
10
|
-
declare const Pay: ({ api, onChange: onChangeStatus, className, terminal, net,
|
|
10
|
+
declare const Pay: ({ api, onChange: onChangeStatus, className, terminal, net, isMobile, tyroUrl, tyroVersion, formatAmount, client }: PayProps & {
|
|
11
11
|
terminal: {
|
|
12
12
|
network: boolean;
|
|
13
13
|
};
|
|
14
14
|
net: boolean;
|
|
15
|
-
|
|
15
|
+
isMobile: boolean;
|
|
16
16
|
tyroUrl?: string | undefined;
|
|
17
17
|
tyroVersion?: string | undefined;
|
|
18
18
|
formatAmount(amount: number | string, precision: number, symbol: string): string;
|
|
19
|
+
client: string;
|
|
19
20
|
}) => React.JSX.Element;
|
|
20
21
|
export default Pay;
|
|
@@ -9,7 +9,7 @@ import Header from "./component/header";
|
|
|
9
9
|
import { getPayParams } from "./helper";
|
|
10
10
|
import Manual from "./component/manual";
|
|
11
11
|
import Signature from "./component/signature";
|
|
12
|
-
import { StatusEnum, PayRouteEnum } from "./const";
|
|
12
|
+
import { StatusEnum, PayRouteEnum, ClientEnum } from "./const";
|
|
13
13
|
import { Payo, Windcave, Tyro } from "./manufacturer";
|
|
14
14
|
import { useContextData, useDispatch, updateStatus, backUpProduction, updateComponent, backUpFree, updateState } from "./store";
|
|
15
15
|
import "./index.less";
|
|
@@ -35,13 +35,14 @@ var Pay = function Pay(_ref) {
|
|
|
35
35
|
className = _ref.className,
|
|
36
36
|
terminal = _ref.terminal,
|
|
37
37
|
net = _ref.net,
|
|
38
|
-
|
|
38
|
+
isMobile = _ref.isMobile,
|
|
39
39
|
tyroUrl = _ref.tyroUrl,
|
|
40
40
|
tyroVersion = _ref.tyroVersion,
|
|
41
41
|
_ref$formatAmount = _ref.formatAmount,
|
|
42
42
|
formatAmount = _ref$formatAmount === void 0 ? function (number, precision, symbol) {
|
|
43
43
|
return "".concat(symbol).concat(number);
|
|
44
|
-
} : _ref$formatAmount
|
|
44
|
+
} : _ref$formatAmount,
|
|
45
|
+
client = _ref.client;
|
|
45
46
|
var data = useContextData();
|
|
46
47
|
var dataRef = useRef(data);
|
|
47
48
|
// console.log("pay = ",'pay')
|
|
@@ -67,11 +68,11 @@ var Pay = function Pay(_ref) {
|
|
|
67
68
|
* @Author: hongbing.wang
|
|
68
69
|
* @Date: 2024-08-20 15:00
|
|
69
70
|
*/
|
|
70
|
-
var onChange = useCallback(function (status, params) {
|
|
71
|
+
var onChange = useCallback(function (status, params, other) {
|
|
71
72
|
if (status === StatusEnum.Success || status === StatusEnum.Fail) {
|
|
72
73
|
dispatch(updateStatus(status));
|
|
73
74
|
}
|
|
74
|
-
onChangeStatus(status, params);
|
|
75
|
+
onChangeStatus(status, params, other);
|
|
75
76
|
}, [dispatch, onChangeStatus]);
|
|
76
77
|
|
|
77
78
|
// 主流程 已完成 的崩溃恢复
|
|
@@ -162,7 +163,7 @@ var Pay = function Pay(_ref) {
|
|
|
162
163
|
}), data.eftpos === 'payo' ? /*#__PURE__*/React.createElement(Payo, {
|
|
163
164
|
api: api,
|
|
164
165
|
onChange: onChange
|
|
165
|
-
}, data.warn && data.status !== StatusEnum.Success ? /*#__PURE__*/React.createElement("div", {
|
|
166
|
+
}, data.warn && data.status !== StatusEnum.Success && client === ClientEnum.Merchant ? /*#__PURE__*/React.createElement("div", {
|
|
166
167
|
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-warn"
|
|
167
168
|
}, data.warn) : null, data.status === StatusEnum.Success ? /*#__PURE__*/React.createElement("div", {
|
|
168
169
|
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
|
|
@@ -181,7 +182,7 @@ var Pay = function Pay(_ref) {
|
|
|
181
182
|
onChange: onChange,
|
|
182
183
|
api: api,
|
|
183
184
|
className: className,
|
|
184
|
-
|
|
185
|
+
isMobile: isMobile,
|
|
185
186
|
formatAmount: formatAmount
|
|
186
187
|
}) : null);
|
|
187
188
|
};
|
|
@@ -8,4 +8,6 @@ export declare const POS: ({ api, onChange, }: {
|
|
|
8
8
|
[keys: string]: unknown;
|
|
9
9
|
} | undefined) => void;
|
|
10
10
|
}) => React.JSX.Element;
|
|
11
|
-
export declare const Action: (
|
|
11
|
+
export declare const Action: ({ onChange }: {
|
|
12
|
+
onChange: any;
|
|
13
|
+
}) => React.JSX.Element;
|
|
@@ -22,7 +22,7 @@ import { locales } from '@pisell/utils';
|
|
|
22
22
|
import { Button } from 'antd';
|
|
23
23
|
import React, { useEffect, useRef } from 'react';
|
|
24
24
|
import Step from "../component/step";
|
|
25
|
-
import { PayStatus, StatusEnum, ModeEnum } from "../const";
|
|
25
|
+
import { PayStatus, StatusEnum, ModeEnum, ClientEnum } from "../const";
|
|
26
26
|
import { getUuid, getPayParams } from "../helper";
|
|
27
27
|
import { useFail, useStoreRef } from "../hooks";
|
|
28
28
|
import { useContextData, useDispatch, updateNextStep, updateComponent, updateState, updateCustom } from "../store";
|
|
@@ -48,7 +48,7 @@ export var POS = function POS(_ref) {
|
|
|
48
48
|
var _steps$ = steps[0],
|
|
49
49
|
key = _steps$.key,
|
|
50
50
|
props = _objectWithoutProperties(_steps$, _excluded);
|
|
51
|
-
var fail = useFail(0
|
|
51
|
+
var fail = useFail(0);
|
|
52
52
|
var failRef = useRef(fail);
|
|
53
53
|
var controllerRef = useRef();
|
|
54
54
|
var clearRef = useRef();
|
|
@@ -108,13 +108,13 @@ export var POS = function POS(_ref) {
|
|
|
108
108
|
success(res);
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
failRef.current(res);
|
|
111
|
+
failRef.current(res, true);
|
|
112
112
|
}, function (res) {
|
|
113
113
|
// 无网 或 已卸载 则不进行处理
|
|
114
114
|
if (unloadRef.current || !netRef.current) {
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
failRef.current(res);
|
|
117
|
+
failRef.current(res, true);
|
|
118
118
|
});
|
|
119
119
|
};
|
|
120
120
|
|
|
@@ -180,7 +180,7 @@ export var POS = function POS(_ref) {
|
|
|
180
180
|
checkApi();
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
|
-
failRef.current(err);
|
|
183
|
+
failRef.current(err, true);
|
|
184
184
|
});
|
|
185
185
|
}, [api, check, dispatch, onChange]);
|
|
186
186
|
useEffect(function () {
|
|
@@ -195,10 +195,12 @@ export var POS = function POS(_ref) {
|
|
|
195
195
|
}, []);
|
|
196
196
|
return /*#__PURE__*/React.createElement(Step, props);
|
|
197
197
|
};
|
|
198
|
-
export var Action = function Action() {
|
|
198
|
+
export var Action = function Action(_ref2) {
|
|
199
|
+
var onChange = _ref2.onChange;
|
|
199
200
|
var dispatch = useDispatch();
|
|
200
201
|
var _useContextData2 = useContextData(),
|
|
201
|
-
mode = _useContextData2.mode
|
|
202
|
+
mode = _useContextData2.mode,
|
|
203
|
+
client = _useContextData2.client;
|
|
202
204
|
|
|
203
205
|
/**
|
|
204
206
|
* @title: 前往手动标记页
|
|
@@ -216,9 +218,9 @@ export var Action = function Action() {
|
|
|
216
218
|
};
|
|
217
219
|
return /*#__PURE__*/React.createElement("div", {
|
|
218
220
|
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
219
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
221
|
+
}, client === ClientEnum.Merchant ? /*#__PURE__*/React.createElement(Button, {
|
|
220
222
|
block: true,
|
|
221
223
|
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
222
224
|
onClick: onManually
|
|
223
|
-
}, locales.getText('page.eftpos-pay.text.manual.marking')));
|
|
225
|
+
}, locales.getText('page.eftpos-pay.text.manual.marking')) : null);
|
|
224
226
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["order_id", "name", "symbol", "amount", "mode", "number", "pay", "device", "net"];
|
|
2
|
+
var _excluded = ["order_id", "name", "symbol", "amount", "mode", "number", "pay", "device", "net", "client"];
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -8,7 +8,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
10
|
import { locales } from '@pisell/utils';
|
|
11
|
-
import { EftposEnum, StatusEnum, PayRouteEnum, ModeEnum } from "../const";
|
|
11
|
+
import { EftposEnum, StatusEnum, PayRouteEnum, ModeEnum, ClientEnum } from "../const";
|
|
12
12
|
/**
|
|
13
13
|
* @title: payo 步骤信息
|
|
14
14
|
* @description:
|
|
@@ -50,6 +50,7 @@ export default (function (params) {
|
|
|
50
50
|
pay = _ref.pay,
|
|
51
51
|
device = _ref.device,
|
|
52
52
|
net = _ref.net,
|
|
53
|
+
client = _ref.client,
|
|
53
54
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
54
55
|
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
55
56
|
order_id: order_id,
|
|
@@ -67,6 +68,7 @@ export default (function (params) {
|
|
|
67
68
|
status: StatusEnum.Loading,
|
|
68
69
|
steps: getStep(mode),
|
|
69
70
|
render: true,
|
|
71
|
+
client: client !== 'undefined' ? client : ClientEnum.Merchant,
|
|
70
72
|
custom: other || {}
|
|
71
73
|
}, typeof net !== 'undefined' ? {
|
|
72
74
|
net: net
|
|
@@ -31,5 +31,7 @@ export default (function (_ref) {
|
|
|
31
31
|
onChange: onChange
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
}), children), data.status !== StatusEnum.Success ? /*#__PURE__*/React.createElement(Action,
|
|
34
|
+
}), children), data.status !== StatusEnum.Success ? /*#__PURE__*/React.createElement(Action, {
|
|
35
|
+
onChange: onChange
|
|
36
|
+
}) : null);
|
|
35
37
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { DeviceStatusType, StatusType, ModeType, RouteType } from '../const';
|
|
2
|
+
import { DeviceStatusType, StatusType, ModeType, RouteType, ClientEnum } from '../const';
|
|
3
3
|
import { ThunkDispatch } from './useThunkReducer';
|
|
4
4
|
export declare enum EActionTypes {
|
|
5
5
|
UPDATE_INIT = "UPDATE_INIT",
|
|
@@ -16,7 +16,8 @@ export declare enum EActionTypes {
|
|
|
16
16
|
UPDATE_STEP_CURRENT_ITEM_CUSTOM = "UPDATE_STEP_CURRENT_ITEM_CUSTOM",
|
|
17
17
|
UPDATE_STEP_ITEM = "UPDATE_STEP_ITEM",
|
|
18
18
|
BACKUP_PRODUCTION = "BACKUP_PRODUCTION",
|
|
19
|
-
BACKUP_FREE = "BACKUP_FREE"
|
|
19
|
+
BACKUP_FREE = "BACKUP_FREE",
|
|
20
|
+
UPDATE_CLIENT = "UPDATE_CLIENT"
|
|
20
21
|
}
|
|
21
22
|
export declare type State = {
|
|
22
23
|
/** 支付名称 */
|
|
@@ -89,6 +90,7 @@ export declare type State = {
|
|
|
89
90
|
money?: number;
|
|
90
91
|
};
|
|
91
92
|
backup?: Omit<State, 'backup'>;
|
|
93
|
+
client: ClientEnum;
|
|
92
94
|
};
|
|
93
95
|
export declare type Action = {
|
|
94
96
|
type: EActionTypes;
|
|
@@ -258,6 +260,18 @@ export declare const updateCurrentStemItem: (payload: any) => {
|
|
|
258
260
|
type: EActionTypes;
|
|
259
261
|
payload: any;
|
|
260
262
|
};
|
|
263
|
+
/**
|
|
264
|
+
* @title: 更新当前步骤信息
|
|
265
|
+
* @description: 更新当前步骤信息
|
|
266
|
+
* @Author: hongbing.wang
|
|
267
|
+
* @Date: 2024-08-19 10:09
|
|
268
|
+
*/
|
|
269
|
+
export declare const updateClient: (payload: ClientEnum) => {
|
|
270
|
+
type: EActionTypes;
|
|
271
|
+
payload: {
|
|
272
|
+
client: ClientEnum;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
261
275
|
/**
|
|
262
276
|
* @title: 更新备份信息
|
|
263
277
|
* @description: 更新备份信息
|
|
@@ -329,6 +343,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
329
343
|
money?: number | undefined;
|
|
330
344
|
} | undefined;
|
|
331
345
|
backup?: Omit<State, "backup"> | undefined;
|
|
346
|
+
client?: ClientEnum | undefined;
|
|
332
347
|
};
|
|
333
348
|
};
|
|
334
349
|
export declare function reducers(state: State, action: Action): State;
|
|
@@ -37,6 +37,7 @@ export var EActionTypes;
|
|
|
37
37
|
EActionTypes["UPDATE_STEP_ITEM"] = "UPDATE_STEP_ITEM";
|
|
38
38
|
EActionTypes["BACKUP_PRODUCTION"] = "BACKUP_PRODUCTION";
|
|
39
39
|
EActionTypes["BACKUP_FREE"] = "BACKUP_FREE";
|
|
40
|
+
EActionTypes["UPDATE_CLIENT"] = "UPDATE_CLIENT";
|
|
40
41
|
})(EActionTypes || (EActionTypes = {}));
|
|
41
42
|
/**
|
|
42
43
|
* @title: 刷新 key
|
|
@@ -207,6 +208,21 @@ export var updateCurrentStemItem = function updateCurrentStemItem(payload) {
|
|
|
207
208
|
};
|
|
208
209
|
};
|
|
209
210
|
|
|
211
|
+
/**
|
|
212
|
+
* @title: 更新当前步骤信息
|
|
213
|
+
* @description: 更新当前步骤信息
|
|
214
|
+
* @Author: hongbing.wang
|
|
215
|
+
* @Date: 2024-08-19 10:09
|
|
216
|
+
*/
|
|
217
|
+
export var updateClient = function updateClient(payload) {
|
|
218
|
+
return {
|
|
219
|
+
type: EActionTypes.UPDATE_CLIENT,
|
|
220
|
+
payload: {
|
|
221
|
+
client: payload
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
|
|
210
226
|
/**
|
|
211
227
|
* @title: 更新备份信息
|
|
212
228
|
* @description: 更新备份信息
|
|
@@ -321,6 +337,10 @@ export function reducers(state, action) {
|
|
|
321
337
|
}
|
|
322
338
|
var s = Object.assign({}, (_objectDestructuringEmpty(state.backup), state.backup));
|
|
323
339
|
return _objectSpread(_objectSpread({}, s), action.payload);
|
|
340
|
+
case EActionTypes.UPDATE_CLIENT:
|
|
341
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
342
|
+
client: action.payload['client']
|
|
343
|
+
});
|
|
324
344
|
default:
|
|
325
345
|
{
|
|
326
346
|
throw new Error("Unhandled action type: ".concat(action.type));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["order_id", "name", "symbol", "amount", "mode", "number", "pay", "device", "net"];
|
|
2
|
+
var _excluded = ["order_id", "name", "symbol", "amount", "mode", "number", "pay", "device", "net", "client"];
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -8,7 +8,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
10
|
import { locales } from '@pisell/utils';
|
|
11
|
-
import { EftposEnum, StatusEnum, PayRouteEnum, ModeEnum } from "../const";
|
|
11
|
+
import { EftposEnum, StatusEnum, PayRouteEnum, ModeEnum, ClientEnum } from "../const";
|
|
12
12
|
/**
|
|
13
13
|
* @title: 初始化 tyro 数据
|
|
14
14
|
* @Author: hongbing.wang
|
|
@@ -27,6 +27,7 @@ export default (function (params) {
|
|
|
27
27
|
pay = _ref.pay,
|
|
28
28
|
device = _ref.device,
|
|
29
29
|
net = _ref.net,
|
|
30
|
+
client = _ref.client,
|
|
30
31
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
31
32
|
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
32
33
|
name: name,
|
|
@@ -44,6 +45,7 @@ export default (function (params) {
|
|
|
44
45
|
status: StatusEnum.Loading,
|
|
45
46
|
steps: [],
|
|
46
47
|
render: true,
|
|
48
|
+
client: client !== 'undefined' ? client : ClientEnum.Merchant,
|
|
47
49
|
custom: other || {}
|
|
48
50
|
}, typeof net !== 'undefined' ? {
|
|
49
51
|
net: net
|