@pisell/private-materials 6.4.50 → 6.4.52

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 (115) 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 +2 -2
  6. package/build/lowcode/preview.js +145 -153
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +3 -3
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/components/appointmentBooking/components/Services/index.js +36 -18
  12. package/es/components/appointmentBooking/hooks.js +6 -0
  13. package/es/components/booking/components/footer/index.js +12 -1
  14. package/es/components/booking/editBookingModal/index.js +8 -2
  15. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  16. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  17. package/es/components/booking/locales.d.ts +6 -0
  18. package/es/components/booking/locales.js +12 -0
  19. package/es/components/checkout/PaymentModal.js +70 -62
  20. package/es/components/checkout/components/AmountSummary/index.js +4 -4
  21. package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
  22. package/es/components/checkout/components/CashPaymentModule/index.js +14 -10
  23. package/es/components/eftposPay/linkly/hooks/normal.js +3 -3
  24. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +60 -17
  25. package/es/components/eftposPay/payo/config.js +10 -10
  26. package/es/components/eftposPay/serve.js +1 -1
  27. package/es/components/index.d.ts +3 -1
  28. package/es/components/index.js +3 -1
  29. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
  30. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  31. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
  32. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  33. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
  34. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  35. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
  36. package/es/components/pay/toC/utils.js +1 -1
  37. package/es/components/pinModal/hooks.d.ts +7 -0
  38. package/es/components/pinModal/hooks.js +65 -0
  39. package/es/components/pinModal/index.d.ts +4 -0
  40. package/es/components/pinModal/index.js +98 -0
  41. package/es/components/pinModal/index.less +44 -0
  42. package/es/components/pinModal/locales.d.ts +27 -0
  43. package/es/components/pinModal/locales.js +26 -0
  44. package/es/components/pinModal/serve.d.ts +6 -0
  45. package/es/components/pinModal/serve.js +11 -0
  46. package/es/components/pinModal/types.d.ts +0 -0
  47. package/es/components/pinModal/types.js +0 -0
  48. package/es/components/pinVerifyModal/hooks.d.ts +7 -0
  49. package/es/components/pinVerifyModal/hooks.js +80 -0
  50. package/es/components/pinVerifyModal/index.d.ts +5 -0
  51. package/es/components/pinVerifyModal/index.js +218 -0
  52. package/es/components/pinVerifyModal/index.less +92 -0
  53. package/es/components/pinVerifyModal/locales.d.ts +24 -0
  54. package/es/components/pinVerifyModal/locales.js +23 -0
  55. package/es/components/pinVerifyModal/types.d.ts +33 -0
  56. package/es/components/pinVerifyModal/types.js +1 -0
  57. package/es/components/ticketBooking/components/ticketBooking/index.js +56 -10
  58. package/es/components/ticketBooking/components/timeBar/index.js +2 -1
  59. package/es/components/walletList/index.js +20 -2
  60. package/es/index.d.ts +2 -0
  61. package/es/index.js +3 -1
  62. package/lib/components/appointmentBooking/components/Services/index.js +13 -3
  63. package/lib/components/appointmentBooking/hooks.js +6 -0
  64. package/lib/components/booking/components/footer/index.js +15 -2
  65. package/lib/components/booking/editBookingModal/index.js +6 -1
  66. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  67. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  68. package/lib/components/booking/locales.d.ts +6 -0
  69. package/lib/components/booking/locales.js +6 -0
  70. package/lib/components/checkout/PaymentModal.js +5 -4
  71. package/lib/components/checkout/components/AmountSummary/index.js +4 -4
  72. package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
  73. package/lib/components/checkout/components/CashPaymentModule/index.js +6 -3
  74. package/lib/components/eftposPay/linkly/hooks/normal.js +3 -3
  75. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +59 -15
  76. package/lib/components/eftposPay/payo/config.js +9 -9
  77. package/lib/components/eftposPay/serve.js +1 -1
  78. package/lib/components/index.d.ts +3 -1
  79. package/lib/components/index.js +6 -0
  80. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
  81. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  82. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
  83. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  84. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
  85. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  86. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
  87. package/lib/components/pay/toC/utils.js +1 -1
  88. package/lib/components/pinModal/hooks.d.ts +7 -0
  89. package/lib/components/pinModal/hooks.js +85 -0
  90. package/lib/components/pinModal/index.d.ts +4 -0
  91. package/lib/components/pinModal/index.js +88 -0
  92. package/lib/components/pinModal/index.less +44 -0
  93. package/lib/components/pinModal/locales.d.ts +27 -0
  94. package/lib/components/pinModal/locales.js +50 -0
  95. package/lib/components/pinModal/serve.d.ts +6 -0
  96. package/lib/components/pinModal/serve.js +37 -0
  97. package/lib/components/pinModal/types.d.ts +0 -0
  98. package/lib/components/pinModal/types.js +0 -0
  99. package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
  100. package/lib/components/pinVerifyModal/hooks.js +93 -0
  101. package/lib/components/pinVerifyModal/index.d.ts +5 -0
  102. package/lib/components/pinVerifyModal/index.js +230 -0
  103. package/lib/components/pinVerifyModal/index.less +92 -0
  104. package/lib/components/pinVerifyModal/locales.d.ts +24 -0
  105. package/lib/components/pinVerifyModal/locales.js +47 -0
  106. package/lib/components/pinVerifyModal/types.d.ts +33 -0
  107. package/lib/components/pinVerifyModal/types.js +17 -0
  108. package/lib/components/ticketBooking/components/ticketBooking/index.js +52 -5
  109. package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
  110. package/lib/components/walletList/index.js +19 -2
  111. package/lib/index.d.ts +2 -0
  112. package/lib/index.js +6 -0
  113. package/lowcode/pin-modal/meta.ts +37 -0
  114. package/lowcode/pin-verify-modal/meta.ts +80 -0
  115. package/package.json +4 -4
@@ -0,0 +1,230 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/pinVerifyModal/index.tsx
30
+ var pinVerifyModal_exports = {};
31
+ __export(pinVerifyModal_exports, {
32
+ default: () => pinVerifyModal_default
33
+ });
34
+ module.exports = __toCommonJS(pinVerifyModal_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_Delete = __toESM(require("@pisell/icon/es/Delete"));
37
+ var import_materials = require("@pisell/materials");
38
+ var import_utils = require("@pisell/utils");
39
+ var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
40
+ var import_locales = __toESM(require("./locales"));
41
+ var import_utils2 = require("../../utils");
42
+ var import_index = require("./index.less");
43
+ var import_hooks = require("./hooks");
44
+ var PinVerifyModal = (props, ref) => {
45
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
46
+ const context = (0, import_useEngineContext.default)();
47
+ import_utils.locales.init(import_locales.default, ((_b = (_a = context == null ? void 0 : context.engine) == null ? void 0 : _a.props) == null ? void 0 : _b.locale) || "en");
48
+ import_utils2.request.setRequest((_d = (_c = context == null ? void 0 : context.appHelper) == null ? void 0 : _c.utils) == null ? void 0 : _d.request);
49
+ const isTerminal = (_g = (_f = (_e = context == null ? void 0 : context.appHelper) == null ? void 0 : _e.utils) == null ? void 0 : _f.isTerminal) == null ? void 0 : _g.call(_f);
50
+ const platform = (_i = (_h = context == null ? void 0 : context.appHelper) == null ? void 0 : _h.constants) == null ? void 0 : _i.platform;
51
+ const [visible, setVisible] = (0, import_react.useState)(false);
52
+ const modalParamsRef = (0, import_react.useRef)({});
53
+ const [pin, setPin] = (0, import_react.useState)("");
54
+ const { verifyPin, loading, verifyInfo, setVerifyInfo } = (0, import_hooks.usePinVerify)();
55
+ const KeyboardItems = (0, import_react.useMemo)(() => {
56
+ return [
57
+ {
58
+ value: 1,
59
+ label: "1",
60
+ disabled: false,
61
+ type: "text"
62
+ },
63
+ {
64
+ value: 2,
65
+ label: "2",
66
+ disabled: false,
67
+ type: "text"
68
+ },
69
+ {
70
+ value: 3,
71
+ label: "3",
72
+ disabled: false,
73
+ type: "text"
74
+ },
75
+ {
76
+ value: 4,
77
+ label: "4",
78
+ disabled: false,
79
+ type: "text"
80
+ },
81
+ {
82
+ value: 5,
83
+ label: "5",
84
+ disabled: false,
85
+ type: "text"
86
+ },
87
+ {
88
+ value: 6,
89
+ label: "6",
90
+ disabled: false,
91
+ type: "text"
92
+ },
93
+ {
94
+ value: 7,
95
+ label: "7",
96
+ disabled: false,
97
+ type: "text"
98
+ },
99
+ {
100
+ value: 8,
101
+ label: "8",
102
+ disabled: false,
103
+ type: "text"
104
+ },
105
+ {
106
+ value: 9,
107
+ label: "9",
108
+ disabled: false,
109
+ type: "text"
110
+ },
111
+ {
112
+ value: "delete",
113
+ label: /* @__PURE__ */ import_react.default.createElement(import_Delete.default, { className: "virtual-keyboard-input-delete-icon" }),
114
+ disabled: false,
115
+ type: "text"
116
+ },
117
+ {
118
+ value: 0,
119
+ label: "0",
120
+ disabled: false,
121
+ type: "text"
122
+ },
123
+ {
124
+ value: "verify",
125
+ label: import_utils.locales.getText("pisell2.pin.verify.modal.keyboard.verify"),
126
+ disabled: false,
127
+ type: "primary"
128
+ }
129
+ ];
130
+ }, [import_utils.locales]);
131
+ const onOpen = (params) => {
132
+ var _a2;
133
+ modalParamsRef.current = params;
134
+ setVerifyInfo({
135
+ failed_count: (params == null ? void 0 : params.failed_count) || 0,
136
+ check_max_count: (params == null ? void 0 : params.check_max_count) || 0
137
+ });
138
+ setVisible(true);
139
+ (_a2 = props.onOpen) == null ? void 0 : _a2.call(props);
140
+ };
141
+ const onClose = () => {
142
+ var _a2;
143
+ modalParamsRef.current = {};
144
+ setPin("");
145
+ setVerifyInfo(null);
146
+ setVisible(false);
147
+ (_a2 = props.onClose) == null ? void 0 : _a2.call(props);
148
+ };
149
+ (0, import_react.useImperativeHandle)(ref, () => ({
150
+ open: onOpen,
151
+ close: onClose
152
+ }));
153
+ const handleChange = (e) => {
154
+ if (e === "delete") {
155
+ setPin(pin.slice(0, -1));
156
+ return;
157
+ } else if (e === "verify") {
158
+ handleVerify();
159
+ return;
160
+ } else {
161
+ if (pin.length < 4) {
162
+ setPin(pin + e);
163
+ }
164
+ }
165
+ };
166
+ const handleVerify = () => {
167
+ var _a2;
168
+ if (loading) {
169
+ return;
170
+ }
171
+ if (pin.length === 4) {
172
+ const wallet_detail_id = (_a2 = modalParamsRef.current) == null ? void 0 : _a2.wallet_detail_id;
173
+ verifyPin({ wallet_detail_id, pin }, (params) => {
174
+ var _a3;
175
+ (_a3 = props.onSuccess) == null ? void 0 : _a3.call(props, params);
176
+ onClose();
177
+ });
178
+ } else {
179
+ (0, import_materials.PisellToast)({
180
+ content: import_utils.locales.getText("pisell2.pin.verify.modal.keyboard.title"),
181
+ duration: 2
182
+ });
183
+ }
184
+ };
185
+ return /* @__PURE__ */ import_react.default.createElement(
186
+ import_materials.PisellModal,
187
+ {
188
+ platform: isTerminal ? "h5" : void 0,
189
+ visible,
190
+ title: import_utils.locales.getText("pisell2.pin.verify.modal.title"),
191
+ headerDivider: false,
192
+ footer: null,
193
+ onClose,
194
+ maskClosable: false,
195
+ onCancel: onClose,
196
+ destroyOnClose: true,
197
+ mobileModalHeight: isTerminal ? void 0 : "auto"
198
+ },
199
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pin-verify-modal-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pin-verify-modal-content-user" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pin-verify-modal-content-user-avatar" }, /* @__PURE__ */ import_react.default.createElement(
200
+ "img",
201
+ {
202
+ src: ((_j = modalParamsRef.current.customer) == null ? void 0 : _j.cover) || "https://file.mypisell.com/static/default_product.png",
203
+ alt: "avatar",
204
+ className: "pin-verify-modal-content-user-avatar-img"
205
+ }
206
+ )), /* @__PURE__ */ import_react.default.createElement("div", { className: "pin-verify-modal-content-user-right" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pin-verify-modal-content-user-right-name" }, ((_k = modalParamsRef.current.customer) == null ? void 0 : _k.display_name) || ((_l = modalParamsRef.current.customer) == null ? void 0 : _l.nickname)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pin-verify-modal-content-user-right-wallet" }, import_utils.locales.getText("pisell2.pin.verify.modal.wallet"), modalParamsRef.current.wallet_code))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pin-verify-modal-content-keyboard" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pin-verify-modal-content-keyboard-title" }, import_utils.locales.getText("pisell2.pin.verify.modal.keyboard.title")), /* @__PURE__ */ import_react.default.createElement(
207
+ import_materials.VirtualKeyboard,
208
+ {
209
+ style: { width: "300px" },
210
+ keyboardProps: {
211
+ keydown: false,
212
+ items: KeyboardItems,
213
+ onChange: handleChange
214
+ },
215
+ virtualKeyInputProps: {
216
+ value: pin,
217
+ onChange: (e) => {
218
+ setPin(e.target.value);
219
+ },
220
+ placeholder: "0000",
221
+ style: {
222
+ height: "45px",
223
+ fontSize: "36px"
224
+ }
225
+ }
226
+ }
227
+ ), (verifyInfo == null ? void 0 : verifyInfo.check_max_count) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pin-verify-modal-content-keyboard-desc" }, import_utils.locales.getText("pisell2.pin.verify.modal.keyboard.desc"), verifyInfo == null ? void 0 : verifyInfo.remaining_count, "/", verifyInfo == null ? void 0 : verifyInfo.check_max_count) : null))
228
+ );
229
+ };
230
+ var pinVerifyModal_default = (0, import_react.forwardRef)(PinVerifyModal);
@@ -0,0 +1,92 @@
1
+ .pin-verify-modal-content {
2
+ width: 100%;
3
+ height: 100%;
4
+ padding-bottom: 16px;
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ gap: 16px;
9
+
10
+ &-user {
11
+ min-width: 300px;
12
+ min-height: 60px;
13
+ padding: 8px;
14
+ display: flex;
15
+ align-items: center;
16
+ gap: 8px;
17
+ border-radius: 8px;
18
+ border: 1px solid #d0d5dd;
19
+
20
+ &-avatar {
21
+ width: 42px;
22
+ height: 42px;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ border-radius: 50%;
27
+ overflow: hidden;
28
+
29
+ &-img {
30
+ width: 100%;
31
+ }
32
+ }
33
+
34
+ &-right {
35
+ display: flex;
36
+ flex-direction: column;
37
+ gap: 4px;
38
+
39
+ &-name {
40
+ font-size: 16px;
41
+ font-weight: 600;
42
+ color: #101828;
43
+ }
44
+
45
+ &-wallet {
46
+ color: #667085;
47
+ font-size: 14px;
48
+ font-weight: 400;
49
+ }
50
+ }
51
+ }
52
+
53
+ &-keyboard {
54
+ display: flex;
55
+ flex-direction: column;
56
+ align-items: center;
57
+ gap: 8px;
58
+
59
+ &-title {
60
+ text-align: center;
61
+ color: #101828;
62
+ font-size: 16px;
63
+ font-weight: 500;
64
+ }
65
+
66
+ &-desc {
67
+ color: #667085;
68
+ font-size: 16px;
69
+ font-weight: 400;
70
+ }
71
+ }
72
+
73
+ .virtual-keyboard-input-wrap {
74
+ height: 45px !important;
75
+ }
76
+
77
+ .virtual-keyboard-wrap .virtual-keyboard-content .virtual-keyboard-item {
78
+ padding-top: 50px !important;
79
+ }
80
+
81
+ .virtual-keyboard-wrap
82
+ .virtual-keyboard-content
83
+ .virtual-keyboard-item
84
+ .virtual-keyboard-item-button {
85
+ padding: 0 !important;
86
+ }
87
+
88
+ .virtual-keyboard-input-delete {
89
+ font-size: 30px;
90
+ color: #000;
91
+ }
92
+ }
@@ -0,0 +1,24 @@
1
+ declare const _default: {
2
+ en: {
3
+ 'pisell2.pin.verify.modal.title': string;
4
+ 'pisell2.pin.verify.modal.wallet': string;
5
+ 'pisell2.pin.verify.modal.keyboard.title': string;
6
+ 'pisell2.pin.verify.modal.keyboard.desc': string;
7
+ 'pisell2.pin.verify.modal.keyboard.verify': string;
8
+ };
9
+ 'zh-CN': {
10
+ 'pisell2.pin.verify.modal.title': string;
11
+ 'pisell2.pin.verify.modal.wallet': string;
12
+ 'pisell2.pin.verify.modal.keyboard.title': string;
13
+ 'pisell2.pin.verify.modal.keyboard.desc': string;
14
+ 'pisell2.pin.verify.modal.keyboard.verify': string;
15
+ };
16
+ 'zh-HK': {
17
+ 'pisell2.pin.verify.modal.title': string;
18
+ 'pisell2.pin.verify.modal.wallet': string;
19
+ 'pisell2.pin.verify.modal.keyboard.title': string;
20
+ 'pisell2.pin.verify.modal.keyboard.desc': string;
21
+ 'pisell2.pin.verify.modal.keyboard.verify': string;
22
+ };
23
+ };
24
+ export default _default;
@@ -0,0 +1,47 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/pinVerifyModal/locales.ts
20
+ var locales_exports = {};
21
+ __export(locales_exports, {
22
+ default: () => locales_default
23
+ });
24
+ module.exports = __toCommonJS(locales_exports);
25
+ var locales_default = {
26
+ en: {
27
+ "pisell2.pin.verify.modal.title": "Wallet Verification",
28
+ "pisell2.pin.verify.modal.wallet": "Wallet : ",
29
+ "pisell2.pin.verify.modal.keyboard.title": "Enter the 4-digit PIN to continue",
30
+ "pisell2.pin.verify.modal.keyboard.desc": "Remaining attempts : ",
31
+ "pisell2.pin.verify.modal.keyboard.verify": "Verify"
32
+ },
33
+ "zh-CN": {
34
+ "pisell2.pin.verify.modal.title": "钱包验证",
35
+ "pisell2.pin.verify.modal.wallet": "钱包 : ",
36
+ "pisell2.pin.verify.modal.keyboard.title": "请输入该钱包的4位PIN码以继续",
37
+ "pisell2.pin.verify.modal.keyboard.desc": "剩余验证次数 : ",
38
+ "pisell2.pin.verify.modal.keyboard.verify": "验证"
39
+ },
40
+ "zh-HK": {
41
+ "pisell2.pin.verify.modal.title": "錢包驗證",
42
+ "pisell2.pin.verify.modal.wallet": "錢包 : ",
43
+ "pisell2.pin.verify.modal.keyboard.title": "請輸入該錢包的4位PIN碼以繼續",
44
+ "pisell2.pin.verify.modal.keyboard.desc": "剩餘驗證次數 : ",
45
+ "pisell2.pin.verify.modal.keyboard.verify": "驗證"
46
+ }
47
+ };
@@ -0,0 +1,33 @@
1
+ export interface PinVerifyModalProps {
2
+ onOpen?: () => void;
3
+ onClose?: () => void;
4
+ onSuccess?: (params?: VerifyPinSuccessParams) => void;
5
+ }
6
+ export interface PinVerifyModalRef {
7
+ open: (params: ModalParams) => void;
8
+ close: () => void;
9
+ }
10
+ export interface ModalParams {
11
+ wallet_code: string;
12
+ wallet_detail_id: string | number;
13
+ failed_count?: number;
14
+ check_max_count?: number;
15
+ customer?: {
16
+ display_name?: string;
17
+ nickname?: string;
18
+ cover?: string;
19
+ };
20
+ }
21
+ export interface VerifyInfo {
22
+ remaining_count?: number;
23
+ failed_count?: number;
24
+ check_max_count?: number;
25
+ }
26
+ export declare type TVerifyPin = (data: {
27
+ wallet_detail_id: string | number;
28
+ pin: string;
29
+ }, onSuccess: (params: VerifyPinSuccessParams) => void) => void;
30
+ export interface VerifyPinSuccessParams {
31
+ customer_id: string | number;
32
+ customer_pin_key: string;
33
+ }
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/components/pinVerifyModal/types.ts
16
+ var types_exports = {};
17
+ module.exports = __toCommonJS(types_exports);
@@ -59,6 +59,7 @@ var import_utils4 = require("../bookingDataPanel/bookingList/utils");
59
59
  var import_pisellos = require("../../hooks/pisellos");
60
60
  var import_ahooks = require("ahooks");
61
61
  var import_useScanManager = __toESM(require("../../hooks/pisellos/useScanManager"));
62
+ var import_ahooks2 = require("ahooks");
62
63
  var _formatBookingDetail = (data, modalState) => {
63
64
  var _a, _b, _c, _d;
64
65
  let {
@@ -278,7 +279,9 @@ var TicketBooking = () => {
278
279
  if (isTerminal()) {
279
280
  const userAgent = navigator.userAgent;
280
281
  if (userAgent.includes("terminal")) {
281
- const terminalVersionMatch = userAgent.match(/terminal\/[\d.]+\((\d+)\)/i);
282
+ const terminalVersionMatch = userAgent.match(
283
+ /terminal\/[\d.]+\((\d+)\)/i
284
+ );
282
285
  if (terminalVersionMatch && terminalVersionMatch[1]) {
283
286
  const buildNumberStr = terminalVersionMatch[1];
284
287
  const buildNumber = parseInt(buildNumberStr, 10);
@@ -311,6 +314,47 @@ var TicketBooking = () => {
311
314
  closeScan();
312
315
  };
313
316
  }, []);
317
+ const { run: clearAllCart } = (0, import_ahooks2.useDebounceFn)(
318
+ (type, orderId) => {
319
+ var _a2, _b2, _c2, _d2, _e2, _f, _g, _h;
320
+ try {
321
+ _initFn(() => {
322
+ });
323
+ setState({
324
+ createCount: state.createCount + 1
325
+ });
326
+ (0, import_utils.sendWarningLog)({
327
+ title: "清空购物车",
328
+ content: [
329
+ {
330
+ key: "店铺id",
331
+ value: (_d2 = (_c2 = (_b2 = (_a2 = store == null ? void 0 : store.getState) == null ? void 0 : _a2.call(store)) == null ? void 0 : _b2.global) == null ? void 0 : _c2.globalConfig) == null ? void 0 : _d2.id
332
+ },
333
+ { key: "订单id", value: orderId },
334
+ { key: "类型", value: type }
335
+ ]
336
+ });
337
+ } catch (err) {
338
+ (0, import_utils.sendWarningLog)({
339
+ title: "清空购物车失败",
340
+ content: [
341
+ {
342
+ key: "店铺id",
343
+ value: (_h = (_g = (_f = (_e2 = store == null ? void 0 : store.getState) == null ? void 0 : _e2.call(store)) == null ? void 0 : _f.global) == null ? void 0 : _g.globalConfig) == null ? void 0 : _h.id
344
+ },
345
+ { key: "订单id", value: orderId },
346
+ { key: "类型", value: type },
347
+ { key: "error", value: err == null ? void 0 : err.message }
348
+ ]
349
+ });
350
+ }
351
+ },
352
+ {
353
+ wait: 500,
354
+ leading: true,
355
+ trailing: false
356
+ }
357
+ );
314
358
  (0, import_react.useEffect)(() => {
315
359
  var _a2, _b2, _c2, _d2, _e2;
316
360
  localStorage.removeItem("bookingResourceList");
@@ -373,6 +417,7 @@ var TicketBooking = () => {
373
417
  console.log("bookingTicket.clearAllCart");
374
418
  _initFn(() => {
375
419
  });
420
+ _setIntervalTime(true);
376
421
  selectCustomer(null);
377
422
  enableAllScanListeners();
378
423
  setState({
@@ -620,7 +665,6 @@ var TicketBooking = () => {
620
665
  num: 500,
621
666
  extension_type: ["product_add_time"]
622
667
  });
623
- console.log("wwww", data);
624
668
  setState({
625
669
  addTimeProducts: (data == null ? void 0 : data.list) || []
626
670
  });
@@ -918,7 +962,6 @@ var TicketBooking = () => {
918
962
  isShowDeposit: state.isShowDeposit,
919
963
  disableEventBookingEdit: state.disableEventBookingEdit,
920
964
  list: state.list,
921
- intervalSetTime: state.intervalSetTime,
922
965
  createCount: state.createCount,
923
966
  bookingFunctions: state.bookingFunctions,
924
967
  isParallelResourcesBooking: state.isParallelResourcesBooking
@@ -1170,9 +1213,13 @@ var TicketBooking = () => {
1170
1213
  {
1171
1214
  open: showTerminalUpgradeModal,
1172
1215
  title: import_utils.locales.getText("pisell2.ticket-booking.terminal-upgrade-title"),
1173
- describe: import_utils.locales.getText("pisell2.ticket-booking.terminal-upgrade-description"),
1216
+ describe: import_utils.locales.getText(
1217
+ "pisell2.ticket-booking.terminal-upgrade-description"
1218
+ ),
1174
1219
  okText: import_utils.locales.getText("pisell2.ticket-booking.terminal-upgrade-ok"),
1175
- cancelText: import_utils.locales.getText("pisell2.ticket-booking.terminal-upgrade-cancel"),
1220
+ cancelText: import_utils.locales.getText(
1221
+ "pisell2.ticket-booking.terminal-upgrade-cancel"
1222
+ ),
1176
1223
  closable: true,
1177
1224
  onOk: () => setShowTerminalUpgradeModal(false),
1178
1225
  onCancel: () => setShowTerminalUpgradeModal(false)
@@ -37,6 +37,7 @@ var import_icons = require("@ant-design/icons");
37
37
  var import_materials = require("@pisell/materials");
38
38
  var import_ahooks = require("ahooks");
39
39
  var import_antd = require("antd");
40
+ var import_dayjs = __toESM(require("dayjs"));
40
41
  var import_classnames = __toESM(require("classnames"));
41
42
  var import_utils = require("@pisell/utils");
42
43
  var import_index = require("./index.less");
@@ -74,7 +75,7 @@ var TimeBar = (props) => {
74
75
  setGlobalState({
75
76
  isTimeChange: true
76
77
  });
77
- (_d = props.setIntervalTime) == null ? void 0 : _d.call(props, false);
78
+ (_d = props.setIntervalTime) == null ? void 0 : _d.call(props, timeString === (0, import_dayjs.default)().format("HH:mm"));
78
79
  });
79
80
  return (0, import_react.useMemo)(() => {
80
81
  var _a2, _b2, _c, _d;
@@ -45,6 +45,7 @@ var import_locales = __toESM(require("./locales"));
45
45
  var import_index = require("./index.less");
46
46
  var import_classnames = __toESM(require("classnames"));
47
47
  var import_types = require("./types");
48
+ var import_pinModal = __toESM(require("../pinModal"));
48
49
  var STORAGE_KEY = "pisell_wallet_list_data";
49
50
  var STORAGE_KEY_BALANCE = "pisell_wallet_balance_data";
50
51
  var safeLocalStorage = {
@@ -134,6 +135,7 @@ var WalletList = (0, import_model.Provider)((props) => {
134
135
  const [walletShopList, setWalletShopList] = (0, import_react.useState)([]);
135
136
  const requestIdRef = (0, import_react.useRef)("");
136
137
  const pubsub = utils == null ? void 0 : utils.pubsub;
138
+ const pinModalRef = (0, import_react.useRef)(null);
137
139
  const isUserLoggedIn = (0, import_react.useMemo)(() => {
138
140
  var _a2, _b2;
139
141
  return !!((_b2 = (_a2 = utils == null ? void 0 : utils.token) == null ? void 0 : _a2.get) == null ? void 0 : _b2.call(_a2)) || false;
@@ -370,6 +372,14 @@ var WalletList = (0, import_model.Provider)((props) => {
370
372
  });
371
373
  }
372
374
  };
375
+ const onViewPinClick = (card) => {
376
+ var _a2;
377
+ if (card == null ? void 0 : card.id) {
378
+ (_a2 = pinModalRef.current) == null ? void 0 : _a2.open(card == null ? void 0 : card.id);
379
+ } else {
380
+ console.error("onViewPinClick方法需要传入wallet_detail_id");
381
+ }
382
+ };
373
383
  const renderWalletCard = (item) => {
374
384
  var _a2;
375
385
  const { code, shop, wallet, id } = item;
@@ -423,7 +433,14 @@ var WalletList = (0, import_model.Provider)((props) => {
423
433
  isLogin: isUserLoggedIn
424
434
  // 添加登录状态
425
435
  };
426
- return /* @__PURE__ */ import_react.default.createElement(import_materials.WalletCard, { key: id, ...cardProps });
436
+ return /* @__PURE__ */ import_react.default.createElement(
437
+ import_materials.WalletCard,
438
+ {
439
+ key: id,
440
+ ...cardProps,
441
+ onViewPinClick: () => onViewPinClick(item)
442
+ }
443
+ );
427
444
  };
428
445
  const carouselProps = {
429
446
  className: (0, import_classnames.default)("pisell-lowcode__walletList"),
@@ -545,7 +562,7 @@ var WalletList = (0, import_model.Provider)((props) => {
545
562
  }
546
563
  }
547
564
  )
548
- )));
565
+ )), /* @__PURE__ */ import_react.default.createElement(import_pinModal.default, { ref: pinModalRef }));
549
566
  };
550
567
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-list-wrapper" }, renderContent());
551
568
  });
package/lib/index.d.ts CHANGED
@@ -59,3 +59,5 @@ export { default as ProSkuDetailModal } from './pro/skuDetailModal';
59
59
  export { default as SaasLogin } from './plus/saasLogin';
60
60
  export { default as SaasRegister } from './plus/saasRegister';
61
61
  export { default as SaasCreateOrganization } from './plus/saasCreateOrganization';
62
+ export { default as PinModal } from './components/pinModal';
63
+ export { default as PinVerifyModal } from './components/pinVerifyModal';
package/lib/index.js CHANGED
@@ -63,6 +63,8 @@ __export(src_exports, {
63
63
  EventTimeResourceSelector: () => import_timeResourceSelector.default,
64
64
  Login: () => import_login.default,
65
65
  NoteModal: () => import_noteModal.default,
66
+ PinModal: () => import_pinModal.default,
67
+ PinVerifyModal: () => import_pinVerifyModal.default,
66
68
  PisellSelectCustomerModal: () => import_pisellSelectCustomerModal.default,
67
69
  ProNumberKeyboard: () => import_numberKeyboard.default,
68
70
  ProNumberSelector: () => import_pisellNumberSelector.default,
@@ -154,6 +156,8 @@ var import_skuDetailModal = __toESM(require("./pro/skuDetailModal"));
154
156
  var import_saasLogin = __toESM(require("./plus/saasLogin"));
155
157
  var import_saasRegister = __toESM(require("./plus/saasRegister"));
156
158
  var import_saasCreateOrganization = __toESM(require("./plus/saasCreateOrganization"));
159
+ var import_pinModal = __toESM(require("./components/pinModal"));
160
+ var import_pinVerifyModal = __toESM(require("./components/pinVerifyModal"));
157
161
  import_dayjs.default.extend(import_weekday.default);
158
162
  import_dayjs.default.extend(import_localeData.default);
159
163
  // Annotate the CommonJS export names for ESM import in node:
@@ -192,6 +196,8 @@ import_dayjs.default.extend(import_localeData.default);
192
196
  EventTimeResourceSelector,
193
197
  Login,
194
198
  NoteModal,
199
+ PinModal,
200
+ PinVerifyModal,
195
201
  PisellSelectCustomerModal,
196
202
  ProNumberKeyboard,
197
203
  ProNumberSelector,