@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
@@ -1,9 +1,3 @@
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
- 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; }
3
- 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; }
4
- 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; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -20,8 +14,17 @@ import { Decimal } from 'decimal.js';
20
14
  import React, { useMemo, useState } from 'react';
21
15
  import Alert from "./component/alert";
22
16
  import Titlebar from "./component/header/titlebar";
23
- import { getDeviceInfo } from "./manufacturer";
17
+ import { getAmonunt } from "./manufacturer";
18
+ import { limitDecimals } from "./helper";
24
19
  import { useDispatch, useContextData, updateComponent, updateState } from "./store";
20
+
21
+ /**
22
+ * @title: 支付金额信息配置页
23
+ * @description: 配置支付金额与手续费
24
+ * @return React.Element
25
+ * @Author: hongbing.wang
26
+ * @Date: 2024-08-12 11:35
27
+ */
25
28
  export default (function (_ref) {
26
29
  var _ref$className = _ref.className,
27
30
  className = _ref$className === void 0 ? '' : _ref$className,
@@ -39,13 +42,14 @@ export default (function (_ref) {
39
42
  status = _useState2[0],
40
43
  setStatus = _useState2[1];
41
44
  var store = useContextData();
42
- var _getDeviceInfo = getDeviceInfo(store),
43
- name = _getDeviceInfo.name,
44
- symbol = _getDeviceInfo.symbol,
45
- money = _getDeviceInfo.money,
46
- lastMoney = _getDeviceInfo.amount,
47
- surRate = _getDeviceInfo.surRate,
48
- surMoney = _getDeviceInfo.surMoney;
45
+ var _getAmonunt = getAmonunt(store),
46
+ name = _getAmonunt.name,
47
+ symbol = _getAmonunt.symbol,
48
+ money = _getAmonunt.money,
49
+ lastMoney = _getAmonunt.amount,
50
+ surRate = _getAmonunt.surRate,
51
+ surMoney = _getAmonunt.surMoney,
52
+ useOriginSurcharge = _getAmonunt.useOriginSurcharge;
49
53
  var _useState3 = useState(surRate),
50
54
  _useState4 = _slicedToArray(_useState3, 2),
51
55
  curSurRate = _useState4[0],
@@ -71,12 +75,28 @@ export default (function (_ref) {
71
75
  var moneyDeci = new Decimal(currentMoney);
72
76
  return moneyDeci.mul(surRateDeci.div(100)).toFixed(2, Decimal.ROUND_HALF_UP);
73
77
  }, [currentMoney, curSurRate]);
78
+
79
+ /**
80
+ * @title: 总手续费
81
+ * @description: 总手续费 = 比例手续费 + 固定手续费
82
+ * @return 总手续费
83
+ * @Author: hongbing.wang
84
+ * @Date: 2024-08-19 09:51
85
+ */
74
86
  var totalSurMoney = useMemo(function () {
75
87
  var surRateDeci = new Decimal(curSurRate);
76
88
  var moneyDeci = new Decimal(currentMoney);
77
89
  var surMoneyDeci = new Decimal(curSurMoney);
78
90
  return moneyDeci.mul(surRateDeci.div(100)).add(surMoneyDeci).toFixed(2, Decimal.ROUND_HALF_UP);
79
91
  }, [currentMoney, curSurRate, curSurMoney]);
92
+
93
+ /**
94
+ * @title: 总金额
95
+ * @description: 总金额 = 总手续费 + 订单金额
96
+ * @return 总金额
97
+ * @Author: hongbing.wang
98
+ * @Date: 2024-08-19 09:52
99
+ */
80
100
  var total = useMemo(function () {
81
101
  var totalSurDeci = new Decimal(totalSurMoney);
82
102
  var moneyDeci = new Decimal(currentMoney);
@@ -87,9 +107,14 @@ export default (function (_ref) {
87
107
  var currentMoneyDeci = new Decimal(currentMoney);
88
108
  return moneyDeci.sub(currentMoneyDeci).toFixed(2, Decimal.ROUND_HALF_UP);
89
109
  }, [currentMoney, money]);
90
- var onBack = function onBack() {
91
- setStatus(true);
92
- };
110
+
111
+ /**
112
+ * @title:提交
113
+ * @description: 1. 修改金额页面提交 前往下一步, 修改收费费金额 前往修改金额页
114
+ * @return {*}
115
+ * @Author: hongbing.wang
116
+ * @Date: 2024-08-19 09:50
117
+ */
93
118
  var onSubmit = function onSubmit() {
94
119
  if (!status) {
95
120
  setStatus(true);
@@ -119,17 +144,18 @@ export default (function (_ref) {
119
144
  };
120
145
  console.log('surRateMoney = ', surRateMoney);
121
146
  dispatch(updateState({
122
- custom: store.custom ? _objectSpread(_objectSpread({}, store.custom), {}, {
123
- pay: pay
124
- }) : {
125
- pay: pay
126
- }
147
+ pay: pay
127
148
  }));
128
149
  dispatch(updateComponent(''));
129
150
  onChange && onChange('page', 'pay');
130
- // 下一步
131
151
  };
132
152
 
153
+ /**
154
+ * @title: 取消
155
+ * @description: 跳出 支付页 返回支付失败
156
+ * @Author: hongbing.wang
157
+ * @Date: 2024-08-19 09:52
158
+ */
133
159
  var onCancel = function onCancel() {
134
160
  if (!status) {
135
161
  setStatus(true);
@@ -137,11 +163,24 @@ export default (function (_ref) {
137
163
  }
138
164
  onClose();
139
165
  };
166
+
167
+ /**
168
+ * @title: 回到编辑页
169
+ * @description:
170
+ * @Author: hongbing.wang
171
+ * @Date: 2024-08-19 09:53
172
+ */
140
173
  var onEdit = function onEdit() {
141
174
  setStatus(false);
142
175
  setTempSurRate(curSurRate);
143
176
  setTempSurMoney(curSurMoney);
144
177
  };
178
+
179
+ /**
180
+ * 1. 金额编辑页 status :true
181
+ * 2. 手续费编辑页 status :false
182
+ * isIpad 确认关闭按钮 出现在哪里
183
+ */
145
184
  return /*#__PURE__*/React.createElement("div", {
146
185
  className: "pisell-lowcode__eft-pay-amount ".concat(className)
147
186
  }, isIpad ? null : /*#__PURE__*/React.createElement(Titlebar, {
@@ -152,7 +191,6 @@ export default (function (_ref) {
152
191
  }, /*#__PURE__*/React.createElement("div", {
153
192
  className: "pisell-lowcode__eft-pay-cash",
154
193
  "data-money": formatAmount(money, 2, symbol)
155
- // format.replace(/{{.+}}/, `${money}`)
156
194
  }, locales.getText('page.eftpos-pay.text.amount.to.pay')), /*#__PURE__*/React.createElement("div", {
157
195
  className: "pisell-lowcode__eft-pay-money"
158
196
  }, /*#__PURE__*/React.createElement("div", {
@@ -187,7 +225,8 @@ export default (function (_ref) {
187
225
  className: "pisell-lowcode__eft-pay-money"
188
226
  }, locales.getText('page.eftpos-pay.text.surcharge.edit.inc.surcharge'), ": ", formatAmount("".concat(totalSurMoney), 2, symbol), " (", locales.getText('page.eftpos-pay.text.surcharge.edit.rate'), ":", curSurRate, "% + ", formatAmount("".concat(curSurMoney), 2, symbol), ")")), /*#__PURE__*/React.createElement(Button, {
189
227
  type: "link",
190
- onClick: onEdit
228
+ onClick: onEdit,
229
+ disabled: useOriginSurcharge
191
230
  }, locales.getText('page.eftpos-pay.text.surcharge.edit.surcharge')))) : /*#__PURE__*/React.createElement("div", {
192
231
  className: "pisell-lowcode__eft-pay-amount-body"
193
232
  }, /*#__PURE__*/React.createElement(Alert, null, locales.getText('page.eftpos-pay.text.surcharge.percentage-fixed')), /*#__PURE__*/React.createElement("div", {
@@ -237,16 +276,4 @@ export default (function (_ref) {
237
276
  onClick: onSubmit,
238
277
  disabled: currentMoney <= 0 && status
239
278
  }, locales.getText('page.eftpos-pay.text.sure'))));
240
- });
241
-
242
- // inputNumber过滤
243
- export var limitDecimals = function limitDecimals(value) {
244
- var reg = /^(\-)*(\d+)\.(\d\d).*$/;
245
- if (typeof value === 'string') {
246
- return !isNaN(Number(value)) ? value.replace(reg, '$1$2.$3') : '';
247
- }
248
- if (typeof value === 'number') {
249
- return !isNaN(value) ? String(value).replace(reg, '$1$2.$3') : '';
250
- }
251
- return '';
252
- };
279
+ });
@@ -1,9 +1,3 @@
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
- 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; }
3
- 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; }
4
- 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; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
1
  /* eslint-disable no-nested-ternary */
8
2
  import { locales } from '@pisell/utils';
9
3
  import { useMount } from 'ahooks';
@@ -22,37 +16,88 @@ export default (function (_ref) {
22
16
  var _useContextData = useContextData(),
23
17
  eftpos = _useContextData.eftpos,
24
18
  custom = _useContextData.custom,
25
- mode = _useContextData.mode;
19
+ mode = _useContextData.mode,
20
+ name = _useContextData.name,
21
+ symbol = _useContextData.symbol,
22
+ amount = _useContextData.amount,
23
+ order_id = _useContextData.order_id,
24
+ number = _useContextData.number,
25
+ device = _useContextData.device;
26
26
  var failCustom = custom === null || custom === void 0 ? void 0 : custom.failCustom;
27
27
  var dispatch = useDispatch();
28
+
29
+ /**
30
+ * @title: 重新支付
31
+ * @Author: hongbing.wang
32
+ * @Date: 2024-08-20 11:30
33
+ */
28
34
  var onRetry = function onRetry() {
29
35
  onChange('page', 'pay');
30
- dispatch(updateState(getInitState(eftpos, mode === ModeEnum.Query ? _objectSpread(_objectSpread({}, custom), {}, {
31
- isPay: true
32
- }) : _objectSpread(_objectSpread({}, custom), {}, {
33
- number: undefined,
34
- isPay: false
35
- }))));
36
+ dispatch(updateState(getInitState(eftpos, mode === ModeEnum.Query ? {
37
+ mode: mode,
38
+ name: name,
39
+ symbol: symbol,
40
+ amount: amount,
41
+ order_id: order_id
42
+ } : {
43
+ mode: mode,
44
+ name: name,
45
+ symbol: symbol,
46
+ amount: amount,
47
+ order_id: order_id,
48
+ number: ''
49
+ })));
36
50
  };
51
+
52
+ /**
53
+ * @title: 修改金额信息重新支付
54
+ * @Author: hongbing.wang
55
+ * @Date: 2024-08-20 11:30
56
+ */
37
57
  var onModify = function onModify() {
38
- dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread({}, custom), {}, {
39
- number: undefined,
40
- isPay: false
41
- }))));
58
+ dispatch(updateState(getInitState(eftpos, {
59
+ mode: mode,
60
+ name: name,
61
+ symbol: symbol,
62
+ amount: amount,
63
+ order_id: order_id,
64
+ number: ''
65
+ })));
42
66
  onChange('page', 'amount');
43
67
  };
68
+
69
+ /**
70
+ * @title: 手动标记
71
+ * @description: 前往手动标记
72
+ * @return {*}
73
+ * @Author: hongbing.wang
74
+ * @Date: 2024-08-20 11:31
75
+ */
44
76
  var onManually = function onManually() {
45
77
  dispatch(updateState({
46
78
  manual: {
47
- title: locales.getText('page.eftpos-pay.text.request.title')(mode),
48
- text: locales.getText('page.eftpos-pay.text.request.text')(mode)
79
+ title: locales.getText('page.eftpos-pay.text.request.unknown.title')(mode),
80
+ text: locales.getText('page.eftpos-pay.text.request.unknown.text')(mode)
49
81
  }
50
82
  }));
51
83
  dispatch(updateComponent('Manual'));
52
84
  };
85
+
86
+ /**
87
+ * @title: 关闭支付页面
88
+ * @description: 交易关闭页面
89
+ * @Author: hongbing.wang
90
+ * @Date: 2024-08-20 11:32
91
+ */
53
92
  var onClose = function onClose() {
54
- onChange('fail');
93
+ onChange('fail', {
94
+ number: number,
95
+ device: device,
96
+ order_id: order_id
97
+ });
55
98
  };
99
+
100
+ // 错误页 通知外界 开发关闭按钮
56
101
  useMount(function () {
57
102
  if ((failCustom === null || failCustom === void 0 ? void 0 : failCustom.status) === 'fail') {
58
103
  onChange('page', 'fail');
@@ -1,9 +1,3 @@
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
- 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; }
3
- 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; }
4
- 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; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
1
  /* eslint-disable no-nested-ternary */
8
2
  import { locales } from '@pisell/utils';
9
3
  import { Button } from 'antd';
@@ -11,7 +5,7 @@ import { useMount } from 'ahooks';
11
5
  import React from 'react';
12
6
  import XClose from '@pisell/icon/es/XClose';
13
7
  import { getInitState } from "../../manufacturer";
14
- import { useDispatch, useContextData, updateState, updateCustomStemItem, updateComponent } from "../../store";
8
+ import { useDispatch, useContextData, updateState, updateComponent } from "../../store";
15
9
  import Header from "../header";
16
10
  export default (function (_ref) {
17
11
  var _steps$step, _steps$step$custom;
@@ -23,47 +17,83 @@ export default (function (_ref) {
23
17
  eftpos = _useContextData.eftpos,
24
18
  step = _useContextData.step,
25
19
  steps = _useContextData.steps,
26
- custom = _useContextData.custom,
27
- mode = _useContextData.mode;
20
+ mode = _useContextData.mode,
21
+ name = _useContextData.name,
22
+ symbol = _useContextData.symbol,
23
+ amount = _useContextData.amount,
24
+ order_id = _useContextData.order_id,
25
+ number = _useContextData.number,
26
+ device = _useContextData.device;
28
27
  var isPosNetworkError = ((_steps$step = steps[step]) === null || _steps$step === void 0 ? void 0 : (_steps$step$custom = _steps$step.custom) === null || _steps$step$custom === void 0 ? void 0 : _steps$step$custom.isPosNetworkError) || false;
29
28
  var dispatch = useDispatch();
29
+
30
+ /**
31
+ * @title: 重新支付
32
+ * @Author: hongbing.wang
33
+ * @Date: 2024-08-20 11:30
34
+ */
30
35
  var onRetry = function onRetry() {
31
36
  onChange('page', 'pay');
32
- dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread({}, custom), {}, {
33
- number: undefined
34
- }))));
35
- dispatch(updateCustomStemItem({
36
- custom: {
37
- status: undefined
38
- },
39
- step: step
40
- }));
37
+ dispatch(updateState(getInitState(eftpos, {
38
+ mode: mode,
39
+ name: name,
40
+ symbol: symbol,
41
+ amount: amount,
42
+ order_id: order_id,
43
+ number: ''
44
+ })));
41
45
  };
46
+
47
+ /**
48
+ * @title: 修改金额信息重新支付
49
+ * @Author: hongbing.wang
50
+ * @Date: 2024-08-20 11:30
51
+ */
42
52
  var onModify = function onModify() {
43
- dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread({}, custom), {}, {
44
- number: undefined
45
- }))));
46
- dispatch(updateCustomStemItem({
47
- custom: {
48
- status: undefined
49
- },
50
- step: step
51
- }));
53
+ dispatch(updateState(getInitState(eftpos, {
54
+ mode: mode,
55
+ name: name,
56
+ symbol: symbol,
57
+ amount: amount,
58
+ order_id: order_id,
59
+ number: ''
60
+ })));
52
61
  onChange('page', 'amount');
53
62
  };
63
+
64
+ /**
65
+ * @title: 手动标记
66
+ * @description: 前往手动标记
67
+ * @return {*}
68
+ * @Author: hongbing.wang
69
+ * @Date: 2024-08-20 11:31
70
+ */
54
71
  var onManually = function onManually() {
55
72
  dispatch(updateState({
56
73
  manual: {
57
- title: locales.getText('page.eftpos-pay.text.timedout.title'),
58
- text: locales.getText('page.eftpos-pay.text.timedout.text')(mode)
74
+ title: locales.getText('page.eftpos-pay.text.request.unknown.title')(mode),
75
+ text: locales.getText('page.eftpos-pay.text.request.unknown.text')(mode)
59
76
  }
60
77
  }));
61
78
  dispatch(updateComponent('Manual'));
62
79
  };
80
+
81
+ /**
82
+ * @title: 关闭支付页面
83
+ * @description: 交易关闭页面
84
+ * @Author: hongbing.wang
85
+ * @Date: 2024-08-20 11:32
86
+ */
63
87
  var onClose = function onClose() {
64
88
  // 支付失败页
65
- onChange('fail');
89
+ onChange('fail', {
90
+ number: number,
91
+ device: device,
92
+ order_id: order_id
93
+ });
66
94
  };
95
+
96
+ // 错误页 通知外界 开发关闭按钮
67
97
  useMount(function () {
68
98
  if (steps[step].status === 'fail') {
69
99
  onChange('page', 'fail');
@@ -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:40
7
+ */
3
8
  declare const _default: ({ className }: ActionProps) => React.JSX.Element;
4
9
  export default _default;
@@ -8,6 +8,12 @@ import { locales } from '@pisell/utils';
8
8
  import React, { useEffect, useState } from 'react';
9
9
  import { Button, message } from 'antd';
10
10
  import Header from "../header";
11
+
12
+ /**
13
+ * @title: 断网(客户端)提示页
14
+ * @Author: hongbing.wang
15
+ * @Date: 2024-08-20 11:40
16
+ */
11
17
  export default (function (_ref) {
12
18
  var _ref$className = _ref.className,
13
19
  className = _ref$className === void 0 ? '' : _ref$className;
@@ -23,6 +29,13 @@ export default (function (_ref) {
23
29
  clearTimeout(clear);
24
30
  };
25
31
  }, []);
32
+
33
+ /**
34
+ * @title: 重新连接
35
+ * @description: 只做提示
36
+ * @Author: hongbing.wang
37
+ * @Date: 2024-08-20 11:41
38
+ */
26
39
  var onReconnect = function onReconnect() {
27
40
  message.open({
28
41
  key: 'net-warning',
@@ -1,4 +1,10 @@
1
1
  import React from 'react';
2
2
  import { ActionProps } from '../../const';
3
+ /**
4
+ * @title: 支付状态未知页面
5
+ * @description:
6
+ * @Author: hongbing.wang
7
+ * @Date: 2024-08-20 11:42
8
+ */
3
9
  declare const _default: ({ className }: ActionProps) => React.JSX.Element;
4
10
  export default _default;
@@ -4,13 +4,27 @@ import { Button } from 'antd';
4
4
  import React, { useEffect } from 'react';
5
5
  import { useDispatch, useContextData, updateState, updateComponent } from "../../store";
6
6
  import Header from "../header";
7
+
8
+ /**
9
+ * @title: 支付状态未知页面
10
+ * @description:
11
+ * @Author: hongbing.wang
12
+ * @Date: 2024-08-20 11:42
13
+ */
7
14
  export default (function (_ref) {
8
15
  var _ref$className = _ref.className,
9
16
  className = _ref$className === void 0 ? '' : _ref$className;
10
17
  var _useContextData = useContextData(),
11
- lastComponent = _useContextData.lastComponent,
18
+ form = _useContextData.form,
12
19
  mode = _useContextData.mode;
13
20
  var dispatch = useDispatch();
21
+
22
+ /**
23
+ * @title: 手动标记
24
+ * @description: 前往手动标记
25
+ * @Author: hongbing.wang
26
+ * @Date: 2024-08-20 11:31
27
+ */
14
28
  var onManually = function onManually() {
15
29
  dispatch(updateState({
16
30
  manual: {
@@ -21,10 +35,11 @@ export default (function (_ref) {
21
35
  dispatch(updateComponent('Manual'));
22
36
  };
23
37
  useEffect(function () {
24
- if (lastComponent === 'Network') {
38
+ // 如果 网络终端 恢复至此页面 则需要 回归 步骤流程
39
+ if (form === 'Network' || form === 'restore') {
25
40
  dispatch(updateComponent(''));
26
41
  }
27
- }, [lastComponent]);
42
+ }, [form]);
28
43
  return /*#__PURE__*/React.createElement("div", {
29
44
  className: "pisell-lowcode__eft-pay-box ".concat(className)
30
45
  }, /*#__PURE__*/React.createElement(Header, {
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import { StatusType } from '../../const';
3
3
  import './index.less';
4
- declare const _default: ({ status, title, children }: {
4
+ declare const _default: ({ status, title, subTitle, children }: {
5
5
  status: StatusType;
6
6
  title?: string | undefined;
7
+ subTitle?: string | undefined;
7
8
  children?: React.ReactNode;
8
9
  }) => React.JSX.Element;
9
10
  export default _default;
@@ -55,6 +55,7 @@ export default (function (_ref2) {
55
55
  var status = _ref2.status,
56
56
  _ref2$title = _ref2.title,
57
57
  title = _ref2$title === void 0 ? '' : _ref2$title,
58
+ subTitle = _ref2.subTitle,
58
59
  children = _ref2.children;
59
60
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
60
61
  className: "pisell-lowcode__eft-pay-icon"
@@ -62,5 +63,7 @@ export default (function (_ref2) {
62
63
  status: status
63
64
  }), children), title ? /*#__PURE__*/React.createElement("div", {
64
65
  className: "pisell-lowcode__eft-pay-title"
65
- }, title) : null);
66
+ }, title) : null, subTitle ? /*#__PURE__*/React.createElement("div", {
67
+ className: "pisell-lowcode__eft-pay-sub-title"
68
+ }, subTitle) : null);
66
69
  });
@@ -24,16 +24,7 @@
24
24
  }
25
25
  .pisell-lowcode__eft-pay-load {
26
26
  animation: spin 1s linear infinite;
27
- }
28
- // .pisell-lowcode__eft-pay-success{
29
-
30
- // }
31
- // .pisell-lowcode__eft-pay-warn{
32
-
33
- // }
34
- // .pisell-lowcode__eft-pay-fail{
35
-
36
- // }
27
+ }
37
28
  @keyframes spin {
38
29
  from {
39
30
  transform: rotate(0deg);
@@ -1,5 +1,10 @@
1
1
  import React from 'react';
2
2
  import { ActionProps } from '../../const';
3
3
  import './index.less';
4
- declare const _default: ({ onChange, className }: ActionProps) => React.JSX.Element;
4
+ /**
5
+ * @title: 结果标记页面
6
+ * @Author: hongbing.wang
7
+ * @Date: 2024-08-20 11:46
8
+ */
9
+ declare const _default: ({ onChange, className, formatAmount }: ActionProps) => React.JSX.Element;
5
10
  export default _default;