@pisell/private-materials 6.6.61 → 6.6.63

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 (203) 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 +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/booking/components/footer/amount.js +4 -3
  12. package/es/components/booking/components/footer/utils.js +10 -3
  13. package/es/components/booking/components/voucher/index.js +1 -1
  14. package/es/components/booking/info2/service/editService/index.js +76 -8
  15. package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
  16. package/es/components/booking/info2/service/editService/utils.js +16 -0
  17. package/es/components/booking/payments/index.js +1 -1
  18. package/es/components/eftpos/PairModal/hooks.d.ts +27 -0
  19. package/es/components/eftpos/PairModal/hooks.js +67 -0
  20. package/es/components/eftpos/PairModal/index.d.ts +11 -0
  21. package/es/components/eftpos/PairModal/index.js +246 -0
  22. package/es/components/eftpos/PairModal/index.less +70 -0
  23. package/es/components/eftpos/SettlementModal/Action.d.ts +7 -0
  24. package/es/components/eftpos/SettlementModal/Action.js +141 -0
  25. package/es/components/eftpos/SettlementModal/index.d.ts +7 -0
  26. package/es/components/eftpos/SettlementModal/index.js +135 -0
  27. package/es/components/eftpos/SettlementModal/index.less +33 -0
  28. package/es/components/eftpos/SettlementModal/serve.d.ts +8 -0
  29. package/es/components/eftpos/SettlementModal/serve.js +171 -0
  30. package/es/components/eftpos/SettlementModal/types.d.ts +138 -0
  31. package/es/components/eftpos/SettlementModal/types.js +35 -0
  32. package/es/components/eftpos/SettlementModal/utils.d.ts +18 -0
  33. package/es/components/eftpos/SettlementModal/utils.js +351 -0
  34. package/es/components/eftpos/assets/mx51SCI.svg +15 -0
  35. package/es/components/eftpos/const.d.ts +3 -1
  36. package/es/components/eftpos/const.js +2 -0
  37. package/es/components/eftpos/device.d.ts +3 -1
  38. package/es/components/eftpos/device.js +14 -3
  39. package/es/components/eftpos/hooks.d.ts +13 -0
  40. package/es/components/eftpos/hooks.js +35 -0
  41. package/es/components/eftpos/index.js +198 -24
  42. package/es/components/eftpos/index.less +32 -1
  43. package/es/components/eftpos/locales.d.ts +80 -0
  44. package/es/components/eftpos/locales.js +205 -25
  45. package/es/components/eftpos/table.js +47 -3
  46. package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
  47. package/es/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
  48. package/es/components/eftposPay/aggregatePayment/hooks/usePayment.js +145 -0
  49. package/es/components/eftposPay/aggregatePayment/index.d.ts +2 -1
  50. package/es/components/eftposPay/aggregatePayment/index.js +2 -1
  51. package/es/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
  52. package/es/components/eftposPay/aggregatePayment/mock.js +567 -0
  53. package/es/components/eftposPay/aggregatePayment/service.js +1 -0
  54. package/es/components/eftposPay/aggregatePayment/types.d.ts +12 -12
  55. package/es/components/eftposPay/aggregatePayment/types.js +4 -8
  56. package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
  57. package/es/components/eftposPay/aggregatePayment/utils/payment.js +231 -168
  58. package/es/components/eftposPay/amount.js +15 -1
  59. package/es/components/eftposPay/app.js +2 -3
  60. package/es/components/eftposPay/component/fail/failCustom.js +13 -4
  61. package/es/components/eftposPay/component/fail/index.js +12 -5
  62. package/es/components/eftposPay/component/fail/network.js +3 -0
  63. package/es/components/eftposPay/component/fail/unknow.js +8 -0
  64. package/es/components/eftposPay/component/manual/index.js +17 -3
  65. package/es/components/eftposPay/component/signature/index.js +3 -0
  66. package/es/components/eftposPay/const.d.ts +8 -3
  67. package/es/components/eftposPay/const.js +2 -0
  68. package/es/components/eftposPay/device.js +225 -38
  69. package/es/components/eftposPay/helper.d.ts +3 -0
  70. package/es/components/eftposPay/helper.js +2 -1
  71. package/es/components/eftposPay/hooks.d.ts +1 -1
  72. package/es/components/eftposPay/index.js +50 -13
  73. package/es/components/eftposPay/linkly/const.js +1 -1
  74. package/es/components/eftposPay/linkly/hooks/normal.js +21 -68
  75. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +20 -81
  76. package/es/components/eftposPay/linkly/index.js +11 -23
  77. package/es/components/eftposPay/locales.d.ts +15 -0
  78. package/es/components/eftposPay/locales.js +30 -15
  79. package/es/components/eftposPay/manufacturer.d.ts +1 -0
  80. package/es/components/eftposPay/manufacturer.js +4 -0
  81. package/es/components/eftposPay/mx51/Action.d.ts +6 -0
  82. package/es/components/eftposPay/mx51/Action.js +144 -0
  83. package/es/components/eftposPay/mx51/const.d.ts +5 -0
  84. package/es/components/eftposPay/mx51/const.js +69 -0
  85. package/es/components/eftposPay/mx51/index.d.ts +6 -0
  86. package/es/components/eftposPay/mx51/index.js +498 -0
  87. package/es/components/eftposPay/mx51/types.d.ts +142 -0
  88. package/es/components/eftposPay/mx51/types.js +35 -0
  89. package/es/components/eftposPay/mx51/utils.d.ts +10 -0
  90. package/es/components/eftposPay/mx51/utils.js +121 -0
  91. package/es/components/eftposPay/pay.js +21 -9
  92. package/es/components/eftposPay/payo/config.js +39 -5
  93. package/es/components/eftposPay/payo/const.js +1 -1
  94. package/es/components/eftposPay/payo/hooks.js +3 -12
  95. package/es/components/eftposPay/payo/payment.js +69 -136
  96. package/es/components/eftposPay/store/index.d.ts +5 -9
  97. package/es/components/eftposPay/tip.js +5 -0
  98. package/es/components/eftposPay/tyro/const.js +1 -1
  99. package/es/components/eftposPay/tyro/index.js +44 -11
  100. package/es/components/eftposPay/utils/payLog.d.ts +81 -0
  101. package/es/components/eftposPay/utils/payLog.js +458 -0
  102. package/es/components/eftposPay/windcave/const.js +1 -1
  103. package/es/components/eftposPay/windcave/receiptAction.js +5 -0
  104. package/es/components/eftposPay/windcave/windcave.js +37 -38
  105. package/es/components/ticketBooking/utils/formatProductMessage.js +47 -2
  106. package/lib/components/booking/components/footer/amount.js +3 -3
  107. package/lib/components/booking/components/footer/utils.js +12 -5
  108. package/lib/components/booking/components/voucher/index.js +1 -1
  109. package/lib/components/booking/info2/service/editService/index.js +56 -5
  110. package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
  111. package/lib/components/booking/info2/service/editService/utils.js +16 -0
  112. package/lib/components/booking/payments/index.js +1 -1
  113. package/lib/components/eftpos/PairModal/hooks.d.ts +27 -0
  114. package/lib/components/eftpos/PairModal/hooks.js +70 -0
  115. package/lib/components/eftpos/PairModal/index.d.ts +11 -0
  116. package/lib/components/eftpos/PairModal/index.js +197 -0
  117. package/lib/components/eftpos/PairModal/index.less +70 -0
  118. package/lib/components/eftpos/SettlementModal/Action.d.ts +7 -0
  119. package/lib/components/eftpos/SettlementModal/Action.js +153 -0
  120. package/lib/components/eftpos/SettlementModal/index.d.ts +7 -0
  121. package/lib/components/eftpos/SettlementModal/index.js +170 -0
  122. package/lib/components/eftpos/SettlementModal/index.less +33 -0
  123. package/lib/components/eftpos/SettlementModal/serve.d.ts +8 -0
  124. package/lib/components/eftpos/SettlementModal/serve.js +45 -0
  125. package/lib/components/eftpos/SettlementModal/types.d.ts +138 -0
  126. package/lib/components/eftpos/SettlementModal/types.js +43 -0
  127. package/lib/components/eftpos/SettlementModal/utils.d.ts +18 -0
  128. package/lib/components/eftpos/SettlementModal/utils.js +248 -0
  129. package/lib/components/eftpos/assets/mx51SCI.svg +15 -0
  130. package/lib/components/eftpos/const.d.ts +3 -1
  131. package/lib/components/eftpos/const.js +2 -0
  132. package/lib/components/eftpos/device.d.ts +3 -1
  133. package/lib/components/eftpos/device.js +13 -3
  134. package/lib/components/eftpos/hooks.d.ts +13 -0
  135. package/lib/components/eftpos/hooks.js +30 -0
  136. package/lib/components/eftpos/index.js +121 -8
  137. package/lib/components/eftpos/index.less +32 -1
  138. package/lib/components/eftpos/locales.d.ts +80 -0
  139. package/lib/components/eftpos/locales.js +231 -21
  140. package/lib/components/eftpos/table.js +30 -2
  141. package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
  142. package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
  143. package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.js +171 -0
  144. package/lib/components/eftposPay/aggregatePayment/index.d.ts +2 -1
  145. package/lib/components/eftposPay/aggregatePayment/index.js +5 -2
  146. package/lib/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
  147. package/lib/components/eftposPay/aggregatePayment/mock.js +679 -0
  148. package/lib/components/eftposPay/aggregatePayment/types.d.ts +12 -12
  149. package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
  150. package/lib/components/eftposPay/aggregatePayment/utils/payment.js +173 -123
  151. package/lib/components/eftposPay/amount.js +13 -1
  152. package/lib/components/eftposPay/app.js +4 -5
  153. package/lib/components/eftposPay/component/fail/failCustom.js +10 -2
  154. package/lib/components/eftposPay/component/fail/index.js +10 -2
  155. package/lib/components/eftposPay/component/fail/network.js +3 -0
  156. package/lib/components/eftposPay/component/fail/unknow.js +8 -0
  157. package/lib/components/eftposPay/component/manual/index.js +16 -2
  158. package/lib/components/eftposPay/component/signature/index.js +3 -0
  159. package/lib/components/eftposPay/const.d.ts +8 -3
  160. package/lib/components/eftposPay/const.js +2 -0
  161. package/lib/components/eftposPay/device.js +114 -25
  162. package/lib/components/eftposPay/helper.d.ts +3 -0
  163. package/lib/components/eftposPay/helper.js +2 -1
  164. package/lib/components/eftposPay/hooks.d.ts +1 -1
  165. package/lib/components/eftposPay/index.js +38 -13
  166. package/lib/components/eftposPay/linkly/const.js +1 -1
  167. package/lib/components/eftposPay/linkly/hooks/normal.js +22 -43
  168. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +13 -65
  169. package/lib/components/eftposPay/linkly/index.js +8 -10
  170. package/lib/components/eftposPay/locales.d.ts +15 -0
  171. package/lib/components/eftposPay/locales.js +30 -15
  172. package/lib/components/eftposPay/manufacturer.d.ts +1 -0
  173. package/lib/components/eftposPay/manufacturer.js +6 -0
  174. package/lib/components/eftposPay/mx51/Action.d.ts +6 -0
  175. package/lib/components/eftposPay/mx51/Action.js +154 -0
  176. package/lib/components/eftposPay/mx51/const.d.ts +5 -0
  177. package/lib/components/eftposPay/mx51/const.js +85 -0
  178. package/lib/components/eftposPay/mx51/index.d.ts +6 -0
  179. package/lib/components/eftposPay/mx51/index.js +433 -0
  180. package/lib/components/eftposPay/mx51/types.d.ts +142 -0
  181. package/lib/components/eftposPay/mx51/types.js +43 -0
  182. package/lib/components/eftposPay/mx51/utils.d.ts +10 -0
  183. package/lib/components/eftposPay/mx51/utils.js +115 -0
  184. package/lib/components/eftposPay/pay.js +13 -3
  185. package/lib/components/eftposPay/payo/config.js +16 -8
  186. package/lib/components/eftposPay/payo/const.js +1 -1
  187. package/lib/components/eftposPay/payo/hooks.js +12 -10
  188. package/lib/components/eftposPay/payo/payment.js +31 -65
  189. package/lib/components/eftposPay/store/index.d.ts +5 -9
  190. package/lib/components/eftposPay/tip.js +5 -0
  191. package/lib/components/eftposPay/tyro/const.js +1 -1
  192. package/lib/components/eftposPay/tyro/index.js +21 -17
  193. package/lib/components/eftposPay/utils/payLog.d.ts +81 -0
  194. package/lib/components/eftposPay/utils/payLog.js +321 -0
  195. package/lib/components/eftposPay/windcave/const.js +1 -1
  196. package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
  197. package/lib/components/eftposPay/windcave/windcave.js +27 -29
  198. package/lib/components/ticketBooking/utils/formatProductMessage.js +44 -2
  199. package/package.json +4 -4
  200. package/es/components/eftposPay/utils/log/index.d.ts +0 -110
  201. package/es/components/eftposPay/utils/log/index.js +0 -371
  202. package/lib/components/eftposPay/utils/log/index.d.ts +0 -110
  203. package/lib/components/eftposPay/utils/log/index.js +0 -294
@@ -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,8 +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_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
43
- var import_utils = require("../../utils");
42
+ var import_payLog = __toESM(require("./utils/payLog"));
44
43
  var App = ({
45
44
  action,
46
45
  api,
@@ -58,9 +57,9 @@ var App = ({
58
57
  const data = (0, import_store.useContextData)();
59
58
  const dispatch = (0, import_store.useDispatch)();
60
59
  const [current, setCurrent] = (0, import_react.useState)(action);
61
- const engineContext = (0, import_useEngineContext.default)();
60
+ const engineContext = useEngineContext();
62
61
  const utils = engineContext.appHelper.utils || {};
63
- import_utils.request.setRequest(utils == null ? void 0 : utils.request);
62
+ request.setRequest(utils == null ? void 0 : utils.request);
64
63
  const statusRef = (0, import_react.useRef)(data.status);
65
64
  const network = (0, import_react.useMemo)(
66
65
  () => typeof terminal.network === "boolean" ? terminal.network : true,
@@ -110,12 +109,12 @@ var App = ({
110
109
  dispatch((0, import_store.updateState)({ action: params }));
111
110
  }
112
111
  }
113
- console.log("状态切换 = ", status, params, other);
114
112
  props.onChangeStatus(status, params, other);
115
113
  },
116
114
  []
117
115
  );
118
116
  const onClose = () => {
117
+ import_payLog.default.log("关闭支付");
119
118
  onChange("fail", {
120
119
  number: data.number,
121
120
  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 {
@@ -60,6 +61,7 @@ var fail_default = ({ onChange, className = "", isMobile }) => {
60
61
  const isPosNetworkError = ((_b = (_a = steps[step]) == null ? void 0 : _a.custom) == null ? void 0 : _b.isPosNetworkError) || false;
61
62
  const dispatch = (0, import_store.useDispatch)();
62
63
  const onRetry = () => {
64
+ import_payLog.default.log("失败页:点击重试");
63
65
  onChange("page", "pay");
64
66
  dispatch(
65
67
  (0, import_store.updateState)(
@@ -70,7 +72,8 @@ var fail_default = ({ onChange, className = "", isMobile }) => {
70
72
  symbol,
71
73
  amount,
72
74
  order_id,
73
- number: ""
75
+ number: "",
76
+ client
74
77
  })
75
78
  )
76
79
  );
@@ -85,13 +88,15 @@ var fail_default = ({ onChange, className = "", isMobile }) => {
85
88
  symbol,
86
89
  amount,
87
90
  order_id,
88
- number: ""
91
+ number: "",
92
+ client
89
93
  })
90
94
  )
91
95
  );
92
96
  onChange("page", "amount");
93
97
  };
94
98
  const onManually = () => {
99
+ import_payLog.default.log("失败页:点击手动标记");
95
100
  dispatch(
96
101
  (0, import_store.updateState)({
97
102
  manual: {
@@ -107,12 +112,15 @@ var fail_default = ({ onChange, className = "", isMobile }) => {
107
112
  dispatch((0, import_store.updateComponent)("Manual"));
108
113
  };
109
114
  const onNotin = () => {
115
+ import_payLog.default.log("失败页:点击打印小票");
110
116
  onChange("print", [], "print_on_timeout");
111
117
  };
112
118
  const onClose = () => {
119
+ import_payLog.default.log("失败页:点击关闭");
113
120
  onChange("fail", { number, uniquePaymentNumber: number, device, order_id });
114
121
  };
115
122
  (0, import_ahooks.useMount)(() => {
123
+ import_payLog.default.log("失败页展示", { status: steps[step].status });
116
124
  if (steps[step].status === "fail") {
117
125
  onChange("page", "fail");
118
126
  }
@@ -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,
@@ -69,10 +75,13 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
69
75
  number,
70
76
  uniquePaymentNumber: number,
71
77
  device,
72
- order_id
78
+ order_id,
79
+ manual_marking_flag: 1
80
+ // 手动标记标志
73
81
  });
74
82
  return;
75
83
  }
84
+ import_payLog.default.log("手动标记:点击标记为成功");
76
85
  updateAmountStatus(true);
77
86
  dispatch((0, import_store.updateState)({ manual: { ...manual, status: true } }));
78
87
  };
@@ -80,6 +89,7 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
80
89
  if (disabled) {
81
90
  return;
82
91
  }
92
+ import_payLog.default.log("手动标记:点击标记为失败");
83
93
  setDisabled(true);
84
94
  onChange("fail", { number, uniquePaymentNumber: number, device, order_id });
85
95
  };
@@ -87,6 +97,7 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
87
97
  if (disabled) {
88
98
  return;
89
99
  }
100
+ import_payLog.default.log("手动标记-确认金额:点击确认", { money });
90
101
  setDisabled(true);
91
102
  if (mode === import_const.ModeEnum.Refund || mode === import_const.ModeEnum.Query) {
92
103
  return;
@@ -119,11 +130,14 @@ var manual_default = ({ onChange, className = "", formatAmount }) => {
119
130
  number,
120
131
  uniquePaymentNumber: number,
121
132
  device,
122
- order_id
133
+ order_id,
134
+ manual_marking_flag: 1
135
+ // 手动标记标志
123
136
  });
124
137
  return;
125
138
  };
126
139
  const onCancel = () => {
140
+ import_payLog.default.log("手动标记-确认金额:点击取消");
127
141
  updateAmountStatus(false);
128
142
  setMoney(pay == null ? void 0 : pay.total);
129
143
  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",
@@ -7,9 +7,12 @@ export declare enum EftposEnum {
7
7
  /** 后端支付 - 支付 + 退款 */
8
8
  Windcave = "windcave",
9
9
  Stripe = "stripe",
10
+ /** 后端支付 - 支付 + 退款 */
10
11
  Linkly = "linkly",
11
12
  /** 汇付天下 */
12
- Huifu = "huifu"
13
+ Huifu = "huifu",
14
+ /** mx51支付 - 支付 + 退款 */
15
+ MX51 = "mx51"
13
16
  }
14
17
  export declare enum StatusEnum {
15
18
  Init = "init",
@@ -163,7 +166,7 @@ export declare enum PayStatus {
163
166
  'Unknown' = "701000",
164
167
  /** 交易请求超时 */
165
168
  'Timeout' = "701001",
166
- /** 支付失败(汇付天下) */
169
+ /** 支付失败 */
167
170
  'PaymentFailed' = "701002",
168
171
  /** 繁忙 EFTPOS终端暂时不可用,因为EFTPOS正在处理另一个请求。 */
169
172
  'PayOtherEftposFailed' = "701003",
@@ -180,7 +183,9 @@ export declare enum PayStatus {
180
183
  /** 签名拒绝 */
181
184
  'SignatureDeclined' = "701009",
182
185
  /** 配置参数错误 */
183
- 'UserConfigError' = "701010"
186
+ 'UserConfigError' = "701010",
187
+ /** mx51未知状态 */
188
+ 'UnknownMx51' = "702001"
184
189
  }
185
190
  export interface ActionProps {
186
191
  onChange: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
@@ -37,6 +37,7 @@ var EftposEnum = /* @__PURE__ */ ((EftposEnum2) => {
37
37
  EftposEnum2["Stripe"] = "stripe";
38
38
  EftposEnum2["Linkly"] = "linkly";
39
39
  EftposEnum2["Huifu"] = "huifu";
40
+ EftposEnum2["MX51"] = "mx51";
40
41
  return EftposEnum2;
41
42
  })(EftposEnum || {});
42
43
  var StatusEnum = /* @__PURE__ */ ((StatusEnum2) => {
@@ -103,6 +104,7 @@ var PayStatus = /* @__PURE__ */ ((PayStatus2) => {
103
104
  PayStatus2["PayBankRefuses"] = "701008";
104
105
  PayStatus2["SignatureDeclined"] = "701009";
105
106
  PayStatus2["UserConfigError"] = "701010";
107
+ PayStatus2["UnknownMx51"] = "702001";
106
108
  return PayStatus2;
107
109
  })(PayStatus || {});
108
110
  // Annotate the CommonJS export names for ESM import in node:
@@ -43,6 +43,8 @@ var import_ChevronRight = __toESM(require("@pisell/icon/es/ChevronRight"));
43
43
  var import_store = require("./store");
44
44
  var import_manufacturer = require("./manufacturer");
45
45
  var import_device = require("./device.less");
46
+ var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
47
+ var import_payLog = __toESM(require("./utils/payLog"));
46
48
  var device_default = ({
47
49
  api,
48
50
  onChange,
@@ -55,13 +57,17 @@ var device_default = ({
55
57
  formatAmount = (number, precision, symbol) => `${symbol}${number}`,
56
58
  containerStyle = {}
57
59
  }) => {
60
+ const context = (0, import_useEngineContext.default)();
61
+ const { isTerminal, interaction } = context.appHelper.utils || {};
58
62
  const store = (0, import_store.useContextData)();
59
- const { device, symbol, mode, eftpos } = store;
63
+ const { device, symbol, mode, eftpos, order_id } = store;
60
64
  const [loading, setLoading] = (0, import_react.useState)(false);
61
65
  const [dataStaus, setDataStaus] = (0, import_react.useState)(true);
62
66
  const [list, setList] = (0, import_react.useState)([]);
63
67
  const dispatch = (0, import_store.useDispatch)();
68
+ const timerRef = (0, import_react.useRef)();
64
69
  const onClick = (event) => {
70
+ var _a;
65
71
  if (!net) {
66
72
  import_antd.message.open({
67
73
  key: "net-warning",
@@ -71,14 +77,48 @@ var device_default = ({
71
77
  return;
72
78
  }
73
79
  const [index] = [Number(event.currentTarget.dataset.index)];
80
+ import_payLog.default.log("手动选择设备", { deviceId: (_a = list[index]) == null ? void 0 : _a.id, index });
74
81
  setDevice(list[index]);
75
82
  };
83
+ const triggerCloseButton = (bool) => {
84
+ var _a, _b;
85
+ if (!(isTerminal == null ? void 0 : isTerminal())) {
86
+ return;
87
+ }
88
+ (_b = (_a = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a.postMessageToApp) == null ? void 0 : _b.call(_a, {
89
+ module: "pos",
90
+ key: "other",
91
+ data: {
92
+ key: bool ? "show_close_button" : "hide_close_button"
93
+ }
94
+ });
95
+ };
96
+ const closeFirstWithDelayShow = () => {
97
+ timerRef.current && clearTimeout(timerRef.current);
98
+ if (!(isTerminal == null ? void 0 : isTerminal())) {
99
+ return;
100
+ }
101
+ triggerCloseButton(false);
102
+ timerRef.current = setTimeout(() => {
103
+ triggerCloseButton(true);
104
+ }, 5e3);
105
+ };
106
+ const clearTimer = () => {
107
+ if (timerRef.current) {
108
+ clearTimeout(timerRef.current);
109
+ timerRef.current = void 0;
110
+ }
111
+ };
76
112
  (0, import_ahooks.useMount)(() => {
113
+ import_payLog.default.log("设备选择页展示");
77
114
  setLoading(true);
115
+ closeFirstWithDelayShow();
78
116
  api.getDeviceList({ type: eftpos, status: "paired" }).then(
79
117
  (res) => {
118
+ clearTimer();
80
119
  setLoading(false);
81
120
  if (res && Array.isArray(res.list) && res.list.length > 0) {
121
+ import_payLog.default.log("设备列表加载成功", { count: res.list.length, hasDeviceNumber: !!device_number });
82
122
  if (device_number) {
83
123
  const hostDeviceList = res.list.filter(
84
124
  (item) => {
@@ -92,6 +132,7 @@ var device_default = ({
92
132
  setDataStaus(true);
93
133
  setList(setDeviceList(hostDeviceList));
94
134
  if (hostDeviceList.length === 1) {
135
+ import_payLog.default.log("自动选择设备(device_number匹配)", { device: hostDeviceList[0] });
95
136
  setDevice(hostDeviceList[0]);
96
137
  }
97
138
  return;
@@ -100,25 +141,62 @@ var device_default = ({
100
141
  setDataStaus(true);
101
142
  setList(setDeviceList(res.list));
102
143
  if (res.list.length === 1) {
144
+ import_payLog.default.log("自动选择设备(单设备)", { device: res.list[0] });
103
145
  setDevice(res.list[0]);
146
+ } else {
147
+ triggerCloseButton(true);
104
148
  }
105
149
  return;
106
150
  }
151
+ import_payLog.default.log("设备列表为空");
152
+ triggerCloseButton(true);
107
153
  setDataStaus(false);
108
154
  },
109
155
  () => {
156
+ clearTimer();
157
+ import_payLog.default.log("设备列表加载失败");
158
+ triggerCloseButton(true);
110
159
  setDataStaus(false);
111
160
  setLoading(false);
112
161
  }
113
162
  );
114
163
  });
115
- const setDevice = (device2) => {
164
+ (0, import_ahooks.useUnmount)(() => {
165
+ timerRef.current && clearTimeout(timerRef.current);
166
+ });
167
+ const checkIsActiveWithDelay = async (time = 100) => {
168
+ var _a, _b, _c;
169
+ if (!(isTerminal == null ? void 0 : isTerminal())) {
170
+ return true;
171
+ }
172
+ await new Promise((resolve) => setTimeout(resolve, time));
173
+ if ((_a = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a.asyncDataManager) {
174
+ try {
175
+ const activeStatus = await ((_c = (_b = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _b.asyncDataManager) == null ? void 0 : _c.call(_b, {
176
+ module: "get",
177
+ key: "pay_webview_active"
178
+ }));
179
+ return activeStatus !== "unActive";
180
+ } catch (error) {
181
+ return true;
182
+ }
183
+ }
184
+ return true;
185
+ };
186
+ const setDevice = async (device2) => {
187
+ import_payLog.default.setContext({ deviceId: device2 == null ? void 0 : device2.id });
116
188
  dispatch((0, import_store.updateDevice)({ device: device2 }));
117
189
  if (typeof api.selectDevice === "function") {
118
190
  api.selectDevice(device2);
119
191
  }
120
192
  if (typeof onChange === "function") {
121
193
  if (mode === import_const.ModeEnum.Pay) {
194
+ triggerCloseButton(false);
195
+ const isActive = await checkIsActiveWithDelay(100);
196
+ if (!isActive) {
197
+ import_payLog.default.log("页面非活跃状态,阻断支付", { order_id, isActive });
198
+ return;
199
+ }
122
200
  if (device2.pay) {
123
201
  dispatch(
124
202
  (0, import_store.updateState)({
@@ -156,34 +234,45 @@ var device_default = ({
156
234
  ...containerStyle || {}
157
235
  }
158
236
  },
159
- /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { spinning: loading, style: { flex: 1, overflow: "auto" } }, /* @__PURE__ */ import_react.default.createElement(
160
- "div",
237
+ /* @__PURE__ */ import_react.default.createElement(
238
+ import_antd.Spin,
161
239
  {
162
- style: { display: "flex", flexDirection: "column", gap: "10px" }
240
+ spinning: loading,
241
+ size: "large",
242
+ style: { flex: 1, overflow: "auto", minHeight: "200px" }
163
243
  },
164
- list.map(({ id, name, pay }, index) => /* @__PURE__ */ import_react.default.createElement(
244
+ /* @__PURE__ */ import_react.default.createElement(
165
245
  "div",
166
246
  {
167
- key: id,
168
- className: `pisell-lowcode__eft-pay-device ${id === (device == null ? void 0 : device.id) ? "active" : ""}`,
169
- "data-index": index,
170
- onClick,
171
- role: "button",
172
- tabIndex: index
247
+ style: { display: "flex", flexDirection: "column", gap: "10px" }
173
248
  },
174
- /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-name" }, name), mode === import_const.ModeEnum.Refund ? null : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-money" }, pay.totalUnit), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-sucharge" }, import_utils.locales.getText(
175
- "page.eftpos-pay.text.surcharge.edit.inc.surcharge"
176
- ), ": ", formatAmount(`${pay.surcharge}`, 2, symbol), " (", import_utils.locales.getText(
177
- "page.eftpos-pay.text.surcharge.edit.rate"
178
- ), ":", pay.surRate, "% +", " ", formatAmount(`${pay.surMoney}`, 2, symbol), ")"))),
179
- /* @__PURE__ */ import_react.default.createElement("div", { style: { flexShrink: 0 } }, /* @__PURE__ */ import_react.default.createElement(
180
- import_ChevronRight.default,
181
- {
182
- style: { fontWeight: "600", fontSize: "24px" }
183
- }
184
- ))
185
- ))
186
- ))
249
+ list.map(({ id, name, pay, connection }, index) => {
250
+ var _a;
251
+ return /* @__PURE__ */ import_react.default.createElement(
252
+ "div",
253
+ {
254
+ key: id,
255
+ className: `pisell-lowcode__eft-pay-device ${id === (device == null ? void 0 : device.id) ? "active" : ""}`,
256
+ "data-index": index,
257
+ onClick,
258
+ role: "button",
259
+ tabIndex: index
260
+ },
261
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-name" }, name), mode === import_const.ModeEnum.Refund ? null : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-money" }, pay.totalUnit), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-sucharge" }, import_utils.locales.getText(
262
+ "page.eftpos-pay.text.surcharge.edit.inc.surcharge"
263
+ ), ": ", formatAmount(`${pay.surcharge}`, 2, symbol), " (", import_utils.locales.getText(
264
+ "page.eftpos-pay.text.surcharge.edit.rate"
265
+ ), ":", pay.surRate, "% +", " ", formatAmount(`${pay.surMoney}`, 2, symbol), ")"), eftpos === import_const.EftposEnum.MX51 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-sucharge" }, "Pairing ID: ", (_a = connection == null ? void 0 : connection.response) == null ? void 0 : _a.pairing_id) : null)),
266
+ /* @__PURE__ */ import_react.default.createElement("div", { style: { flexShrink: 0 } }, /* @__PURE__ */ import_react.default.createElement(
267
+ import_ChevronRight.default,
268
+ {
269
+ style: { fontWeight: "600", fontSize: "24px" }
270
+ }
271
+ ))
272
+ );
273
+ })
274
+ )
275
+ )
187
276
  ) : /* @__PURE__ */ import_react.default.createElement(
188
277
  "div",
189
278
  {
@@ -29,6 +29,7 @@ export declare const getPayParams: (data: Partial<Omit<State, key>> & Pick<State
29
29
  amount?: undefined;
30
30
  total?: undefined;
31
31
  receipt?: undefined;
32
+ uniquePaymentNumber?: undefined;
32
33
  } | {
33
34
  cardReaderSurcharge: {};
34
35
  surMoney: string;
@@ -51,6 +52,7 @@ export declare const getPayParams: (data: Partial<Omit<State, key>> & Pick<State
51
52
  } | undefined;
52
53
  order_id: string | number;
53
54
  receipt: {};
55
+ uniquePaymentNumber: string | number | undefined;
54
56
  } | {
55
57
  amount: string | number;
56
58
  total: string | number;
@@ -58,6 +60,7 @@ export declare const getPayParams: (data: Partial<Omit<State, key>> & Pick<State
58
60
  order_id: string | number;
59
61
  device?: undefined;
60
62
  receipt?: undefined;
63
+ uniquePaymentNumber?: undefined;
61
64
  };
62
65
  export declare const limitDecimals: (value: any) => any;
63
66
  /**
@@ -103,7 +103,8 @@ var getPayParams = (data, statue) => {
103
103
  number: data.number,
104
104
  device: data.device,
105
105
  order_id: data.order_id,
106
- receipt: ((_f = (_e = data.device) == null ? void 0 : _e.setting) == null ? void 0 : _f.receipts) ? [] : receipt
106
+ receipt: ((_f = (_e = data.device) == null ? void 0 : _e.setting) == null ? void 0 : _f.receipts) ? [] : receipt,
107
+ uniquePaymentNumber: data.number
107
108
  };
108
109
  }
109
110
  return {
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "payo" | "linkly" | "huifu">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "mx51" | "payo" | "windcave" | "linkly" | "huifu">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };