@pisell/private-materials 3.2.6 → 3.2.7
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/components/footer/index.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/materiels/contacts/index.d.ts +0 -1
- package/es/components/eftpos/index.d.ts +0 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +0 -1
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/login/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/es/components/productExtension/index.d.ts +0 -1
- package/es/components/ruleSetting/index.d.ts +0 -1
- package/es/components/taxSelect/index.d.ts +0 -1
- package/es/components/wallet/Detail/index.d.ts +14 -0
- package/es/components/wallet/Detail/index.js +140 -19
- package/es/components/wallet/components/FooterButtons/index.less +3 -1
- package/es/components/walletList/index.js +70 -32
- package/lib/components/booking/components/footer/index.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
- package/lib/components/eftpos/index.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +0 -1
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/login/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
- package/lib/components/productExtension/index.d.ts +0 -1
- package/lib/components/ruleSetting/index.d.ts +0 -1
- package/lib/components/taxSelect/index.d.ts +0 -1
- package/lib/components/wallet/Detail/index.d.ts +14 -0
- package/lib/components/wallet/Detail/index.js +67 -12
- package/lib/components/wallet/components/FooterButtons/index.less +3 -1
- package/lib/components/walletList/index.js +50 -16
- package/package.json +3 -3
|
@@ -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<"tyro" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"tyro" | "payo" | "windcave" | "stripe">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -297,8 +297,8 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
298
|
mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "tyro" | "
|
|
301
|
-
action?: "amount" | "
|
|
300
|
+
eftpos?: "tyro" | "payo" | "windcave" | "stripe" | undefined;
|
|
301
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
304
304
|
title?: string | undefined;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.less';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
PKPass?: any;
|
|
6
|
+
GoogleWalletPass?: any;
|
|
7
|
+
}
|
|
8
|
+
interface Navigator {
|
|
9
|
+
pkpass?: {
|
|
10
|
+
addPass(pass: any): Promise<string>;
|
|
11
|
+
};
|
|
12
|
+
googlewallet?: {
|
|
13
|
+
addPass(pass: any): Promise<string>;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
3
17
|
interface DetailProps {
|
|
4
18
|
detail: {
|
|
5
19
|
id?: string;
|
|
@@ -24,6 +24,9 @@ import { request } from "./../../../utils";
|
|
|
24
24
|
import { WalletBar, FooterButtons } from "../components";
|
|
25
25
|
import "./index.less";
|
|
26
26
|
var Text = Typography.Text;
|
|
27
|
+
|
|
28
|
+
// 为Web PKI API添加TypeScript声明
|
|
29
|
+
|
|
27
30
|
dayjs.extend(timezone);
|
|
28
31
|
dayjs.extend(utc);
|
|
29
32
|
var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -308,7 +311,7 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
308
311
|
|
|
309
312
|
// 如果是积分卡 移除掉2024-8-10之前的数据
|
|
310
313
|
if (((_filterList$i3 = filterList[i]) === null || _filterList$i3 === void 0 ? void 0 : _filterList$i3.tag) === 'point_card' && dayjs.tz((_filterList$i4 = filterList[i]) === null || _filterList$i4 === void 0 ? void 0 : _filterList$i4.created_at, timezone).unix() < stateTimeUnix) {
|
|
311
|
-
filterList.splice(i, 1); // 移除当前索引的元素
|
|
314
|
+
filterList.splice(i, 1); // 移除当前索引的元素
|
|
312
315
|
}
|
|
313
316
|
}
|
|
314
317
|
setTimeLineData(formatTimeLineDta(filterList));
|
|
@@ -337,24 +340,142 @@ var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
337
340
|
getTimeTreeList();
|
|
338
341
|
}
|
|
339
342
|
}, [code]);
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
343
|
+
/**
|
|
344
|
+
* 添加钱包卡片的公共函数
|
|
345
|
+
* @param url 钱包卡片URL
|
|
346
|
+
* @param type 钱包类型('apple'或'google')
|
|
347
|
+
* @returns Promise<void>
|
|
348
|
+
*/
|
|
349
|
+
var addWalletPass = /*#__PURE__*/function () {
|
|
350
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(url, type) {
|
|
351
|
+
var response, passData, _pass, result, blob, _url, a;
|
|
352
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
353
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
354
|
+
case 0:
|
|
355
|
+
if (url) {
|
|
356
|
+
_context3.next = 2;
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
return _context3.abrupt("return");
|
|
360
|
+
case 2:
|
|
361
|
+
if (!isWechat()) {
|
|
362
|
+
_context3.next = 6;
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
setWechatModalOpen(true);
|
|
366
|
+
setCopyUrl(url);
|
|
367
|
+
return _context3.abrupt("return");
|
|
368
|
+
case 6:
|
|
369
|
+
console.log('%c [ window.PKPass ]-395', 'font-size:13px; color:#bf2c9f;', window.PKPass);
|
|
370
|
+
console.log('%c [ navigator.pkpass ]-396', 'font-size:13px; color:#bf2c9f;', navigator.pkpass);
|
|
371
|
+
// 根据不同类型处理不同API
|
|
372
|
+
if (!(type === 'apple')) {
|
|
373
|
+
_context3.next = 46;
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
_context3.prev = 9;
|
|
377
|
+
_context3.next = 12;
|
|
378
|
+
return fetch('/generate-pass');
|
|
379
|
+
case 12:
|
|
380
|
+
response = _context3.sent;
|
|
381
|
+
alert(response);
|
|
382
|
+
console.log('%c [ response ]-400', 'font-size:13px; color:#bf2c9f;', response);
|
|
383
|
+
_context3.next = 17;
|
|
384
|
+
return response.arrayBuffer();
|
|
385
|
+
case 17:
|
|
386
|
+
passData = _context3.sent;
|
|
387
|
+
console.log('%c [ passData ]-402', 'font-size:13px; color:#bf2c9f;', passData);
|
|
388
|
+
console.log('%c [ window.PKPass ]-404', 'font-size:13px; color:#bf2c9f;', window.PKPass);
|
|
389
|
+
// 2. 调用 Web PKI API
|
|
390
|
+
|
|
391
|
+
alert(window.PKPass + 'window.PKPass');
|
|
392
|
+
alert(navigator.pkpass + 'navigator.pkpass');
|
|
393
|
+
if (!(window.PKPass && navigator.pkpass)) {
|
|
394
|
+
_context3.next = 30;
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
_pass = new window.PKPass(passData);
|
|
398
|
+
_context3.next = 26;
|
|
399
|
+
return navigator.pkpass.addPass(_pass);
|
|
400
|
+
case 26:
|
|
401
|
+
result = _context3.sent;
|
|
402
|
+
// 3. 根据结果触发自定义事件
|
|
403
|
+
if (result === 'added') {
|
|
404
|
+
console.log('Pass 添加成功!');
|
|
405
|
+
// 触发自定义事件,例如发送分析、更新UI等
|
|
406
|
+
window.dispatchEvent(new CustomEvent('passAdded'));
|
|
407
|
+
} else {
|
|
408
|
+
console.log('用户取消了操作');
|
|
409
|
+
}
|
|
410
|
+
_context3.next = 39;
|
|
411
|
+
break;
|
|
412
|
+
case 30:
|
|
413
|
+
alert('浏览器不支持 Web PKI');
|
|
414
|
+
// 浏览器不支持 Web PKI,回退到直接下载
|
|
415
|
+
blob = new Blob([passData], {
|
|
416
|
+
type: 'application/vnd.apple.pkpass'
|
|
417
|
+
});
|
|
418
|
+
_url = URL.createObjectURL(blob);
|
|
419
|
+
a = document.createElement('a');
|
|
420
|
+
alert(_url + 'url');
|
|
421
|
+
a.href = _url;
|
|
422
|
+
a.download = 'pass.pkpass';
|
|
423
|
+
a.click();
|
|
424
|
+
URL.revokeObjectURL(_url);
|
|
425
|
+
case 39:
|
|
426
|
+
_context3.next = 44;
|
|
427
|
+
break;
|
|
428
|
+
case 41:
|
|
429
|
+
_context3.prev = 41;
|
|
430
|
+
_context3.t0 = _context3["catch"](9);
|
|
431
|
+
console.error('添加失败:', _context3.t0);
|
|
432
|
+
case 44:
|
|
433
|
+
_context3.next = 46;
|
|
434
|
+
break;
|
|
435
|
+
case 46:
|
|
436
|
+
case "end":
|
|
437
|
+
return _context3.stop();
|
|
438
|
+
}
|
|
439
|
+
}, _callee3, null, [[9, 41]]);
|
|
440
|
+
}));
|
|
441
|
+
return function addWalletPass(_x, _x2) {
|
|
442
|
+
return _ref4.apply(this, arguments);
|
|
443
|
+
};
|
|
444
|
+
}();
|
|
445
|
+
var onAppleClick = /*#__PURE__*/function () {
|
|
446
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
447
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
448
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
449
|
+
case 0:
|
|
450
|
+
_context4.next = 2;
|
|
451
|
+
return addWalletPass(apple_wallet_url, 'apple');
|
|
452
|
+
case 2:
|
|
453
|
+
case "end":
|
|
454
|
+
return _context4.stop();
|
|
455
|
+
}
|
|
456
|
+
}, _callee4);
|
|
457
|
+
}));
|
|
458
|
+
return function onAppleClick() {
|
|
459
|
+
return _ref5.apply(this, arguments);
|
|
460
|
+
};
|
|
461
|
+
}();
|
|
462
|
+
var onGoogleClick = /*#__PURE__*/function () {
|
|
463
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
464
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
465
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
466
|
+
case 0:
|
|
467
|
+
_context5.next = 2;
|
|
468
|
+
return addWalletPass(google_wallet_url, 'google');
|
|
469
|
+
case 2:
|
|
470
|
+
case "end":
|
|
471
|
+
return _context5.stop();
|
|
472
|
+
}
|
|
473
|
+
}, _callee5);
|
|
474
|
+
}));
|
|
475
|
+
return function onGoogleClick() {
|
|
476
|
+
return _ref6.apply(this, arguments);
|
|
477
|
+
};
|
|
478
|
+
}();
|
|
358
479
|
var isWechat = function isWechat() {
|
|
359
480
|
return /MicroMessenger/i.test(window.navigator.userAgent);
|
|
360
481
|
};
|
|
@@ -32,16 +32,37 @@ import { WalletCardItem, DEFAULT_CARD_CONFIG } from "./types";
|
|
|
32
32
|
// 添加 localStorage 相关的操作函数
|
|
33
33
|
var STORAGE_KEY = 'pisell_wallet_list_data';
|
|
34
34
|
var STORAGE_KEY_BALANCE = 'pisell_wallet_balance_data';
|
|
35
|
+
|
|
36
|
+
// 确保localStorage函数在所有环境下都能正确使用
|
|
37
|
+
var safeLocalStorage = {
|
|
38
|
+
getItem: function getItem(key) {
|
|
39
|
+
try {
|
|
40
|
+
return typeof localStorage !== 'undefined' ? localStorage.getItem(key) : null;
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error('Error accessing localStorage:', error);
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
setItem: function setItem(key, value) {
|
|
47
|
+
try {
|
|
48
|
+
if (typeof localStorage !== 'undefined') {
|
|
49
|
+
localStorage.setItem(key, value);
|
|
50
|
+
}
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error('Error writing to localStorage:', error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
35
56
|
var saveToLocalStorage = function saveToLocalStorage(key, data) {
|
|
36
57
|
try {
|
|
37
|
-
|
|
58
|
+
safeLocalStorage.setItem(key, JSON.stringify(data));
|
|
38
59
|
} catch (error) {
|
|
39
60
|
console.error('Error saving to localStorage:', error);
|
|
40
61
|
}
|
|
41
62
|
};
|
|
42
63
|
var getFromLocalStorage = function getFromLocalStorage(key) {
|
|
43
64
|
try {
|
|
44
|
-
var data =
|
|
65
|
+
var data = safeLocalStorage.getItem(key);
|
|
45
66
|
return data ? JSON.parse(data) : null;
|
|
46
67
|
} catch (error) {
|
|
47
68
|
console.error('Error reading from localStorage:', error);
|
|
@@ -156,7 +177,6 @@ var WalletList = Provider(function (props) {
|
|
|
156
177
|
// 先获取list
|
|
157
178
|
var _state$list = state.list,
|
|
158
179
|
list = _state$list === void 0 ? [] : _state$list,
|
|
159
|
-
loading = state.loading,
|
|
160
180
|
error = state.error,
|
|
161
181
|
authError = state.authError,
|
|
162
182
|
hasAttempted = state.hasAttempted,
|
|
@@ -171,6 +191,7 @@ var WalletList = Provider(function (props) {
|
|
|
171
191
|
|
|
172
192
|
// 组件挂载时执行一次请求
|
|
173
193
|
useEffect(function () {
|
|
194
|
+
console.log('%c [ ]-221', 'font-size:13px; color:#bf2c9f;', 22121212);
|
|
174
195
|
// 组件卸载时取消所有操作
|
|
175
196
|
return function () {
|
|
176
197
|
isMountedRef.current = false;
|
|
@@ -191,7 +212,6 @@ var WalletList = Provider(function (props) {
|
|
|
191
212
|
setState({
|
|
192
213
|
list: [DEFAULT_WALLET_CARD],
|
|
193
214
|
balance: DEFAULT_BALANCE,
|
|
194
|
-
loading: false,
|
|
195
215
|
hasAttempted: true,
|
|
196
216
|
isLoggedIn: false
|
|
197
217
|
});
|
|
@@ -364,7 +384,6 @@ var WalletList = Provider(function (props) {
|
|
|
364
384
|
setState({
|
|
365
385
|
list: [DEFAULT_WALLET_CARD],
|
|
366
386
|
balance: DEFAULT_BALANCE,
|
|
367
|
-
loading: false,
|
|
368
387
|
hasAttempted: true,
|
|
369
388
|
isLoggedIn: false
|
|
370
389
|
});
|
|
@@ -376,43 +395,58 @@ var WalletList = Provider(function (props) {
|
|
|
376
395
|
}
|
|
377
396
|
return _context3.abrupt("return");
|
|
378
397
|
case 9:
|
|
379
|
-
//
|
|
380
|
-
cachedList =
|
|
381
|
-
cachedBalance =
|
|
398
|
+
// 从本地缓存获取数据,使用try-catch包裹防止错误
|
|
399
|
+
cachedList = null;
|
|
400
|
+
cachedBalance = null;
|
|
401
|
+
try {
|
|
402
|
+
cachedList = getFromLocalStorage(STORAGE_KEY);
|
|
403
|
+
cachedBalance = getFromLocalStorage(STORAGE_KEY_BALANCE);
|
|
404
|
+
} catch (e) {
|
|
405
|
+
console.error('Error fetching from localStorage:', e);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// 如果有缓存数据,先使用缓存数据
|
|
382
409
|
if (cachedList && cachedBalance) {
|
|
383
410
|
setState({
|
|
384
411
|
list: cachedList,
|
|
385
412
|
balance: cachedBalance,
|
|
386
|
-
loading: false,
|
|
387
413
|
hasAttempted: false
|
|
388
414
|
});
|
|
389
415
|
}
|
|
390
|
-
_context3.prev =
|
|
416
|
+
_context3.prev = 13;
|
|
391
417
|
if (isMountedRef.current) {
|
|
392
|
-
_context3.next =
|
|
418
|
+
_context3.next = 16;
|
|
393
419
|
break;
|
|
394
420
|
}
|
|
395
421
|
return _context3.abrupt("return");
|
|
396
|
-
case
|
|
397
|
-
_context3.next =
|
|
422
|
+
case 16:
|
|
423
|
+
_context3.next = 18;
|
|
398
424
|
return Promise.all([getWalletList(), getWalletBalance()]);
|
|
399
|
-
case
|
|
425
|
+
case 18:
|
|
400
426
|
_yield$Promise$all = _context3.sent;
|
|
401
427
|
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
402
428
|
walletListData = _yield$Promise$all2[0];
|
|
403
429
|
walletBalanceData = _yield$Promise$all2[1];
|
|
404
430
|
if (!(!isMountedRef.current || requestIdRef.current !== requestId)) {
|
|
405
|
-
_context3.next =
|
|
431
|
+
_context3.next = 24;
|
|
406
432
|
break;
|
|
407
433
|
}
|
|
408
434
|
return _context3.abrupt("return");
|
|
409
|
-
case
|
|
435
|
+
case 24:
|
|
410
436
|
// 如果获取到有效数据,保存到 localStorage
|
|
411
437
|
if (walletListData && walletListData.length > 0) {
|
|
412
|
-
|
|
438
|
+
try {
|
|
439
|
+
saveToLocalStorage(STORAGE_KEY, walletListData);
|
|
440
|
+
} catch (e) {
|
|
441
|
+
console.error('Error saving wallet list to localStorage:', e);
|
|
442
|
+
}
|
|
413
443
|
}
|
|
414
444
|
if (walletBalanceData) {
|
|
415
|
-
|
|
445
|
+
try {
|
|
446
|
+
saveToLocalStorage(STORAGE_KEY_BALANCE, walletBalanceData);
|
|
447
|
+
} catch (e) {
|
|
448
|
+
console.error('Error saving wallet balance to localStorage:', e);
|
|
449
|
+
}
|
|
416
450
|
}
|
|
417
451
|
|
|
418
452
|
// 添加判断逻辑:如果walletBalanceData为空或walletListData为空,2秒后重试
|
|
@@ -442,7 +476,11 @@ var WalletList = Provider(function (props) {
|
|
|
442
476
|
case 8:
|
|
443
477
|
retryBalanceData = _context2.sent;
|
|
444
478
|
if (retryBalanceData) {
|
|
445
|
-
|
|
479
|
+
try {
|
|
480
|
+
saveToLocalStorage(STORAGE_KEY_BALANCE, retryBalanceData);
|
|
481
|
+
} catch (e) {
|
|
482
|
+
console.error('Error saving retry balance to localStorage:', e);
|
|
483
|
+
}
|
|
446
484
|
}
|
|
447
485
|
case 10:
|
|
448
486
|
if (!(Array.isArray(walletListData) && walletListData.length === 0)) {
|
|
@@ -454,14 +492,17 @@ var WalletList = Provider(function (props) {
|
|
|
454
492
|
case 13:
|
|
455
493
|
retryListData = _context2.sent;
|
|
456
494
|
if (retryListData && retryListData.length > 0) {
|
|
457
|
-
|
|
495
|
+
try {
|
|
496
|
+
saveToLocalStorage(STORAGE_KEY, retryListData);
|
|
497
|
+
} catch (e) {
|
|
498
|
+
console.error('Error saving retry list to localStorage:', e);
|
|
499
|
+
}
|
|
458
500
|
}
|
|
459
501
|
case 15:
|
|
460
502
|
// 更新状态
|
|
461
503
|
setState({
|
|
462
504
|
list: retryListData || [],
|
|
463
505
|
balance: retryBalanceData,
|
|
464
|
-
loading: false,
|
|
465
506
|
hasAttempted: true
|
|
466
507
|
});
|
|
467
508
|
_context2.next = 21;
|
|
@@ -473,7 +514,6 @@ var WalletList = Provider(function (props) {
|
|
|
473
514
|
setState({
|
|
474
515
|
list: walletListData || [],
|
|
475
516
|
balance: walletBalanceData,
|
|
476
|
-
loading: false,
|
|
477
517
|
hasAttempted: true
|
|
478
518
|
});
|
|
479
519
|
case 21:
|
|
@@ -487,34 +527,32 @@ var WalletList = Provider(function (props) {
|
|
|
487
527
|
setState({
|
|
488
528
|
list: walletListData || [],
|
|
489
529
|
balance: walletBalanceData,
|
|
490
|
-
loading: false,
|
|
491
530
|
hasAttempted: true
|
|
492
531
|
});
|
|
493
532
|
}
|
|
494
|
-
_context3.next =
|
|
533
|
+
_context3.next = 35;
|
|
495
534
|
break;
|
|
496
|
-
case
|
|
497
|
-
_context3.prev =
|
|
498
|
-
_context3.t0 = _context3["catch"](
|
|
535
|
+
case 29:
|
|
536
|
+
_context3.prev = 29;
|
|
537
|
+
_context3.t0 = _context3["catch"](13);
|
|
499
538
|
if (!(!isMountedRef.current || requestIdRef.current !== requestId)) {
|
|
500
|
-
_context3.next =
|
|
539
|
+
_context3.next = 33;
|
|
501
540
|
break;
|
|
502
541
|
}
|
|
503
542
|
return _context3.abrupt("return");
|
|
504
|
-
case
|
|
543
|
+
case 33:
|
|
505
544
|
// 判断是否是登录超时错误
|
|
506
545
|
isAuthError = (_context3.t0 === null || _context3.t0 === void 0 ? void 0 : _context3.t0.code) === 4001 || (_context3.t0 === null || _context3.t0 === void 0 || (_message = _context3.t0.message) === null || _message === void 0 ? void 0 : _message.includes('login time out')) || (_context3.t0 === null || _context3.t0 === void 0 || (_data = _context3.t0.data) === null || _data === void 0 ? void 0 : _data.code) === 4001;
|
|
507
546
|
setState({
|
|
508
|
-
loading: false,
|
|
509
547
|
error: _context3.t0 instanceof Error ? _context3.t0 : new Error('加载失败'),
|
|
510
548
|
authError: isAuthError,
|
|
511
549
|
hasAttempted: true
|
|
512
550
|
});
|
|
513
|
-
case
|
|
551
|
+
case 35:
|
|
514
552
|
case "end":
|
|
515
553
|
return _context3.stop();
|
|
516
554
|
}
|
|
517
|
-
}, _callee3, null, [[
|
|
555
|
+
}, _callee3, null, [[13, 29]]);
|
|
518
556
|
}));
|
|
519
557
|
return function initData(_x) {
|
|
520
558
|
return _ref3.apply(this, arguments);
|
|
@@ -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<"tyro" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"tyro" | "payo" | "windcave" | "stripe">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|