@pisell/private-materials 3.0.186 → 3.0.188

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 (101) 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 +3 -3
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/components/booking/addons/model.d.ts +1 -2
  12. package/es/components/booking/forms/model.d.ts +1 -2
  13. package/es/components/booking/notes/index.d.ts +1 -1
  14. package/es/components/booking/notes/model.d.ts +1 -2
  15. package/es/components/booking/payments/model.d.ts +1 -2
  16. package/es/components/eftposPay/amount.d.ts +4 -3
  17. package/es/components/eftposPay/amount.js +5 -4
  18. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -1
  19. package/es/components/eftposPay/component/fail/failCustom.js +14 -6
  20. package/es/components/eftposPay/component/fail/index.d.ts +1 -1
  21. package/es/components/eftposPay/component/fail/index.js +14 -5
  22. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -1
  23. package/es/components/eftposPay/component/fail/unknow.js +17 -7
  24. package/es/components/eftposPay/const.d.ts +8 -2
  25. package/es/components/eftposPay/const.js +5 -0
  26. package/es/components/eftposPay/device.d.ts +4 -3
  27. package/es/components/eftposPay/device.js +5 -4
  28. package/es/components/eftposPay/hooks.d.ts +4 -3
  29. package/es/components/eftposPay/hooks.js +31 -6
  30. package/es/components/eftposPay/index.js +57 -23
  31. package/es/components/eftposPay/index.less +1 -0
  32. package/es/components/eftposPay/locales.d.ts +6 -0
  33. package/es/components/eftposPay/locales.js +6 -0
  34. package/es/components/eftposPay/pay.d.ts +3 -2
  35. package/es/components/eftposPay/pay.js +8 -7
  36. package/es/components/eftposPay/payo/config.d.ts +3 -1
  37. package/es/components/eftposPay/payo/config.js +11 -9
  38. package/es/components/eftposPay/payo/const.js +4 -2
  39. package/es/components/eftposPay/payo/index.js +3 -1
  40. package/es/components/eftposPay/store/index.d.ts +17 -2
  41. package/es/components/eftposPay/store/index.js +20 -0
  42. package/es/components/eftposPay/tyro/const.js +4 -2
  43. package/es/components/eftposPay/tyro/index.js +70 -20
  44. package/es/components/eftposPay/windcave/const.js +4 -2
  45. package/es/components/eftposPay/windcave/helper.js +19 -28
  46. package/es/components/eftposPay/windcave/windcave.js +2 -1
  47. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +10 -4
  48. package/es/components/pisellSelectCustomerModal/RightPanel/index.js +5 -3
  49. package/es/components/pisellSelectCustomerModal/RightPanel/index.less +7 -0
  50. package/es/components/pisellSelectCustomerModal/index.js +7 -1
  51. package/es/components/pisellSelectCustomerModal/index.less +6 -0
  52. package/es/components/pisellSelectCustomerModal/locales.d.ts +6 -0
  53. package/es/components/pisellSelectCustomerModal/locales.js +9 -3
  54. package/es/components/schedules/index.d.ts +1 -1
  55. package/es/components/schedules/model.d.ts +1 -2
  56. package/lib/components/booking/addons/model.d.ts +1 -2
  57. package/lib/components/booking/forms/model.d.ts +1 -2
  58. package/lib/components/booking/notes/index.d.ts +1 -1
  59. package/lib/components/booking/notes/model.d.ts +1 -2
  60. package/lib/components/booking/payments/model.d.ts +1 -2
  61. package/lib/components/eftposPay/amount.d.ts +4 -3
  62. package/lib/components/eftposPay/amount.js +4 -3
  63. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -1
  64. package/lib/components/eftposPay/component/fail/failCustom.js +16 -4
  65. package/lib/components/eftposPay/component/fail/index.d.ts +1 -1
  66. package/lib/components/eftposPay/component/fail/index.js +17 -4
  67. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -1
  68. package/lib/components/eftposPay/component/fail/unknow.js +15 -3
  69. package/lib/components/eftposPay/const.d.ts +8 -2
  70. package/lib/components/eftposPay/const.js +7 -0
  71. package/lib/components/eftposPay/device.d.ts +4 -3
  72. package/lib/components/eftposPay/device.js +5 -4
  73. package/lib/components/eftposPay/hooks.d.ts +4 -3
  74. package/lib/components/eftposPay/hooks.js +30 -8
  75. package/lib/components/eftposPay/index.js +46 -18
  76. package/lib/components/eftposPay/index.less +1 -0
  77. package/lib/components/eftposPay/locales.d.ts +6 -0
  78. package/lib/components/eftposPay/locales.js +6 -0
  79. package/lib/components/eftposPay/pay.d.ts +3 -2
  80. package/lib/components/eftposPay/pay.js +7 -6
  81. package/lib/components/eftposPay/payo/config.d.ts +3 -1
  82. package/lib/components/eftposPay/payo/config.js +8 -8
  83. package/lib/components/eftposPay/payo/const.js +2 -0
  84. package/lib/components/eftposPay/payo/index.js +1 -1
  85. package/lib/components/eftposPay/store/index.d.ts +17 -2
  86. package/lib/components/eftposPay/store/index.js +14 -0
  87. package/lib/components/eftposPay/tyro/const.js +2 -0
  88. package/lib/components/eftposPay/tyro/index.js +63 -6
  89. package/lib/components/eftposPay/windcave/const.js +2 -0
  90. package/lib/components/eftposPay/windcave/helper.js +23 -28
  91. package/lib/components/eftposPay/windcave/windcave.js +2 -1
  92. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +3 -0
  93. package/lib/components/pisellSelectCustomerModal/RightPanel/index.js +5 -3
  94. package/lib/components/pisellSelectCustomerModal/RightPanel/index.less +7 -0
  95. package/lib/components/pisellSelectCustomerModal/index.js +7 -0
  96. package/lib/components/pisellSelectCustomerModal/index.less +6 -0
  97. package/lib/components/pisellSelectCustomerModal/locales.d.ts +6 -0
  98. package/lib/components/pisellSelectCustomerModal/locales.js +9 -3
  99. package/lib/components/schedules/index.d.ts +1 -1
  100. package/lib/components/schedules/model.d.ts +1 -2
  101. package/package.json +2 -2
@@ -41,7 +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 failCustom_default = ({ className = "", isIpad, onChange }) => {
44
+ var failCustom_default = ({ className = "", isMobile, onChange }) => {
45
45
  const {
46
46
  eftpos,
47
47
  custom,
@@ -51,7 +51,8 @@ var failCustom_default = ({ className = "", isIpad, onChange }) => {
51
51
  amount,
52
52
  order_id,
53
53
  number,
54
- device
54
+ device,
55
+ client
55
56
  } = (0, import_store.useContextData)();
56
57
  const failCustom = custom == null ? void 0 : custom.failCustom;
57
58
  const dispatch = (0, import_store.useDispatch)();
@@ -96,6 +97,9 @@ var failCustom_default = ({ className = "", isIpad, onChange }) => {
96
97
  );
97
98
  dispatch((0, import_store.updateComponent)("Manual"));
98
99
  };
100
+ const onNotin = () => {
101
+ onChange("print", [], "print_on_timeout");
102
+ };
99
103
  const onClose = () => {
100
104
  onChange("fail", { number, device, order_id });
101
105
  };
@@ -104,14 +108,14 @@ var failCustom_default = ({ className = "", isIpad, onChange }) => {
104
108
  onChange("page", "fail");
105
109
  }
106
110
  });
107
- return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-box ${className}` }, /* @__PURE__ */ import_react.default.createElement(import_header.default, { status: failCustom.status }, (failCustom == null ? void 0 : failCustom.status) === "fail" && !isIpad ? /* @__PURE__ */ import_react.default.createElement(
111
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-box ${className}` }, /* @__PURE__ */ import_react.default.createElement(import_header.default, { status: failCustom.status }, (failCustom == null ? void 0 : failCustom.status) === "fail" && !isMobile ? /* @__PURE__ */ import_react.default.createElement(
108
112
  import_XClose.default,
109
113
  {
110
114
  size: 20,
111
115
  style: { fontSize: "24px", position: "absolute", top: 0, right: 0 },
112
116
  onClick: onClose
113
117
  }
114
- ) : null), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-title" }, failCustom.title || import_utils.locales.getText("page.eftpos-pay.text.failed")(mode)), (failCustom == null ? void 0 : failCustom.status) === "fail" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-text pisell-lowcode__eft-pay-body" }, failCustom == null ? void 0 : failCustom.fail) : (failCustom == null ? void 0 : failCustom.status) === "warn" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-warn-text pisell-lowcode__eft-pay-body" }, failCustom == null ? void 0 : failCustom.warn) : null, (failCustom == null ? void 0 : failCustom.isPosNetworkError) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
118
+ ) : null), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-title" }, failCustom.title || import_utils.locales.getText("page.eftpos-pay.text.failed")(mode)), (failCustom == null ? void 0 : failCustom.status) === "fail" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-text pisell-lowcode__eft-pay-body" }, failCustom == null ? void 0 : failCustom.fail) : (failCustom == null ? void 0 : failCustom.status) === "warn" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-warn-text pisell-lowcode__eft-pay-body" }, failCustom == null ? void 0 : failCustom.warn) : null, (failCustom == null ? void 0 : failCustom.isPosNetworkError) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, client === import_const.ClientEnum.Merchant ? /* @__PURE__ */ import_react.default.createElement(
115
119
  import_antd.Button,
116
120
  {
117
121
  block: true,
@@ -119,6 +123,14 @@ var failCustom_default = ({ className = "", isIpad, onChange }) => {
119
123
  onClick: onManually
120
124
  },
121
125
  import_utils.locales.getText("page.eftpos-pay.text.manual.marking")
126
+ ) : /* @__PURE__ */ import_react.default.createElement(
127
+ import_antd.Button,
128
+ {
129
+ block: true,
130
+ className: "pisell-lowcode__eft-pay-step-item-btn",
131
+ onClick: onNotin
132
+ },
133
+ import_utils.locales.getText("page.eftpos-pay.text.manual.print_receipt")
122
134
  )) : /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
123
135
  import_antd.Button,
124
136
  {
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { ActionProps } from '../../const';
3
- declare const _default: ({ onChange, className, isIpad }: ActionProps) => React.JSX.Element;
3
+ declare const _default: ({ onChange, className, isMobile }: ActionProps) => React.JSX.Element;
4
4
  export default _default;
@@ -37,10 +37,11 @@ var import_antd = require("antd");
37
37
  var import_ahooks = require("ahooks");
38
38
  var import_react = __toESM(require("react"));
39
39
  var import_XClose = __toESM(require("@pisell/icon/es/XClose"));
40
+ var import_const = require("../../const");
40
41
  var import_manufacturer = require("../../manufacturer");
41
42
  var import_store = require("../../store");
42
43
  var import_header = __toESM(require("../header"));
43
- var fail_default = ({ onChange, className = "", isIpad }) => {
44
+ var fail_default = ({ onChange, className = "", isMobile }) => {
44
45
  var _a, _b;
45
46
  const {
46
47
  eftpos,
@@ -52,7 +53,8 @@ var fail_default = ({ onChange, className = "", isIpad }) => {
52
53
  amount,
53
54
  order_id,
54
55
  number,
55
- device
56
+ device,
57
+ client
56
58
  } = (0, import_store.useContextData)();
57
59
  const isPosNetworkError = ((_b = (_a = steps[step]) == null ? void 0 : _a.custom) == null ? void 0 : _b.isPosNetworkError) || false;
58
60
  const dispatch = (0, import_store.useDispatch)();
@@ -101,6 +103,9 @@ var fail_default = ({ onChange, className = "", isIpad }) => {
101
103
  );
102
104
  dispatch((0, import_store.updateComponent)("Manual"));
103
105
  };
106
+ const onNotin = () => {
107
+ onChange("print", [], "print_on_timeout");
108
+ };
104
109
  const onClose = () => {
105
110
  onChange("fail", { number, device, order_id });
106
111
  };
@@ -109,14 +114,14 @@ var fail_default = ({ onChange, className = "", isIpad }) => {
109
114
  onChange("page", "fail");
110
115
  }
111
116
  });
112
- return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-box ${className}` }, /* @__PURE__ */ import_react.default.createElement(import_header.default, { status: steps[step].status }, steps[step].status === "fail" && !isIpad ? /* @__PURE__ */ import_react.default.createElement(
117
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-box ${className}` }, /* @__PURE__ */ import_react.default.createElement(import_header.default, { status: steps[step].status }, steps[step].status === "fail" && !isMobile ? /* @__PURE__ */ import_react.default.createElement(
113
118
  import_XClose.default,
114
119
  {
115
120
  size: 20,
116
121
  style: { fontSize: "24px", position: "absolute", top: 0, right: 0 },
117
122
  onClick: onClose
118
123
  }
119
- ) : null), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-title" }, steps[step].title || import_utils.locales.getText("page.eftpos-pay.text.failed")(mode)), steps[step].status === "fail" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-text pisell-lowcode__eft-pay-body" }, steps[step].fail) : steps[step].status === "warn" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-warn-text pisell-lowcode__eft-pay-body" }, steps[step].warn) : null, isPosNetworkError ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
124
+ ) : null), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-title" }, steps[step].title || import_utils.locales.getText("page.eftpos-pay.text.failed")(mode)), steps[step].status === "fail" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-text pisell-lowcode__eft-pay-body" }, steps[step].fail) : steps[step].status === "warn" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-warn-text pisell-lowcode__eft-pay-body" }, steps[step].warn) : null, isPosNetworkError ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, client === import_const.ClientEnum.Merchant ? /* @__PURE__ */ import_react.default.createElement(
120
125
  import_antd.Button,
121
126
  {
122
127
  block: true,
@@ -124,6 +129,14 @@ var fail_default = ({ onChange, className = "", isIpad }) => {
124
129
  onClick: onManually
125
130
  },
126
131
  import_utils.locales.getText("page.eftpos-pay.text.manual.marking")
132
+ ) : /* @__PURE__ */ import_react.default.createElement(
133
+ import_antd.Button,
134
+ {
135
+ block: true,
136
+ className: "pisell-lowcode__eft-pay-step-item-btn",
137
+ onClick: onNotin
138
+ },
139
+ import_utils.locales.getText("page.eftpos-pay.text.manual.print_receipt")
127
140
  )) : /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
128
141
  import_antd.Button,
129
142
  {
@@ -6,5 +6,5 @@ import { ActionProps } from '../../const';
6
6
  * @Author: hongbing.wang
7
7
  * @Date: 2024-08-20 11:42
8
8
  */
9
- declare const _default: ({ className }: ActionProps) => React.JSX.Element;
9
+ declare const _default: ({ onChange, className }: ActionProps) => React.JSX.Element;
10
10
  export default _default;
@@ -35,10 +35,11 @@ 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_const = require("../../const");
38
39
  var import_store = require("../../store");
39
40
  var import_header = __toESM(require("../header"));
40
- var unknow_default = ({ className = "" }) => {
41
- const { form, mode } = (0, import_store.useContextData)();
41
+ var unknow_default = ({ onChange, className = "" }) => {
42
+ const { form, mode, client } = (0, import_store.useContextData)();
42
43
  const dispatch = (0, import_store.useDispatch)();
43
44
  const onManually = () => {
44
45
  dispatch(
@@ -55,12 +56,15 @@ var unknow_default = ({ className = "" }) => {
55
56
  );
56
57
  dispatch((0, import_store.updateComponent)("Manual"));
57
58
  };
59
+ const onNotin = () => {
60
+ onChange("print", [], "print_on_timeout");
61
+ };
58
62
  (0, import_react.useEffect)(() => {
59
63
  if (form === "Network" || form === "restore") {
60
64
  dispatch((0, import_store.updateComponent)(""));
61
65
  }
62
66
  }, [form]);
63
- return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-box ${className}` }, /* @__PURE__ */ import_react.default.createElement(import_header.default, { status: "warn" }), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-title" }, import_utils.locales.getText("page.eftpos-pay.text.unknown.title")(mode)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-warn-text pisell-lowcode__eft-pay-body" }, import_utils.locales.getText("page.eftpos-pay.text.unknown.text")(mode)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
67
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-box ${className}` }, /* @__PURE__ */ import_react.default.createElement(import_header.default, { status: "warn" }), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-title" }, import_utils.locales.getText("page.eftpos-pay.text.unknown.title")(mode)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-warn-text pisell-lowcode__eft-pay-body" }, client === import_const.ClientEnum.Merchant ? import_utils.locales.getText("page.eftpos-pay.text.unknown.text")(mode) : import_utils.locales.getText("page.eftpos-pay.text.transaction.eftpos.fail.other")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, client === import_const.ClientEnum.Merchant ? /* @__PURE__ */ import_react.default.createElement(
64
68
  import_antd.Button,
65
69
  {
66
70
  block: true,
@@ -68,5 +72,13 @@ var unknow_default = ({ className = "" }) => {
68
72
  onClick: onManually
69
73
  },
70
74
  import_utils.locales.getText("page.eftpos-pay.text.manual.marking")
75
+ ) : /* @__PURE__ */ import_react.default.createElement(
76
+ import_antd.Button,
77
+ {
78
+ block: true,
79
+ className: "pisell-lowcode__eft-pay-step-item-btn",
80
+ onClick: onNotin
81
+ },
82
+ import_utils.locales.getText("page.eftpos-pay.text.manual.print_receipt")
71
83
  )));
72
84
  };
@@ -27,6 +27,12 @@ export declare enum ModeEnum {
27
27
  /** 查询 */
28
28
  Query = "query"
29
29
  }
30
+ export declare enum ClientEnum {
31
+ /** 用户端 */
32
+ User = "user",
33
+ /** 商家端 */
34
+ Merchant = "merchant"
35
+ }
30
36
  export declare enum RouteEnum {
31
37
  /** 改价页 */
32
38
  Amount = "amount",
@@ -56,7 +62,7 @@ export interface PosProps {
56
62
  /** 回调 */
57
63
  onChangeStatus: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
58
64
  [keys: string]: unknown;
59
- } | string) => void;
65
+ } | string, other?: any) => void;
60
66
  onChangeParams(...agrn: unknown[]): void;
61
67
  terminal: {
62
68
  network: boolean;
@@ -144,6 +150,6 @@ export interface ActionProps {
144
150
  [key: string]: (...agrn: unknown[]) => Promise<unknown>;
145
151
  };
146
152
  className?: string;
147
- isIpad?: boolean;
153
+ isMobile?: boolean;
148
154
  formatAmount: (amount: number | string, precision: number, symbol: string) => string;
149
155
  }
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/components/eftposPay/const.ts
20
20
  var const_exports = {};
21
21
  __export(const_exports, {
22
+ ClientEnum: () => ClientEnum,
22
23
  EftposEnum: () => EftposEnum,
23
24
  ModeEnum: () => ModeEnum,
24
25
  PayRouteEnum: () => PayRouteEnum,
@@ -52,6 +53,11 @@ var ModeEnum = /* @__PURE__ */ ((ModeEnum2) => {
52
53
  ModeEnum2["Query"] = "query";
53
54
  return ModeEnum2;
54
55
  })(ModeEnum || {});
56
+ var ClientEnum = /* @__PURE__ */ ((ClientEnum2) => {
57
+ ClientEnum2["User"] = "user";
58
+ ClientEnum2["Merchant"] = "merchant";
59
+ return ClientEnum2;
60
+ })(ClientEnum || {});
55
61
  var RouteEnum = /* @__PURE__ */ ((RouteEnum2) => {
56
62
  RouteEnum2["Amount"] = "amount";
57
63
  RouteEnum2["DeviceList"] = "deviceList";
@@ -80,6 +86,7 @@ var PayStatus = /* @__PURE__ */ ((PayStatus2) => {
80
86
  })(PayStatus || {});
81
87
  // Annotate the CommonJS export names for ESM import in node:
82
88
  0 && (module.exports = {
89
+ ClientEnum,
83
90
  EftposEnum,
84
91
  ModeEnum,
85
92
  PayRouteEnum,
@@ -8,16 +8,17 @@ import './device.less';
8
8
  * @Author: hongbing.wang
9
9
  * @Date: 2024-08-12 11:40
10
10
  */
11
- declare const _default: ({ api, onChange, onClose, className, device_number, isIpad, net, formatAmount, }: {
11
+ declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
14
  onChange?: ((status: "page" | "success" | "fail", params?: string | {
15
15
  [keys: string]: unknown;
16
- } | undefined) => void) | undefined;
16
+ } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
18
18
  device_number?: string | number | undefined;
19
- isIpad: boolean;
19
+ isMobile: boolean;
20
20
  net: boolean;
21
+ client: string;
21
22
  formatAmount(amount: number | string, precision: number, symbol: string): string;
22
23
  }) => React.JSX.Element;
23
24
  export default _default;
@@ -49,8 +49,9 @@ var device_default = ({
49
49
  onClose,
50
50
  className = "",
51
51
  device_number,
52
- isIpad,
52
+ isMobile,
53
53
  net,
54
+ client,
54
55
  formatAmount = (number, precision, symbol) => `${symbol}${number}`
55
56
  }) => {
56
57
  const store = (0, import_store.useContextData)();
@@ -145,11 +146,11 @@ var device_default = ({
145
146
  return { ...item, pay };
146
147
  });
147
148
  };
148
- return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-device-box ${className}` }, isIpad ? null : /* @__PURE__ */ import_react.default.createElement(import_titlebar.default, { type: "left-title-close", onClose }, dataStaus ? import_utils.locales.getText("page.eftpos-pay.text.device") : ""), dataStaus ? /* @__PURE__ */ import_react.default.createElement(
149
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-device-box ${className}` }, isMobile ? null : /* @__PURE__ */ import_react.default.createElement(import_titlebar.default, { type: "left-title-close", onClose }, dataStaus ? import_utils.locales.getText("page.eftpos-pay.text.device") : ""), dataStaus ? /* @__PURE__ */ import_react.default.createElement(
149
150
  "div",
150
151
  {
151
152
  className: "pisell-lowcode__eft-pay-device-list",
152
- style: isIpad ? { marginTop: "20px" } : {}
153
+ style: isMobile ? { marginTop: "20px" } : {}
153
154
  },
154
155
  /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { spinning: loading, style: { flex: 1, overflow: "auto" } }, /* @__PURE__ */ import_react.default.createElement(
155
156
  "div",
@@ -183,7 +184,7 @@ var device_default = ({
183
184
  "div",
184
185
  {
185
186
  className: "pisell-lowcode__eft-pay-device-error",
186
- style: isIpad ? { marginTop: "20px" } : {}
187
+ style: isMobile ? { marginTop: "20px" } : {}
187
188
  },
188
189
  /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-error-tit" }, import_utils.locales.getText("page.eftpos-pay.text.device.no.title")),
189
190
  /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-error-txt" }, import_utils.locales.getText("page.eftpos-pay.text.device.no.add")),
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PayStatus } from './const';
3
- import { ModeEnum } from './const';
3
+ import { ModeEnum, ClientEnum } from './const';
4
4
  export declare const useStoreRef: <T extends {
5
5
  [key: string]: unknown;
6
6
  } = {
@@ -20,6 +20,7 @@ export declare const useStoreRef: <T extends {
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
22
  readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "payo" | "stripe">;
23
+ readonly clientRef: React.MutableRefObject<ClientEnum>;
23
24
  };
24
25
  /**
25
26
  * @title: 通用失败处理
@@ -28,6 +29,6 @@ export declare const useStoreRef: <T extends {
28
29
  * @Author: hongbing.wang
29
30
  * @Date: 2024-08-12 11:54
30
31
  */
31
- export declare const useFail: (index: number, isMark?: boolean) => (res: {
32
+ export declare const useFail: (index: number) => (res: {
32
33
  code?: "200" | "4004" | "701000" | "701001" | "701003" | "701004" | "701005" | "701006" | "701007" | "701008" | "701009" | "701010" | undefined;
33
- }) => void;
34
+ }, isMark?: boolean) => void;
@@ -27,6 +27,7 @@ var import_utils = require("@pisell/utils");
27
27
  var import_react = require("react");
28
28
  var import_const = require("./const");
29
29
  var import_store = require("./store");
30
+ var import_const2 = require("./const");
30
31
  var Max4004 = 1;
31
32
  var useStoreRef = () => {
32
33
  const {
@@ -39,7 +40,8 @@ var useStoreRef = () => {
39
40
  status,
40
41
  symbol,
41
42
  amount,
42
- eftpos
43
+ eftpos,
44
+ client
43
45
  } = (0, import_store.useContextData)();
44
46
  const deviceRef = (0, import_react.useRef)(device);
45
47
  const payRef = (0, import_react.useRef)(pay);
@@ -51,6 +53,7 @@ var useStoreRef = () => {
51
53
  const symbolRef = (0, import_react.useRef)(symbol);
52
54
  const amountRef = (0, import_react.useRef)(amount);
53
55
  const eftposRef = (0, import_react.useRef)(eftpos);
56
+ const clientRef = (0, import_react.useRef)(client);
54
57
  (0, import_react.useEffect)(() => {
55
58
  deviceRef.current = device;
56
59
  }, [device]);
@@ -81,6 +84,9 @@ var useStoreRef = () => {
81
84
  (0, import_react.useEffect)(() => {
82
85
  eftposRef.current = eftpos;
83
86
  }, [eftpos]);
87
+ (0, import_react.useEffect)(() => {
88
+ clientRef.current = client;
89
+ }, [client]);
84
90
  return {
85
91
  deviceRef,
86
92
  payRef,
@@ -91,19 +97,20 @@ var useStoreRef = () => {
91
97
  netRef,
92
98
  symbolRef,
93
99
  amountRef,
94
- eftposRef
100
+ eftposRef,
101
+ clientRef
95
102
  };
96
103
  };
97
- var useFail = (index, isMark = false) => {
104
+ var useFail = (index) => {
98
105
  const { steps, custom } = (0, import_store.useContextData)();
99
- const { modeRef } = useStoreRef();
106
+ const { modeRef, clientRef } = useStoreRef();
100
107
  const dispatch = (0, import_store.useDispatch)();
101
108
  const ref = (0, import_react.useRef)((custom == null ? void 0 : custom.retry) || 0);
102
109
  (0, import_react.useEffect)(() => {
103
110
  ref.current = (custom == null ? void 0 : custom.retry) || 0;
104
111
  }, [custom == null ? void 0 : custom.retry]);
105
112
  return (0, import_react.useCallback)(
106
- (res) => {
113
+ (res, isMark = false) => {
107
114
  if (!res || !res.code) {
108
115
  dispatch(
109
116
  (0, import_store.updateCustom)({
@@ -153,6 +160,21 @@ var useFail = (index, isMark = false) => {
153
160
  }
154
161
  if (code === import_const.PayStatus.Timeout) {
155
162
  if (isMark) {
163
+ if (clientRef.current === import_const2.ClientEnum.User) {
164
+ steps[index].status = "fail";
165
+ steps[index].title = import_utils.locales.getText("page.eftpos-pay.text.timedout.title");
166
+ steps[index].fail = import_utils.locales.getText("page.eftpos-pay.text.transaction.eftpos.fail.other");
167
+ steps[index].custom = steps[index].custom ? { ...steps[index].custom, isPosNetworkError: true } : { isPosNetworkError: true };
168
+ dispatch((0, import_store.updateSteps)(steps));
169
+ dispatch((0, import_store.updateComponent)("Fail"));
170
+ dispatch(
171
+ (0, import_store.updateCustom)({
172
+ errorStatus: "know"
173
+ // unknow know
174
+ })
175
+ );
176
+ return;
177
+ }
156
178
  steps[index].status = "fail";
157
179
  dispatch((0, import_store.updateSteps)(steps));
158
180
  dispatch(
@@ -268,7 +290,7 @@ var useFail = (index, isMark = false) => {
268
290
  steps[index].title = import_utils.locales.getText(
269
291
  "page.eftpos-pay.text.interrupted"
270
292
  );
271
- steps[index].warn = `${import_utils.locales.getText(
293
+ steps[index].warn = clientRef.current === import_const2.ClientEnum.Merchant ? `${import_utils.locales.getText(
272
294
  "page.eftpos-pay.text.transaction.eftpos.fail.title"
273
295
  )}
274
296
  ${import_utils.locales.getText(
@@ -282,7 +304,7 @@ ${import_utils.locales.getText(
282
304
  )}
283
305
  ${import_utils.locales.getText(
284
306
  "page.eftpos-pay.text.transaction.eftpos.fail.if"
285
- )(modeRef.current)}`;
307
+ )(modeRef.current)}` : import_utils.locales.getText("page.eftpos-pay.text.transaction.eftpos.fail.other");
286
308
  steps[index].status = "warn";
287
309
  steps[index].custom = steps[index].custom ? { ...steps[index].custom, isPosNetworkError: true } : { isPosNetworkError: true };
288
310
  dispatch((0, import_store.updateSteps)(steps));
@@ -365,7 +387,7 @@ ${import_utils.locales.getText(
365
387
  );
366
388
  dispatch((0, import_store.updateComponent)("UnknowFail"));
367
389
  },
368
- [dispatch, index, steps, isMark]
390
+ [dispatch, index, steps]
369
391
  );
370
392
  };
371
393
  // Annotate the CommonJS export names for ESM import in node:
@@ -62,9 +62,14 @@ var App = ({
62
62
  const statusRef = (0, import_react.useRef)(data.status);
63
63
  const context = (0, import_useEngineContext.default)();
64
64
  console.log("context = ", context);
65
- const { formatAmount, isTerminal } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {
65
+ const {
66
+ formatAmount,
67
+ storage
68
+ } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {
66
69
  formatAmount: (number, precision, symbol) => `${symbol}${number}`,
67
- isTerminal: () => false
70
+ storage: () => ({
71
+ get: () => ""
72
+ })
68
73
  };
69
74
  const network = (0, import_react.useMemo)(
70
75
  () => typeof terminal.network === "boolean" ? terminal.network : true,
@@ -90,7 +95,27 @@ var App = ({
90
95
  (0, import_react.useEffect)(() => {
91
96
  statusRef.current = data.status;
92
97
  }, [data.status]);
93
- const isIpad = (0, import_react.useMemo)(() => isTerminal && isTerminal(), [isTerminal]);
98
+ const channel = (0, import_react.useMemo)(() => {
99
+ var _a2;
100
+ const channel2 = ((_a2 = storage == null ? void 0 : storage.get) == null ? void 0 : _a2.call(storage, "channel")) || "";
101
+ if (channel2 === "terminal") {
102
+ return "terminal";
103
+ }
104
+ if (channel2 === "android_kiosk") {
105
+ return "kiosk";
106
+ }
107
+ return "";
108
+ }, []);
109
+ const client = (0, import_react.useMemo)(() => {
110
+ if (channel === "kiosk") {
111
+ return import_const.ClientEnum.User;
112
+ }
113
+ return import_const.ClientEnum.Merchant;
114
+ }, [channel]);
115
+ (0, import_react.useEffect)(() => {
116
+ dispatch((0, import_store.updateClient)(client));
117
+ }, [client]);
118
+ const isMobile = (0, import_react.useMemo)(() => Boolean(channel), [channel]);
94
119
  const api = (0, import_react.useMemo)(() => {
95
120
  if (typeof getApi === "function") {
96
121
  return getApi();
@@ -104,15 +129,15 @@ var App = ({
104
129
  form: "restore"
105
130
  });
106
131
  }, [data, onChangeParams]);
107
- const onChange = (0, import_react.useCallback)((status, params) => {
132
+ const onChange = (0, import_react.useCallback)((status, params, other) => {
108
133
  if (status === "page" && typeof params === "string") {
109
134
  if (["amount", "deviceList", "pay"].includes(params)) {
110
135
  setCurrent(params);
111
136
  dispatch((0, import_store.updateState)({ action: params }));
112
137
  }
113
138
  }
114
- console.log("状态切换 = ", status, params);
115
- props.onChangeStatus(status, params);
139
+ console.log("状态切换 = ", status, params, other);
140
+ props.onChangeStatus(status, params, other);
116
141
  }, []);
117
142
  const onClose = () => {
118
143
  onChange("fail", {
@@ -128,11 +153,12 @@ var App = ({
128
153
  api,
129
154
  onChange,
130
155
  onClose,
131
- isIpad,
132
- className: isIpad ? "pisell-lowcode__eft-pay-terminal" : "",
156
+ isMobile,
157
+ className: isMobile ? "pisell-lowcode__eft-pay-terminal" : "",
133
158
  net,
134
159
  device_number,
135
- formatAmount
160
+ formatAmount,
161
+ client
136
162
  }
137
163
  );
138
164
  }
@@ -143,9 +169,10 @@ var App = ({
143
169
  onChange,
144
170
  onClose,
145
171
  formatAmount,
146
- isIpad,
147
- className: isIpad ? "pisell-lowcode__eft-pay-terminal" : "",
148
- net
172
+ isMobile,
173
+ className: isMobile ? "pisell-lowcode__eft-pay-terminal" : "",
174
+ net,
175
+ client
149
176
  }
150
177
  );
151
178
  }
@@ -156,11 +183,12 @@ var App = ({
156
183
  tyroUrl,
157
184
  tyroVersion,
158
185
  onChange,
159
- className: isIpad ? "pisell-lowcode__eft-pay-terminal" : "",
186
+ className: isMobile ? "pisell-lowcode__eft-pay-terminal" : "",
160
187
  terminal,
161
- isIpad,
188
+ isMobile,
162
189
  net,
163
- formatAmount
190
+ formatAmount,
191
+ client
164
192
  }
165
193
  );
166
194
  };
@@ -194,8 +222,8 @@ var eftposPay_default = (props) => {
194
222
  );
195
223
  }, [mode, props.params, props.type, symbol]);
196
224
  const onChangeStatus = (0, import_react.useCallback)(
197
- (status, params) => {
198
- props.onChangeStatus(status, params);
225
+ (status, params, other) => {
226
+ props.onChangeStatus(status, params, other);
199
227
  },
200
228
  []
201
229
  );
@@ -228,7 +256,7 @@ var eftposPay_default = (props) => {
228
256
  return act;
229
257
  }, [mode, state]);
230
258
  (0, import_react.useEffect)(() => {
231
- console.log("初始化 ........");
259
+ console.log("初始化 ........11221801");
232
260
  }, []);
233
261
  console.log("props?.params?.device_number = ", (_e = props == null ? void 0 : props.params) == null ? void 0 : _e.device_number);
234
262
  return /* @__PURE__ */ import_react.default.createElement(import_store.Provider, { state }, /* @__PURE__ */ import_react.default.createElement(
@@ -256,6 +256,7 @@
256
256
  .pisell-lowcode__eft-pay-terminal {
257
257
  width: var(--pisel-lc-pos-terminal-width, 100%) !important;
258
258
  height: var(--pisel-lc-pos-terminal-height, 100%) !important;
259
+ max-height: var(--pisel-lc-pos-terminal-max-height, unset) !important;
259
260
  display: flex;
260
261
  flex-direction: column;
261
262
  }
@@ -37,6 +37,7 @@ declare const _default: {
37
37
  'page.eftpos-pay.text.manual.diff': string;
38
38
  'page.eftpos-pay.text.manual.tip': string;
39
39
  'page.eftpos-pay.text.manual.cancel': string;
40
+ 'page.eftpos-pay.text.manual.print_receipt': string;
40
41
  'page.eftpos-pay.text.modify.payment.info': (mode: string) => "Modify payment info" | "Modify refund information";
41
42
  'page.eftpos-pay.text.successful': (mode: string) => string;
42
43
  'page.eftpos-pay.text.failed': (mode: string) => string;
@@ -85,6 +86,7 @@ declare const _default: {
85
86
  'page.eftpos-pay.text.transaction.eftpos.fail.device': string;
86
87
  'page.eftpos-pay.text.transaction.eftpos.fail.network': string;
87
88
  'page.eftpos-pay.text.transaction.eftpos.fail.if': (mode: string) => "If you have confirmed the payment status of this order, please click on Manual marking." | "If you have confirmed the refund status of this order, please click on Manual Marking.";
89
+ 'page.eftpos-pay.text.transaction.eftpos.fail.other': string;
88
90
  'page.eftpos-pay.text.application': string;
89
91
  'page.eftpos-pay.text.approved': string;
90
92
  'page.eftpos-pay.text.device.no.title': string;
@@ -139,6 +141,7 @@ declare const _default: {
139
141
  'page.eftpos-pay.text.manual.diff': string;
140
142
  'page.eftpos-pay.text.manual.tip': string;
141
143
  'page.eftpos-pay.text.manual.cancel': string;
144
+ 'page.eftpos-pay.text.manual.print_receipt': string;
142
145
  'page.eftpos-pay.text.modify.payment.info': (mode: string) => "修改支付信息" | "修改退款信息";
143
146
  'page.eftpos-pay.text.successful': (mode: string) => string;
144
147
  'page.eftpos-pay.text.failed': (mode: string) => string;
@@ -187,6 +190,7 @@ declare const _default: {
187
190
  'page.eftpos-pay.text.transaction.eftpos.fail.device': string;
188
191
  'page.eftpos-pay.text.transaction.eftpos.fail.network': string;
189
192
  'page.eftpos-pay.text.transaction.eftpos.fail.if': (mode: string) => "如果您已确认此交易的付款状态,请点击手动标记" | "如果您已确认此订单的退款状态,请点击手动标记。";
193
+ 'page.eftpos-pay.text.transaction.eftpos.fail.other': string;
190
194
  'page.eftpos-pay.text.application': string;
191
195
  'page.eftpos-pay.text.approved': string;
192
196
  'page.eftpos-pay.text.device.no.title': string;
@@ -241,6 +245,7 @@ declare const _default: {
241
245
  'page.eftpos-pay.text.manual.diff': string;
242
246
  'page.eftpos-pay.text.manual.tip': string;
243
247
  'page.eftpos-pay.text.manual.cancel': string;
248
+ 'page.eftpos-pay.text.manual.print_receipt': string;
244
249
  'page.eftpos-pay.text.modify.payment.info': (mode: string) => "修改支付信息" | "修改退款信息";
245
250
  'page.eftpos-pay.text.successful': (mode: string) => string;
246
251
  'page.eftpos-pay.text.failed': (mode: string) => string;
@@ -289,6 +294,7 @@ declare const _default: {
289
294
  'page.eftpos-pay.text.transaction.eftpos.fail.device': string;
290
295
  'page.eftpos-pay.text.transaction.eftpos.fail.network': string;
291
296
  'page.eftpos-pay.text.transaction.eftpos.fail.if': (mode: string) => "如果您已確認此交易的付款狀態,請點擊手動標記" | "如果您已確認此訂單的退款狀態,請點擊手動標記。";
297
+ 'page.eftpos-pay.text.transaction.eftpos.fail.other': string;
292
298
  'page.eftpos-pay.text.application': string;
293
299
  'page.eftpos-pay.text.approved': string;
294
300
  'page.eftpos-pay.text.device.no.title': string;