@pisell/private-materials 6.6.61 → 6.6.63
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/components/footer/amount.js +4 -3
- package/es/components/booking/components/footer/utils.js +10 -3
- package/es/components/booking/components/voucher/index.js +1 -1
- package/es/components/booking/info2/service/editService/index.js +76 -8
- package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/es/components/booking/info2/service/editService/utils.js +16 -0
- package/es/components/booking/payments/index.js +1 -1
- package/es/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/es/components/eftpos/PairModal/hooks.js +67 -0
- package/es/components/eftpos/PairModal/index.d.ts +11 -0
- package/es/components/eftpos/PairModal/index.js +246 -0
- package/es/components/eftpos/PairModal/index.less +70 -0
- package/es/components/eftpos/SettlementModal/Action.d.ts +7 -0
- package/es/components/eftpos/SettlementModal/Action.js +141 -0
- package/es/components/eftpos/SettlementModal/index.d.ts +7 -0
- package/es/components/eftpos/SettlementModal/index.js +135 -0
- package/es/components/eftpos/SettlementModal/index.less +33 -0
- package/es/components/eftpos/SettlementModal/serve.d.ts +8 -0
- package/es/components/eftpos/SettlementModal/serve.js +171 -0
- package/es/components/eftpos/SettlementModal/types.d.ts +138 -0
- package/es/components/eftpos/SettlementModal/types.js +35 -0
- package/es/components/eftpos/SettlementModal/utils.d.ts +18 -0
- package/es/components/eftpos/SettlementModal/utils.js +351 -0
- package/es/components/eftpos/assets/mx51SCI.svg +15 -0
- package/es/components/eftpos/const.d.ts +3 -1
- package/es/components/eftpos/const.js +2 -0
- package/es/components/eftpos/device.d.ts +3 -1
- package/es/components/eftpos/device.js +14 -3
- package/es/components/eftpos/hooks.d.ts +13 -0
- package/es/components/eftpos/hooks.js +35 -0
- package/es/components/eftpos/index.js +198 -24
- package/es/components/eftpos/index.less +32 -1
- package/es/components/eftpos/locales.d.ts +80 -0
- package/es/components/eftpos/locales.js +205 -25
- package/es/components/eftpos/table.js +47 -3
- package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.js +145 -0
- package/es/components/eftposPay/aggregatePayment/index.d.ts +2 -1
- package/es/components/eftposPay/aggregatePayment/index.js +2 -1
- package/es/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/es/components/eftposPay/aggregatePayment/mock.js +567 -0
- package/es/components/eftposPay/aggregatePayment/service.js +1 -0
- package/es/components/eftposPay/aggregatePayment/types.d.ts +12 -12
- package/es/components/eftposPay/aggregatePayment/types.js +4 -8
- package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +231 -168
- package/es/components/eftposPay/amount.js +15 -1
- package/es/components/eftposPay/app.js +2 -3
- package/es/components/eftposPay/component/fail/failCustom.js +13 -4
- package/es/components/eftposPay/component/fail/index.js +12 -5
- package/es/components/eftposPay/component/fail/network.js +3 -0
- package/es/components/eftposPay/component/fail/unknow.js +8 -0
- package/es/components/eftposPay/component/manual/index.js +17 -3
- package/es/components/eftposPay/component/signature/index.js +3 -0
- package/es/components/eftposPay/const.d.ts +8 -3
- package/es/components/eftposPay/const.js +2 -0
- package/es/components/eftposPay/device.js +225 -38
- package/es/components/eftposPay/helper.d.ts +3 -0
- package/es/components/eftposPay/helper.js +2 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.js +50 -13
- package/es/components/eftposPay/linkly/const.js +1 -1
- package/es/components/eftposPay/linkly/hooks/normal.js +21 -68
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +20 -81
- package/es/components/eftposPay/linkly/index.js +11 -23
- package/es/components/eftposPay/locales.d.ts +15 -0
- package/es/components/eftposPay/locales.js +30 -15
- package/es/components/eftposPay/manufacturer.d.ts +1 -0
- package/es/components/eftposPay/manufacturer.js +4 -0
- package/es/components/eftposPay/mx51/Action.d.ts +6 -0
- package/es/components/eftposPay/mx51/Action.js +144 -0
- package/es/components/eftposPay/mx51/const.d.ts +5 -0
- package/es/components/eftposPay/mx51/const.js +69 -0
- package/es/components/eftposPay/mx51/index.d.ts +6 -0
- package/es/components/eftposPay/mx51/index.js +498 -0
- package/es/components/eftposPay/mx51/types.d.ts +142 -0
- package/es/components/eftposPay/mx51/types.js +35 -0
- package/es/components/eftposPay/mx51/utils.d.ts +10 -0
- package/es/components/eftposPay/mx51/utils.js +121 -0
- package/es/components/eftposPay/pay.js +21 -9
- package/es/components/eftposPay/payo/config.js +39 -5
- package/es/components/eftposPay/payo/const.js +1 -1
- package/es/components/eftposPay/payo/hooks.js +3 -12
- package/es/components/eftposPay/payo/payment.js +69 -136
- package/es/components/eftposPay/store/index.d.ts +5 -9
- package/es/components/eftposPay/tip.js +5 -0
- package/es/components/eftposPay/tyro/const.js +1 -1
- package/es/components/eftposPay/tyro/index.js +44 -11
- package/es/components/eftposPay/utils/payLog.d.ts +81 -0
- package/es/components/eftposPay/utils/payLog.js +458 -0
- package/es/components/eftposPay/windcave/const.js +1 -1
- package/es/components/eftposPay/windcave/receiptAction.js +5 -0
- package/es/components/eftposPay/windcave/windcave.js +37 -38
- package/es/components/ticketBooking/utils/formatProductMessage.js +47 -2
- package/lib/components/booking/components/footer/amount.js +3 -3
- package/lib/components/booking/components/footer/utils.js +12 -5
- package/lib/components/booking/components/voucher/index.js +1 -1
- package/lib/components/booking/info2/service/editService/index.js +56 -5
- package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/utils.js +16 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/lib/components/eftpos/PairModal/hooks.js +70 -0
- package/lib/components/eftpos/PairModal/index.d.ts +11 -0
- package/lib/components/eftpos/PairModal/index.js +197 -0
- package/lib/components/eftpos/PairModal/index.less +70 -0
- package/lib/components/eftpos/SettlementModal/Action.d.ts +7 -0
- package/lib/components/eftpos/SettlementModal/Action.js +153 -0
- package/lib/components/eftpos/SettlementModal/index.d.ts +7 -0
- package/lib/components/eftpos/SettlementModal/index.js +170 -0
- package/lib/components/eftpos/SettlementModal/index.less +33 -0
- package/lib/components/eftpos/SettlementModal/serve.d.ts +8 -0
- package/lib/components/eftpos/SettlementModal/serve.js +45 -0
- package/lib/components/eftpos/SettlementModal/types.d.ts +138 -0
- package/lib/components/eftpos/SettlementModal/types.js +43 -0
- package/lib/components/eftpos/SettlementModal/utils.d.ts +18 -0
- package/lib/components/eftpos/SettlementModal/utils.js +248 -0
- package/lib/components/eftpos/assets/mx51SCI.svg +15 -0
- package/lib/components/eftpos/const.d.ts +3 -1
- package/lib/components/eftpos/const.js +2 -0
- package/lib/components/eftpos/device.d.ts +3 -1
- package/lib/components/eftpos/device.js +13 -3
- package/lib/components/eftpos/hooks.d.ts +13 -0
- package/lib/components/eftpos/hooks.js +30 -0
- package/lib/components/eftpos/index.js +121 -8
- package/lib/components/eftpos/index.less +32 -1
- package/lib/components/eftpos/locales.d.ts +80 -0
- package/lib/components/eftpos/locales.js +231 -21
- package/lib/components/eftpos/table.js +30 -2
- package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.js +171 -0
- package/lib/components/eftposPay/aggregatePayment/index.d.ts +2 -1
- package/lib/components/eftposPay/aggregatePayment/index.js +5 -2
- package/lib/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/lib/components/eftposPay/aggregatePayment/mock.js +679 -0
- package/lib/components/eftposPay/aggregatePayment/types.d.ts +12 -12
- package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +173 -123
- package/lib/components/eftposPay/amount.js +13 -1
- package/lib/components/eftposPay/app.js +4 -5
- package/lib/components/eftposPay/component/fail/failCustom.js +10 -2
- package/lib/components/eftposPay/component/fail/index.js +10 -2
- package/lib/components/eftposPay/component/fail/network.js +3 -0
- package/lib/components/eftposPay/component/fail/unknow.js +8 -0
- package/lib/components/eftposPay/component/manual/index.js +16 -2
- package/lib/components/eftposPay/component/signature/index.js +3 -0
- package/lib/components/eftposPay/const.d.ts +8 -3
- package/lib/components/eftposPay/const.js +2 -0
- package/lib/components/eftposPay/device.js +114 -25
- package/lib/components/eftposPay/helper.d.ts +3 -0
- package/lib/components/eftposPay/helper.js +2 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.js +38 -13
- package/lib/components/eftposPay/linkly/const.js +1 -1
- package/lib/components/eftposPay/linkly/hooks/normal.js +22 -43
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +13 -65
- package/lib/components/eftposPay/linkly/index.js +8 -10
- package/lib/components/eftposPay/locales.d.ts +15 -0
- package/lib/components/eftposPay/locales.js +30 -15
- package/lib/components/eftposPay/manufacturer.d.ts +1 -0
- package/lib/components/eftposPay/manufacturer.js +6 -0
- package/lib/components/eftposPay/mx51/Action.d.ts +6 -0
- package/lib/components/eftposPay/mx51/Action.js +154 -0
- package/lib/components/eftposPay/mx51/const.d.ts +5 -0
- package/lib/components/eftposPay/mx51/const.js +85 -0
- package/lib/components/eftposPay/mx51/index.d.ts +6 -0
- package/lib/components/eftposPay/mx51/index.js +433 -0
- package/lib/components/eftposPay/mx51/types.d.ts +142 -0
- package/lib/components/eftposPay/mx51/types.js +43 -0
- package/lib/components/eftposPay/mx51/utils.d.ts +10 -0
- package/lib/components/eftposPay/mx51/utils.js +115 -0
- package/lib/components/eftposPay/pay.js +13 -3
- package/lib/components/eftposPay/payo/config.js +16 -8
- package/lib/components/eftposPay/payo/const.js +1 -1
- package/lib/components/eftposPay/payo/hooks.js +12 -10
- package/lib/components/eftposPay/payo/payment.js +31 -65
- package/lib/components/eftposPay/store/index.d.ts +5 -9
- package/lib/components/eftposPay/tip.js +5 -0
- package/lib/components/eftposPay/tyro/const.js +1 -1
- package/lib/components/eftposPay/tyro/index.js +21 -17
- package/lib/components/eftposPay/utils/payLog.d.ts +81 -0
- package/lib/components/eftposPay/utils/payLog.js +321 -0
- package/lib/components/eftposPay/windcave/const.js +1 -1
- package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
- package/lib/components/eftposPay/windcave/windcave.js +27 -29
- package/lib/components/ticketBooking/utils/formatProductMessage.js +44 -2
- package/package.json +4 -4
- package/es/components/eftposPay/utils/log/index.d.ts +0 -110
- package/es/components/eftposPay/utils/log/index.js +0 -371
- package/lib/components/eftposPay/utils/log/index.d.ts +0 -110
- package/lib/components/eftposPay/utils/log/index.js +0 -294
|
@@ -23,11 +23,17 @@ import Pos from "./pos";
|
|
|
23
23
|
import Drawer from "../booking/components/drawer";
|
|
24
24
|
import Log from "./log";
|
|
25
25
|
import localeTexts from "./locales";
|
|
26
|
-
import { usePairTerminalo } from "./hooks";
|
|
26
|
+
import { usePairRequest, usePairTerminalo, useCheckPairRequest } from "./hooks";
|
|
27
27
|
import DeviceIcon from "./icon/apiKey";
|
|
28
28
|
import ApiKeyIcon from "./icon/device";
|
|
29
29
|
import { getLocale } from "../../utils/locales";
|
|
30
|
+
import { usePairModal } from "./PairModal/hooks";
|
|
31
|
+
import PairModal from "./PairModal/index";
|
|
30
32
|
import { Eftpos, getCommByFields, DeviceEnum, getDefaultValue } from "./const";
|
|
33
|
+
import { Image } from '@pisell/materials';
|
|
34
|
+
import mx51SCISvg from "./assets/mx51SCI.svg";
|
|
35
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
36
|
+
import { request } from "../../utils";
|
|
31
37
|
import "./index.less";
|
|
32
38
|
locales.init(localeTexts, getLocale());
|
|
33
39
|
|
|
@@ -134,6 +140,10 @@ export default (function (props) {
|
|
|
134
140
|
tyroUrl = props.tyroUrl,
|
|
135
141
|
tyroVersion = props.tyroVersion,
|
|
136
142
|
useTyroLog = props.useTyroLog;
|
|
143
|
+
// 设置request
|
|
144
|
+
var context = useEngineContext();
|
|
145
|
+
var utils = context.appHelper.utils || {};
|
|
146
|
+
request.setRequest(utils === null || utils === void 0 ? void 0 : utils.request);
|
|
137
147
|
var _useState3 = useState('list'),
|
|
138
148
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
139
149
|
page = _useState4[0],
|
|
@@ -184,6 +194,13 @@ export default (function (props) {
|
|
|
184
194
|
posLoading = _useState22[0],
|
|
185
195
|
setPosLoading = _useState22[1];
|
|
186
196
|
|
|
197
|
+
// 配对弹窗
|
|
198
|
+
var pairModalHook = usePairModal();
|
|
199
|
+
// 配对请求
|
|
200
|
+
var pairRequest = usePairRequest();
|
|
201
|
+
// 检查配对状态
|
|
202
|
+
var checkPairRequest = useCheckPairRequest();
|
|
203
|
+
|
|
187
204
|
/**
|
|
188
205
|
* @title: 删除设备
|
|
189
206
|
* @param {string} id 设备id
|
|
@@ -258,28 +275,69 @@ export default (function (props) {
|
|
|
258
275
|
*/
|
|
259
276
|
var onRepair = /*#__PURE__*/function () {
|
|
260
277
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(device) {
|
|
261
|
-
var field, list;
|
|
278
|
+
var checkPairResponse, field, list;
|
|
262
279
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
263
280
|
while (1) switch (_context2.prev = _context2.next) {
|
|
264
281
|
case 0:
|
|
282
|
+
console.log('onRepair device = ', device);
|
|
283
|
+
// 特殊操作,如果是MX51设备需要先调用接口查询设备状态,如果设备状态为离线,则需要先调用接口进行重连
|
|
284
|
+
if (!(type === Eftpos.MX51)) {
|
|
285
|
+
_context2.next = 19;
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
_context2.prev = 2;
|
|
289
|
+
setLoading(true);
|
|
290
|
+
_context2.next = 6;
|
|
291
|
+
return checkPairRequest.run({
|
|
292
|
+
type: type,
|
|
293
|
+
pair_response: device === null || device === void 0 ? void 0 : device.response
|
|
294
|
+
});
|
|
295
|
+
case 6:
|
|
296
|
+
checkPairResponse = _context2.sent;
|
|
297
|
+
console.log('checkPairResponse = ', checkPairResponse);
|
|
298
|
+
// code为200表示设备正常连接,提示用户并且不可以继续重配对
|
|
299
|
+
if (!((checkPairResponse === null || checkPairResponse === void 0 ? void 0 : checkPairResponse.code) == 200)) {
|
|
300
|
+
_context2.next = 11;
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
messageApi.open({
|
|
304
|
+
type: 'warning',
|
|
305
|
+
style: {
|
|
306
|
+
zIndex: (zIndex || 9999) + 1
|
|
307
|
+
},
|
|
308
|
+
content: locales.getText('page.eftpos.text.repair.message.warning')
|
|
309
|
+
});
|
|
310
|
+
return _context2.abrupt("return");
|
|
311
|
+
case 11:
|
|
312
|
+
_context2.next = 16;
|
|
313
|
+
break;
|
|
314
|
+
case 13:
|
|
315
|
+
_context2.prev = 13;
|
|
316
|
+
_context2.t0 = _context2["catch"](2);
|
|
317
|
+
console.error('onRepair error =>', _context2.t0);
|
|
318
|
+
case 16:
|
|
319
|
+
_context2.prev = 16;
|
|
320
|
+
setLoading(false);
|
|
321
|
+
return _context2.finish(16);
|
|
322
|
+
case 19:
|
|
265
323
|
field = getField(type, DeviceEnum.Repair);
|
|
266
|
-
_context2.next =
|
|
324
|
+
_context2.next = 22;
|
|
267
325
|
return getCommByFields({
|
|
268
326
|
field: field,
|
|
269
327
|
value: device,
|
|
270
328
|
getComm: getComm
|
|
271
329
|
});
|
|
272
|
-
case
|
|
330
|
+
case 22:
|
|
273
331
|
list = _context2.sent;
|
|
274
332
|
deviceIdRef.current = device.id;
|
|
275
333
|
setDeviceCommList(list);
|
|
276
334
|
setStatus(DeviceEnum.Repair);
|
|
277
335
|
setPage('edit');
|
|
278
|
-
case
|
|
336
|
+
case 27:
|
|
279
337
|
case "end":
|
|
280
338
|
return _context2.stop();
|
|
281
339
|
}
|
|
282
|
-
}, _callee2);
|
|
340
|
+
}, _callee2, null, [[2, 13, 16, 19]]);
|
|
283
341
|
}));
|
|
284
342
|
return function onRepair(_x2) {
|
|
285
343
|
return _ref3.apply(this, arguments);
|
|
@@ -303,34 +361,66 @@ export default (function (props) {
|
|
|
303
361
|
* @Date: 2024-08-20 11:21
|
|
304
362
|
*/
|
|
305
363
|
var onSave = /*#__PURE__*/function () {
|
|
306
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(device) {
|
|
364
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(device, pair_response) {
|
|
307
365
|
var update;
|
|
308
366
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
309
367
|
while (1) switch (_context4.prev = _context4.next) {
|
|
310
368
|
case 0:
|
|
311
369
|
console.log('device = ', device);
|
|
370
|
+
console.log('pair_response = ', pair_response);
|
|
312
371
|
update = /*#__PURE__*/function () {
|
|
313
372
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
373
|
+
var _device$connection;
|
|
314
374
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
315
375
|
while (1) switch (_context3.prev = _context3.next) {
|
|
316
376
|
case 0:
|
|
317
|
-
_context3.
|
|
377
|
+
_context3.prev = 0;
|
|
378
|
+
_context3.next = 3;
|
|
318
379
|
return onEdit(_objectSpread(_objectSpread({}, device), {}, {
|
|
319
|
-
type: type
|
|
320
|
-
|
|
321
|
-
|
|
380
|
+
type: type,
|
|
381
|
+
pair_response: pair_response
|
|
382
|
+
}), status || 'add');
|
|
383
|
+
case 3:
|
|
384
|
+
// MX51 设备在新增与重连时候需单独展示提示信息
|
|
385
|
+
if (type === Eftpos.MX51 && (status === DeviceEnum.Add || status === DeviceEnum.Repair)) {
|
|
386
|
+
messageApi.open({
|
|
387
|
+
type: 'success',
|
|
388
|
+
style: {
|
|
389
|
+
zIndex: (zIndex || 9999) + 1
|
|
390
|
+
},
|
|
391
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
392
|
+
className: "pisell-lowcode__pos_message-custom-content_mx51"
|
|
393
|
+
}, /*#__PURE__*/React.createElement("span", null, "Terminal paired successfully."), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "Pairing Name: ", (device === null || device === void 0 || (_device$connection = device.connection) === null || _device$connection === void 0 ? void 0 : _device$connection.pairing_nickname) || '-'), /*#__PURE__*/React.createElement("span", null, "Pairing ID: ", (pair_response === null || pair_response === void 0 ? void 0 : pair_response.pairing_id) || '-')))
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
_context3.next = 11;
|
|
397
|
+
break;
|
|
398
|
+
case 6:
|
|
399
|
+
_context3.prev = 6;
|
|
400
|
+
_context3.t0 = _context3["catch"](0);
|
|
401
|
+
console.error('onSave error =>', _context3.t0);
|
|
402
|
+
messageApi.open({
|
|
403
|
+
type: 'error',
|
|
404
|
+
style: {
|
|
405
|
+
zIndex: (zIndex || 9999) + 1
|
|
406
|
+
},
|
|
407
|
+
content: (_context3.t0 === null || _context3.t0 === void 0 ? void 0 : _context3.t0.message) || locales.getText('page.eftpos.text.pair.error')
|
|
322
408
|
});
|
|
323
|
-
|
|
409
|
+
return _context3.abrupt("return");
|
|
410
|
+
case 11:
|
|
411
|
+
_context3.prev = 11;
|
|
324
412
|
setLoading(false);
|
|
325
|
-
_context3.
|
|
413
|
+
return _context3.finish(11);
|
|
414
|
+
case 14:
|
|
415
|
+
_context3.next = 16;
|
|
326
416
|
return tableRef.current.loadData();
|
|
327
|
-
case
|
|
417
|
+
case 16:
|
|
328
418
|
setPage('list');
|
|
329
|
-
case
|
|
419
|
+
case 17:
|
|
330
420
|
case "end":
|
|
331
421
|
return _context3.stop();
|
|
332
422
|
}
|
|
333
|
-
}, _callee3);
|
|
423
|
+
}, _callee3, null, [[0, 6, 11, 14]]);
|
|
334
424
|
}));
|
|
335
425
|
return function update() {
|
|
336
426
|
return _ref5.apply(this, arguments);
|
|
@@ -338,7 +428,7 @@ export default (function (props) {
|
|
|
338
428
|
}();
|
|
339
429
|
setLoading(true);
|
|
340
430
|
if (!(type === 'tyro' && status !== 'edit')) {
|
|
341
|
-
_context4.next =
|
|
431
|
+
_context4.next = 7;
|
|
342
432
|
break;
|
|
343
433
|
}
|
|
344
434
|
pair(_objectSpread(_objectSpread({}, config), device.connection), function (response) {
|
|
@@ -379,15 +469,15 @@ export default (function (props) {
|
|
|
379
469
|
update();
|
|
380
470
|
});
|
|
381
471
|
return _context4.abrupt("return");
|
|
382
|
-
case 6:
|
|
383
|
-
update();
|
|
384
472
|
case 7:
|
|
473
|
+
update();
|
|
474
|
+
case 8:
|
|
385
475
|
case "end":
|
|
386
476
|
return _context4.stop();
|
|
387
477
|
}
|
|
388
478
|
}, _callee4);
|
|
389
479
|
}));
|
|
390
|
-
return function onSave(_x3) {
|
|
480
|
+
return function onSave(_x3, _x4) {
|
|
391
481
|
return _ref4.apply(this, arguments);
|
|
392
482
|
};
|
|
393
483
|
}();
|
|
@@ -479,6 +569,78 @@ export default (function (props) {
|
|
|
479
569
|
useEffect(function () {
|
|
480
570
|
setPage('list');
|
|
481
571
|
}, [type]);
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* @title 保存配对信息
|
|
575
|
+
* @description MX51设备配对的第一步不是直接保存,而是要先发起配对请求,等刷卡机上配对后,再保存
|
|
576
|
+
*/
|
|
577
|
+
var onSavePair = /*#__PURE__*/function () {
|
|
578
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(device) {
|
|
579
|
+
var eftposList, response;
|
|
580
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
581
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
582
|
+
case 0:
|
|
583
|
+
eftposList = [Eftpos.MX51]; // MX51 设备在新增与重连时候需单独发起配对请求
|
|
584
|
+
if (!(eftposList.includes(type) && (status === DeviceEnum.Add || status === DeviceEnum.Repair))) {
|
|
585
|
+
_context6.next = 19;
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
_context6.prev = 2;
|
|
589
|
+
setLoading(true);
|
|
590
|
+
_context6.next = 6;
|
|
591
|
+
return pairRequest.run(_objectSpread(_objectSpread({}, (device === null || device === void 0 ? void 0 : device.connection) || {}), {}, {
|
|
592
|
+
type: type
|
|
593
|
+
}));
|
|
594
|
+
case 6:
|
|
595
|
+
response = _context6.sent;
|
|
596
|
+
if ((response === null || response === void 0 ? void 0 : response.code) == 200) {
|
|
597
|
+
pairModalHook.open({
|
|
598
|
+
data: {
|
|
599
|
+
type: type,
|
|
600
|
+
device: device,
|
|
601
|
+
pairResponse: response === null || response === void 0 ? void 0 : response.data
|
|
602
|
+
},
|
|
603
|
+
onCancel: function onCancel() {
|
|
604
|
+
pairModalHook.close();
|
|
605
|
+
},
|
|
606
|
+
onConfirm: function onConfirm() {
|
|
607
|
+
pairModalHook.close();
|
|
608
|
+
onSave(device, response === null || response === void 0 ? void 0 : response.data);
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
_context6.next = 14;
|
|
613
|
+
break;
|
|
614
|
+
case 10:
|
|
615
|
+
_context6.prev = 10;
|
|
616
|
+
_context6.t0 = _context6["catch"](2);
|
|
617
|
+
console.error('onSavePair error =>', _context6.t0);
|
|
618
|
+
messageApi.open({
|
|
619
|
+
type: 'error',
|
|
620
|
+
style: {
|
|
621
|
+
zIndex: (zIndex || 9999) + 1
|
|
622
|
+
},
|
|
623
|
+
content: (_context6.t0 === null || _context6.t0 === void 0 ? void 0 : _context6.t0.message) || locales.getText('page.eftpos.text.pair.error')
|
|
624
|
+
});
|
|
625
|
+
case 14:
|
|
626
|
+
_context6.prev = 14;
|
|
627
|
+
setLoading(false);
|
|
628
|
+
return _context6.finish(14);
|
|
629
|
+
case 17:
|
|
630
|
+
_context6.next = 20;
|
|
631
|
+
break;
|
|
632
|
+
case 19:
|
|
633
|
+
onSave(device);
|
|
634
|
+
case 20:
|
|
635
|
+
case "end":
|
|
636
|
+
return _context6.stop();
|
|
637
|
+
}
|
|
638
|
+
}, _callee6, null, [[2, 10, 14, 17]]);
|
|
639
|
+
}));
|
|
640
|
+
return function onSavePair(_x5) {
|
|
641
|
+
return _ref7.apply(this, arguments);
|
|
642
|
+
};
|
|
643
|
+
}();
|
|
482
644
|
if (type === Eftpos.Windcave) {
|
|
483
645
|
// 使用 stripe 支付 需要设置 商家参数
|
|
484
646
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PosTabs, {
|
|
@@ -567,7 +729,17 @@ export default (function (props) {
|
|
|
567
729
|
}), /*#__PURE__*/React.createElement(Drawer, {
|
|
568
730
|
open: page === 'edit',
|
|
569
731
|
onClose: onBack,
|
|
570
|
-
title:
|
|
732
|
+
title: type === Eftpos.MX51 ? /*#__PURE__*/React.createElement("span", {
|
|
733
|
+
style: {
|
|
734
|
+
display: 'inline-flex',
|
|
735
|
+
alignItems: 'center',
|
|
736
|
+
gap: '4px'
|
|
737
|
+
}
|
|
738
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
739
|
+
src: mx51SCISvg,
|
|
740
|
+
preview: false,
|
|
741
|
+
width: 24
|
|
742
|
+
}), /*#__PURE__*/React.createElement("span", null, locales.getText('page.eftpos.text.simple.cloud.integration'))) : locales.getText('page.eftpos.text.device.add')(status, name),
|
|
571
743
|
titleNoWrap: true,
|
|
572
744
|
zIndex: zIndex || 9999,
|
|
573
745
|
destroyOnClose: true,
|
|
@@ -578,8 +750,10 @@ export default (function (props) {
|
|
|
578
750
|
wrapperClassName: "pisell-lowcode__pos_box"
|
|
579
751
|
}, /*#__PURE__*/React.createElement(Device, {
|
|
580
752
|
formItemList: deviceItemList,
|
|
581
|
-
onSave:
|
|
582
|
-
key: "device".concat(type)
|
|
753
|
+
onSave: onSavePair,
|
|
754
|
+
key: "device".concat(type),
|
|
755
|
+
type: type,
|
|
756
|
+
status: status
|
|
583
757
|
}, pairStatus ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
584
758
|
label: "Status"
|
|
585
759
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
@@ -603,5 +777,5 @@ export default (function (props) {
|
|
|
603
777
|
tyroUrl: tyroUrl,
|
|
604
778
|
tyroVersion: tyroVersion,
|
|
605
779
|
device: deviceItem
|
|
606
|
-
})), contextHolder);
|
|
780
|
+
})), contextHolder, pairModalHook.visible && /*#__PURE__*/React.createElement(PairModal, pairModalHook.modalProps));
|
|
607
781
|
});
|
|
@@ -88,7 +88,6 @@
|
|
|
88
88
|
display: flex;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
92
91
|
.pisell-lowcode__pos_drawer {
|
|
93
92
|
transform: translateZ(0);
|
|
94
93
|
}
|
|
@@ -204,3 +203,35 @@
|
|
|
204
203
|
display: flex;
|
|
205
204
|
flex-direction: column;
|
|
206
205
|
}
|
|
206
|
+
.pisell-lowcode__pos-device-pair-text {
|
|
207
|
+
padding: 0 24px 0 34px;
|
|
208
|
+
color: #101828;
|
|
209
|
+
font-size: 14px;
|
|
210
|
+
font-weight: 400;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.pisell-lowcode__pos_message
|
|
214
|
+
.pisell-lowcode__pos_message-notice-content
|
|
215
|
+
.pisell-lowcode__pos_message-success {
|
|
216
|
+
display: flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.pisell-lowcode__pos_message-custom-content_mx51 {
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
align-items: flex-start;
|
|
224
|
+
justify-content: center;
|
|
225
|
+
|
|
226
|
+
> span:last-child {
|
|
227
|
+
display: flex;
|
|
228
|
+
gap: 10px;
|
|
229
|
+
flex-wrap: wrap;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.pisell-lowcode__booking-drawer-title-wrap
|
|
234
|
+
.pisell-lowcode__booking-drawer-title-line {
|
|
235
|
+
display: flex;
|
|
236
|
+
align-items: center;
|
|
237
|
+
}
|
|
@@ -15,6 +15,7 @@ declare const _default: {
|
|
|
15
15
|
'page.eftpos.text.edit': string;
|
|
16
16
|
'page.eftpos.text.delete': string;
|
|
17
17
|
'page.eftpos.text.save': string;
|
|
18
|
+
'page.eftpos.text.pair': string;
|
|
18
19
|
'page.eftpos.text.confim.delete': string;
|
|
19
20
|
'page.eftpos.text.confirm_delete-message': (x: string) => string;
|
|
20
21
|
'page.eftpos.text.confim.cancel': string;
|
|
@@ -27,9 +28,24 @@ declare const _default: {
|
|
|
27
28
|
'page.eftpos.text.table.del.delete': string;
|
|
28
29
|
'page.eftpos.text.table.del.cancel': string;
|
|
29
30
|
'page.eftpos.text.log': string;
|
|
31
|
+
'page.eftpos.text.settlement': string;
|
|
32
|
+
'page.eftpos.text.settlement_enquiry': string;
|
|
33
|
+
'page.eftpos.text.simple.cloud.integration': string;
|
|
34
|
+
'page.eftpos.text.simple.cloud.integration.steps': string[];
|
|
30
35
|
'page.eftpos.text.setting': string;
|
|
31
36
|
'page.eftpos.text.setting.tip': string;
|
|
32
37
|
'page.eftpos.text.setting.btn': string;
|
|
38
|
+
'page.eftpos.text.pair.modal.content.text-info': (status: string) => {
|
|
39
|
+
title: string;
|
|
40
|
+
description: string;
|
|
41
|
+
codeTitle: string;
|
|
42
|
+
cancenButtonText: string;
|
|
43
|
+
okButtonText: string;
|
|
44
|
+
} | undefined;
|
|
45
|
+
'page.eftpos.text.repair.message.warning': string;
|
|
46
|
+
'page.eftpos.text.settlement.failed': string;
|
|
47
|
+
'page.eftpos.text.settlement.button.done': string;
|
|
48
|
+
'page.eftpos.text.pair.error': string;
|
|
33
49
|
};
|
|
34
50
|
'zh-CN': {
|
|
35
51
|
'page.eftpos.text.manufacturer': string;
|
|
@@ -47,6 +63,7 @@ declare const _default: {
|
|
|
47
63
|
'page.eftpos.text.edit': string;
|
|
48
64
|
'page.eftpos.text.delete': string;
|
|
49
65
|
'page.eftpos.text.save': string;
|
|
66
|
+
'page.eftpos.text.pair': string;
|
|
50
67
|
'page.eftpos.text.confim.delete': string;
|
|
51
68
|
'page.eftpos.text.confirm_delete-message': (x: string) => string;
|
|
52
69
|
'page.eftpos.text.confim.cancel': string;
|
|
@@ -59,9 +76,24 @@ declare const _default: {
|
|
|
59
76
|
'page.eftpos.text.table.del.delete': string;
|
|
60
77
|
'page.eftpos.text.table.del.cancel': string;
|
|
61
78
|
'page.eftpos.text.log': string;
|
|
79
|
+
'page.eftpos.text.settlement': string;
|
|
80
|
+
'page.eftpos.text.settlement_enquiry': string;
|
|
81
|
+
'page.eftpos.text.simple.cloud.integration': string;
|
|
82
|
+
'page.eftpos.text.simple.cloud.integration.steps': string[];
|
|
62
83
|
'page.eftpos.text.setting': string;
|
|
63
84
|
'page.eftpos.text.setting.tip': string;
|
|
64
85
|
'page.eftpos.text.setting.btn': string;
|
|
86
|
+
'page.eftpos.text.pair.modal.content.text-info': (status: string) => {
|
|
87
|
+
title: string;
|
|
88
|
+
description: string;
|
|
89
|
+
codeTitle: string;
|
|
90
|
+
cancenButtonText: string;
|
|
91
|
+
okButtonText: string;
|
|
92
|
+
} | undefined;
|
|
93
|
+
'page.eftpos.text.repair.message.warning': string;
|
|
94
|
+
'page.eftpos.text.settlement.failed': string;
|
|
95
|
+
'page.eftpos.text.settlement.button.done': string;
|
|
96
|
+
'page.eftpos.text.pair.error': string;
|
|
65
97
|
};
|
|
66
98
|
'zh-HK': {
|
|
67
99
|
'page.eftpos.text.manufacturer': string;
|
|
@@ -79,6 +111,7 @@ declare const _default: {
|
|
|
79
111
|
'page.eftpos.text.edit': string;
|
|
80
112
|
'page.eftpos.text.delete': string;
|
|
81
113
|
'page.eftpos.text.save': string;
|
|
114
|
+
'page.eftpos.text.pair': string;
|
|
82
115
|
'page.eftpos.text.confim.delete': string;
|
|
83
116
|
'page.eftpos.text.confirm_delete-message': (x: string) => string;
|
|
84
117
|
'page.eftpos.text.confim.cancel': string;
|
|
@@ -91,9 +124,24 @@ declare const _default: {
|
|
|
91
124
|
'page.eftpos.text.table.del.delete': string;
|
|
92
125
|
'page.eftpos.text.table.del.cancel': string;
|
|
93
126
|
'page.eftpos.text.log': string;
|
|
127
|
+
'page.eftpos.text.settlement': string;
|
|
128
|
+
'page.eftpos.text.settlement_enquiry': string;
|
|
129
|
+
'page.eftpos.text.simple.cloud.integration': string;
|
|
130
|
+
'page.eftpos.text.simple.cloud.integration.steps': string[];
|
|
94
131
|
'page.eftpos.text.setting': string;
|
|
95
132
|
'page.eftpos.text.setting.tip': string;
|
|
96
133
|
'page.eftpos.text.setting.btn': string;
|
|
134
|
+
'page.eftpos.text.pair.modal.content.text-info': (status: string) => {
|
|
135
|
+
title: string;
|
|
136
|
+
description: string;
|
|
137
|
+
codeTitle: string;
|
|
138
|
+
cancenButtonText: string;
|
|
139
|
+
okButtonText: string;
|
|
140
|
+
} | undefined;
|
|
141
|
+
'page.eftpos.text.repair.message.warning': string;
|
|
142
|
+
'page.eftpos.text.settlement.failed': string;
|
|
143
|
+
'page.eftpos.text.settlement.button.done': string;
|
|
144
|
+
'page.eftpos.text.pair.error': string;
|
|
97
145
|
};
|
|
98
146
|
ja: {
|
|
99
147
|
'page.eftpos.text.manufacturer': string;
|
|
@@ -111,6 +159,7 @@ declare const _default: {
|
|
|
111
159
|
'page.eftpos.text.edit': string;
|
|
112
160
|
'page.eftpos.text.delete': string;
|
|
113
161
|
'page.eftpos.text.save': string;
|
|
162
|
+
'page.eftpos.text.pair': string;
|
|
114
163
|
'page.eftpos.text.confim.delete': string;
|
|
115
164
|
'page.eftpos.text.confirm_delete-message': (x: string) => string;
|
|
116
165
|
'page.eftpos.text.confim.cancel': string;
|
|
@@ -123,9 +172,24 @@ declare const _default: {
|
|
|
123
172
|
'page.eftpos.text.table.del.delete': string;
|
|
124
173
|
'page.eftpos.text.table.del.cancel': string;
|
|
125
174
|
'page.eftpos.text.log': string;
|
|
175
|
+
'page.eftpos.text.settlement': string;
|
|
176
|
+
'page.eftpos.text.settlement_enquiry': string;
|
|
177
|
+
'page.eftpos.text.simple.cloud.integration': string;
|
|
178
|
+
'page.eftpos.text.simple.cloud.integration.steps': string[];
|
|
126
179
|
'page.eftpos.text.setting': string;
|
|
127
180
|
'page.eftpos.text.setting.tip': string;
|
|
128
181
|
'page.eftpos.text.setting.btn': string;
|
|
182
|
+
'page.eftpos.text.pair.modal.content.text-info': (status: string) => {
|
|
183
|
+
title: string;
|
|
184
|
+
description: string;
|
|
185
|
+
codeTitle: string;
|
|
186
|
+
cancenButtonText: string;
|
|
187
|
+
okButtonText: string;
|
|
188
|
+
} | undefined;
|
|
189
|
+
'page.eftpos.text.repair.message.warning': string;
|
|
190
|
+
'page.eftpos.text.settlement.failed': string;
|
|
191
|
+
'page.eftpos.text.settlement.button.done': string;
|
|
192
|
+
'page.eftpos.text.pair.error': string;
|
|
129
193
|
};
|
|
130
194
|
pt: {
|
|
131
195
|
'page.eftpos.text.manufacturer': string;
|
|
@@ -143,6 +207,7 @@ declare const _default: {
|
|
|
143
207
|
'page.eftpos.text.edit': string;
|
|
144
208
|
'page.eftpos.text.delete': string;
|
|
145
209
|
'page.eftpos.text.save': string;
|
|
210
|
+
'page.eftpos.text.pair': string;
|
|
146
211
|
'page.eftpos.text.confim.delete': string;
|
|
147
212
|
'page.eftpos.text.confirm_delete-message': (x: string) => string;
|
|
148
213
|
'page.eftpos.text.confim.cancel': string;
|
|
@@ -155,9 +220,24 @@ declare const _default: {
|
|
|
155
220
|
'page.eftpos.text.table.del.delete': string;
|
|
156
221
|
'page.eftpos.text.table.del.cancel': string;
|
|
157
222
|
'page.eftpos.text.log': string;
|
|
223
|
+
'page.eftpos.text.settlement': string;
|
|
224
|
+
'page.eftpos.text.settlement_enquiry': string;
|
|
225
|
+
'page.eftpos.text.simple.cloud.integration': string;
|
|
226
|
+
'page.eftpos.text.simple.cloud.integration.steps': string[];
|
|
158
227
|
'page.eftpos.text.setting': string;
|
|
159
228
|
'page.eftpos.text.setting.tip': string;
|
|
160
229
|
'page.eftpos.text.setting.btn': string;
|
|
230
|
+
'page.eftpos.text.pair.modal.content.text-info': (status: string) => {
|
|
231
|
+
title: string;
|
|
232
|
+
description: string;
|
|
233
|
+
codeTitle: string;
|
|
234
|
+
cancenButtonText: string;
|
|
235
|
+
okButtonText: string;
|
|
236
|
+
} | undefined;
|
|
237
|
+
'page.eftpos.text.repair.message.warning': string;
|
|
238
|
+
'page.eftpos.text.settlement.failed': string;
|
|
239
|
+
'page.eftpos.text.settlement.button.done': string;
|
|
240
|
+
'page.eftpos.text.pair.error': string;
|
|
161
241
|
};
|
|
162
242
|
};
|
|
163
243
|
export default _default;
|