@pisell/private-materials 6.3.123 → 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 (129) 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 +4 -4
  7. package/build/lowcode/render/default/view.js +4 -4
  8. package/build/lowcode/view.js +4 -4
  9. package/es/components/booking/addons/model.d.ts +10 -1
  10. package/es/components/booking/forms/model.d.ts +10 -1
  11. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  12. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  13. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  14. package/es/components/booking/info/model.d.ts +10 -1
  15. package/es/components/booking/model.d.ts +9 -1
  16. package/es/components/booking/notes/model.d.ts +10 -1
  17. package/es/components/booking/payments/model.d.ts +10 -1
  18. package/es/components/eftposPay/amount.js +15 -1
  19. package/es/components/eftposPay/app.js +2 -1
  20. package/es/components/eftposPay/component/fail/failCustom.js +12 -4
  21. package/es/components/eftposPay/component/fail/index.js +14 -6
  22. package/es/components/eftposPay/component/fail/network.js +3 -0
  23. package/es/components/eftposPay/component/fail/unknow.js +8 -0
  24. package/es/components/eftposPay/component/manual/index.js +13 -1
  25. package/es/components/eftposPay/component/signature/index.js +3 -0
  26. package/es/components/eftposPay/device.js +33 -22
  27. package/es/components/eftposPay/index.js +48 -11
  28. package/es/components/eftposPay/linkly/hooks/normal.js +21 -68
  29. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +20 -81
  30. package/es/components/eftposPay/linkly/index.js +10 -23
  31. package/es/components/eftposPay/pay.js +14 -7
  32. package/es/components/eftposPay/payo/config.js +38 -5
  33. package/es/components/eftposPay/payo/hooks.js +3 -12
  34. package/es/components/eftposPay/payo/payment.js +69 -136
  35. package/es/components/eftposPay/tip.js +5 -0
  36. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  37. package/es/components/eftposPay/tyro/index.js +44 -11
  38. package/es/components/eftposPay/utils/payLog.d.ts +81 -0
  39. package/es/components/eftposPay/utils/payLog.js +430 -0
  40. package/es/components/eftposPay/windcave/receiptAction.js +5 -0
  41. package/es/components/eftposPay/windcave/windcave.js +28 -29
  42. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  43. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  44. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  45. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  46. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  47. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  48. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  49. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  50. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  51. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  52. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  53. package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
  54. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +142 -165
  55. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
  56. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
  57. package/es/components/pay/toC/WalletPassBlock/index.js +1 -3
  58. package/es/components/pay/toC/index.js +31 -65
  59. package/es/components/pay/toC/model.d.ts +9 -2
  60. package/es/components/pay/toC/serve.d.ts +0 -18
  61. package/es/components/pay/toC/serve.js +15 -42
  62. package/es/components/pay/toC/utils.d.ts +2 -2
  63. package/es/components/pay/toC/utils.js +0 -4
  64. package/es/components/schedules/model.d.ts +9 -1
  65. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  66. package/es/hooks/usePaymentLogger.d.ts +0 -1
  67. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  68. package/es/pro/Login2.0/components/phoneValidation.js +65 -58
  69. package/lib/components/booking/addons/model.d.ts +10 -1
  70. package/lib/components/booking/forms/model.d.ts +10 -1
  71. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  72. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  73. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  74. package/lib/components/booking/info/model.d.ts +10 -1
  75. package/lib/components/booking/model.d.ts +9 -1
  76. package/lib/components/booking/notes/model.d.ts +10 -1
  77. package/lib/components/booking/payments/model.d.ts +10 -1
  78. package/lib/components/eftposPay/amount.js +13 -1
  79. package/lib/components/eftposPay/app.js +2 -1
  80. package/lib/components/eftposPay/component/fail/failCustom.js +10 -2
  81. package/lib/components/eftposPay/component/fail/index.js +10 -2
  82. package/lib/components/eftposPay/component/fail/network.js +3 -0
  83. package/lib/components/eftposPay/component/fail/unknow.js +8 -0
  84. package/lib/components/eftposPay/component/manual/index.js +10 -0
  85. package/lib/components/eftposPay/component/signature/index.js +3 -0
  86. package/lib/components/eftposPay/device.js +11 -10
  87. package/lib/components/eftposPay/index.js +36 -11
  88. package/lib/components/eftposPay/linkly/hooks/normal.js +22 -43
  89. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +13 -65
  90. package/lib/components/eftposPay/linkly/index.js +7 -10
  91. package/lib/components/eftposPay/pay.js +9 -1
  92. package/lib/components/eftposPay/payo/config.js +15 -8
  93. package/lib/components/eftposPay/payo/hooks.js +12 -10
  94. package/lib/components/eftposPay/payo/payment.js +31 -65
  95. package/lib/components/eftposPay/tip.js +5 -0
  96. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  97. package/lib/components/eftposPay/tyro/index.js +21 -17
  98. package/lib/components/eftposPay/utils/payLog.d.ts +81 -0
  99. package/lib/components/eftposPay/utils/payLog.js +320 -0
  100. package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
  101. package/lib/components/eftposPay/windcave/windcave.js +18 -20
  102. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  103. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  104. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  105. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  106. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  107. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  108. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  109. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  110. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  111. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  112. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  113. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
  114. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +100 -90
  115. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
  116. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
  117. package/lib/components/pay/toC/WalletPassBlock/index.js +1 -3
  118. package/lib/components/pay/toC/index.js +19 -52
  119. package/lib/components/pay/toC/model.d.ts +9 -2
  120. package/lib/components/pay/toC/serve.d.ts +0 -18
  121. package/lib/components/pay/toC/serve.js +0 -6
  122. package/lib/components/pay/toC/utils.d.ts +2 -2
  123. package/lib/components/pay/toC/utils.js +2 -6
  124. package/lib/components/schedules/model.d.ts +9 -1
  125. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  126. package/lib/hooks/usePaymentLogger.d.ts +0 -1
  127. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  128. package/lib/pro/Login2.0/components/phoneValidation.js +4 -2
  129. package/package.json +2 -2
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SendModalValues } from './index';
3
2
  declare const useSendModal: (bookingId?: number) => {
4
3
  open: boolean;
@@ -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 { EditServiceRef } from "../service/editService";
3
2
  declare const useInfoHolder: (state: any, dispatch: any) => {
4
3
  detailRef: import("react").MutableRefObject<EditServiceRef | undefined>;
@@ -1,5 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormState } from '../model';
1
3
  export declare const walkInData: {
2
4
  id: number;
3
5
  nickname: string;
4
6
  };
5
- export declare const Provider: any, Context: any;
7
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
+ state: FormState;
9
+ } & {
10
+ dispatch: (params: {
11
+ type: string;
12
+ payload: any;
13
+ }) => void;
14
+ }>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  amountSymbol: string;
3
4
  apis: {
@@ -109,4 +110,11 @@ export declare const walkInData: {
109
110
  id: number;
110
111
  nickname: string;
111
112
  };
112
- export declare const Provider: any, Context: any;
113
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
114
+ state: FormState;
115
+ } & {
116
+ dispatch: (params: {
117
+ type: string;
118
+ payload: any;
119
+ }) => void;
120
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -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) {
@@ -43,19 +43,30 @@ var import_manufacturer = require("./manufacturer");
43
43
  var import_store = require("./store");
44
44
  var import_index = require("./index.less");
45
45
  var import_locales2 = require("../../utils/locales");
46
+ var import_payLog = __toESM(require("./utils/payLog"));
46
47
  import_utils.locales.init(import_locales.default, (0, import_locales2.getLocale)());
47
48
  var eftposPay_default = (props) => {
48
- var _a, _b, _c, _d, _e, _f;
49
+ var _a, _b, _c, _d, _e, _f, _g, _h;
49
50
  const [check, setCheckStatus] = (0, import_react.useState)(
50
51
  props.type === import_const.EftposEnum.Tyro ? import_const.OrderEumn.Null : props.source === import_const.RestoreEumn.Restore ? import_const.OrderEumn.Restore : import_const.OrderEumn.Normal
51
52
  );
52
53
  const context = (0, import_useEngineContext.default)();
54
+ (0, import_payLog.usePayLog)({
55
+ paymentType: props.type,
56
+ mode: props.mode || import_const.ModeEnum.Pay,
57
+ orderId: (_a = props.params) == null ? void 0 : _a.order_id,
58
+ extra: {
59
+ initialParams: (props == null ? void 0 : props.params) || null,
60
+ initialSource: (props == null ? void 0 : props.source) || "",
61
+ initialDevice: (props == null ? void 0 : props.device) || null
62
+ }
63
+ });
53
64
  const [cardSurcharge, setCardSurcharge] = (0, import_react.useState)(0);
54
65
  const [receipt, setReceipt] = (0, import_react.useState)([]);
55
66
  const [updateTime, setTime] = (0, import_react.useState)("");
56
67
  console.log("context = ", context);
57
68
  const [historyData, setHistory] = (0, import_react.useState)();
58
- const { formatAmount, storage, store } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {
69
+ const { formatAmount, storage, store } = ((_b = context.appHelper) == null ? void 0 : _b.utils) || {
59
70
  store: {},
60
71
  formatAmount: (number, precision, symbol2) => `${symbol2}${number}`,
61
72
  storage: () => ({
@@ -63,18 +74,24 @@ var eftposPay_default = (props) => {
63
74
  })
64
75
  };
65
76
  const channel = (0, import_react.useMemo)(() => {
66
- var _a2;
67
- const channel2 = ((_a2 = storage == null ? void 0 : storage.get) == null ? void 0 : _a2.call(storage, "channel")) || "";
68
- if (channel2 === "terminal") {
77
+ var _a2, _b2;
78
+ if (((_a2 = props == null ? void 0 : props.params) == null ? void 0 : _a2.platform) === "kiosk") {
79
+ return "kiosk";
80
+ }
81
+ const rawChannel = ((_b2 = storage == null ? void 0 : storage.get) == null ? void 0 : _b2.call(storage, "channel")) || "";
82
+ if (rawChannel === "terminal") {
69
83
  return "terminal";
70
84
  }
71
- if (channel2 === "android_kiosk") {
85
+ if (rawChannel === "android_kiosk") {
72
86
  return "kiosk";
73
87
  }
74
88
  return "";
75
- }, []);
89
+ }, [(_c = props == null ? void 0 : props.params) == null ? void 0 : _c.platform, storage]);
90
+ (0, import_react.useEffect)(() => {
91
+ import_payLog.default.setContext({ channel: channel || "web" });
92
+ }, [channel]);
76
93
  const isMobile = (0, import_react.useMemo)(() => Boolean(channel), [channel]);
77
- const symbol = ((_d = (_c = (_b = store == null ? void 0 : store.getState) == null ? void 0 : _b.call(store)) == null ? void 0 : _c.global) == null ? void 0 : _d.symbol) || "$";
94
+ const symbol = ((_f = (_e = (_d = store == null ? void 0 : store.getState) == null ? void 0 : _d.call(store)) == null ? void 0 : _e.global) == null ? void 0 : _f.symbol) || "$";
78
95
  const mode = (0, import_react.useMemo)(() => {
79
96
  if (props.source === import_const.RestoreEumn.Restore) {
80
97
  if (props.params) {
@@ -109,6 +126,7 @@ var eftposPay_default = (props) => {
109
126
  }, [state]);
110
127
  const onChangeStatus = (0, import_react.useCallback)(
111
128
  (status, params, other) => {
129
+ import_payLog.default.log("支付状态回调", { status, params, other });
112
130
  props.onChangeStatus(status, params, other);
113
131
  },
114
132
  []
@@ -143,9 +161,8 @@ var eftposPay_default = (props) => {
143
161
  }, [mode, state]);
144
162
  (0, import_react.useEffect)(() => {
145
163
  document.body.id = "body";
146
- console.log("初始化 ........112218017777");
147
164
  }, []);
148
- console.log("props?.params?.device_number = ", (_e = props == null ? void 0 : props.params) == null ? void 0 : _e.device_number);
165
+ console.log("props?.params?.device_number = ", (_g = props == null ? void 0 : props.params) == null ? void 0 : _g.device_number);
149
166
  const api = (0, import_react.useMemo)(() => {
150
167
  if (typeof props.getApi === "function") {
151
168
  return props.getApi();
@@ -156,12 +173,14 @@ var eftposPay_default = (props) => {
156
173
  if (props.source === import_const.RestoreEumn.Restore || props.type === import_const.EftposEnum.Tyro) {
157
174
  return;
158
175
  }
176
+ import_payLog.default.log("交易检查:开始检查交易");
159
177
  api.getTransaction({
160
178
  order_id: stateRef.current.order_id,
161
179
  card_reader_type: stateRef.current.eftpos,
162
180
  receive_status: "unprocessed"
163
181
  }).then((res) => {
164
182
  if (!Array.isArray(res.data) || res.data.length === 0) {
183
+ import_payLog.default.log("交易检查:无未处理交易");
165
184
  setCheckStatus(import_const.OrderEumn.Null);
166
185
  return;
167
186
  }
@@ -176,6 +195,7 @@ var eftposPay_default = (props) => {
176
195
  const latest = list.pop();
177
196
  const numberList = list.map((item) => item.number);
178
197
  if (latest.status === import_const.OrderEumn.Failed) {
198
+ import_payLog.default.log("交易检查:最新交易已失败", { number: latest.number });
179
199
  setCheckStatus(latest.status);
180
200
  onChangeStatus("mark_tx_processed", [
181
201
  ...numberList,
@@ -199,8 +219,13 @@ var eftposPay_default = (props) => {
199
219
  decodeURIComponent(atob(decodeURIComponent(pay_param_base64)))
200
220
  );
201
221
  setHistory(data);
222
+ import_payLog.default.log("交易检查:发现待处理交易", {
223
+ status: latest.status,
224
+ number: latest.number
225
+ });
202
226
  setCheckStatus(latest.status);
203
227
  } catch (e) {
228
+ import_payLog.default.log("交易检查:解析交易数据失败", { error: e });
204
229
  setCheckStatus(import_const.OrderEumn.Failed);
205
230
  return;
206
231
  }
@@ -236,7 +261,7 @@ var eftposPay_default = (props) => {
236
261
  source: props.source,
237
262
  tyroUrl: props.tyroUrl,
238
263
  tyroVersion: props.tyroVersion,
239
- device_number: (_f = props == null ? void 0 : props.params) == null ? void 0 : _f.device_number,
264
+ device_number: (_h = props == null ? void 0 : props.params) == null ? void 0 : _h.device_number,
240
265
  isMobile,
241
266
  formatAmount
242
267
  }