@pisell/private-materials 3.0.136 → 3.0.138

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 (219) 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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +12 -12
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/booking/forms/single/index.js +3 -0
  12. package/es/components/eftpos/const.d.ts +26 -0
  13. package/es/components/eftpos/const.js +40 -8
  14. package/es/components/eftpos/device.d.ts +3 -2
  15. package/es/components/eftpos/device.js +6 -5
  16. package/es/components/eftpos/form/index.d.ts +5 -0
  17. package/es/components/eftpos/form/index.js +8 -0
  18. package/es/components/eftpos/hooks.d.ts +34 -0
  19. package/es/components/{eftposPay/windcave/hook.js → eftpos/hooks.js} +96 -122
  20. package/es/components/eftpos/icon/apiKey.d.ts +5 -0
  21. package/es/components/eftpos/icon/apiKey.js +17 -0
  22. package/es/components/eftpos/icon/device.d.ts +5 -0
  23. package/es/components/eftpos/icon/device.js +19 -0
  24. package/es/components/eftpos/index.d.ts +10 -0
  25. package/es/components/eftpos/index.js +329 -46
  26. package/es/components/eftpos/index.less +38 -1
  27. package/es/components/eftpos/locales.d.ts +12 -0
  28. package/es/components/eftpos/locales.js +15 -3
  29. package/es/components/eftpos/log.d.ts +8 -0
  30. package/es/components/eftpos/log.js +85 -0
  31. package/es/components/eftpos/pos.d.ts +1 -1
  32. package/es/components/eftpos/pos.js +8 -5
  33. package/es/components/eftpos/surcharge/index.d.ts +25 -2
  34. package/es/components/eftpos/surcharge/index.js +100 -16
  35. package/es/components/eftpos/table.d.ts +4 -0
  36. package/es/components/eftpos/table.js +102 -10
  37. package/es/components/eftposPay/amount.d.ts +7 -1
  38. package/es/components/eftposPay/amount.js +65 -38
  39. package/es/components/eftposPay/component/fail/failCustom.js +65 -20
  40. package/es/components/eftposPay/component/fail/index.js +60 -30
  41. package/es/components/eftposPay/component/fail/network.d.ts +5 -0
  42. package/es/components/eftposPay/component/fail/network.js +13 -0
  43. package/es/components/eftposPay/component/fail/unknow.d.ts +6 -0
  44. package/es/components/eftposPay/component/fail/unknow.js +18 -3
  45. package/es/components/eftposPay/component/header/index.d.ts +2 -1
  46. package/es/components/eftposPay/component/header/index.js +4 -1
  47. package/es/components/eftposPay/component/header/index.less +1 -10
  48. package/es/components/eftposPay/component/manual/index.d.ts +6 -1
  49. package/es/components/eftposPay/component/manual/index.js +174 -23
  50. package/es/components/eftposPay/component/manual/index.less +42 -14
  51. package/es/components/eftposPay/component/signature/index.d.ts +5 -0
  52. package/es/components/eftposPay/component/signature/index.js +20 -2
  53. package/es/components/eftposPay/component/step/index.d.ts +7 -7
  54. package/es/components/eftposPay/component/step/step.d.ts +4 -4
  55. package/es/components/eftposPay/const.d.ts +19 -4
  56. package/es/components/eftposPay/const.js +4 -2
  57. package/es/components/eftposPay/device.d.ts +7 -0
  58. package/es/components/eftposPay/device.js +22 -0
  59. package/es/components/eftposPay/helper.d.ts +54 -0
  60. package/es/components/eftposPay/helper.js +93 -1
  61. package/es/components/eftposPay/hooks.d.ts +30 -1
  62. package/es/components/eftposPay/hooks.js +181 -26
  63. package/es/components/eftposPay/index.d.ts +2 -4
  64. package/es/components/eftposPay/index.js +119 -31
  65. package/es/components/eftposPay/index.less +27 -19
  66. package/es/components/eftposPay/locales.d.ts +45 -0
  67. package/es/components/eftposPay/locales.js +348 -3
  68. package/es/components/eftposPay/manufacturer.d.ts +2 -2
  69. package/es/components/eftposPay/manufacturer.js +9 -10
  70. package/es/components/eftposPay/pay.d.ts +10 -1
  71. package/es/components/eftposPay/pay.js +112 -34
  72. package/es/components/eftposPay/payo/config.js +137 -270
  73. package/es/components/eftposPay/payo/const.d.ts +22 -2
  74. package/es/components/eftposPay/payo/const.js +83 -33
  75. package/es/components/eftposPay/payo/hooks.d.ts +5 -0
  76. package/es/components/eftposPay/payo/hooks.js +19 -2
  77. package/es/components/eftposPay/store/index.d.ts +154 -53
  78. package/es/components/eftposPay/store/index.js +112 -60
  79. package/es/components/eftposPay/tyro/const.d.ts +17 -0
  80. package/es/components/eftposPay/{eftpos → tyro}/const.js +71 -90
  81. package/es/components/eftposPay/tyro/hooks.d.ts +14 -0
  82. package/es/components/eftposPay/tyro/hooks.js +40 -0
  83. package/es/components/eftposPay/tyro/index.d.ts +9 -0
  84. package/es/components/eftposPay/tyro/index.js +575 -0
  85. package/es/components/eftposPay/windcave/const.d.ts +24 -9
  86. package/es/components/eftposPay/windcave/const.js +90 -81
  87. package/es/components/eftposPay/windcave/helper.d.ts +16 -2
  88. package/es/components/eftposPay/windcave/helper.js +175 -42
  89. package/es/components/eftposPay/windcave/receiptAction.d.ts +12 -0
  90. package/es/components/eftposPay/windcave/receiptAction.js +91 -43
  91. package/es/components/eftposPay/windcave/timer.d.ts +13 -1
  92. package/es/components/eftposPay/windcave/timer.js +18 -1
  93. package/es/components/eftposPay/windcave/windcave.d.ts +2 -1
  94. package/es/components/eftposPay/windcave/windcave.js +155 -139
  95. package/es/utils/load.d.ts +11 -0
  96. package/es/utils/load.js +85 -0
  97. package/lib/components/booking/forms/single/index.js +1 -0
  98. package/lib/components/eftpos/const.d.ts +26 -0
  99. package/lib/components/eftpos/const.js +13 -1
  100. package/lib/components/eftpos/device.d.ts +3 -2
  101. package/lib/components/eftpos/device.js +2 -2
  102. package/lib/components/eftpos/form/index.d.ts +5 -0
  103. package/lib/components/eftpos/hooks.d.ts +34 -0
  104. package/lib/components/eftpos/hooks.js +106 -0
  105. package/lib/components/eftpos/icon/apiKey.d.ts +5 -0
  106. package/lib/components/eftpos/icon/apiKey.js +57 -0
  107. package/lib/components/eftpos/icon/device.d.ts +5 -0
  108. package/lib/components/eftpos/icon/device.js +57 -0
  109. package/lib/components/eftpos/index.d.ts +10 -0
  110. package/lib/components/eftpos/index.js +262 -97
  111. package/lib/components/eftpos/index.less +38 -1
  112. package/lib/components/eftpos/locales.d.ts +12 -0
  113. package/lib/components/eftpos/locales.js +15 -3
  114. package/lib/components/eftpos/log.d.ts +8 -0
  115. package/lib/components/eftpos/log.js +87 -0
  116. package/lib/components/eftpos/pos.d.ts +1 -1
  117. package/lib/components/eftpos/pos.js +5 -4
  118. package/lib/components/eftpos/surcharge/index.d.ts +25 -2
  119. package/lib/components/eftpos/surcharge/index.js +36 -6
  120. package/lib/components/eftpos/table.d.ts +4 -0
  121. package/lib/components/eftpos/table.js +40 -8
  122. package/lib/components/eftposPay/amount.d.ts +7 -1
  123. package/lib/components/eftposPay/amount.js +10 -33
  124. package/lib/components/eftposPay/component/fail/failCustom.js +27 -6
  125. package/lib/components/eftposPay/component/fail/index.js +39 -18
  126. package/lib/components/eftposPay/component/fail/network.d.ts +5 -0
  127. package/lib/components/eftposPay/component/fail/unknow.d.ts +6 -0
  128. package/lib/components/eftposPay/component/fail/unknow.js +3 -3
  129. package/lib/components/eftposPay/component/header/index.d.ts +2 -1
  130. package/lib/components/eftposPay/component/header/index.js +2 -1
  131. package/lib/components/eftposPay/component/header/index.less +1 -10
  132. package/lib/components/eftposPay/component/manual/index.d.ts +6 -1
  133. package/lib/components/eftposPay/component/manual/index.js +122 -31
  134. package/lib/components/eftposPay/component/manual/index.less +42 -14
  135. package/lib/components/eftposPay/component/signature/index.d.ts +5 -0
  136. package/lib/components/eftposPay/component/signature/index.js +2 -2
  137. package/lib/components/eftposPay/component/step/index.d.ts +7 -7
  138. package/lib/components/eftposPay/component/step/step.d.ts +4 -4
  139. package/lib/components/eftposPay/const.d.ts +19 -4
  140. package/lib/components/eftposPay/const.js +3 -1
  141. package/lib/components/eftposPay/device.d.ts +7 -0
  142. package/lib/components/eftposPay/helper.d.ts +54 -0
  143. package/lib/components/eftposPay/helper.js +64 -0
  144. package/lib/components/eftposPay/hooks.d.ts +30 -1
  145. package/lib/components/eftposPay/hooks.js +182 -44
  146. package/lib/components/eftposPay/index.d.ts +2 -4
  147. package/lib/components/eftposPay/index.js +74 -27
  148. package/lib/components/eftposPay/index.less +27 -19
  149. package/lib/components/eftposPay/locales.d.ts +45 -0
  150. package/lib/components/eftposPay/locales.js +352 -3
  151. package/lib/components/eftposPay/manufacturer.d.ts +2 -2
  152. package/lib/components/eftposPay/manufacturer.js +13 -13
  153. package/lib/components/eftposPay/pay.d.ts +10 -1
  154. package/lib/components/eftposPay/pay.js +86 -25
  155. package/lib/components/eftposPay/payo/config.js +121 -268
  156. package/lib/components/eftposPay/payo/const.d.ts +22 -2
  157. package/lib/components/eftposPay/payo/const.js +55 -36
  158. package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
  159. package/lib/components/eftposPay/payo/hooks.js +1 -1
  160. package/lib/components/eftposPay/store/index.d.ts +154 -53
  161. package/lib/components/eftposPay/store/index.js +7 -66
  162. package/lib/components/eftposPay/tyro/const.d.ts +17 -0
  163. package/lib/components/eftposPay/tyro/const.js +114 -0
  164. package/lib/components/eftposPay/tyro/hooks.d.ts +14 -0
  165. package/lib/components/eftposPay/{eftpos/index.js → tyro/hooks.js} +31 -36
  166. package/lib/components/eftposPay/tyro/index.d.ts +9 -0
  167. package/lib/components/eftposPay/tyro/index.js +558 -0
  168. package/lib/components/eftposPay/windcave/const.d.ts +24 -9
  169. package/lib/components/eftposPay/windcave/const.js +53 -104
  170. package/lib/components/eftposPay/windcave/helper.d.ts +16 -2
  171. package/lib/components/eftposPay/windcave/helper.js +163 -48
  172. package/lib/components/eftposPay/windcave/receiptAction.d.ts +12 -0
  173. package/lib/components/eftposPay/windcave/receiptAction.js +15 -47
  174. package/lib/components/eftposPay/windcave/timer.d.ts +13 -1
  175. package/lib/components/eftposPay/windcave/timer.js +5 -0
  176. package/lib/components/eftposPay/windcave/windcave.d.ts +2 -1
  177. package/lib/components/eftposPay/windcave/windcave.js +130 -130
  178. package/lib/utils/load.d.ts +11 -0
  179. package/lib/utils/load.js +100 -0
  180. package/lowcode/eftpos/meta.ts +202 -160
  181. package/lowcode/eftpos-pay/meta.ts +45 -12
  182. package/package.json +4 -4
  183. package/es/components/eftposPay/eftpos/config.d.ts +0 -11
  184. package/es/components/eftposPay/eftpos/config.js +0 -178
  185. package/es/components/eftposPay/eftpos/const.d.ts +0 -10
  186. package/es/components/eftposPay/eftpos/index.d.ts +0 -7
  187. package/es/components/eftposPay/eftpos/index.js +0 -35
  188. package/es/components/eftposPay/windcave/action.d.ts +0 -8
  189. package/es/components/eftposPay/windcave/action.js +0 -104
  190. package/es/components/eftposPay/windcave/hook.d.ts +0 -14
  191. package/es/components/eftposPay/windcave/index.d.ts +0 -8
  192. package/es/components/eftposPay/windcave/index.js +0 -49
  193. package/es/components/eftposPay/windcave/pos.d.ts +0 -8
  194. package/es/components/eftposPay/windcave/pos.js +0 -180
  195. package/es/components/eftposPay/windcave/pwd.d.ts +0 -8
  196. package/es/components/eftposPay/windcave/pwd.js +0 -124
  197. package/es/components/eftposPay/windcave/receipet.d.ts +0 -6
  198. package/es/components/eftposPay/windcave/receipet.js +0 -67
  199. package/es/components/eftposPay/windcave/wait.d.ts +0 -12
  200. package/es/components/eftposPay/windcave/wait.js +0 -139
  201. package/lib/components/eftposPay/eftpos/config.d.ts +0 -11
  202. package/lib/components/eftposPay/eftpos/config.js +0 -199
  203. package/lib/components/eftposPay/eftpos/const.d.ts +0 -10
  204. package/lib/components/eftposPay/eftpos/const.js +0 -165
  205. package/lib/components/eftposPay/eftpos/index.d.ts +0 -7
  206. package/lib/components/eftposPay/windcave/action.d.ts +0 -8
  207. package/lib/components/eftposPay/windcave/action.js +0 -143
  208. package/lib/components/eftposPay/windcave/hook.d.ts +0 -14
  209. package/lib/components/eftposPay/windcave/hook.js +0 -139
  210. package/lib/components/eftposPay/windcave/index.d.ts +0 -8
  211. package/lib/components/eftposPay/windcave/index.js +0 -78
  212. package/lib/components/eftposPay/windcave/pos.d.ts +0 -8
  213. package/lib/components/eftposPay/windcave/pos.js +0 -197
  214. package/lib/components/eftposPay/windcave/pwd.d.ts +0 -8
  215. package/lib/components/eftposPay/windcave/pwd.js +0 -143
  216. package/lib/components/eftposPay/windcave/receipet.d.ts +0 -6
  217. package/lib/components/eftposPay/windcave/receipet.js +0 -93
  218. package/lib/components/eftposPay/windcave/wait.d.ts +0 -12
  219. package/lib/components/eftposPay/windcave/wait.js +0 -163
@@ -11,61 +11,212 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { locales } from '@pisell/utils';
14
- import { Button } from 'antd';
15
- import React, { useState } from 'react';
14
+ import { Decimal } from 'decimal.js';
15
+ import { Button, InputNumber } from 'antd';
16
+ import React, { useMemo, useState } from 'react';
16
17
  import usePrefix from "../../../../hooks/usePrefix";
17
18
  import { ModeEnum } from "../../const";
18
- import { useContextData } from "../../store";
19
+ import { useContextData, useDispatch, updateState } from "../../store";
20
+ import { limitDecimals } from "../../helper";
19
21
  import "./index.less";
22
+
23
+ /**
24
+ * @title: 结果标记页面
25
+ * @Author: hongbing.wang
26
+ * @Date: 2024-08-20 11:46
27
+ */
20
28
  export default (function (_ref) {
21
29
  var onChange = _ref.onChange,
22
30
  _ref$className = _ref.className,
23
- className = _ref$className === void 0 ? '' : _ref$className;
31
+ className = _ref$className === void 0 ? '' : _ref$className,
32
+ formatAmount = _ref.formatAmount;
33
+ var dispatch = useDispatch();
24
34
  var _useContextData = useContextData(),
35
+ symbol = _useContextData.symbol,
25
36
  manual = _useContextData.manual,
26
- custom = _useContextData.custom,
37
+ order_id = _useContextData.order_id,
27
38
  mode = _useContextData.mode,
28
- device = _useContextData.device;
29
- var _useState = useState(false),
39
+ device = _useContextData.device,
40
+ number = _useContextData.number,
41
+ pay = _useContextData.pay,
42
+ amount = _useContextData.amount;
43
+ var start = useMemo(function () {
44
+ if (typeof (manual === null || manual === void 0 ? void 0 : manual.money) === 'number') {
45
+ return manual === null || manual === void 0 ? void 0 : manual.money;
46
+ }
47
+ if (typeof (pay === null || pay === void 0 ? void 0 : pay.total) === 'number') {
48
+ return pay === null || pay === void 0 ? void 0 : pay.total;
49
+ }
50
+ return amount;
51
+ }, [manual === null || manual === void 0 ? void 0 : manual.money, pay === null || pay === void 0 ? void 0 : pay.total, amount]);
52
+ var _useState = useState(start),
30
53
  _useState2 = _slicedToArray(_useState, 2),
31
- disabled = _useState2[0],
32
- setDisabled = _useState2[1];
54
+ money = _useState2[0],
55
+ setMoney = _useState2[1];
56
+ var _useState3 = useState(false),
57
+ _useState4 = _slicedToArray(_useState3, 2),
58
+ disabled = _useState4[0],
59
+ setDisabled = _useState4[1];
33
60
  var prefix = usePrefix();
61
+ var _useState5 = useState(manual === null || manual === void 0 ? void 0 : manual.status),
62
+ _useState6 = _slicedToArray(_useState5, 2),
63
+ isUpdateAmount = _useState6[0],
64
+ updateAmountStatus = _useState6[1];
65
+
66
+ /**
67
+ * @title: 标记成功
68
+ * @Author: hongbing.wang
69
+ * @Date: 2024-08-20 11:48
70
+ */
34
71
  var onSuccess = function onSuccess() {
35
72
  if (disabled) {
36
73
  return;
37
74
  }
38
- setDisabled(true);
75
+ // 暂时关闭 后期可以放开用于自定义编辑金额
39
76
  if (mode === ModeEnum.Pay) {
40
- var obj = (custom === null || custom === void 0 ? void 0 : custom.pay) || {};
77
+ setDisabled(true);
78
+ var obj = pay || {};
41
79
  onChange('success', _objectSpread(_objectSpread({}, obj), {}, {
42
- number: custom === null || custom === void 0 ? void 0 : custom.number,
43
- device: device
80
+ number: number,
81
+ device: device,
82
+ order_id: order_id
44
83
  }));
45
84
  return;
46
85
  }
47
86
  if (mode === ModeEnum.Refund) {
48
- var _obj = (custom === null || custom === void 0 ? void 0 : custom.refund) || {};
49
- onChange('success', _objectSpread(_objectSpread({}, _obj), {}, {
50
- number: custom === null || custom === void 0 ? void 0 : custom.number,
51
- device: device
52
- }));
87
+ setDisabled(true);
88
+ onChange('success', {
89
+ amount: amount,
90
+ total: amount,
91
+ number: number,
92
+ device: device,
93
+ order_id: order_id
94
+ });
53
95
  return;
54
96
  }
55
- onChange('success', {
56
- number: custom === null || custom === void 0 ? void 0 : custom.number
57
- });
97
+ updateAmountStatus(true);
98
+ dispatch(updateState({
99
+ manual: _objectSpread(_objectSpread({}, manual), {}, {
100
+ status: true
101
+ })
102
+ }));
58
103
  };
104
+
105
+ /**
106
+ * @title: 标记失败
107
+ * @Author: hongbing.wang
108
+ * @Date: 2024-08-20 11:49
109
+ */
59
110
  var onFail = function onFail() {
60
111
  if (disabled) {
61
112
  return;
62
113
  }
63
114
  setDisabled(true);
64
- onChange('fail');
115
+ onChange('fail', {
116
+ number: number,
117
+ device: device,
118
+ order_id: order_id
119
+ });
120
+ };
121
+ var onSubmit = function onSubmit() {
122
+ if (disabled) {
123
+ return;
124
+ }
125
+ setDisabled(true);
126
+ if (mode !== ModeEnum.Pay) {
127
+ return;
128
+ }
129
+ var prevMoneyDeci = new Decimal((pay === null || pay === void 0 ? void 0 : pay.total) || 0);
130
+ var moneyDeci = new Decimal(Number(money || 0));
131
+
132
+ // 手续费-固定金额
133
+ var surMoneyDeci = new Decimal(Number((pay === null || pay === void 0 ? void 0 : pay.surMoney) || 0));
134
+
135
+ // 手续费-比例金额
136
+ var surchargeDeci = new Decimal(Number(pay === null || pay === void 0 ? void 0 : pay.surcharge));
137
+ var diff = moneyDeci.sub(prevMoneyDeci);
138
+ var flag = diff.comparedTo(0);
139
+ if (flag < 0) {
140
+ setDisabled(false);
141
+ return;
142
+ }
143
+ if (flag > 0) {
144
+ surMoneyDeci = surMoneyDeci.add(diff);
145
+ surchargeDeci = surchargeDeci.add(diff);
146
+ }
147
+ var obj = pay || {};
148
+ onChange('success', _objectSpread(_objectSpread({}, obj), {}, {
149
+ surMoney: surMoneyDeci.toFixed(2, Decimal.ROUND_HALF_UP),
150
+ surcharge: surchargeDeci.toFixed(2, Decimal.ROUND_HALF_UP),
151
+ total: moneyDeci.toFixed(2, Decimal.ROUND_HALF_UP),
152
+ totalUnit: formatAmount(moneyDeci.toFixed(2, Decimal.ROUND_HALF_UP), 2, symbol),
153
+ number: number,
154
+ device: device,
155
+ order_id: order_id
156
+ }));
157
+ return;
158
+ };
159
+ var onCancel = function onCancel() {
160
+ updateAmountStatus(false);
161
+ setMoney(pay === null || pay === void 0 ? void 0 : pay.total);
162
+ dispatch(updateState({
163
+ manual: _objectSpread(_objectSpread({}, manual), {}, {
164
+ status: true,
165
+ money: pay === null || pay === void 0 ? void 0 : pay.total
166
+ })
167
+ }));
65
168
  };
66
169
  return /*#__PURE__*/React.createElement("div", {
67
170
  className: "pisell-lowcode__eft-pay-manual ".concat(className)
171
+ }, isUpdateAmount ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
172
+ className: "pisell-lowcode__eft-pay-manual-edit-title"
173
+ }, locales.getText('page.eftpos-pay.text.manual.title')), /*#__PURE__*/React.createElement("div", {
174
+ className: "pisell-lowcode__eft-pay-manual-edit-body"
68
175
  }, /*#__PURE__*/React.createElement("div", {
176
+ className: "pisell-lowcode__eft-pay-manual-edit-text"
177
+ }, locales.getText('page.eftpos-pay.text.manual.subtitle')(formatAmount(pay === null || pay === void 0 ? void 0 : pay.total, 2, symbol)), " ", /*#__PURE__*/React.createElement("br", null), locales.getText('page.eftpos-pay.text.manual.confirm'), /*#__PURE__*/React.createElement("br", null), locales.getText('page.eftpos-pay.text.manual.diff')), /*#__PURE__*/React.createElement("div", {
178
+ className: "pisell-lowcode__eft-pay-manual-edit-act"
179
+ }, /*#__PURE__*/React.createElement("div", {
180
+ className: "pisell-lowcode__eft-pay-manual-edit-text"
181
+ }, locales.getText('page.eftpos-pay.text.manual.tip')), /*#__PURE__*/React.createElement(InputNumber, {
182
+ addonBefore: symbol || '$',
183
+ min: pay === null || pay === void 0 ? void 0 : pay.total,
184
+ precision: 2,
185
+ style: {
186
+ width: '100%'
187
+ },
188
+ formatter: limitDecimals,
189
+ parser: limitDecimals,
190
+ defaultValue: money,
191
+ onChange: function onChange(event) {
192
+ if (event !== null && event !== undefined) {
193
+ setMoney(event || 0);
194
+ dispatch(updateState({
195
+ manual: _objectSpread(_objectSpread({}, manual), {}, {
196
+ money: event || 0
197
+ })
198
+ }));
199
+ } else {
200
+ setMoney(0);
201
+ dispatch(updateState({
202
+ manual: _objectSpread(_objectSpread({}, manual), {}, {
203
+ money: 0
204
+ })
205
+ }));
206
+ }
207
+ }
208
+ }))), /*#__PURE__*/React.createElement("div", {
209
+ className: "pisell-lowcode__eft-pay-step-item-btns"
210
+ }, /*#__PURE__*/React.createElement(Button, {
211
+ className: "pisell-lowcode__eft-pay-manual-btn",
212
+ block: true,
213
+ onClick: onCancel
214
+ }, locales.getText('page.eftpos-pay.text.cancel')), /*#__PURE__*/React.createElement(Button, {
215
+ className: "pisell-lowcode__eft-pay-manual-btn",
216
+ block: true,
217
+ type: "primary",
218
+ onClick: onSubmit
219
+ }, locales.getText('page.eftpos-pay.text.manual.btn.confirm')(formatAmount(money, 2, symbol))))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
69
220
  className: "pisell-lowcode__eft-pay-manual-title"
70
221
  }, manual === null || manual === void 0 ? void 0 : manual.title), /*#__PURE__*/React.createElement("div", {
71
222
  className: "pisell-lowcode__eft-pay-manual-txt"
@@ -93,5 +244,5 @@ export default (function (_ref) {
93
244
  }), /*#__PURE__*/React.createElement(Button, {
94
245
  className: "pisell-lowcode__eft-pay-manual-btn",
95
246
  block: true
96
- }, locales.getText('page.eftpos-pay.text.failed')(mode)))));
247
+ }, locales.getText('page.eftpos-pay.text.failed')(mode))))));
97
248
  });
@@ -1,4 +1,4 @@
1
- .pisell-lowcode__eft-pay-manual{
1
+ .pisell-lowcode__eft-pay-manual {
2
2
  padding: var(--pisel-lc-pos-manual-padding, 24px);
3
3
  width: var(--pisel-lc-pos-manual-width, 600px);
4
4
  }
@@ -7,16 +7,48 @@
7
7
  color: var(--text-text_1, #1b1b1b);
8
8
 
9
9
  /* H6/Semi Bold */
10
-
10
+
11
11
  font-size: 16px;
12
12
  font-style: normal;
13
13
  font-weight: 600;
14
14
  line-height: 22px; /* 137.5% */
15
15
  }
16
+
17
+ .pisell-lowcode__eft-pay-manual-edit-title {
18
+ color: var(--Gray-900, #101828);
19
+ font-size: 18px;
20
+ font-style: normal;
21
+ font-weight: 600;
22
+ line-height: 28px; /* 155.556% */
23
+ padding: 0 0 16px 0;
24
+ }
25
+
26
+ .pisell-lowcode__eft-pay-manual-edit-body {
27
+ border-top: 1px solid var(--Gray-200, #eaecf0);
28
+ padding: 16px 0;
29
+ display: flex;
30
+ flex-direction: column;
31
+ gap: 16px;
32
+ flex: 1;
33
+ }
34
+
35
+ .pisell-lowcode__eft-pay-manual-edit-act{
36
+ display: flex;
37
+ flex-direction: column;
38
+ gap: 6px;
39
+ }
40
+
41
+ .pisell-lowcode__eft-pay-manual-edit-text {
42
+ color: var(--Gray-900, #101828);
43
+ font-size: 16px;
44
+ font-style: normal;
45
+ font-weight: 400;
46
+ line-height: 24px; /* 150% */
47
+ }
16
48
  .pisell-lowcode__eft-pay-manual-txt {
17
49
  color: var(--text-text_1, #1b1b1b);
18
50
  /* Paragraph/Regular */
19
-
51
+
20
52
  font-size: 14px;
21
53
  font-style: normal;
22
54
  font-weight: 400;
@@ -51,14 +83,14 @@
51
83
  background-position: center;
52
84
  background-size: cover;
53
85
  }
54
- .pisell-lowcode__eft-pay-manual-card-box{
86
+ .pisell-lowcode__eft-pay-manual-card-box {
55
87
  flex: 1;
56
88
  overflow: auto;
57
89
  }
58
90
 
59
91
  @media only screen and (max-width: 499px) {
60
92
  .pisell-lowcode__eft-pay-manual-card-box {
61
- gap:10px;
93
+ gap: 10px;
62
94
  }
63
95
  .pisell-lowcode__eft-pay-manual-card {
64
96
  flex: 1;
@@ -68,35 +100,31 @@
68
100
  width: 110px;
69
101
  height: 150px;
70
102
  }
71
- .pisell-lowcode__eft-pay-manual-card .pisell-lowcode__eft-pay-manual-btn{
103
+ .pisell-lowcode__eft-pay-manual-card .pisell-lowcode__eft-pay-manual-btn {
72
104
  font-size: 12px !important;
73
105
  }
74
106
  }
75
107
 
76
-
77
108
  @media only screen and (min-width: 500px) and (max-width: 601px) {
78
- .pisell-lowcode__eft-pay-terminal .pisell-lowcode__eft-pay-manual-card-box{
109
+ .pisell-lowcode__eft-pay-terminal .pisell-lowcode__eft-pay-manual-card-box {
79
110
  flex: none;
80
111
  height: 360px;
81
112
  }
82
113
  .pisell-lowcode__eft-pay-manual-card-box {
83
- gap:10px;
114
+ gap: 10px;
84
115
  height: 400px;
85
-
86
116
  }
87
117
  .pisell-lowcode__eft-pay-manual-card {
88
118
  flex: 1;
89
119
  padding: 20px;
90
- gap:30px;
120
+ gap: 30px;
91
121
  }
92
- .pisell-lowcode__eft-pay-manual-img{
122
+ .pisell-lowcode__eft-pay-manual-img {
93
123
  width: 200px;
94
124
  height: 200px;
95
125
  }
96
126
  }
97
127
 
98
-
99
-
100
128
  @media only screen and (min-width: 601px) {
101
129
  .pisell-lowcode__eft-pay-manual-card-box {
102
130
  margin: 24px auto 0;
@@ -1,4 +1,9 @@
1
1
  import React from 'react';
2
2
  import { ActionProps } from '../../const';
3
+ /**
4
+ * @title: 取消签名确认页
5
+ * @Author: hongbing.wang
6
+ * @Date: 2024-08-20 11:49
7
+ */
3
8
  declare const _default: ({ api, className }: ActionProps) => React.JSX.Element;
4
9
  export default _default;
@@ -9,26 +9,44 @@ import { Button } from 'antd';
9
9
  import React, { useState } from 'react';
10
10
  import { useContextData, useDispatch, updateNextStep, updateComponent } from "../../store";
11
11
  import Header from "../header";
12
+
13
+ /**
14
+ * @title: 取消签名确认页
15
+ * @Author: hongbing.wang
16
+ * @Date: 2024-08-20 11:49
17
+ */
12
18
  export default (function (_ref) {
13
19
  var api = _ref.api,
14
20
  _ref$className = _ref.className,
15
21
  className = _ref$className === void 0 ? '' : _ref$className;
16
22
  var dispatch = useDispatch();
17
23
  var _useContextData = useContextData(),
18
- custom = _useContextData.custom,
24
+ number = _useContextData.number,
19
25
  mode = _useContextData.mode;
20
26
  var _useState = useState(false),
21
27
  _useState2 = _slicedToArray(_useState, 2),
22
28
  disabled = _useState2[0],
23
29
  setDisabled = _useState2[1];
30
+
31
+ /**
32
+ * @title: 返回流程页
33
+ * @Author: hongbing.wang
34
+ * @Date: 2024-08-20 11:51
35
+ */
24
36
  var onBack = function onBack() {
25
37
  dispatch(updateComponent(''));
26
38
  };
39
+
40
+ /**
41
+ * @title: 取消签名确认页
42
+ * @Author: hongbing.wang
43
+ * @Date: 2024-08-20 11:51
44
+ */
27
45
  var onConfirm = function onConfirm() {
28
46
  setDisabled(true);
29
47
  api.update({
30
48
  type: 'NO',
31
- number: custom === null || custom === void 0 ? void 0 : custom.number
49
+ number: number
32
50
  }).then(function () {
33
51
  setDisabled(false);
34
52
  dispatch(updateComponent(''));
@@ -1,12 +1,12 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import { StatusType } from '../../const';
3
3
  declare const _default: (props: {
4
4
  status: StatusType;
5
- warn?: ReactNode;
6
- text?: ReactNode;
7
- tip?: ReactNode;
8
- loading?: ReactNode;
9
- success?: ReactNode;
10
- fail?: ReactNode;
5
+ warn?: string | undefined;
6
+ text?: string | undefined;
7
+ tip?: string | undefined;
8
+ loading?: string | undefined;
9
+ success?: string | undefined;
10
+ fail?: string | undefined;
11
11
  }) => React.JSX.Element;
12
12
  export default _default;
@@ -1,9 +1,9 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  declare const _default: (props: {
3
3
  status: string;
4
- pedding?: ReactNode;
5
- resolve?: ReactNode;
6
- reject?: ReactNode;
4
+ pedding?: string | undefined;
5
+ resolve?: string | undefined;
6
+ reject?: string | undefined;
7
7
  className?: string | undefined;
8
8
  }) => React.JSX.Element;
9
9
  export default _default;
@@ -1,9 +1,11 @@
1
1
  export declare enum EftposEnum {
2
+ /** 后端支付 - 仅支付 */
2
3
  Payo = "payo",
4
+ /** 前端支付 */
3
5
  Tyro = "tyro",
6
+ /** 后端支付 - 支付 + 退款 */
4
7
  Windcave = "windcave",
5
- Stripe = "stripe",
6
- Eftpos = "eftpos"
8
+ Stripe = "stripe"
7
9
  }
8
10
  export declare enum StatusEnum {
9
11
  Loading = "loading",
@@ -53,13 +55,17 @@ export interface PosProps {
53
55
  onChangeStatus: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
54
56
  [keys: string]: unknown;
55
57
  } | string) => void;
58
+ onChangeParams(...agrn: unknown[]): void;
56
59
  terminal: {
57
60
  network: boolean;
58
61
  };
59
62
  device?: {
60
63
  [key: string]: unknown;
61
64
  };
62
- action: RouteType;
65
+ mode: ModeEnum;
66
+ tyroUrl?: string;
67
+ tyroVersion?: string;
68
+ source: 'normal' | 'restore';
63
69
  }
64
70
  export interface PayProps {
65
71
  api: ReturnType<PosProps['getApi']>;
@@ -80,6 +86,8 @@ export declare type Amount = {
80
86
  surMoney: number;
81
87
  /** 手续费-是否存在 */
82
88
  surcharge: boolean;
89
+ /** 是否使用原始手续费 */
90
+ useOriginSurcharge: boolean;
83
91
  };
84
92
  export declare type PayAmount = {
85
93
  /** 手续费-百分比-带百分号 例: 1% =》 数据为 0.01 */
@@ -118,7 +126,13 @@ export declare enum PayStatus {
118
126
  /** 交易等待超时 */
119
127
  'PayTimeout' = "701006",
120
128
  /** 连接失败 */
121
- 'SocketError' = "701007"
129
+ 'SocketError' = "701007",
130
+ /** 银行拒绝 */
131
+ 'PayBankRefuses' = "701008",
132
+ /** 签名拒绝 */
133
+ 'SignatureDeclined' = "701009",
134
+ /** 配置参数错误 */
135
+ 'UserConfigError' = "701010"
122
136
  }
123
137
  export interface ActionProps {
124
138
  onChange: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
@@ -129,4 +143,5 @@ export interface ActionProps {
129
143
  };
130
144
  className?: string;
131
145
  isIpad?: boolean;
146
+ formatAmount: (amount: number | string, precision: number, symbol: string) => string;
132
147
  }
@@ -1,10 +1,9 @@
1
- export var EftposEnum;
1
+ export var EftposEnum; // Eftpos = 'eftpos',
2
2
  (function (EftposEnum) {
3
3
  EftposEnum["Payo"] = "payo";
4
4
  EftposEnum["Tyro"] = "tyro";
5
5
  EftposEnum["Windcave"] = "windcave";
6
6
  EftposEnum["Stripe"] = "stripe";
7
- EftposEnum["Eftpos"] = "eftpos";
8
7
  })(EftposEnum || (EftposEnum = {}));
9
8
  export var StatusEnum;
10
9
  (function (StatusEnum) {
@@ -45,4 +44,7 @@ export var PayStatus;
45
44
  PayStatus["NoNetWork"] = "701005";
46
45
  PayStatus["PayTimeout"] = "701006";
47
46
  PayStatus["SocketError"] = "701007";
47
+ PayStatus["PayBankRefuses"] = "701008";
48
+ PayStatus["SignatureDeclined"] = "701009";
49
+ PayStatus["UserConfigError"] = "701010";
48
50
  })(PayStatus || (PayStatus = {}));
@@ -1,6 +1,13 @@
1
1
  import React from 'react';
2
2
  import { PayProps, PosProps } from './const';
3
3
  import './device.less';
4
+ /**
5
+ * @title: 设备选择页
6
+ * @description: 选择设备信息,无设备增加提示;仅有一条,默认选中跳走;多条记录则停留等待用户选择
7
+ * @return React.Element
8
+ * @Author: hongbing.wang
9
+ * @Date: 2024-08-12 11:40
10
+ */
4
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isIpad, net, }: {
5
12
  api: PayProps['api'];
6
13
  className?: string | undefined;
@@ -12,6 +12,14 @@ import Titlebar from "./component/header/titlebar";
12
12
  import { ModeEnum } from "./const";
13
13
  import { useDispatch, useContextData, updateDevice } from "./store";
14
14
  import "./device.less";
15
+
16
+ /**
17
+ * @title: 设备选择页
18
+ * @description: 选择设备信息,无设备增加提示;仅有一条,默认选中跳走;多条记录则停留等待用户选择
19
+ * @return React.Element
20
+ * @Author: hongbing.wang
21
+ * @Date: 2024-08-12 11:40
22
+ */
15
23
  export default (function (_ref) {
16
24
  var api = _ref.api,
17
25
  onChange = _ref.onChange,
@@ -38,6 +46,13 @@ export default (function (_ref) {
38
46
  list = _useState6[0],
39
47
  setList = _useState6[1];
40
48
  var dispatch = useDispatch();
49
+
50
+ /**
51
+ * @title: 设备选择事件
52
+ * @param {*} event
53
+ * @Author: hongbing.wang
54
+ * @Date: 2024-08-20 13:02
55
+ */
41
56
  var onClick = function onClick(event) {
42
57
  if (!net) {
43
58
  message.open({
@@ -56,6 +71,13 @@ export default (function (_ref) {
56
71
  onChange('page', mode === ModeEnum.Pay ? 'amount' : 'pay');
57
72
  }
58
73
  };
74
+
75
+ /**
76
+ * @title: 初始化加载设备列表页
77
+ * @description: 初始化加载设备列表页 若只有一条数据 则直接进入下一步
78
+ * @Author: hongbing.wang
79
+ * @Date: 2024-08-20 13:02
80
+ */
59
81
  useMount(function () {
60
82
  setLoading(true);
61
83
  api.getDeviceList({
@@ -1,3 +1,57 @@
1
+ import { State } from './store';
1
2
  export declare function getUuid(): string;
3
+ /**
4
+ * @title: Promise化 setTimeout
5
+ * @param {number} time
6
+ * @Author: hongbing.wang
7
+ * @Date: 2024-08-20 13:03
8
+ */
2
9
  export declare const sleep: (time: number) => Promise<unknown>;
10
+ /**
11
+ * @title: 克隆
12
+ * @Author: hongbing.wang
13
+ * @Date: 2024-08-20 13:03
14
+ */
3
15
  export declare function cloneDeep(source: any, hash?: WeakMap<object, any>): any;
16
+ declare type key = 'mode' | 'amount' | 'order_id' | 'number' | 'device' | 'pay' | 'custom';
17
+ /**
18
+ * @title: 获取支付回调参数
19
+ * @Author: hongbing.wang
20
+ * @Date: 2024-08-20 20:26
21
+ */
22
+ export declare const getPayParams: (data: Partial<Omit<State, key>> & Pick<State, Extract<key, keyof State>>, statue: 'success' | 'fail') => {
23
+ number: string | number | undefined;
24
+ device: {
25
+ [key: string]: unknown;
26
+ } | undefined;
27
+ order_id: string | number;
28
+ amount?: undefined;
29
+ total?: undefined;
30
+ } | {
31
+ cardReaderSurcharge: {};
32
+ surMoney: string;
33
+ surcharge: string;
34
+ total: string;
35
+ number: string | number | undefined;
36
+ device: {
37
+ [key: string]: unknown;
38
+ } | undefined;
39
+ order_id: string | number;
40
+ amount?: undefined;
41
+ } | {
42
+ amount: string | number;
43
+ total: string | number;
44
+ number: string | number | undefined;
45
+ device: {
46
+ [key: string]: unknown;
47
+ } | undefined;
48
+ order_id: string | number;
49
+ } | {
50
+ amount: string | number;
51
+ total: string | number;
52
+ number: string | number | undefined;
53
+ order_id: string | number;
54
+ device?: undefined;
55
+ };
56
+ export declare const limitDecimals: (value: any) => any;
57
+ export {};