@pisell/private-materials 6.3.124 → 6.3.125

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 (73) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  8. package/es/components/eftpos/hooks.d.ts +0 -1
  9. package/es/components/eftposPay/amount.js +15 -1
  10. package/es/components/eftposPay/app.js +2 -1
  11. package/es/components/eftposPay/component/fail/failCustom.js +12 -4
  12. package/es/components/eftposPay/component/fail/index.js +14 -6
  13. package/es/components/eftposPay/component/fail/network.js +3 -0
  14. package/es/components/eftposPay/component/fail/unknow.js +8 -0
  15. package/es/components/eftposPay/component/manual/index.js +13 -1
  16. package/es/components/eftposPay/component/signature/index.js +3 -0
  17. package/es/components/eftposPay/device.js +33 -22
  18. package/es/components/eftposPay/index.js +48 -11
  19. package/es/components/eftposPay/linkly/hooks/normal.js +21 -68
  20. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +20 -81
  21. package/es/components/eftposPay/linkly/index.js +10 -23
  22. package/es/components/eftposPay/pay.js +14 -7
  23. package/es/components/eftposPay/payo/config.js +38 -5
  24. package/es/components/eftposPay/payo/hooks.js +3 -12
  25. package/es/components/eftposPay/payo/payment.js +69 -136
  26. package/es/components/eftposPay/tip.js +5 -0
  27. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  28. package/es/components/eftposPay/tyro/index.js +44 -11
  29. package/es/components/eftposPay/utils/payLog.d.ts +81 -0
  30. package/es/components/eftposPay/utils/payLog.js +430 -0
  31. package/es/components/eftposPay/windcave/receiptAction.js +5 -0
  32. package/es/components/eftposPay/windcave/windcave.js +28 -29
  33. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  34. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  35. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  36. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  37. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  38. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  39. package/es/hooks/usePaymentLogger.d.ts +0 -1
  40. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  41. package/lib/components/eftpos/hooks.d.ts +0 -1
  42. package/lib/components/eftposPay/amount.js +13 -1
  43. package/lib/components/eftposPay/app.js +2 -1
  44. package/lib/components/eftposPay/component/fail/failCustom.js +10 -2
  45. package/lib/components/eftposPay/component/fail/index.js +10 -2
  46. package/lib/components/eftposPay/component/fail/network.js +3 -0
  47. package/lib/components/eftposPay/component/fail/unknow.js +8 -0
  48. package/lib/components/eftposPay/component/manual/index.js +10 -0
  49. package/lib/components/eftposPay/component/signature/index.js +3 -0
  50. package/lib/components/eftposPay/device.js +11 -10
  51. package/lib/components/eftposPay/index.js +36 -11
  52. package/lib/components/eftposPay/linkly/hooks/normal.js +22 -43
  53. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +13 -65
  54. package/lib/components/eftposPay/linkly/index.js +7 -10
  55. package/lib/components/eftposPay/pay.js +9 -1
  56. package/lib/components/eftposPay/payo/config.js +15 -8
  57. package/lib/components/eftposPay/payo/hooks.js +12 -10
  58. package/lib/components/eftposPay/payo/payment.js +31 -65
  59. package/lib/components/eftposPay/tip.js +5 -0
  60. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  61. package/lib/components/eftposPay/tyro/index.js +21 -17
  62. package/lib/components/eftposPay/utils/payLog.d.ts +81 -0
  63. package/lib/components/eftposPay/utils/payLog.js +320 -0
  64. package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
  65. package/lib/components/eftposPay/windcave/windcave.js +18 -20
  66. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  67. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  68. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  69. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  70. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  71. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  72. package/lib/hooks/usePaymentLogger.d.ts +0 -1
  73. package/package.json +1 -1
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useIsLowSpeedNetwork: () => import("react").MutableRefObject<boolean>;
3
2
  export default useIsLowSpeedNetwork;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Eftpos } from './const';
3
2
  /**
4
3
  * @title: tyro 设备连接
@@ -12,11 +12,13 @@ import { locales } from '@pisell/utils';
12
12
  import { InputNumber, Button, message } from 'antd';
13
13
  import { Decimal } from 'decimal.js';
14
14
  import React, { useMemo, useState } from 'react';
15
+ import { useMount } from 'ahooks';
15
16
  import Alert from "./component/alert";
16
17
  import Titlebar from "./component/header/titlebar";
17
18
  import { getAmonunt } from "./manufacturer";
18
19
  import { limitDecimals } from "./helper";
19
20
  import { useDispatch, useContextData, updateComponent, updateState } from "./store";
21
+ import payLog from "./utils/payLog";
20
22
 
21
23
  /**
22
24
  * @title: 支付金额信息配置页
@@ -108,6 +110,14 @@ export default (function (_ref) {
108
110
  var currentMoneyDeci = new Decimal(currentMoney);
109
111
  return moneyDeci.sub(currentMoneyDeci).toFixed(2, Decimal.ROUND_HALF_UP);
110
112
  }, [currentMoney, money]);
113
+ useMount(function () {
114
+ payLog.log('金额页面展示', {
115
+ amount: currentMoney,
116
+ surcharge: totalSurMoney,
117
+ total: total,
118
+ surRate: curSurRate
119
+ });
120
+ });
111
121
 
112
122
  /**
113
123
  * @title:提交
@@ -143,7 +153,9 @@ export default (function (_ref) {
143
153
  surRateMoney: "".concat(surRateMoney),
144
154
  totalUnit: formatAmount(total, 2, symbol)
145
155
  };
146
- console.log('amount pay = ', pay);
156
+ payLog.log('金额页-确认提交', {
157
+ pay: pay
158
+ });
147
159
  dispatch(updateState({
148
160
  pay: pay
149
161
  }));
@@ -162,6 +174,7 @@ export default (function (_ref) {
162
174
  setStatus(true);
163
175
  return;
164
176
  }
177
+ payLog.log('金额页-点击取消');
165
178
  onClose();
166
179
  };
167
180
 
@@ -172,6 +185,7 @@ export default (function (_ref) {
172
185
  * @Date: 2024-08-19 09:53
173
186
  */
174
187
  var onEdit = function onEdit() {
188
+ payLog.log('金额页-点击编辑');
175
189
  setStatus(false);
176
190
  setTempSurRate(curSurRate);
177
191
  setTempSurMoney(curSurMoney);
@@ -21,6 +21,7 @@ import { RouteEnum, ClientEnum, RestoreEumn } from "./const";
21
21
  import Device from "./device";
22
22
  import Pay from "./pay";
23
23
  import { useContextData, useDispatch, updateState, updateClient } from "./store";
24
+ import payLog from "./utils/payLog";
24
25
  var App = function App(_ref) {
25
26
  var action = _ref.action,
26
27
  api = _ref.api,
@@ -116,7 +117,6 @@ var App = function App(_ref) {
116
117
  }));
117
118
  }
118
119
  }
119
- console.log('状态切换 = ', status, params, other);
120
120
  props.onChangeStatus(status, params, other);
121
121
  }, []);
122
122
 
@@ -126,6 +126,7 @@ var App = function App(_ref) {
126
126
  * @Date: 2024-08-20 13:09
127
127
  */
128
128
  var onClose = function onClose() {
129
+ payLog.log('关闭支付');
129
130
  onChange('fail', {
130
131
  number: data.number,
131
132
  uniquePaymentNumber: data.number,
@@ -14,6 +14,7 @@ import { getInitState } from "../../manufacturer";
14
14
  import XClose from '@pisell/icon/es/XClose';
15
15
  import { useDispatch, useContextData, updateState, updateComponent } from "../../store";
16
16
  import Header from "../header";
17
+ import payLog from "../../utils/payLog";
17
18
  export default (function (_ref) {
18
19
  var _ref$className = _ref.className,
19
20
  className = _ref$className === void 0 ? '' : _ref$className,
@@ -40,13 +41,15 @@ export default (function (_ref) {
40
41
  * @Date: 2024-08-20 11:30
41
42
  */
42
43
  var onRetry = function onRetry() {
44
+ payLog.log('自定义失败页:重试');
43
45
  onChange('page', 'pay');
44
46
  var params = _objectSpread(_objectSpread({}, originalParams || {}), {}, {
45
47
  mode: mode,
46
48
  name: name,
47
49
  symbol: symbol,
48
50
  amount: amount,
49
- order_id: order_id
51
+ order_id: order_id,
52
+ client: client
50
53
  });
51
54
  // 非查询模式,清空支付流水号
52
55
  if (mode !== ModeEnum.Query) {
@@ -67,7 +70,8 @@ export default (function (_ref) {
67
70
  symbol: symbol,
68
71
  amount: amount,
69
72
  order_id: order_id,
70
- number: ''
73
+ number: '',
74
+ client: client
71
75
  }))));
72
76
  onChange('page', 'amount');
73
77
  };
@@ -80,6 +84,7 @@ export default (function (_ref) {
80
84
  * @Date: 2024-08-20 11:31
81
85
  */
82
86
  var onManually = function onManually() {
87
+ payLog.log('自定义失败页:点击手动标记');
83
88
  dispatch(updateState({
84
89
  manual: {
85
90
  title: locales.getText('page.eftpos-pay.text.request.unknown.title')(mode),
@@ -89,6 +94,7 @@ export default (function (_ref) {
89
94
  dispatch(updateComponent('Manual'));
90
95
  };
91
96
  var onNotin = function onNotin() {
97
+ payLog.log('自定义失败页:点击打印小票');
92
98
  onChange('print', [], 'print_on_timeout');
93
99
  };
94
100
 
@@ -99,6 +105,7 @@ export default (function (_ref) {
99
105
  * @Date: 2024-08-20 11:32
100
106
  */
101
107
  var onClose = function onClose() {
108
+ payLog.log('自定义失败页:关闭');
102
109
  onChange('fail', {
103
110
  number: number,
104
111
  uniquePaymentNumber: number,
@@ -106,9 +113,10 @@ export default (function (_ref) {
106
113
  order_id: order_id
107
114
  });
108
115
  };
109
-
110
- // 错误页 通知外界 开发关闭按钮
111
116
  useMount(function () {
117
+ payLog.log('自定义失败页展示', {
118
+ status: failCustom === null || failCustom === void 0 ? void 0 : failCustom.status
119
+ });
112
120
  if ((failCustom === null || failCustom === void 0 ? void 0 : failCustom.status) === 'fail') {
113
121
  onChange('page', 'fail');
114
122
  }
@@ -14,6 +14,7 @@ import { ClientEnum } from "../../const";
14
14
  import { getInitState } from "../../manufacturer";
15
15
  import { useDispatch, useContextData, updateState, updateComponent } from "../../store";
16
16
  import Header from "../header";
17
+ import payLog from "../../utils/payLog";
17
18
  export default (function (_ref) {
18
19
  var _steps$step;
19
20
  var onChange = _ref.onChange,
@@ -43,8 +44,9 @@ export default (function (_ref) {
43
44
  * @Date: 2024-08-20 11:30
44
45
  */
45
46
  var onRetry = function onRetry() {
47
+ payLog.log('失败页:点击重试');
46
48
  onChange('page', 'pay');
47
- dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread({}, originalParams || {}), {}, {
49
+ dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread(_objectSpread({}, originalParams || {}), {}, {
48
50
  mode: mode,
49
51
  name: name,
50
52
  symbol: symbol,
@@ -56,7 +58,9 @@ export default (function (_ref) {
56
58
  "operator_type": custom.operator_type,
57
59
  "platform": custom.platform,
58
60
  "custom_payment_id": custom.custom_payment_id
59
- } : {}))));
61
+ } : {}), {}, {
62
+ client: client
63
+ }))));
60
64
  };
61
65
 
62
66
  /**
@@ -71,7 +75,8 @@ export default (function (_ref) {
71
75
  symbol: symbol,
72
76
  amount: amount,
73
77
  order_id: order_id,
74
- number: ''
78
+ number: '',
79
+ client: client
75
80
  }))));
76
81
  onChange('page', 'amount');
77
82
  };
@@ -84,6 +89,7 @@ export default (function (_ref) {
84
89
  * @Date: 2024-08-20 11:31
85
90
  */
86
91
  var onManually = function onManually() {
92
+ payLog.log('失败页:点击手动标记');
87
93
  dispatch(updateState({
88
94
  manual: {
89
95
  title: locales.getText('page.eftpos-pay.text.request.unknown.title')(mode),
@@ -93,6 +99,7 @@ export default (function (_ref) {
93
99
  dispatch(updateComponent('Manual'));
94
100
  };
95
101
  var onNotin = function onNotin() {
102
+ payLog.log('失败页:点击打印小票');
96
103
  onChange('print', [], 'print_on_timeout');
97
104
  };
98
105
 
@@ -103,7 +110,7 @@ export default (function (_ref) {
103
110
  * @Date: 2024-08-20 11:32
104
111
  */
105
112
  var onClose = function onClose() {
106
- // 支付失败页
113
+ payLog.log('失败页:点击关闭');
107
114
  onChange('fail', {
108
115
  number: number,
109
116
  uniquePaymentNumber: number,
@@ -111,9 +118,10 @@ export default (function (_ref) {
111
118
  order_id: order_id
112
119
  });
113
120
  };
114
-
115
- // 错误页 通知外界 开发关闭按钮
116
121
  useMount(function () {
122
+ payLog.log('失败页展示', {
123
+ status: steps[step].status
124
+ });
117
125
  if (steps[step].status === 'fail') {
118
126
  onChange('page', 'fail');
119
127
  }
@@ -8,6 +8,7 @@ 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
+ import payLog from "../../utils/payLog";
11
12
 
12
13
  /**
13
14
  * @title: 断网(客户端)提示页
@@ -22,6 +23,7 @@ export default (function (_ref) {
22
23
  hasBtn = _useState2[0],
23
24
  setBtn = _useState2[1];
24
25
  useEffect(function () {
26
+ payLog.log('断网提示页展示');
25
27
  var clear = setTimeout(function () {
26
28
  setBtn(true);
27
29
  }, 1000);
@@ -37,6 +39,7 @@ export default (function (_ref) {
37
39
  * @Date: 2024-08-20 11:41
38
40
  */
39
41
  var onReconnect = function onReconnect() {
42
+ payLog.log('断网提示页:点击重新连接');
40
43
  message.open({
41
44
  key: 'net-warning',
42
45
  type: 'loading',
@@ -2,9 +2,11 @@
2
2
  import { locales } from '@pisell/utils';
3
3
  import { Button } from 'antd';
4
4
  import React, { useEffect } from 'react';
5
+ import { useMount } from 'ahooks';
5
6
  import { ClientEnum } from "../../const";
6
7
  import { useDispatch, useContextData, updateState, updateComponent } from "../../store";
7
8
  import Header from "../header";
9
+ import payLog from "../../utils/payLog";
8
10
 
9
11
  /**
10
12
  * @title: 支付状态未知页面
@@ -21,6 +23,9 @@ export default (function (_ref) {
21
23
  mode = _useContextData.mode,
22
24
  client = _useContextData.client;
23
25
  var dispatch = useDispatch();
26
+ useMount(function () {
27
+ payLog.log('未知状态处理页展示');
28
+ });
24
29
 
25
30
  /**
26
31
  * @title: 手动标记
@@ -29,6 +34,7 @@ export default (function (_ref) {
29
34
  * @Date: 2024-08-20 11:31
30
35
  */
31
36
  var onManually = function onManually() {
37
+ payLog.log('未知状态处理页:点击手动标记');
32
38
  dispatch(updateState({
33
39
  manual: {
34
40
  title: locales.getText('page.eftpos-pay.text.request.unknown.title')(mode),
@@ -38,11 +44,13 @@ export default (function (_ref) {
38
44
  dispatch(updateComponent('Manual'));
39
45
  };
40
46
  var onNotin = function onNotin() {
47
+ payLog.log('未知状态处理页:点击打印小票');
41
48
  onChange('print', [], 'print_on_timeout');
42
49
  };
43
50
  useEffect(function () {
44
51
  // 如果 网络终端 恢复至此页面 则需要 回归 步骤流程
45
52
  if (form === 'Network' || form === 'restore') {
53
+ payLog.log('未知状态处理页:网络终端');
46
54
  dispatch(updateComponent(''));
47
55
  }
48
56
  }, [form]);
@@ -13,11 +13,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { locales } from '@pisell/utils';
14
14
  import { Decimal } from 'decimal.js';
15
15
  import { Button, InputNumber } from 'antd';
16
- import React, { useMemo, useState } from 'react';
16
+ import React, { useMemo, useEffect, useState } from 'react';
17
17
  import usePrefix from "../../../../hooks/usePrefix";
18
18
  import { ModeEnum } from "../../const";
19
19
  import { useContextData, useDispatch, updateState } from "../../store";
20
20
  import { limitDecimals } from "../../helper";
21
+ import payLog from "../../utils/payLog";
21
22
  import "./index.less";
22
23
 
23
24
  /**
@@ -40,6 +41,9 @@ export default (function (_ref) {
40
41
  number = _useContextData.number,
41
42
  pay = _useContextData.pay,
42
43
  amount = _useContextData.amount;
44
+ useEffect(function () {
45
+ payLog.log('手动标记页展示');
46
+ }, []);
43
47
  var start = useMemo(function () {
44
48
  if (typeof (manual === null || manual === void 0 ? void 0 : manual.money) === 'number' || typeof (manual === null || manual === void 0 ? void 0 : manual.money) === 'string') {
45
49
  return Number(manual === null || manual === void 0 ? void 0 : manual.money);
@@ -70,6 +74,7 @@ export default (function (_ref) {
70
74
  */
71
75
  var onSuccess = function onSuccess() {
72
76
  if (disabled) {
77
+ payLog.log('手动标记:点击成功被拦截');
73
78
  return;
74
79
  }
75
80
  // if (mode === ModeEnum.Pay) {
@@ -84,6 +89,7 @@ export default (function (_ref) {
84
89
  // return;
85
90
  // }
86
91
  if (mode === ModeEnum.Refund) {
92
+ payLog.log('手动标记(退款):点击标记为成功');
87
93
  setDisabled(true);
88
94
  onChange('success', {
89
95
  amount: amount,
@@ -95,6 +101,7 @@ export default (function (_ref) {
95
101
  });
96
102
  return;
97
103
  }
104
+ payLog.log('手动标记:点击标记为成功');
98
105
  updateAmountStatus(true);
99
106
  dispatch(updateState({
100
107
  manual: _objectSpread(_objectSpread({}, manual), {}, {
@@ -112,6 +119,7 @@ export default (function (_ref) {
112
119
  if (disabled) {
113
120
  return;
114
121
  }
122
+ payLog.log('手动标记:点击标记为失败');
115
123
  setDisabled(true);
116
124
  onChange('fail', {
117
125
  number: number,
@@ -124,6 +132,9 @@ export default (function (_ref) {
124
132
  if (disabled) {
125
133
  return;
126
134
  }
135
+ payLog.log('手动标记-确认金额:点击确认', {
136
+ money: money
137
+ });
127
138
  setDisabled(true);
128
139
  if (mode === ModeEnum.Refund || mode === ModeEnum.Query) {
129
140
  return;
@@ -160,6 +171,7 @@ export default (function (_ref) {
160
171
  return;
161
172
  };
162
173
  var onCancel = function onCancel() {
174
+ payLog.log('手动标记-确认金额:点击取消');
163
175
  updateAmountStatus(false);
164
176
  setMoney(pay === null || pay === void 0 ? void 0 : pay.total);
165
177
  dispatch(updateState({
@@ -9,6 +9,7 @@ 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
+ import payLog from "../../utils/payLog";
12
13
 
13
14
  /**
14
15
  * @title: 取消签名确认页
@@ -34,6 +35,7 @@ export default (function (_ref) {
34
35
  * @Date: 2024-08-20 11:51
35
36
  */
36
37
  var onBack = function onBack() {
38
+ payLog.log('取消签名确认页:点击返回');
37
39
  dispatch(updateComponent(''));
38
40
  };
39
41
 
@@ -43,6 +45,7 @@ export default (function (_ref) {
43
45
  * @Date: 2024-08-20 11:51
44
46
  */
45
47
  var onConfirm = function onConfirm() {
48
+ payLog.log('取消签名确认页:点击确认');
46
49
  setDisabled(true);
47
50
  api.update({
48
51
  type: 'NO',
@@ -25,7 +25,7 @@ import { useDispatch, useContextData, updateDevice, updateState } from "./store"
25
25
  import { getAmonunt } from "./manufacturer";
26
26
  import "./device.less";
27
27
  import useEngineContext from "../../hooks/useEngineContext";
28
- import { sendWarningLog } from '@pisell/utils';
28
+ import payLog from "./utils/payLog";
29
29
 
30
30
  /**
31
31
  * @title: 设备选择页
@@ -80,6 +80,7 @@ export default (function (_ref) {
80
80
  * @Date: 2024-08-20 13:02
81
81
  */
82
82
  var onClick = function onClick(event) {
83
+ var _list$index;
83
84
  if (!net) {
84
85
  message.open({
85
86
  key: 'net-warning',
@@ -90,6 +91,10 @@ export default (function (_ref) {
90
91
  }
91
92
  var _ref3 = [Number(event.currentTarget.dataset.index)],
92
93
  index = _ref3[0];
94
+ payLog.log('手动选择设备', {
95
+ deviceId: (_list$index = list[index]) === null || _list$index === void 0 ? void 0 : _list$index.id,
96
+ index: index
97
+ });
93
98
  setDevice(list[index]);
94
99
  };
95
100
 
@@ -144,8 +149,8 @@ export default (function (_ref) {
144
149
  * @Date: 2024-08-20 13:02
145
150
  */
146
151
  useMount(function () {
152
+ payLog.log('设备选择页展示');
147
153
  setLoading(true);
148
- // Terminal环境,进入设备列表页面初始化默认关闭原生弹窗的loading,5s后如果还是没有调用成功再放开
149
154
  closeFirstWithDelayShow();
150
155
  api.getDeviceList({
151
156
  type: eftpos,
@@ -154,6 +159,10 @@ export default (function (_ref) {
154
159
  clearTimer();
155
160
  setLoading(false);
156
161
  if (res && Array.isArray(res.list) && res.list.length > 0) {
162
+ payLog.log('设备列表加载成功', {
163
+ count: res.list.length,
164
+ hasDeviceNumber: !!device_number
165
+ });
157
166
  if (device_number) {
158
167
  var hostDeviceList = res.list.filter(function (item) {
159
168
  var _item$setting;
@@ -165,6 +174,9 @@ export default (function (_ref) {
165
174
  setDataStaus(true);
166
175
  setList(setDeviceList(hostDeviceList));
167
176
  if (hostDeviceList.length === 1) {
177
+ payLog.log('自动选择设备(device_number匹配)', {
178
+ device: hostDeviceList[0]
179
+ });
168
180
  setDevice(hostDeviceList[0]);
169
181
  }
170
182
  return;
@@ -173,7 +185,9 @@ export default (function (_ref) {
173
185
  setDataStaus(true);
174
186
  setList(setDeviceList(res.list));
175
187
  if (res.list.length === 1) {
176
- // 只存在一个设备时,直接选中进行支付
188
+ payLog.log('自动选择设备(单设备)', {
189
+ device: res.list[0]
190
+ });
177
191
  setDevice(res.list[0]);
178
192
  } else {
179
193
  // 存在多个设备时,等待用户选择,Terminal环境需要显示关闭按钮
@@ -181,12 +195,12 @@ export default (function (_ref) {
181
195
  }
182
196
  return;
183
197
  }
184
- // 列表为空,显示关闭按钮
198
+ payLog.log('设备列表为空');
185
199
  triggerCloseButton(true);
186
200
  setDataStaus(false);
187
201
  }, function () {
188
202
  clearTimer();
189
- // 加载失败,显示关闭按钮
203
+ payLog.log('设备列表加载失败');
190
204
  triggerCloseButton(true);
191
205
  setDataStaus(false);
192
206
  setLoading(false);
@@ -259,6 +273,9 @@ export default (function (_ref) {
259
273
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
260
274
  while (1) switch (_context2.prev = _context2.next) {
261
275
  case 0:
276
+ payLog.setContext({
277
+ deviceId: device === null || device === void 0 ? void 0 : device.id
278
+ });
262
279
  dispatch(updateDevice({
263
280
  device: device
264
281
  }));
@@ -266,36 +283,30 @@ export default (function (_ref) {
266
283
  api.selectDevice(device);
267
284
  }
268
285
  if (!(typeof onChange === 'function')) {
269
- _context2.next = 13;
286
+ _context2.next = 14;
270
287
  break;
271
288
  }
272
289
  if (!(mode === ModeEnum.Pay)) {
273
- _context2.next = 12;
290
+ _context2.next = 13;
274
291
  break;
275
292
  }
276
293
  // Terminal环境,进入支付页面之前需要先隐藏关闭按钮
277
294
  triggerCloseButton(false);
278
295
  // 由于js和原生通信存在延时,需要检查当前页面是否处于活跃状态,如果不在活跃状态,则不进行支付
279
- _context2.next = 7;
296
+ _context2.next = 8;
280
297
  return checkIsActiveWithDelay(100);
281
- case 7:
298
+ case 8:
282
299
  isActive = _context2.sent;
283
300
  if (isActive) {
284
- _context2.next = 11;
301
+ _context2.next = 12;
285
302
  break;
286
303
  }
287
- sendWarningLog({
288
- title: '支付-当前页面非活跃状态,无法进行支付',
289
- content: [{
290
- key: 'activeStatus',
291
- value: JSON.stringify({
292
- order_id: order_id,
293
- isActive: isActive
294
- })
295
- }]
304
+ payLog.log('页面非活跃状态,阻断支付', {
305
+ order_id: order_id,
306
+ isActive: isActive
296
307
  });
297
308
  return _context2.abrupt("return");
298
- case 11:
309
+ case 12:
299
310
  if (device.pay) {
300
311
  dispatch(updateState({
301
312
  pay: device.pay
@@ -311,9 +322,9 @@ export default (function (_ref) {
311
322
  pay: pay
312
323
  }));
313
324
  }
314
- case 12:
315
- onChange('page', mode === ModeEnum.FullPay ? 'amount' : 'pay');
316
325
  case 13:
326
+ onChange('page', mode === ModeEnum.FullPay ? 'amount' : 'pay');
327
+ case 14:
317
328
  case "end":
318
329
  return _context2.stop();
319
330
  }