@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.
Files changed (101) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +3 -3
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/components/booking/addons/model.d.ts +1 -2
  12. package/es/components/booking/forms/model.d.ts +1 -2
  13. package/es/components/booking/notes/index.d.ts +1 -1
  14. package/es/components/booking/notes/model.d.ts +1 -2
  15. package/es/components/booking/payments/model.d.ts +1 -2
  16. package/es/components/eftposPay/amount.d.ts +4 -3
  17. package/es/components/eftposPay/amount.js +5 -4
  18. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -1
  19. package/es/components/eftposPay/component/fail/failCustom.js +14 -6
  20. package/es/components/eftposPay/component/fail/index.d.ts +1 -1
  21. package/es/components/eftposPay/component/fail/index.js +14 -5
  22. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -1
  23. package/es/components/eftposPay/component/fail/unknow.js +17 -7
  24. package/es/components/eftposPay/const.d.ts +8 -2
  25. package/es/components/eftposPay/const.js +5 -0
  26. package/es/components/eftposPay/device.d.ts +4 -3
  27. package/es/components/eftposPay/device.js +5 -4
  28. package/es/components/eftposPay/hooks.d.ts +4 -3
  29. package/es/components/eftposPay/hooks.js +31 -6
  30. package/es/components/eftposPay/index.js +57 -23
  31. package/es/components/eftposPay/index.less +1 -0
  32. package/es/components/eftposPay/locales.d.ts +6 -0
  33. package/es/components/eftposPay/locales.js +6 -0
  34. package/es/components/eftposPay/pay.d.ts +3 -2
  35. package/es/components/eftposPay/pay.js +8 -7
  36. package/es/components/eftposPay/payo/config.d.ts +3 -1
  37. package/es/components/eftposPay/payo/config.js +11 -9
  38. package/es/components/eftposPay/payo/const.js +4 -2
  39. package/es/components/eftposPay/payo/index.js +3 -1
  40. package/es/components/eftposPay/store/index.d.ts +17 -2
  41. package/es/components/eftposPay/store/index.js +20 -0
  42. package/es/components/eftposPay/tyro/const.js +4 -2
  43. package/es/components/eftposPay/tyro/index.js +70 -20
  44. package/es/components/eftposPay/windcave/const.js +4 -2
  45. package/es/components/eftposPay/windcave/helper.js +19 -28
  46. package/es/components/eftposPay/windcave/windcave.js +2 -1
  47. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +10 -4
  48. package/es/components/pisellSelectCustomerModal/RightPanel/index.js +5 -3
  49. package/es/components/pisellSelectCustomerModal/RightPanel/index.less +7 -0
  50. package/es/components/pisellSelectCustomerModal/index.js +7 -1
  51. package/es/components/pisellSelectCustomerModal/index.less +6 -0
  52. package/es/components/pisellSelectCustomerModal/locales.d.ts +6 -0
  53. package/es/components/pisellSelectCustomerModal/locales.js +9 -3
  54. package/es/components/schedules/index.d.ts +1 -1
  55. package/es/components/schedules/model.d.ts +1 -2
  56. package/lib/components/booking/addons/model.d.ts +1 -2
  57. package/lib/components/booking/forms/model.d.ts +1 -2
  58. package/lib/components/booking/notes/index.d.ts +1 -1
  59. package/lib/components/booking/notes/model.d.ts +1 -2
  60. package/lib/components/booking/payments/model.d.ts +1 -2
  61. package/lib/components/eftposPay/amount.d.ts +4 -3
  62. package/lib/components/eftposPay/amount.js +4 -3
  63. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -1
  64. package/lib/components/eftposPay/component/fail/failCustom.js +16 -4
  65. package/lib/components/eftposPay/component/fail/index.d.ts +1 -1
  66. package/lib/components/eftposPay/component/fail/index.js +17 -4
  67. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -1
  68. package/lib/components/eftposPay/component/fail/unknow.js +15 -3
  69. package/lib/components/eftposPay/const.d.ts +8 -2
  70. package/lib/components/eftposPay/const.js +7 -0
  71. package/lib/components/eftposPay/device.d.ts +4 -3
  72. package/lib/components/eftposPay/device.js +5 -4
  73. package/lib/components/eftposPay/hooks.d.ts +4 -3
  74. package/lib/components/eftposPay/hooks.js +30 -8
  75. package/lib/components/eftposPay/index.js +46 -18
  76. package/lib/components/eftposPay/index.less +1 -0
  77. package/lib/components/eftposPay/locales.d.ts +6 -0
  78. package/lib/components/eftposPay/locales.js +6 -0
  79. package/lib/components/eftposPay/pay.d.ts +3 -2
  80. package/lib/components/eftposPay/pay.js +7 -6
  81. package/lib/components/eftposPay/payo/config.d.ts +3 -1
  82. package/lib/components/eftposPay/payo/config.js +8 -8
  83. package/lib/components/eftposPay/payo/const.js +2 -0
  84. package/lib/components/eftposPay/payo/index.js +1 -1
  85. package/lib/components/eftposPay/store/index.d.ts +17 -2
  86. package/lib/components/eftposPay/store/index.js +14 -0
  87. package/lib/components/eftposPay/tyro/const.js +2 -0
  88. package/lib/components/eftposPay/tyro/index.js +63 -6
  89. package/lib/components/eftposPay/windcave/const.js +2 -0
  90. package/lib/components/eftposPay/windcave/helper.js +23 -28
  91. package/lib/components/eftposPay/windcave/windcave.js +2 -1
  92. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +3 -0
  93. package/lib/components/pisellSelectCustomerModal/RightPanel/index.js +5 -3
  94. package/lib/components/pisellSelectCustomerModal/RightPanel/index.less +7 -0
  95. package/lib/components/pisellSelectCustomerModal/index.js +7 -0
  96. package/lib/components/pisellSelectCustomerModal/index.less +6 -0
  97. package/lib/components/pisellSelectCustomerModal/locales.d.ts +6 -0
  98. package/lib/components/pisellSelectCustomerModal/locales.js +9 -3
  99. package/lib/components/schedules/index.d.ts +1 -1
  100. package/lib/components/schedules/model.d.ts +1 -2
  101. package/package.json +2 -2
@@ -19,7 +19,7 @@ import { useTyro } from "./hooks";
19
19
  import { locales } from '@pisell/utils';
20
20
  import { Button } from 'antd';
21
21
  import { useDispatch, useContextData, updateState, updateCustom, updateComponent } from "../store";
22
- import { ModeEnum } from "../const";
22
+ import { ModeEnum, ClientEnum } from "../const";
23
23
  import { Decimal } from 'decimal.js';
24
24
  import { getUuid, getPayParams } from "../helper";
25
25
  import Step from "../component/step/step";
@@ -35,7 +35,8 @@ export default (function (_ref) {
35
35
  eftpos = _useContextData.eftpos,
36
36
  custom = _useContextData.custom,
37
37
  mode = _useContextData.mode,
38
- payStatus = _useContextData.status;
38
+ payStatus = _useContextData.status,
39
+ client = _useContextData.client;
39
40
  var dispatch = useDispatch();
40
41
  var _useState = useState(-1),
41
42
  _useState2 = _slicedToArray(_useState, 2),
@@ -64,11 +65,15 @@ export default (function (_ref) {
64
65
  var requestParams = useRef(custom === null || custom === void 0 ? void 0 : custom.requestParams);
65
66
  var listRef = useRef((custom === null || custom === void 0 ? void 0 : custom.list) || []);
66
67
  var iClientRef = useRef();
68
+ var requestIdRef = useRef((custom === null || custom === void 0 ? void 0 : custom.requestId) || '');
67
69
  var unloadRef = useRef(false);
68
70
  var clearRef = useRef();
69
71
  useEffect(function () {
70
72
  listRef.current = (custom === null || custom === void 0 ? void 0 : custom.list) || [];
71
73
  }, [custom === null || custom === void 0 ? void 0 : custom.list]);
74
+ useEffect(function () {
75
+ requestIdRef.current = (custom === null || custom === void 0 ? void 0 : custom.requestId) || '';
76
+ }, [custom === null || custom === void 0 ? void 0 : custom.requestId]);
72
77
  useEffect(function () {
73
78
  requestParams.current = custom === null || custom === void 0 ? void 0 : custom.requestParams;
74
79
  }, [custom === null || custom === void 0 ? void 0 : custom.requestParams]);
@@ -112,7 +117,7 @@ export default (function (_ref) {
112
117
  * @Date: 2024-08-19 11:32
113
118
  */
114
119
  var refundOrder = function refundOrder() {
115
- var _deviceRef$current, _deviceRef$current$se;
120
+ var _deviceRef$current, _deviceRef$current$se, _deviceRef$current2;
116
121
  var iClient = iClientRef.current;
117
122
  if (!iClient) {
118
123
  return;
@@ -142,6 +147,26 @@ export default (function (_ref) {
142
147
  }));
143
148
  setStatus(Date.now());
144
149
  merchantReceiptRef.current = {};
150
+ // 退款 记录
151
+ api.addTransaction({
152
+ order_id: orderIdRef.current,
153
+ number: numRef.current,
154
+ card_reader_id: (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.id,
155
+ card_reader_type: eftpos,
156
+ amount: requestParams.current.amount,
157
+ action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
158
+ status: 'pending',
159
+ request: requestParams.current,
160
+ response: {},
161
+ metadata: {
162
+ receipt: []
163
+ }
164
+ }).then(function (res) {
165
+ requestIdRef.current = res.data.id;
166
+ dispatch(updateCustom({
167
+ requestId: res.data.id
168
+ }));
169
+ });
145
170
  iClient.initiateRefund(requestParams.current, {
146
171
  receiptCallback: receiptCallbackImpl,
147
172
  transactionCompleteCallback: transactionCompleteCallbackImpl,
@@ -158,7 +183,7 @@ export default (function (_ref) {
158
183
  * @Date: 2024-08-19 11:33
159
184
  */
160
185
  var payOrder = function payOrder() {
161
- var _deviceRef$current2, _deviceRef$current2$s, _payRef$current, _deviceRef$current3, _deviceRef$current3$s, _deviceRef$current4, _deviceRef$current4$s;
186
+ var _deviceRef$current3, _deviceRef$current3$s, _payRef$current, _deviceRef$current4, _deviceRef$current4$s, _deviceRef$current5, _deviceRef$current5$s, _deviceRef$current6;
162
187
  var iClient = iClientRef.current;
163
188
  if (!iClient) {
164
189
  return;
@@ -174,14 +199,14 @@ export default (function (_ref) {
174
199
  dispatch(updateState({
175
200
  number: numRef.current
176
201
  }));
177
- console.log('deviceRef.current?.settings?.useOriginSurcharge = ', (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : (_deviceRef$current2$s = _deviceRef$current2.setting) === null || _deviceRef$current2$s === void 0 ? void 0 : _deviceRef$current2$s.useOriginSurcharge);
202
+ console.log('deviceRef.current?.settings?.useOriginSurcharge = ', (_deviceRef$current3 = deviceRef.current) === null || _deviceRef$current3 === void 0 ? void 0 : (_deviceRef$current3$s = _deviceRef$current3.setting) === null || _deviceRef$current3$s === void 0 ? void 0 : _deviceRef$current3$s.useOriginSurcharge);
178
203
  // (deviceRef.current?.setting as { receipts?: boolean })
179
204
  requestParams.current = {
180
205
  amount: new Decimal((_payRef$current = payRef.current) === null || _payRef$current === void 0 ? void 0 : _payRef$current.total).mul(100).toFixed(0, Decimal.ROUND_HALF_UP),
181
206
  // 手续费 true tyro 手续费, false 系统手续费
182
- enableSurcharge: ((_deviceRef$current3 = deviceRef.current) === null || _deviceRef$current3 === void 0 ? void 0 : (_deviceRef$current3$s = _deviceRef$current3.setting) === null || _deviceRef$current3$s === void 0 ? void 0 : _deviceRef$current3$s.useOriginSurcharge) || false,
207
+ enableSurcharge: ((_deviceRef$current4 = deviceRef.current) === null || _deviceRef$current4 === void 0 ? void 0 : (_deviceRef$current4$s = _deviceRef$current4.setting) === null || _deviceRef$current4$s === void 0 ? void 0 : _deviceRef$current4$s.useOriginSurcharge) || false,
183
208
  // 打印小票 true 打印到系统上 false 打印到pos机上
184
- integratedReceipt: !((_deviceRef$current4 = deviceRef.current) !== null && _deviceRef$current4 !== void 0 && (_deviceRef$current4$s = _deviceRef$current4.setting) !== null && _deviceRef$current4$s !== void 0 && _deviceRef$current4$s.receipts),
209
+ integratedReceipt: !((_deviceRef$current5 = deviceRef.current) !== null && _deviceRef$current5 !== void 0 && (_deviceRef$current5$s = _deviceRef$current5.setting) !== null && _deviceRef$current5$s !== void 0 && _deviceRef$current5$s.receipts),
185
210
  integrationKey: integrationKey,
186
211
  transactionId: numRef.current,
187
212
  mid: mid,
@@ -192,6 +217,26 @@ export default (function (_ref) {
192
217
  }));
193
218
  setStatus(Date.now());
194
219
  merchantReceiptRef.current = {};
220
+ // 支付 记录
221
+ api.addTransaction({
222
+ order_id: orderIdRef.current,
223
+ number: numRef.current,
224
+ card_reader_id: (_deviceRef$current6 = deviceRef.current) === null || _deviceRef$current6 === void 0 ? void 0 : _deviceRef$current6.id,
225
+ card_reader_type: eftpos,
226
+ amount: requestParams.current.amount,
227
+ action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
228
+ status: 'pending',
229
+ request: requestParams.current,
230
+ response: {},
231
+ metadata: {
232
+ receipt: []
233
+ }
234
+ }).then(function (res) {
235
+ requestIdRef.current = res.data.id;
236
+ dispatch(updateCustom({
237
+ requestId: res.data.id
238
+ }));
239
+ });
195
240
  iClient.initiatePurchase(requestParams.current, {
196
241
  receiptCallback: receiptCallbackImpl,
197
242
  transactionCompleteCallback: transactionCompleteCallbackImpl,
@@ -215,6 +260,7 @@ export default (function (_ref) {
215
260
  }
216
261
  setStatus(Date.now());
217
262
  merchantReceiptRef.current = {};
263
+ // 恢复 记录
218
264
  iClient.continueLastTransaction({
219
265
  receiptCallback: receiptCallbackImpl,
220
266
  transactionCompleteCallback: transactionCompleteCallbackImpl,
@@ -235,12 +281,10 @@ export default (function (_ref) {
235
281
  merchantReceipt = _ref3.merchantReceipt;
236
282
  console.log('商家小票 客户端是否打印小票 = ', signatureRequired);
237
283
  console.log('商家小票 小票内容 = \n', merchantReceipt);
238
- // if (signatureRequired) {
239
284
  var receipt = [merchantReceipt].filter(function (item) {
240
285
  return typeof item === 'string';
241
286
  }).filter(Boolean);
242
287
  onChange('print', receipt);
243
- // }
244
288
  merchantReceiptRef.current = {
245
289
  signatureRequired: signatureRequired,
246
290
  merchantReceipt: merchantReceipt
@@ -329,7 +373,7 @@ export default (function (_ref) {
329
373
  * @Date: 2024-08-19 11:35
330
374
  */
331
375
  var transactionCompleteCallbackImpl = function transactionCompleteCallbackImpl(response) {
332
- var _deviceRef$current5;
376
+ var _deviceRef$current7;
333
377
  setStatus(-1);
334
378
  setManually(false);
335
379
  console.log('Response = ' + JSON.stringify(response), ', Request = ', JSON.stringify(requestParams.current));
@@ -338,15 +382,15 @@ export default (function (_ref) {
338
382
  response === null || response === void 0 ? void 0 : response.customerReceipt].filter(function (item) {
339
383
  return typeof item === 'string';
340
384
  }).filter(Boolean);
341
- api.addTransaction({
385
+ api.editTransaction(requestIdRef.current, {
342
386
  order_id: orderIdRef.current,
343
387
  number: numRef.current,
344
- card_reader_id: (_deviceRef$current5 = deviceRef.current) === null || _deviceRef$current5 === void 0 ? void 0 : _deviceRef$current5.id,
388
+ card_reader_id: (_deviceRef$current7 = deviceRef.current) === null || _deviceRef$current7 === void 0 ? void 0 : _deviceRef$current7.id,
345
389
  card_reader_type: eftpos,
346
390
  amount: requestParams.current.amount,
347
391
  action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
348
- status: response.result === 'APPROVED' ? 'succeed' : 'failed',
349
392
  request: requestParams.current,
393
+ status: response.result === 'APPROVED' ? 'succeed' : 'failed',
350
394
  response: _objectSpread(_objectSpread({}, response), {}, {
351
395
  merchantReceipt: merchantReceiptRef.current
352
396
  }),
@@ -369,7 +413,7 @@ export default (function (_ref) {
369
413
  card_reader_surcharge: response.surchargeAmount || 0
370
414
  }));
371
415
  clearRef.current = setTimeout(function () {
372
- var _deviceRef$current6;
416
+ var _deviceRef$current8;
373
417
  var params = getPayParams({
374
418
  mode: modeRef.current,
375
419
  amount: amountRef.current,
@@ -382,13 +426,13 @@ export default (function (_ref) {
382
426
  }
383
427
  }, 'success');
384
428
  onChange('success', _objectSpread(_objectSpread({}, params), {}, {
385
- receipt: (_deviceRef$current6 = deviceRef.current) !== null && _deviceRef$current6 !== void 0 && _deviceRef$current6.setting.receipts ? [] : receipt
429
+ receipt: (_deviceRef$current8 = deviceRef.current) !== null && _deviceRef$current8 !== void 0 && _deviceRef$current8.setting.receipts ? [] : receipt
386
430
  }));
387
431
  }, 1000);
388
432
  return;
389
433
  } else {
390
- var _deviceRef$current7;
391
- var current = (_deviceRef$current7 = deviceRef.current) !== null && _deviceRef$current7 !== void 0 && _deviceRef$current7.setting.receipts ? [] : receipt;
434
+ var _deviceRef$current9;
435
+ var current = (_deviceRef$current9 = deviceRef.current) !== null && _deviceRef$current9 !== void 0 && _deviceRef$current9.setting.receipts ? [] : receipt;
392
436
  if (current.length > 0) {
393
437
  onChange('print', current);
394
438
  }
@@ -447,6 +491,9 @@ export default (function (_ref) {
447
491
  }
448
492
  }
449
493
  }, [load]);
494
+ var onNotin = function onNotin() {
495
+ onChange('print', [], 'print_on_timeout');
496
+ };
450
497
  useEffect(function () {
451
498
  var clear;
452
499
  if (status === -1) {
@@ -485,7 +532,6 @@ export default (function (_ref) {
485
532
  }
486
533
  console.log('倒计时到了');
487
534
  setManually(true);
488
- // iClient.cancelCurrentTransaction();
489
535
  }, Minute);
490
536
  return function () {
491
537
  if (clear) {
@@ -559,11 +605,15 @@ export default (function (_ref) {
559
605
  });
560
606
  })), isManually ? /*#__PURE__*/React.createElement("div", {
561
607
  className: "pisell-lowcode__eft-pay-step-item-btns"
562
- }, /*#__PURE__*/React.createElement(Button, {
608
+ }, client === ClientEnum.Merchant ? /*#__PURE__*/React.createElement(Button, {
563
609
  block: true,
564
610
  className: "pisell-lowcode__eft-pay-step-item-btn",
565
611
  onClick: onManually
566
- }, locales.getText('page.eftpos-pay.text.manual.marking'))) : null, /*#__PURE__*/React.createElement("div", {
612
+ }, locales.getText('page.eftpos-pay.text.manual.marking')) : /*#__PURE__*/React.createElement(Button, {
613
+ block: true,
614
+ className: "pisell-lowcode__eft-pay-step-item-btn",
615
+ onClick: onNotin
616
+ }, locales.getText('page.eftpos-pay.text.manual.print_receipt'))) : null, /*#__PURE__*/React.createElement("div", {
567
617
  className: "pisell-lowcode__eft-pay-step-item-btns",
568
618
  style: {
569
619
  flexWrap: 'wrap'
@@ -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: 初始化 windcave 数据
14
14
  * @return store 全局数据管理
@@ -28,6 +28,7 @@ export default (function (params) {
28
28
  pay = _ref.pay,
29
29
  device = _ref.device,
30
30
  net = _ref.net,
31
+ client = _ref.client,
31
32
  other = _objectWithoutProperties(_ref, _excluded);
32
33
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
33
34
  order_id: order_id,
@@ -45,6 +46,7 @@ export default (function (params) {
45
46
  status: StatusEnum.Loading,
46
47
  steps: [],
47
48
  render: true,
49
+ client: client !== 'undefined' ? client : ClientEnum.Merchant,
48
50
  custom: other ? _objectSpread(_objectSpread({}, other), {}, {
49
51
  list: [],
50
52
  step: StepStatusEnum.Free
@@ -7,7 +7,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
7
7
  /* eslint-disable @typescript-eslint/no-unused-expressions */
8
8
  import { locales } from '@pisell/utils';
9
9
  import { useCallback, useEffect, useRef } from 'react';
10
- import { StatusEnum, PayStatus } from "../const";
10
+ import { StatusEnum, PayStatus, ClientEnum } from "../const";
11
11
  import { useContextData, useDispatch, updateComponent, updateState, updateStatus, updateCustom, updateKey } from "../store";
12
12
  import { StepStatusEnum, getStepMapping, StemTypeEnum } from "./const";
13
13
  import { useStoreRef } from "../hooks";
@@ -26,7 +26,8 @@ export var useFail = function useFail() {
26
26
  var _useContextData = useContextData(),
27
27
  custom = _useContextData.custom;
28
28
  var _useStoreRef = useStoreRef(),
29
- modeRef = _useStoreRef.modeRef;
29
+ modeRef = _useStoreRef.modeRef,
30
+ clientRef = _useStoreRef.clientRef;
30
31
  var ref = useRef((custom === null || custom === void 0 ? void 0 : custom.retry) || 0);
31
32
  useEffect(function () {
32
33
  ref.current = (custom === null || custom === void 0 ? void 0 : custom.retry) || 0;
@@ -103,6 +104,19 @@ export var useFail = function useFail() {
103
104
  }
104
105
  if (code === PayStatus.Timeout) {
105
106
  if (isMark) {
107
+ if (clientRef.current === ClientEnum.User) {
108
+ dispatch(updateCustom({
109
+ failCustom: {
110
+ isPosNetworkError: true,
111
+ status: 'warn',
112
+ fail: null,
113
+ title: locales.getText('page.eftpos-pay.text.timedout.title'),
114
+ warn: locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.other')
115
+ }
116
+ }));
117
+ dispatch(updateComponent('FailCustom'));
118
+ return;
119
+ }
106
120
  // 超时 前往标记页
107
121
  dispatch(updateState({
108
122
  manual: {
@@ -161,33 +175,9 @@ export var useFail = function useFail() {
161
175
  status: 'warn',
162
176
  fail: null,
163
177
  title: locales.getText('page.eftpos-pay.text.interrupted'),
164
- warn: "".concat(locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.title'), "\n").concat(locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.power'), "\n ").concat(locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.device'), "\n").concat(locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.network'), "\n").concat(locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.if')(modeRef.current), "\n ")
165
- // warn: (
166
- // <>
167
- // {locales.getText(
168
- // 'page.eftpos-pay.text.transaction.eftpos.fail.title'
169
- // )}
170
- // <br />
171
- // {locales.getText(
172
- // 'page.eftpos-pay.text.transaction.eftpos.fail.power'
173
- // )}
174
- // . <br />
175
- // {locales.getText(
176
- // 'page.eftpos-pay.text.transaction.eftpos.fail.device'
177
- // )}
178
- // <br />
179
- // {locales.getText(
180
- // 'page.eftpos-pay.text.transaction.eftpos.fail.network'
181
- // )}
182
- // <br />
183
- // {locales.getText(
184
- // 'page.eftpos-pay.text.transaction.eftpos.fail.if'
185
- // )(modeRef.current)}
186
- // </>
187
- // ),
178
+ warn: clientRef.current === ClientEnum.Merchant ? "".concat(locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.title'), "\n").concat(locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.power'), "\n ").concat(locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.device'), "\n").concat(locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.network'), "\n").concat(locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.if')(modeRef.current)) : locales.getText('page.eftpos-pay.text.transaction.eftpos.fail.other')
188
179
  }
189
180
  }));
190
-
191
181
  dispatch(updateComponent('FailCustom'));
192
182
  return;
193
183
  }
@@ -260,7 +250,8 @@ export var useValidate = function useValidate(check, num, onChange) {
260
250
  netRef = _useStoreRef2.netRef,
261
251
  payRef = _useStoreRef2.payRef,
262
252
  numRef = _useStoreRef2.numRef,
263
- modeRef = _useStoreRef2.modeRef;
253
+ modeRef = _useStoreRef2.modeRef,
254
+ clientRef = _useStoreRef2.clientRef;
264
255
  var stepRef = useRef(custom === null || custom === void 0 ? void 0 : custom.step);
265
256
  var listRef = useRef(custom === null || custom === void 0 ? void 0 : custom.list);
266
257
  useEffect(function () {
@@ -50,7 +50,8 @@ export default (function (_ref) {
50
50
  netRef = _useStoreRef.netRef,
51
51
  symbolRef = _useStoreRef.symbolRef,
52
52
  amountRef = _useStoreRef.amountRef,
53
- eftposRef = _useStoreRef.eftposRef;
53
+ eftposRef = _useStoreRef.eftposRef,
54
+ clientRef = _useStoreRef.clientRef;
54
55
  var dispatch = useDispatch();
55
56
  var fail = useFail();
56
57
  var failRef = useRef(fail);
@@ -186,9 +186,15 @@ export var checkEnrollment = /*#__PURE__*/function () {
186
186
  _yield$request$getReq = _context2.sent;
187
187
  data = _yield$request$getReq.data;
188
188
  setPayNumber(orderId, data === null || data === void 0 ? void 0 : data.pay_number);
189
+ if (data !== null && data !== void 0 && data.pay_info) {
190
+ _context2.next = 8;
191
+ break;
192
+ }
193
+ return _context2.abrupt("return", null);
194
+ case 8:
189
195
  return _context2.abrupt("return", data);
190
- case 9:
191
- _context2.prev = 9;
196
+ case 11:
197
+ _context2.prev = 11;
192
198
  _context2.t0 = _context2["catch"](0);
193
199
  // 记录卡失败的原因
194
200
  log({
@@ -208,11 +214,11 @@ export var checkEnrollment = /*#__PURE__*/function () {
208
214
  });
209
215
  console.log('error', _context2.t0);
210
216
  return _context2.abrupt("return", 0);
211
- case 17:
217
+ case 19:
212
218
  case "end":
213
219
  return _context2.stop();
214
220
  }
215
- }, _callee2, null, [[0, 9]]);
221
+ }, _callee2, null, [[0, 11]]);
216
222
  }));
217
223
  return function checkEnrollment(_x3, _x4, _x5) {
218
224
  return _ref3.apply(this, arguments);
@@ -80,12 +80,14 @@ var RightPanel = function RightPanel(props) {
80
80
  if (page === 'list') {
81
81
  return /*#__PURE__*/React.createElement("div", {
82
82
  className: "select-customer-right-panel-header"
83
- }, /*#__PURE__*/React.createElement("span", null, phone ? locales.getText('pisell2.text.result-found') : locales.getText('pisell2.text.personnel-list')), /*#__PURE__*/React.createElement(PlusCircle, {
84
- className: "select-customer-right-panel-header-icon",
83
+ }, /*#__PURE__*/React.createElement("span", null, phone ? locales.getText('pisell2.text.result-found') : locales.getText('pisell2.text.personnel-list')), /*#__PURE__*/React.createElement("span", {
84
+ className: "select-customer-right-panel-header-create-btn",
85
85
  onClick: function onClick() {
86
86
  setPage('create');
87
87
  }
88
- }));
88
+ }, /*#__PURE__*/React.createElement(PlusCircle, {
89
+ className: "select-customer-right-panel-header-icon"
90
+ }), locales.getText('pisell2.text.create')));
89
91
  }
90
92
  return /*#__PURE__*/React.createElement("div", {
91
93
  className: classNames('select-customer-right-panel-header', {
@@ -25,6 +25,13 @@
25
25
  justify-content: flex-start;
26
26
  }
27
27
 
28
+ .select-customer-right-panel-header-create-btn {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ cursor: pointer;
33
+ }
34
+
28
35
  .select-customer-right-panel-header-icon {
29
36
  display: flex;
30
37
  align-items: center;
@@ -146,6 +146,10 @@ var PisellSelectCustomerModal = function PisellSelectCustomerModal(props) {
146
146
 
147
147
  // 动态计算input的字体大小
148
148
  var adjustFontSize = useMemo(function () {
149
+ // 没有内容固定位30px, 因为placeholder的字体大小是30px 太大会展示不全
150
+ if (!phone) {
151
+ return 30;
152
+ }
149
153
  var maxFontSize = 60; // 最大字体大小
150
154
  var minFontSize = 10; // 最小字体大小
151
155
  var defaultFontSize = maxFontSize;
@@ -194,10 +198,12 @@ var PisellSelectCustomerModal = function PisellSelectCustomerModal(props) {
194
198
  onChange: function onChange(e) {
195
199
  setPhone(e.target.value);
196
200
  },
201
+ placeholder: locales.getText('pisell2.text.search-customer-by-phone-number'),
197
202
  style: {
198
203
  textAlign: 'left',
199
204
  fontSize: adjustFontSize
200
- }
205
+ },
206
+ className: 'pisell-select-customer-modal-input'
201
207
  }, virtualKeyInputProps),
202
208
  rightPanel: /*#__PURE__*/React.createElement(RightPanel, {
203
209
  value: _value,
@@ -13,4 +13,10 @@ body {
13
13
  display: none;
14
14
  }
15
15
  }
16
+ }
17
+
18
+ .pisell-select-customer-modal-input {
19
+ &::placeholder {
20
+ font-size: 30px;
21
+ }
16
22
  }
@@ -22,6 +22,8 @@ declare const _default: {
22
22
  'pisell2.text.personnel-list': string;
23
23
  'pisell2.text.load-more': string;
24
24
  'pisell2.text.add-client.confirm': string;
25
+ 'pisell2.text.search-customer-by-phone-number': string;
26
+ 'pisell2.text.create': string;
25
27
  };
26
28
  'zh-CN': {
27
29
  'pisell2.text.leave-empty-for-walk-in': string;
@@ -46,6 +48,8 @@ declare const _default: {
46
48
  'pisell2.text.personnel-list': string;
47
49
  'pisell2.text.add-client.confirm': string;
48
50
  'pisell2.text.load-more': string;
51
+ 'pisell2.text.search-customer-by-phone-number': string;
52
+ 'pisell2.text.create': string;
49
53
  };
50
54
  'zh-HK': {
51
55
  'pisell2.text.leave-empty-for-walk-in': string;
@@ -70,6 +74,8 @@ declare const _default: {
70
74
  'pisell2.text.personnel-list': string;
71
75
  'pisell2.text.add-client.confirm': string;
72
76
  'pisell2.text.load-more': string;
77
+ 'pisell2.text.search-customer-by-phone-number': string;
78
+ 'pisell2.text.create': string;
73
79
  };
74
80
  };
75
81
  export default _default;
@@ -21,7 +21,9 @@ export default {
21
21
  'pisell2.text.result-found': 'Result found',
22
22
  'pisell2.text.personnel-list': 'Personnel list',
23
23
  'pisell2.text.load-more': 'Load more',
24
- 'pisell2.text.add-client.confirm': 'Fill in at least one name, phone number and email address'
24
+ 'pisell2.text.add-client.confirm': 'Fill in at least one name, phone number and email address',
25
+ 'pisell2.text.search-customer-by-phone-number': 'Search by phone number',
26
+ 'pisell2.text.create': 'Create'
25
27
  },
26
28
  'zh-CN': {
27
29
  'pisell2.text.leave-empty-for-walk-in': '未选择表示 Walk-In',
@@ -45,7 +47,9 @@ export default {
45
47
  'pisell2.text.result-found': '搜索结果',
46
48
  'pisell2.text.personnel-list': '客户列表',
47
49
  'pisell2.text.add-client.confirm': '姓名,电话,邮箱至少填一个',
48
- 'pisell2.text.load-more': '加载更多'
50
+ 'pisell2.text.load-more': '加载更多',
51
+ 'pisell2.text.search-customer-by-phone-number': '输入手机号搜索客户',
52
+ 'pisell2.text.create': '创建'
49
53
  },
50
54
  'zh-HK': {
51
55
  'pisell2.text.leave-empty-for-walk-in': '未選擇表示 Walk-In',
@@ -69,6 +73,8 @@ export default {
69
73
  'pisell2.text.result-found': '搜索結果',
70
74
  'pisell2.text.personnel-list': '客戶列表',
71
75
  'pisell2.text.add-client.confirm': '姓名,電話,郵箱至少填一個',
72
- 'pisell2.text.load-more': '加載更多'
76
+ 'pisell2.text.load-more': '加載更多',
77
+ 'pisell2.text.search-customer-by-phone-number': '輸入手機號搜索客戶',
78
+ 'pisell2.text.create': '創建'
73
79
  }
74
80
  };
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => any;
2
+ declare const Schedules: (props: any) => JSX.Element;
3
3
  export default Schedules;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem, ScheduleItem } from "./type";
3
2
  import dayjs from "dayjs";
4
3
  export interface FormState {
@@ -69,7 +68,7 @@ export interface FormState {
69
68
  };
70
69
  setGlobalState: Function | null;
71
70
  }
72
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
71
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
73
72
  state: FormState;
74
73
  } & {
75
74
  dispatch: (params: {
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: (props: any) => any;
7
+ declare const Notes: any;
8
8
  export default Notes;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -7,14 +7,15 @@ import { PosProps } from './const';
7
7
  * @Author: hongbing.wang
8
8
  * @Date: 2024-08-12 11:35
9
9
  */
10
- declare const _default: ({ className, onChange, onClose, formatAmount, isIpad, net, }: {
10
+ declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
12
  onChange?: ((status: "page" | "success" | "fail", params?: string | {
13
13
  [keys: string]: unknown;
14
- } | undefined) => void) | undefined;
14
+ } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
16
16
  formatAmount(amount: number | string, precision: number, symbol: string): string;
17
- isIpad: boolean;
17
+ isMobile: boolean;
18
18
  net: boolean;
19
+ client: string;
19
20
  }) => React.JSX.Element;
20
21
  export default _default;
@@ -46,8 +46,9 @@ var amount_default = ({
46
46
  onChange,
47
47
  onClose,
48
48
  formatAmount = (number, precision, symbol) => `${symbol}${number}`,
49
- isIpad,
50
- net
49
+ isMobile,
50
+ net,
51
+ client
51
52
  }) => {
52
53
  const dispatch = (0, import_store.useDispatch)();
53
54
  const [status, setStatus] = (0, import_react.useState)(true);
@@ -131,7 +132,7 @@ var amount_default = ({
131
132
  setTempSurRate(curSurRate);
132
133
  setTempSurMoney(curSurMoney);
133
134
  };
134
- return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-amount ${className}` }, isIpad ? null : /* @__PURE__ */ import_react.default.createElement(import_titlebar.default, { type: "left-title-close", onClose }, status ? name : import_utils.locales.getText("page.eftpos-pay.text.surcharge.edit.title")), status ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-amount-body" }, /* @__PURE__ */ import_react.default.createElement(
135
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-amount ${className}` }, isMobile ? null : /* @__PURE__ */ import_react.default.createElement(import_titlebar.default, { type: "left-title-close", onClose }, status ? name : import_utils.locales.getText("page.eftpos-pay.text.surcharge.edit.title")), status ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-amount-body" }, /* @__PURE__ */ import_react.default.createElement(
135
136
  "div",
136
137
  {
137
138
  className: "pisell-lowcode__eft-pay-cash",
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { ActionProps } from '../../const';
3
- declare const _default: ({ className, isIpad, onChange }: ActionProps) => React.JSX.Element;
3
+ declare const _default: ({ className, isMobile, onChange }: ActionProps) => React.JSX.Element;
4
4
  export default _default;