@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,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 = ["action", "getApi", "device_number", "terminal"];
2
+ var _excluded = ["action", "getApi", "device_number", "terminal", "tyroUrl", "tyroVersion", "onChangeParams"];
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; }
@@ -15,7 +15,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
15
15
  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; }
16
16
  /* eslint-disable react/destructuring-assignment */
17
17
  import { locales } from '@pisell/utils';
18
- import React, { useEffect, useState, useMemo, useRef } from 'react';
18
+ import React, { useEffect, useState, useMemo, useRef, useCallback } from 'react';
19
19
  import { useNetwork } from 'ahooks';
20
20
  import useEngineContext from "../../hooks/useEngineContext";
21
21
  import Amount from "./amount";
@@ -24,7 +24,7 @@ import Device from "./device";
24
24
  import localeTexts from "./locales";
25
25
  import { getInitState } from "./manufacturer";
26
26
  import Pay from "./pay";
27
- import { Provider, useContextData } from "./store";
27
+ import { Provider, useContextData, useDispatch, updateState } from "./store";
28
28
  import "./index.less";
29
29
  locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
30
30
  var App = function App(_ref) {
@@ -33,15 +33,17 @@ var App = function App(_ref) {
33
33
  getApi = _ref.getApi,
34
34
  device_number = _ref.device_number,
35
35
  terminal = _ref.terminal,
36
+ tyroUrl = _ref.tyroUrl,
37
+ tyroVersion = _ref.tyroVersion,
38
+ onChangeParams = _ref.onChangeParams,
36
39
  props = _objectWithoutProperties(_ref, _excluded);
37
40
  var data = useContextData();
38
- var ref = useRef(false);
41
+ var dispatch = useDispatch();
39
42
  var _useState = useState(action),
40
43
  _useState2 = _slicedToArray(_useState, 2),
41
44
  current = _useState2[0],
42
45
  setCurrent = _useState2[1];
43
46
  var statusRef = useRef(data.status);
44
- var actRef = useRef(action);
45
47
  var context = useEngineContext();
46
48
  var _ref2 = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {
47
49
  formatAmount: function formatAmount(number, precision, symbol) {
@@ -53,12 +55,17 @@ var App = function App(_ref) {
53
55
  },
54
56
  formatAmount = _ref2.formatAmount,
55
57
  isTerminal = _ref2.isTerminal;
58
+
59
+ // 外部网络数据
56
60
  var network = useMemo(function () {
57
61
  return typeof terminal.network === 'boolean' ? terminal.network : true;
58
62
  }, [terminal === null || terminal === void 0 ? void 0 : terminal.network]);
63
+ // 内部网络数据
59
64
  var _useNetwork = useNetwork(),
60
65
  online = _useNetwork.online;
61
66
  var netRef = useRef([network, online]);
67
+
68
+ // 网络数据
62
69
  var net = useMemo(function () {
63
70
  var networkChange = false,
64
71
  onlineChange = false;
@@ -81,6 +88,12 @@ var App = function App(_ref) {
81
88
  var isIpad = useMemo(function () {
82
89
  return isTerminal && isTerminal();
83
90
  }, [isTerminal]);
91
+
92
+ /**
93
+ * @title: api 接口 数据
94
+ * @Author: hongbing.wang
95
+ * @Date: 2024-08-20 13:10
96
+ */
84
97
  var api = useMemo(function () {
85
98
  if (typeof getApi === 'function') {
86
99
  return getApi();
@@ -88,20 +101,51 @@ var App = function App(_ref) {
88
101
  return {};
89
102
  }, [getApi]);
90
103
 
91
- // 切换
92
- var onChange = function onChange(status, params) {
104
+ /**
105
+ * @title: 缓存状态数据 可以用于闪退,成功or失败时清除缓存
106
+ * @Author: hongbing.wang
107
+ * @Date: 2024-08-20 10:27
108
+ */
109
+ useEffect(function () {
110
+ onChangeParams && onChangeParams(_objectSpread(_objectSpread(_objectSpread({}, data), data.eftpos === 'tyro' ? {
111
+ custom: _objectSpread(_objectSpread({}, data.custom), {}, {
112
+ btnList: [],
113
+ list: []
114
+ })
115
+ } : {}), {}, {
116
+ form: 'restore'
117
+ }));
118
+ }, [data, onChangeParams]);
119
+
120
+ /**
121
+ * @title: 支付状态切换页
122
+ * @Author: hongbing.wang
123
+ * @Date: 2024-08-20 13:10
124
+ */
125
+ var onChange = useCallback(function (status, params) {
93
126
  if (status === 'page' && typeof params === 'string') {
94
127
  if (['amount', 'deviceList', 'pay'].includes(params)) {
95
128
  setCurrent(params);
129
+ dispatch(updateState({
130
+ action: params
131
+ }));
96
132
  }
97
133
  }
98
134
  console.log('状态切换 = ', status, params);
99
135
  props.onChangeStatus(status, params);
100
- };
136
+ }, []);
101
137
 
102
- // 成功失败
138
+ /**
139
+ * @title: 支付失败
140
+ * @Author: hongbing.wang
141
+ * @Date: 2024-08-20 13:09
142
+ */
103
143
  var onClose = function onClose() {
104
- onChange('fail');
144
+ onChange('fail', {
145
+ number: data.number,
146
+ device: data.device,
147
+ order_id: data.order_id
148
+ });
105
149
  };
106
150
  if (current === RouteEnum.DeviceList) {
107
151
  return /*#__PURE__*/React.createElement(Device, {
@@ -126,11 +170,14 @@ var App = function App(_ref) {
126
170
  }
127
171
  return /*#__PURE__*/React.createElement(Pay, {
128
172
  api: api,
173
+ tyroUrl: tyroUrl,
174
+ tyroVersion: tyroVersion,
129
175
  onChange: onChange,
130
176
  className: isIpad ? 'pisell-lowcode__eft-pay-terminal' : '',
131
177
  terminal: terminal,
132
178
  isIpad: isIpad,
133
- net: net
179
+ net: net,
180
+ formatAmount: formatAmount
134
181
  });
135
182
  };
136
183
  export default (function (props) {
@@ -140,31 +187,34 @@ export default (function (props) {
140
187
  store: {}
141
188
  },
142
189
  store = _ref3.store;
190
+ var symbol = (store === null || store === void 0 ? void 0 : (_store$getState = store.getState) === null || _store$getState === void 0 ? void 0 : (_store$getState$call = _store$getState.call(store)) === null || _store$getState$call === void 0 ? void 0 : (_store$getState$call$ = _store$getState$call.global) === null || _store$getState$call$ === void 0 ? void 0 : _store$getState$call$.symbol) || '$';
143
191
  var mode = useMemo(function () {
192
+ if (props.source === 'restore') {
193
+ if (props.params) {
194
+ if (props.params.mode) {
195
+ return props.params.mode;
196
+ }
197
+ }
198
+ return ModeEnum.Pay;
199
+ }
144
200
  if (props.mode) {
145
201
  return props.mode;
146
202
  }
147
203
  return ModeEnum.Pay;
148
- }, [props.mode]);
149
- var action = useMemo(function () {
150
- if (mode === ModeEnum.Pay) {
151
- return RouteEnum.DeviceList;
152
- }
153
- if (mode === ModeEnum.Refund) {
154
- return RouteEnum.DeviceList;
155
- }
156
- if (mode === ModeEnum.Query) {
157
- return RouteEnum.Pay;
158
- }
159
- throw Error('未知模式');
160
- }, [mode]);
161
- var symbol = (store === null || store === void 0 ? void 0 : (_store$getState = store.getState) === null || _store$getState === void 0 ? void 0 : (_store$getState$call = _store$getState.call(store)) === null || _store$getState$call === void 0 ? void 0 : (_store$getState$call$ = _store$getState$call.global) === null || _store$getState$call$ === void 0 ? void 0 : _store$getState$call$.symbol) || '$';
162
- var onChangeStatus = function onChangeStatus(status, params) {
163
- props.onChangeStatus(status, params);
164
- };
204
+ }, [props.mode, props.source, props.params]);
205
+
206
+ /**
207
+ * @title: 构建全局状态
208
+ * @description: 1. 初始化, 2. 恢复
209
+ * @Author: hongbing.wang
210
+ * @Date: 2024-08-20 13:11
211
+ */
165
212
  var state = useMemo(function () {
166
213
  var current = props.params && props.params.symbol ? props.params.symbol : symbol;
167
- console.log('current 单位 = ', props.params.symbol, symbol);
214
+ // console.log('current 单位 = ', props.params.symbol, symbol);
215
+ if (props.source === 'restore') {
216
+ return props.params;
217
+ }
168
218
  return getInitState(props.type, props.params ? _objectSpread(_objectSpread({
169
219
  mode: mode
170
220
  }, props.params), {}, {
@@ -174,9 +224,45 @@ export default (function (props) {
174
224
  symbol: current
175
225
  });
176
226
  }, [mode, props.params, props.type, symbol]);
177
- useEffect(function () {
178
- document.body.id = 'body';
227
+ var onChangeStatus = useCallback(function (status, params) {
228
+ props.onChangeStatus(status, params);
179
229
  }, []);
230
+ var action = useMemo(function () {
231
+ var act = function () {
232
+ if (state.action) {
233
+ return state.action;
234
+ }
235
+ if (mode === ModeEnum.Pay) {
236
+ if (state.device && state.pay) {
237
+ return RouteEnum.Pay;
238
+ }
239
+ if (state.device) {
240
+ return RouteEnum.Amount;
241
+ }
242
+ return RouteEnum.DeviceList;
243
+ }
244
+ if (mode === ModeEnum.Refund) {
245
+ if (state.device) {
246
+ return RouteEnum.Pay;
247
+ }
248
+ return RouteEnum.DeviceList;
249
+ }
250
+ if (mode === ModeEnum.Query) {
251
+ return RouteEnum.Pay;
252
+ }
253
+ throw Error('未知模式');
254
+ }();
255
+ if (props.source === 'restore') {
256
+ onChangeStatus('page', act);
257
+ }
258
+ return act;
259
+ }, [mode, state]);
260
+
261
+ // useEffect(() => {
262
+ // document.body.id = 'body';
263
+ // }, []);
264
+
265
+ // console.log('action = ', action);
180
266
  console.log('props?.params?.device_number = ', props === null || props === void 0 ? void 0 : (_props$params = props.params) === null || _props$params === void 0 ? void 0 : _props$params.device_number);
181
267
  return /*#__PURE__*/React.createElement(Provider, {
182
268
  state: state
@@ -185,7 +271,9 @@ export default (function (props) {
185
271
  params: props.params,
186
272
  onChangeStatus: onChangeStatus,
187
273
  terminal: props.terminal,
274
+ onChangeParams: props.onChangeParams,
188
275
  action: action,
276
+ source: props.source,
189
277
  device_number: props === null || props === void 0 ? void 0 : (_props$params2 = props.params) === null || _props$params2 === void 0 ? void 0 : _props$params2.device_number
190
278
  }));
191
279
  });
@@ -1,17 +1,17 @@
1
- @import './var.less';
1
+ @import './var.less';
2
2
 
3
3
  .pisell-lowcode__eft-pay-amount {
4
4
  display: flex;
5
5
  flex-direction: column;
6
6
  }
7
7
 
8
- //
9
8
  .pisell-lowcode__eft-pay-step-box {
10
9
  display: flex;
11
10
  flex-direction: column;
12
11
  gap: 4;
13
12
  margin: 4px 0;
14
13
  }
14
+ .pisell-lowcode__eft-pay-sub-title,
15
15
  .pisell-lowcode__eft-pay-step-item,
16
16
  .pisell-lowcode__eft-pay-step-item-success {
17
17
  color: var(--gray-true-900, #141414);
@@ -19,6 +19,8 @@
19
19
  font-style: normal;
20
20
  font-weight: 400;
21
21
  line-height: 20px; /* 142.857% */
22
+
23
+ white-space: pre-line;
22
24
  }
23
25
  .pisell-lowcode__eft-pay-step-item-icon {
24
26
  vertical-align: middle;
@@ -30,7 +32,7 @@
30
32
  }
31
33
  .pisell-lowcode__eft-pay-step-item-loading {
32
34
  color: var(--gray-500, #667085);
33
-
35
+
34
36
  font-size: 14px;
35
37
  font-style: normal;
36
38
  font-weight: 400;
@@ -39,7 +41,7 @@
39
41
  .pisell-lowcode__eft-pay-step-item-tip {
40
42
  color: var(--gray-500, #667085);
41
43
  /* Text sm/Regular */
42
-
44
+
43
45
  font-size: 14px;
44
46
  font-style: normal;
45
47
  font-weight: 400;
@@ -56,9 +58,6 @@
56
58
  height: 48px !important;
57
59
  }
58
60
 
59
-
60
-
61
-
62
61
  .pisell-lowcode__eft-pay-amount-body {
63
62
  gap: 20px;
64
63
  display: flex;
@@ -86,7 +85,7 @@
86
85
  .pisell-lowcode__eft-pay-money-title {
87
86
  color: var(--Gray-700, #344054);
88
87
  /* Text sm/Semibold */
89
-
88
+
90
89
  font-size: 14px;
91
90
  font-style: normal;
92
91
  font-weight: 600;
@@ -95,7 +94,7 @@
95
94
  .pisell-lowcode__eft-pay-money-tip {
96
95
  color: var(--Gray-600, #475467);
97
96
  /* Text sm/Regular */
98
-
97
+
99
98
  font-size: 14px;
100
99
  font-style: normal;
101
100
  font-weight: 400;
@@ -116,7 +115,7 @@
116
115
  .pisell-lowcode__eft-pay-total {
117
116
  color: var(--Gray-900, #101828);
118
117
  /* Text sm/Regular */
119
-
118
+
120
119
  font-size: 14px;
121
120
  font-style: normal;
122
121
  font-weight: 400;
@@ -125,7 +124,7 @@
125
124
  .pisell-lowcode__eft-pay-money {
126
125
  color: var(--Gray-900, #101828);
127
126
  /* Text sm/Regular */
128
-
127
+
129
128
  font-size: 14px;
130
129
  font-style: normal;
131
130
  font-weight: 400;
@@ -148,7 +147,7 @@
148
147
 
149
148
  color: var(--Warning-700, #b54708);
150
149
  /* Text sm/Semibold */
151
-
150
+
152
151
  font-size: 14px;
153
152
  font-style: normal;
154
153
  font-weight: 600;
@@ -183,7 +182,7 @@
183
182
  color: var(--Gray-700, #344054);
184
183
 
185
184
  /* Text sm/Semibold */
186
-
185
+
187
186
  font-size: 14px;
188
187
  font-style: normal;
189
188
  font-weight: 600;
@@ -207,7 +206,7 @@
207
206
  .pisell-lowcode__eft-pay-warn-title {
208
207
  color: var(--gray-900, #101828);
209
208
  /* Text lg/Semibold */
210
-
209
+
211
210
  font-size: 18px;
212
211
  font-style: normal;
213
212
  font-weight: 600;
@@ -218,28 +217,28 @@
218
217
  .pisell-lowcode__eft-pay-warn-text {
219
218
  color: var(--error-600, #d92d20);
220
219
  /* Text sm/Regular */
221
-
220
+
222
221
  font-size: 14px;
223
222
  font-style: normal;
224
223
  font-weight: 400;
225
224
  line-height: 20px; /* 142.857% */
226
- }
227
225
 
226
+ white-space: pre-line;
227
+ }
228
228
 
229
229
  .pisell-lowcode__eft-pay-step-item-resolve {
230
230
  color: var(--gray-true-900, #141414);
231
-
231
+
232
232
  font-size: 14px;
233
233
  font-style: normal;
234
234
  font-weight: 400;
235
235
  line-height: 20px; /* 142.857% */
236
236
  }
237
- .pisell-lowcode__eft-pay-manual-btn{
237
+ .pisell-lowcode__eft-pay-manual-btn {
238
238
  // height: ;
239
239
  height: 48px !important;
240
240
  }
241
241
 
242
-
243
242
  .pisell-lowcode__eft-pay-box {
244
243
  max-height: var(--pisel-lc-pos-pay-max-height, unset);
245
244
  width: var(--pisel-lc-pos-pay-width, 600px);
@@ -261,3 +260,12 @@
261
260
  flex-direction: column;
262
261
  }
263
262
 
263
+ .pisell-lowcode__eft-pay-tyro-text {
264
+ color: var(--Gray-900, #101828);
265
+ /* Text sm/Regular */
266
+ font-size: 14px;
267
+ font-style: normal;
268
+ font-weight: 400;
269
+ line-height: 20px; /* 142.857% */
270
+ padding: 0 0 12px 0;
271
+ }
@@ -30,6 +30,13 @@ declare const _default: {
30
30
  'page.eftpos-pay.text.accept': string;
31
31
  'page.eftpos-pay.text.decline': string;
32
32
  'page.eftpos-pay.text.manual.marking': string;
33
+ 'page.eftpos-pay.text.manual.title': string;
34
+ 'page.eftpos-pay.text.manual.subtitle': (money: string) => string;
35
+ 'page.eftpos-pay.text.manual.confirm': string;
36
+ 'page.eftpos-pay.text.manual.btn.confirm': (money: string) => string;
37
+ 'page.eftpos-pay.text.manual.diff': string;
38
+ 'page.eftpos-pay.text.manual.tip': string;
39
+ 'page.eftpos-pay.text.manual.cancel': string;
33
40
  'page.eftpos-pay.text.modify.payment.info': (mode: string) => "Modify payment info" | "Modify refund information";
34
41
  'page.eftpos-pay.text.successful': (mode: string) => string;
35
42
  'page.eftpos-pay.text.failed': (mode: string) => string;
@@ -58,6 +65,12 @@ declare const _default: {
58
65
  'page.eftpos-pay.text.surcharge.edit.rate': string;
59
66
  'page.eftpos-pay.text.surcharge.edit.surcharge': string;
60
67
  'page.eftpos-pay.text.transaction.end': string;
68
+ 'page.eftpos-pay.text.transaction.user.declined.title': string;
69
+ 'page.eftpos-pay.text.transaction.user.declined.text': string;
70
+ 'page.eftpos-pay.text.transaction.user.config.title': string;
71
+ 'page.eftpos-pay.text.transaction.user.config.text': string;
72
+ 'page.eftpos-pay.text.transaction.back.declined.title': string;
73
+ 'page.eftpos-pay.text.transaction.back.declined.text': string;
61
74
  'page.eftpos-pay.text.transaction.fail': string;
62
75
  'page.eftpos-pay.text.transaction.fail.timeout': string;
63
76
  'page.eftpos-pay.text.transaction.pay.fail.timeout': string;
@@ -85,6 +98,8 @@ declare const _default: {
85
98
  'page.eftpos-pay.text.reconnect.network': string;
86
99
  'page.eftpos-pay.text.network.disconnected': string;
87
100
  'page.eftpos-pay.text.not.connected': string;
101
+ 'page.eftpos-pay.text.tyro-btn': (key: string) => string;
102
+ 'page.eftpos-pay.text.tyro': (key: string) => string;
88
103
  };
89
104
  'zh-CN': {
90
105
  'page.eftpos-pay.text.loading': (mode: string) => string;
@@ -117,6 +132,13 @@ declare const _default: {
117
132
  'page.eftpos-pay.text.accept': string;
118
133
  'page.eftpos-pay.text.decline': string;
119
134
  'page.eftpos-pay.text.manual.marking': string;
135
+ 'page.eftpos-pay.text.manual.title': string;
136
+ 'page.eftpos-pay.text.manual.subtitle': (money: string) => string;
137
+ 'page.eftpos-pay.text.manual.confirm': string;
138
+ 'page.eftpos-pay.text.manual.btn.confirm': (money: string) => string;
139
+ 'page.eftpos-pay.text.manual.diff': string;
140
+ 'page.eftpos-pay.text.manual.tip': string;
141
+ 'page.eftpos-pay.text.manual.cancel': string;
120
142
  'page.eftpos-pay.text.modify.payment.info': (mode: string) => "修改支付信息" | "修改退款信息";
121
143
  'page.eftpos-pay.text.successful': (mode: string) => string;
122
144
  'page.eftpos-pay.text.failed': (mode: string) => string;
@@ -145,6 +167,12 @@ declare const _default: {
145
167
  'page.eftpos-pay.text.surcharge.edit.rate': string;
146
168
  'page.eftpos-pay.text.surcharge.edit.surcharge': string;
147
169
  'page.eftpos-pay.text.transaction.end': string;
170
+ 'page.eftpos-pay.text.transaction.user.declined.title': string;
171
+ 'page.eftpos-pay.text.transaction.user.declined.text': string;
172
+ 'page.eftpos-pay.text.transaction.user.config.title': string;
173
+ 'page.eftpos-pay.text.transaction.user.config.text': string;
174
+ 'page.eftpos-pay.text.transaction.back.declined.title': string;
175
+ 'page.eftpos-pay.text.transaction.back.declined.text': string;
148
176
  'page.eftpos-pay.text.transaction.fail': string;
149
177
  'page.eftpos-pay.text.transaction.fail.timeout': string;
150
178
  'page.eftpos-pay.text.transaction.pay.fail.timeout': string;
@@ -172,6 +200,8 @@ declare const _default: {
172
200
  'page.eftpos-pay.text.reconnect.network': string;
173
201
  'page.eftpos-pay.text.network.disconnected': string;
174
202
  'page.eftpos-pay.text.not.connected': string;
203
+ 'page.eftpos-pay.text.tyro-btn': (key: string) => string;
204
+ 'page.eftpos-pay.text.tyro': (key: string) => string | string[];
175
205
  };
176
206
  'zh-HK': {
177
207
  'page.eftpos-pay.text.loading': (mode: string) => string;
@@ -204,6 +234,13 @@ declare const _default: {
204
234
  'page.eftpos-pay.text.accept': string;
205
235
  'page.eftpos-pay.text.decline': string;
206
236
  'page.eftpos-pay.text.manual.marking': string;
237
+ 'page.eftpos-pay.text.manual.title': string;
238
+ 'page.eftpos-pay.text.manual.subtitle': (money: string) => string;
239
+ 'page.eftpos-pay.text.manual.confirm': string;
240
+ 'page.eftpos-pay.text.manual.btn.confirm': (money: string) => string;
241
+ 'page.eftpos-pay.text.manual.diff': string;
242
+ 'page.eftpos-pay.text.manual.tip': string;
243
+ 'page.eftpos-pay.text.manual.cancel': string;
207
244
  'page.eftpos-pay.text.modify.payment.info': (mode: string) => "修改支付信息" | "修改退款信息";
208
245
  'page.eftpos-pay.text.successful': (mode: string) => string;
209
246
  'page.eftpos-pay.text.failed': (mode: string) => string;
@@ -232,6 +269,12 @@ declare const _default: {
232
269
  'page.eftpos-pay.text.surcharge.edit.rate': string;
233
270
  'page.eftpos-pay.text.surcharge.edit.surcharge': string;
234
271
  'page.eftpos-pay.text.transaction.end': string;
272
+ 'page.eftpos-pay.text.transaction.user.declined.title': string;
273
+ 'page.eftpos-pay.text.transaction.user.declined.text': string;
274
+ 'page.eftpos-pay.text.transaction.user.config.title': string;
275
+ 'page.eftpos-pay.text.transaction.user.config.text': string;
276
+ 'page.eftpos-pay.text.transaction.back.declined.title': string;
277
+ 'page.eftpos-pay.text.transaction.back.declined.text': string;
235
278
  'page.eftpos-pay.text.transaction.fail': string;
236
279
  'page.eftpos-pay.text.transaction.fail.timeout': string;
237
280
  'page.eftpos-pay.text.transaction.pay.fail.timeout': string;
@@ -259,6 +302,8 @@ declare const _default: {
259
302
  'page.eftpos-pay.text.reconnect.network': string;
260
303
  'page.eftpos-pay.text.network.disconnected': string;
261
304
  'page.eftpos-pay.text.not.connected': string;
305
+ 'page.eftpos-pay.text.tyro-btn': (key: string) => string;
306
+ 'page.eftpos-pay.text.tyro': (key: string) => string | string[];
262
307
  };
263
308
  };
264
309
  export default _default;