@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
@@ -18,6 +18,7 @@ import { StatusEnum } from "../const";
18
18
  import { useContextData, useDispatch, updateState, updateCustom, updateStatus } from "../store";
19
19
  import { useStoreRef } from "../hooks";
20
20
  import { StemTypeEnum, StepStatusEnum, getStepMapping } from "./const";
21
+ import payLog from "../utils/payLog";
21
22
 
22
23
  /**
23
24
  * @title: 按钮操作区
@@ -60,6 +61,7 @@ export var ReceiptAction = function ReceiptAction(_ref) {
60
61
  * @Date: 2024-08-12 11:30
61
62
  */
62
63
  var onAccept = function onAccept() {
64
+ payLog.log('Windcave:签名-点击确认');
63
65
  // 确认签名
64
66
  dispatch(updateStatus(StatusEnum.Loading));
65
67
  dispatch(updateCustom({
@@ -138,6 +140,7 @@ export var ReceiptAction = function ReceiptAction(_ref) {
138
140
  * @Date: 2024-08-20 12:34
139
141
  */
140
142
  var onBack = function onBack() {
143
+ payLog.log('Windcave:签名-点击后退');
141
144
  dispatch(updateState({
142
145
  title: locales.getText('page.eftpos-pay.text.waiting.signature'),
143
146
  // ''), // 等待签名
@@ -156,6 +159,7 @@ export var ReceiptAction = function ReceiptAction(_ref) {
156
159
  * @Date: 2024-08-12 11:30
157
160
  */
158
161
  var onConfirm = function onConfirm() {
162
+ payLog.log('Windcave:签名-点击取消');
159
163
  // 取消签名
160
164
  dispatch(updateState({
161
165
  title: locales.getText('page.eftpos-pay.text.processing'),
@@ -244,6 +248,7 @@ export var ReceiptAction = function ReceiptAction(_ref) {
244
248
  * @Date: 2024-08-20 12:40
245
249
  */
246
250
  var onDecline = function onDecline() {
251
+ payLog.log('Windcave:签名-点击取消');
247
252
  dispatch(updateState({
248
253
  title: locales.getText('page.eftpos-pay.text.signature.title'),
249
254
  // 'page.eftpos-pay.text.waiting.signature'), // 等待签名
@@ -17,7 +17,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
17
  /* eslint-disable consistent-return */
18
18
  /* eslint-disable react/no-array-index-key */
19
19
  /* eslint-disable array-callback-return */
20
- import { locales, sendWarningLog } from '@pisell/utils';
20
+ import { locales } from '@pisell/utils';
21
21
  import React, { useEffect, useMemo, useRef, useState } from 'react';
22
22
  import Step from "../component/step/step";
23
23
  import { ModeEnum, StatusEnum } from "../const";
@@ -26,6 +26,7 @@ import { useStoreRef } from "../hooks";
26
26
  import { updateCustom, updateState, useContextData, useDispatch } from "../store";
27
27
  import { StemTypeEnum, StepStatusEnum, getStepMapping } from "./const";
28
28
  import { useFail, useValidate } from "./helper";
29
+ import payLog from "../utils/payLog";
29
30
  import Action, { ReceiptAction } from "./receiptAction";
30
31
  var Minute = 1000 * 60;
31
32
 
@@ -59,7 +60,7 @@ export default (function (_ref) {
59
60
  var stepRef = useRef(custom === null || custom === void 0 ? void 0 : custom.step);
60
61
  var listRef = useRef(custom === null || custom === void 0 ? void 0 : custom.list);
61
62
  var initRef = useRef(false);
62
- var clearRef = useRef();
63
+ var clearRef = useRef(null);
63
64
 
64
65
  /** 是否是签名页面 */
65
66
  var isReceiptPage = useMemo(function () {
@@ -146,9 +147,11 @@ export default (function (_ref) {
146
147
  // 是否在签名步骤
147
148
  if (stepRef.current === StepStatusEnum.Receipt) {
148
149
  if (StatusEnum.Loading === statusRef.current) {
150
+ payLog.log('Windcave:签名页面处于运行中(已发送签名,或取消签名接口),进行计时查询');
149
151
  // 签名页面处于运行中(已发送签名,或取消签名接口),则进行计时查询
150
152
  run();
151
153
  } else {
154
+ payLog.log('Windcave:签名页面处于未加载中,进行无限查询');
152
155
  // 签名页面处于未加载中,则进行无限查询
153
156
  run(-1);
154
157
  }
@@ -162,9 +165,6 @@ export default (function (_ref) {
162
165
  run();
163
166
  return;
164
167
  }
165
-
166
- // 不存在支付流水号 则去创建支付
167
- console.log('modeRef.current = ', modeRef.current);
168
168
  numRef.current = getUuid();
169
169
  dispatch(updateState({
170
170
  number: numRef.current
@@ -206,6 +206,18 @@ export default (function (_ref) {
206
206
  })))))
207
207
  };
208
208
  }
209
+ payLog.setContext({
210
+ transactionNumber: numRef.current
211
+ });
212
+ if (isPay) {
213
+ payLog.log('Windcave:发起支付', {
214
+ number: numRef.current
215
+ });
216
+ } else {
217
+ payLog.log('Windcave:发起退款', {
218
+ number: numRef.current
219
+ });
220
+ }
209
221
  var resultPromise = isPay ? api.pay(_params, {
210
222
  signal: controllerRef.current.signal
211
223
  }) : api.refund(_params, {
@@ -218,39 +230,24 @@ export default (function (_ref) {
218
230
  return;
219
231
  }
220
232
  if (res && "".concat(res.code) === '200' && res.data && res.data.txn_status_id) {
221
- var _validateRef$current;
233
+ var _res$data, _validateRef$current;
234
+ payLog.log('Windcave:接口成功,进入轮询', {
235
+ txn_status_id: res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.txn_status_id
236
+ });
222
237
  (_validateRef$current = validateRef.current) === null || _validateRef$current === void 0 || _validateRef$current.call(validateRef, res, true);
223
238
  return;
224
239
  }
225
- sendWarningLog({
226
- title: 'windcave支付失败',
227
- content: [{
228
- key: 'res',
229
- value: JSON.stringify(res)
230
- }, {
231
- key: 'params',
232
- value: JSON.stringify(_params)
233
- }]
240
+ payLog.log('Windcave:支付接口返回失败', {
241
+ code: res === null || res === void 0 ? void 0 : res.code
234
242
  });
235
243
  (_failRef$current = failRef.current) === null || _failRef$current === void 0 || _failRef$current.call(failRef, res, stepRef.current >= StepStatusEnum.Account);
236
244
  }).catch(function (res) {
237
245
  var _failRef$current2;
238
246
  var isNoNet = unloadRef.current || !netRef.current;
239
- sendWarningLog({
240
- title: 'windcave支付失败',
241
- content: [{
242
- key: 'error',
243
- value: JSON.stringify(res)
244
- }, {
245
- key: 'params',
246
- value: JSON.stringify(_params)
247
- }, {
248
- key: 'isNoNet',
249
- value: isNoNet ? '1' : '0'
250
- }]
247
+ payLog.log('Windcave:支付接口异常', {
248
+ error: res === null || res === void 0 ? void 0 : res.message,
249
+ isNoNet: isNoNet
251
250
  });
252
-
253
- // 无网 或 已卸载 则不进行处理
254
251
  if (isNoNet) {
255
252
  return;
256
253
  }
@@ -265,6 +262,7 @@ export default (function (_ref) {
265
262
  * @Date: 2024-08-20 12:51
266
263
  */
267
264
  var onCancel = function onCancel() {
265
+ payLog.log('Windcave:点击取消支付');
268
266
  setDisabled(true);
269
267
  api.update({
270
268
  type: 'CANCEL',
@@ -290,6 +288,7 @@ export default (function (_ref) {
290
288
  */
291
289
  var onChangeReceipt = function onChangeReceipt(status) {
292
290
  if (status) {
291
+ payLog.log('Windcave:签名状态');
293
292
  // 签名,取消签名接口执行成功, 进行计时查询
294
293
  run();
295
294
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Status: (props: any) => import("react").JSX.Element;
4
3
  export default Status;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const DayItem: (props: any) => import("react").JSX.Element;
4
3
  export default DayItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  import { CalendarItemProps } from '../../../../../type';
4
3
  declare const Item: (props: CalendarItemProps) => import("react").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Status: (props: any) => import("react").JSX.Element;
4
3
  export default Status;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const StripeSDK: ({ public_key, client_secret, children, lang, }: {
3
2
  public_key: string;
4
3
  client_secret?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Empty: (props: any) => import("react").JSX.Element;
4
3
  export default Empty;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface LogData {
3
2
  key: string;
4
3
  value: any;
@@ -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 设备连接
@@ -36,11 +36,13 @@ var import_utils = require("@pisell/utils");
36
36
  var import_antd = require("antd");
37
37
  var import_decimal = require("decimal.js");
38
38
  var import_react = __toESM(require("react"));
39
+ var import_ahooks = require("ahooks");
39
40
  var import_alert = __toESM(require("./component/alert"));
40
41
  var import_titlebar = __toESM(require("./component/header/titlebar"));
41
42
  var import_manufacturer = require("./manufacturer");
42
43
  var import_helper = require("./helper");
43
44
  var import_store = require("./store");
45
+ var import_payLog = __toESM(require("./utils/payLog"));
44
46
  var amount_default = ({
45
47
  className = "",
46
48
  onChange,
@@ -88,6 +90,14 @@ var amount_default = ({
88
90
  const currentMoneyDeci = new import_decimal.Decimal(currentMoney);
89
91
  return moneyDeci.sub(currentMoneyDeci).toFixed(2, import_decimal.Decimal.ROUND_HALF_UP);
90
92
  }, [currentMoney, money]);
93
+ (0, import_ahooks.useMount)(() => {
94
+ import_payLog.default.log("金额页面展示", {
95
+ amount: currentMoney,
96
+ surcharge: totalSurMoney,
97
+ total,
98
+ surRate: curSurRate
99
+ });
100
+ });
91
101
  const onSubmit = () => {
92
102
  if (!status) {
93
103
  setStatus(true);
@@ -115,7 +125,7 @@ var amount_default = ({
115
125
  surRateMoney: `${surRateMoney}`,
116
126
  totalUnit: formatAmount(total, 2, symbol)
117
127
  };
118
- console.log("amount pay = ", pay);
128
+ import_payLog.default.log("金额页-确认提交", { pay });
119
129
  dispatch((0, import_store.updateState)({ pay }));
120
130
  dispatch((0, import_store.updateComponent)(""));
121
131
  onChange && onChange("page", "pay");
@@ -125,9 +135,11 @@ var amount_default = ({
125
135
  setStatus(true);
126
136
  return;
127
137
  }
138
+ import_payLog.default.log("金额页-点击取消");
128
139
  onClose();
129
140
  };
130
141
  const onEdit = () => {
142
+ import_payLog.default.log("金额页-点击编辑");
131
143
  setStatus(false);
132
144
  setTempSurRate(curSurRate);
133
145
  setTempSurMoney(curSurMoney);
@@ -39,6 +39,7 @@ var import_const = require("./const");
39
39
  var import_device = __toESM(require("./device"));
40
40
  var import_pay = __toESM(require("./pay"));
41
41
  var import_store = require("./store");
42
+ var import_payLog = __toESM(require("./utils/payLog"));
42
43
  var App = ({
43
44
  action,
44
45
  api,
@@ -104,12 +105,12 @@ var App = ({
104
105
  dispatch((0, import_store.updateState)({ action: params }));
105
106
  }
106
107
  }
107
- console.log("状态切换 = ", status, params, other);
108
108
  props.onChangeStatus(status, params, other);
109
109
  },
110
110
  []
111
111
  );
112
112
  const onClose = () => {
113
+ import_payLog.default.log("关闭支付");
113
114
  onChange("fail", {
114
115
  number: data.number,
115
116
  uniquePaymentNumber: data.number,
@@ -41,6 +41,7 @@ var import_manufacturer = require("../../manufacturer");
41
41
  var import_XClose = __toESM(require("@pisell/icon/es/XClose"));
42
42
  var import_store = require("../../store");
43
43
  var import_header = __toESM(require("../header"));
44
+ var import_payLog = __toESM(require("../../utils/payLog"));
44
45
  var failCustom_default = ({ className = "", isMobile, onChange }) => {
45
46
  const {
46
47
  eftpos,
@@ -58,6 +59,7 @@ var failCustom_default = ({ className = "", isMobile, onChange }) => {
58
59
  const failCustom = custom == null ? void 0 : custom.failCustom;
59
60
  const dispatch = (0, import_store.useDispatch)();
60
61
  const onRetry = () => {
62
+ import_payLog.default.log("自定义失败页:重试");
61
63
  onChange("page", "pay");
62
64
  const params = {
63
65
  ...originalParams || {},
@@ -65,7 +67,8 @@ var failCustom_default = ({ className = "", isMobile, onChange }) => {
65
67
  name,
66
68
  symbol,
67
69
  amount,
68
- order_id
70
+ order_id,
71
+ client
69
72
  };
70
73
  if (mode !== import_const.ModeEnum.Query) {
71
74
  params.number = "";
@@ -82,13 +85,15 @@ var failCustom_default = ({ className = "", isMobile, onChange }) => {
82
85
  symbol,
83
86
  amount,
84
87
  order_id,
85
- number: ""
88
+ number: "",
89
+ client
86
90
  })
87
91
  )
88
92
  );
89
93
  onChange("page", "amount");
90
94
  };
91
95
  const onManually = () => {
96
+ import_payLog.default.log("自定义失败页:点击手动标记");
92
97
  dispatch(
93
98
  (0, import_store.updateState)({
94
99
  manual: {
@@ -104,12 +109,15 @@ var failCustom_default = ({ className = "", isMobile, onChange }) => {
104
109
  dispatch((0, import_store.updateComponent)("Manual"));
105
110
  };
106
111
  const onNotin = () => {
112
+ import_payLog.default.log("自定义失败页:点击打印小票");
107
113
  onChange("print", [], "print_on_timeout");
108
114
  };
109
115
  const onClose = () => {
116
+ import_payLog.default.log("自定义失败页:关闭");
110
117
  onChange("fail", { number, uniquePaymentNumber: number, device, order_id });
111
118
  };
112
119
  (0, import_ahooks.useMount)(() => {
120
+ import_payLog.default.log("自定义失败页展示", { status: failCustom == null ? void 0 : failCustom.status });
113
121
  if ((failCustom == null ? void 0 : failCustom.status) === "fail") {
114
122
  onChange("page", "fail");
115
123
  }
@@ -41,6 +41,7 @@ var import_const = require("../../const");
41
41
  var import_manufacturer = require("../../manufacturer");
42
42
  var import_store = require("../../store");
43
43
  var import_header = __toESM(require("../header"));
44
+ var import_payLog = __toESM(require("../../utils/payLog"));
44
45
  var fail_default = ({ onChange, className = "", isMobile }) => {
45
46
  var _a, _b;
46
47
  const {
@@ -61,6 +62,7 @@ var fail_default = ({ onChange, className = "", isMobile }) => {
61
62
  const isPosNetworkError = ((_b = (_a = steps[step]) == null ? void 0 : _a.custom) == null ? void 0 : _b.isPosNetworkError) || false;
62
63
  const dispatch = (0, import_store.useDispatch)();
63
64
  const onRetry = () => {
65
+ import_payLog.default.log("失败页:点击重试");
64
66
  onChange("page", "pay");
65
67
  dispatch(
66
68
  (0, import_store.updateState)(
@@ -77,7 +79,8 @@ var fail_default = ({ onChange, className = "", isMobile }) => {
77
79
  "operator_type": custom.operator_type,
78
80
  "platform": custom.platform,
79
81
  "custom_payment_id": custom.custom_payment_id
80
- } : {}
82
+ } : {},
83
+ client
81
84
  })
82
85
  )
83
86
  );
@@ -92,13 +95,15 @@ var fail_default = ({ onChange, className = "", isMobile }) => {
92
95
  symbol,
93
96
  amount,
94
97
  order_id,
95
- number: ""
98
+ number: "",
99
+ client
96
100
  })
97
101
  )
98
102
  );
99
103
  onChange("page", "amount");
100
104
  };
101
105
  const onManually = () => {
106
+ import_payLog.default.log("失败页:点击手动标记");
102
107
  dispatch(
103
108
  (0, import_store.updateState)({
104
109
  manual: {
@@ -114,12 +119,15 @@ var fail_default = ({ onChange, className = "", isMobile }) => {
114
119
  dispatch((0, import_store.updateComponent)("Manual"));
115
120
  };
116
121
  const onNotin = () => {
122
+ import_payLog.default.log("失败页:点击打印小票");
117
123
  onChange("print", [], "print_on_timeout");
118
124
  };
119
125
  const onClose = () => {
126
+ import_payLog.default.log("失败页:点击关闭");
120
127
  onChange("fail", { number, uniquePaymentNumber: number, device, order_id });
121
128
  };
122
129
  (0, import_ahooks.useMount)(() => {
130
+ import_payLog.default.log("失败页展示", { status: steps[step].status });
123
131
  if (steps[step].status === "fail") {
124
132
  onChange("page", "fail");
125
133
  }
@@ -36,9 +36,11 @@ var import_utils = require("@pisell/utils");
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_antd = require("antd");
38
38
  var import_header = __toESM(require("../header"));
39
+ var import_payLog = __toESM(require("../../utils/payLog"));
39
40
  var network_default = ({ className = "" }) => {
40
41
  const [hasBtn, setBtn] = (0, import_react.useState)(false);
41
42
  (0, import_react.useEffect)(() => {
43
+ import_payLog.default.log("断网提示页展示");
42
44
  const clear = setTimeout(() => {
43
45
  setBtn(true);
44
46
  }, 1e3);
@@ -47,6 +49,7 @@ var network_default = ({ className = "" }) => {
47
49
  };
48
50
  }, []);
49
51
  const onReconnect = () => {
52
+ import_payLog.default.log("断网提示页:点击重新连接");
50
53
  import_antd.message.open({
51
54
  key: "net-warning",
52
55
  type: "loading",
@@ -35,13 +35,19 @@ module.exports = __toCommonJS(unknow_exports);
35
35
  var import_utils = require("@pisell/utils");
36
36
  var import_antd = require("antd");
37
37
  var import_react = __toESM(require("react"));
38
+ var import_ahooks = require("ahooks");
38
39
  var import_const = require("../../const");
39
40
  var import_store = require("../../store");
40
41
  var import_header = __toESM(require("../header"));
42
+ var import_payLog = __toESM(require("../../utils/payLog"));
41
43
  var unknow_default = ({ onChange, className = "" }) => {
42
44
  const { form, mode, client } = (0, import_store.useContextData)();
43
45
  const dispatch = (0, import_store.useDispatch)();
46
+ (0, import_ahooks.useMount)(() => {
47
+ import_payLog.default.log("未知状态处理页展示");
48
+ });
44
49
  const onManually = () => {
50
+ import_payLog.default.log("未知状态处理页:点击手动标记");
45
51
  dispatch(
46
52
  (0, import_store.updateState)({
47
53
  manual: {
@@ -57,10 +63,12 @@ var unknow_default = ({ onChange, className = "" }) => {
57
63
  dispatch((0, import_store.updateComponent)("Manual"));
58
64
  };
59
65
  const onNotin = () => {
66
+ import_payLog.default.log("未知状态处理页:点击打印小票");
60
67
  onChange("print", [], "print_on_timeout");
61
68
  };
62
69
  (0, import_react.useEffect)(() => {
63
70
  if (form === "Network" || form === "restore") {
71
+ import_payLog.default.log("未知状态处理页:网络终端");
64
72
  dispatch((0, import_store.updateComponent)(""));
65
73
  }
66
74
  }, [form]);
@@ -40,10 +40,14 @@ var import_usePrefix = __toESM(require("../../../../hooks/usePrefix"));
40
40
  var import_const = require("../../const");
41
41
  var import_store = require("../../store");
42
42
  var import_helper = require("../../helper");
43
+ var import_payLog = __toESM(require("../../utils/payLog"));
43
44
  var import_index = require("./index.less");
44
45
  var manual_default = ({ onChange, className = "", formatAmount }) => {
45
46
  const dispatch = (0, import_store.useDispatch)();
46
47
  const { symbol, manual, order_id, mode, device, number, pay, amount } = (0, import_store.useContextData)();
48
+ (0, import_react.useEffect)(() => {
49
+ import_payLog.default.log("手动标记页展示");
50
+ }, []);
47
51
  const start = (0, import_react.useMemo)(() => {
48
52
  if (typeof (manual == null ? void 0 : manual.money) === "number" || typeof (manual == null ? void 0 : manual.money) === "string") {
49
53
  return Number(manual == null ? void 0 : manual.money);
@@ -59,9 +63,11 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
59
63
  const [isUpdateAmount, updateAmountStatus] = (0, import_react.useState)(manual == null ? void 0 : manual.status);
60
64
  const onSuccess = () => {
61
65
  if (disabled) {
66
+ import_payLog.default.log("手动标记:点击成功被拦截");
62
67
  return;
63
68
  }
64
69
  if (mode === import_const.ModeEnum.Refund) {
70
+ import_payLog.default.log("手动标记(退款):点击标记为成功");
65
71
  setDisabled(true);
66
72
  onChange("success", {
67
73
  amount,
@@ -73,6 +79,7 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
73
79
  });
74
80
  return;
75
81
  }
82
+ import_payLog.default.log("手动标记:点击标记为成功");
76
83
  updateAmountStatus(true);
77
84
  dispatch((0, import_store.updateState)({ manual: { ...manual, status: true } }));
78
85
  };
@@ -80,6 +87,7 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
80
87
  if (disabled) {
81
88
  return;
82
89
  }
90
+ import_payLog.default.log("手动标记:点击标记为失败");
83
91
  setDisabled(true);
84
92
  onChange("fail", { number, uniquePaymentNumber: number, device, order_id });
85
93
  };
@@ -87,6 +95,7 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
87
95
  if (disabled) {
88
96
  return;
89
97
  }
98
+ import_payLog.default.log("手动标记-确认金额:点击确认", { money });
90
99
  setDisabled(true);
91
100
  if (mode === import_const.ModeEnum.Refund || mode === import_const.ModeEnum.Query) {
92
101
  return;
@@ -124,6 +133,7 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
124
133
  return;
125
134
  };
126
135
  const onCancel = () => {
136
+ import_payLog.default.log("手动标记-确认金额:点击取消");
127
137
  updateAmountStatus(false);
128
138
  setMoney(pay == null ? void 0 : pay.total);
129
139
  dispatch(
@@ -37,14 +37,17 @@ var import_antd = require("antd");
37
37
  var import_react = __toESM(require("react"));
38
38
  var import_store = require("../../store");
39
39
  var import_header = __toESM(require("../header"));
40
+ var import_payLog = __toESM(require("../../utils/payLog"));
40
41
  var signature_default = ({ api, className = "" }) => {
41
42
  const dispatch = (0, import_store.useDispatch)();
42
43
  const { number, mode } = (0, import_store.useContextData)();
43
44
  const [disabled, setDisabled] = (0, import_react.useState)(false);
44
45
  const onBack = () => {
46
+ import_payLog.default.log("取消签名确认页:点击返回");
45
47
  dispatch((0, import_store.updateComponent)(""));
46
48
  };
47
49
  const onConfirm = () => {
50
+ import_payLog.default.log("取消签名确认页:点击确认");
48
51
  setDisabled(true);
49
52
  api.update({
50
53
  type: "NO",
@@ -44,7 +44,7 @@ var import_store = require("./store");
44
44
  var import_manufacturer = require("./manufacturer");
45
45
  var import_device = require("./device.less");
46
46
  var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
47
- var import_utils2 = require("@pisell/utils");
47
+ var import_payLog = __toESM(require("./utils/payLog"));
48
48
  var device_default = ({
49
49
  api,
50
50
  onChange,
@@ -66,6 +66,7 @@ var device_default = ({
66
66
  const dispatch = (0, import_store.useDispatch)();
67
67
  const timerRef = (0, import_react.useRef)();
68
68
  const onClick = (event) => {
69
+ var _a;
69
70
  if (!net) {
70
71
  import_antd.message.open({
71
72
  key: "net-warning",
@@ -75,6 +76,7 @@ var device_default = ({
75
76
  return;
76
77
  }
77
78
  const [index] = [Number(event.currentTarget.dataset.index)];
79
+ import_payLog.default.log("手动选择设备", { deviceId: (_a = list[index]) == null ? void 0 : _a.id, index });
78
80
  setDevice(list[index]);
79
81
  };
80
82
  const triggerCloseButton = (bool) => {
@@ -107,6 +109,7 @@ var device_default = ({
107
109
  }
108
110
  };
109
111
  (0, import_ahooks.useMount)(() => {
112
+ import_payLog.default.log("设备选择页展示");
110
113
  setLoading(true);
111
114
  closeFirstWithDelayShow();
112
115
  api.getDeviceList({ type: eftpos, status: "paired" }).then(
@@ -114,6 +117,7 @@ var device_default = ({
114
117
  clearTimer();
115
118
  setLoading(false);
116
119
  if (res && Array.isArray(res.list) && res.list.length > 0) {
120
+ import_payLog.default.log("设备列表加载成功", { count: res.list.length, hasDeviceNumber: !!device_number });
117
121
  if (device_number) {
118
122
  const hostDeviceList = res.list.filter(
119
123
  (item) => {
@@ -127,6 +131,7 @@ var device_default = ({
127
131
  setDataStaus(true);
128
132
  setList(setDeviceList(hostDeviceList));
129
133
  if (hostDeviceList.length === 1) {
134
+ import_payLog.default.log("自动选择设备(device_number匹配)", { device: hostDeviceList[0] });
130
135
  setDevice(hostDeviceList[0]);
131
136
  }
132
137
  return;
@@ -135,17 +140,20 @@ var device_default = ({
135
140
  setDataStaus(true);
136
141
  setList(setDeviceList(res.list));
137
142
  if (res.list.length === 1) {
143
+ import_payLog.default.log("自动选择设备(单设备)", { device: res.list[0] });
138
144
  setDevice(res.list[0]);
139
145
  } else {
140
146
  triggerCloseButton(true);
141
147
  }
142
148
  return;
143
149
  }
150
+ import_payLog.default.log("设备列表为空");
144
151
  triggerCloseButton(true);
145
152
  setDataStaus(false);
146
153
  },
147
154
  () => {
148
155
  clearTimer();
156
+ import_payLog.default.log("设备列表加载失败");
149
157
  triggerCloseButton(true);
150
158
  setDataStaus(false);
151
159
  setLoading(false);
@@ -175,6 +183,7 @@ var device_default = ({
175
183
  return true;
176
184
  };
177
185
  const setDevice = async (device2) => {
186
+ import_payLog.default.setContext({ deviceId: device2 == null ? void 0 : device2.id });
178
187
  dispatch((0, import_store.updateDevice)({ device: device2 }));
179
188
  if (typeof api.selectDevice === "function") {
180
189
  api.selectDevice(device2);
@@ -184,15 +193,7 @@ var device_default = ({
184
193
  triggerCloseButton(false);
185
194
  const isActive = await checkIsActiveWithDelay(100);
186
195
  if (!isActive) {
187
- (0, import_utils2.sendWarningLog)({
188
- title: "支付-当前页面非活跃状态,无法进行支付",
189
- content: [
190
- {
191
- key: "activeStatus",
192
- value: JSON.stringify({ order_id, isActive })
193
- }
194
- ]
195
- });
196
+ import_payLog.default.log("页面非活跃状态,阻断支付", { order_id, isActive });
196
197
  return;
197
198
  }
198
199
  if (device2.pay) {