@pisell/private-materials 3.2.4 → 3.2.6
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 +4 -4
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/component/fail/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/index.d.ts +1 -0
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/ruleSetting/index.d.ts +1 -0
- package/es/components/wallet/DiscountCard/index.js +1 -1
- package/es/components/wallet/DiscountCard/index.less +3 -4
- package/es/components/wallet/PointCard/index.js +1 -1
- package/es/components/wallet/PointCard/index.less +3 -4
- package/es/components/wallet/RechargeableCard/index.js +4 -4
- package/es/components/wallet/RechargeableCard/index.less +4 -5
- package/es/components/wallet/Voucher/index.js +1 -1
- package/es/components/wallet/Voucher/index.less +3 -4
- package/es/components/wallet/components/WalletBar/index.js +4 -2
- package/es/components/wallet/index.js +8 -4
- package/es/components/wallet/index.less +9 -3
- package/es/components/walletList/index.js +77 -85
- package/es/components/walletList/serve.d.ts +2 -6
- package/es/components/walletList/serve.js +17 -52
- package/es/components/walletList/types/index.d.ts +1 -1
- package/es/components/walletList/types/index.js +1 -1
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/index.d.ts +1 -0
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/ruleSetting/index.d.ts +1 -0
- package/lib/components/wallet/DiscountCard/index.js +1 -1
- package/lib/components/wallet/DiscountCard/index.less +3 -4
- package/lib/components/wallet/PointCard/index.js +1 -1
- package/lib/components/wallet/PointCard/index.less +3 -4
- package/lib/components/wallet/RechargeableCard/index.js +3 -3
- package/lib/components/wallet/RechargeableCard/index.less +4 -5
- package/lib/components/wallet/Voucher/index.js +1 -1
- package/lib/components/wallet/Voucher/index.less +3 -4
- package/lib/components/wallet/components/WalletBar/index.js +3 -2
- package/lib/components/wallet/index.js +3 -2
- package/lib/components/wallet/index.less +9 -3
- package/lib/components/walletList/index.js +42 -20
- package/lib/components/walletList/serve.d.ts +2 -6
- package/lib/components/walletList/serve.js +4 -14
- package/lib/components/walletList/types/index.d.ts +1 -1
- package/lib/components/walletList/types/index.js +1 -1
- package/package.json +4 -4
|
@@ -9,14 +9,14 @@ import { request } from "./../../utils";
|
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
11
|
export var getWalletList = /*#__PURE__*/function () {
|
|
12
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
12
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
13
13
|
var _yield$request$getReq, data;
|
|
14
14
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15
15
|
while (1) switch (_context.prev = _context.next) {
|
|
16
16
|
case 0:
|
|
17
17
|
_context.prev = 0;
|
|
18
18
|
_context.next = 3;
|
|
19
|
-
return request.getRequest().get('/h5/wallet',
|
|
19
|
+
return request.getRequest().get('/h5/wallet', {});
|
|
20
20
|
case 3:
|
|
21
21
|
_yield$request$getReq = _context.sent;
|
|
22
22
|
data = _yield$request$getReq.data;
|
|
@@ -31,74 +31,39 @@ export var getWalletList = /*#__PURE__*/function () {
|
|
|
31
31
|
}
|
|
32
32
|
}, _callee, null, [[0, 8]]);
|
|
33
33
|
}));
|
|
34
|
-
return function getWalletList(
|
|
34
|
+
return function getWalletList() {
|
|
35
35
|
return _ref.apply(this, arguments);
|
|
36
36
|
};
|
|
37
37
|
}();
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* 获取钱包余额
|
|
41
|
+
* @returns
|
|
41
42
|
*/
|
|
42
|
-
export var
|
|
43
|
+
export var getWalletBalance = /*#__PURE__*/function () {
|
|
43
44
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
44
|
-
var
|
|
45
|
-
_yield$request$getReq2,
|
|
46
|
-
data,
|
|
47
|
-
_args2 = arguments;
|
|
45
|
+
var _yield$request$getReq2, data;
|
|
48
46
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
49
47
|
while (1) switch (_context2.prev = _context2.next) {
|
|
50
48
|
case 0:
|
|
51
|
-
|
|
52
|
-
_context2.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
case 4:
|
|
49
|
+
_context2.prev = 0;
|
|
50
|
+
_context2.next = 3;
|
|
51
|
+
return request.getRequest().get('/h5/wallet/wallet-pass/balance', {});
|
|
52
|
+
case 3:
|
|
56
53
|
_yield$request$getReq2 = _context2.sent;
|
|
57
54
|
data = _yield$request$getReq2.data;
|
|
58
55
|
return _context2.abrupt("return", data || null);
|
|
59
|
-
case 9:
|
|
60
|
-
_context2.prev = 9;
|
|
61
|
-
_context2.t0 = _context2["catch"](1);
|
|
62
|
-
return _context2.abrupt("return", null);
|
|
63
|
-
case 12:
|
|
64
|
-
case "end":
|
|
65
|
-
return _context2.stop();
|
|
66
|
-
}
|
|
67
|
-
}, _callee2, null, [[1, 9]]);
|
|
68
|
-
}));
|
|
69
|
-
return function getWalletPassBalance() {
|
|
70
|
-
return _ref2.apply(this, arguments);
|
|
71
|
-
};
|
|
72
|
-
}();
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 获取钱包余额
|
|
76
|
-
* @returns
|
|
77
|
-
*/
|
|
78
|
-
export var getWalletBalance = /*#__PURE__*/function () {
|
|
79
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
80
|
-
var _yield$request$getReq3, data;
|
|
81
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
82
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
83
|
-
case 0:
|
|
84
|
-
_context3.prev = 0;
|
|
85
|
-
_context3.next = 3;
|
|
86
|
-
return request.getRequest().get('/h5/wallet/wallet-pass/balance', {});
|
|
87
|
-
case 3:
|
|
88
|
-
_yield$request$getReq3 = _context3.sent;
|
|
89
|
-
data = _yield$request$getReq3.data;
|
|
90
|
-
return _context3.abrupt("return", data || null);
|
|
91
56
|
case 8:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return
|
|
57
|
+
_context2.prev = 8;
|
|
58
|
+
_context2.t0 = _context2["catch"](0);
|
|
59
|
+
return _context2.abrupt("return", null);
|
|
95
60
|
case 11:
|
|
96
61
|
case "end":
|
|
97
|
-
return
|
|
62
|
+
return _context2.stop();
|
|
98
63
|
}
|
|
99
|
-
},
|
|
64
|
+
}, _callee2, null, [[0, 8]]);
|
|
100
65
|
}));
|
|
101
66
|
return function getWalletBalance() {
|
|
102
|
-
return
|
|
67
|
+
return _ref2.apply(this, arguments);
|
|
103
68
|
};
|
|
104
69
|
}();
|
|
@@ -163,7 +163,7 @@ export declare const DEFAULT_CARD_CONFIG: {
|
|
|
163
163
|
readonly codeDirection: "bottom";
|
|
164
164
|
readonly showShopName: true;
|
|
165
165
|
readonly showWalletName: true;
|
|
166
|
-
readonly showIcon:
|
|
166
|
+
readonly showIcon: true;
|
|
167
167
|
readonly iconImg: "";
|
|
168
168
|
readonly showCardNo: true;
|
|
169
169
|
readonly showCode: true;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
.wallet-discountCard-title {
|
|
2
2
|
color: var(--Gray-900, #101828);
|
|
3
|
-
|
|
4
|
-
/* Text xl/Semibold */
|
|
5
3
|
font-family: Inter;
|
|
6
4
|
font-size: 20px;
|
|
7
5
|
font-style: normal;
|
|
8
6
|
font-weight: 600;
|
|
9
|
-
line-height: 30px;
|
|
10
|
-
margin: 20px
|
|
7
|
+
line-height: 30px;
|
|
8
|
+
margin-top: 20px;
|
|
9
|
+
margin-bottom: 24px;
|
|
11
10
|
}
|
|
@@ -170,7 +170,7 @@ var RechargeableCard = (0, import_model.Provider)((props) => {
|
|
|
170
170
|
modalWrapStyle: {
|
|
171
171
|
overflowY: "auto",
|
|
172
172
|
top: 68,
|
|
173
|
-
height: "calc(
|
|
173
|
+
height: "calc(100% - 68px)",
|
|
174
174
|
zIndex: 998
|
|
175
175
|
},
|
|
176
176
|
pcDetailModalDisplay: platform === "h5" ? true : false,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
.wallet-pointCard-title {
|
|
2
2
|
color: var(--Gray-900, #101828);
|
|
3
|
-
|
|
4
|
-
/* Text xl/Semibold */
|
|
5
3
|
font-family: Inter;
|
|
6
4
|
font-size: 20px;
|
|
7
5
|
font-style: normal;
|
|
8
6
|
font-weight: 600;
|
|
9
|
-
line-height: 30px;
|
|
10
|
-
margin: 20px
|
|
7
|
+
line-height: 30px;
|
|
8
|
+
margin-top: 20px;
|
|
9
|
+
margin-bottom: 24px;
|
|
11
10
|
}
|
|
@@ -284,11 +284,11 @@ var RechargeableCard = (0, import_model.Provider)(
|
|
|
284
284
|
};
|
|
285
285
|
openDetail(detailWithButtons);
|
|
286
286
|
};
|
|
287
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null,
|
|
287
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, platform !== "pc" && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-rechargeableCard-title" }, import_utils.locales.getText("page.wallet.rechargeableCard")), isEmpty ? /* @__PURE__ */ import_react.default.createElement(import_materials.PisellEmpty, null) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
288
288
|
import_materials.CardMetricItem,
|
|
289
289
|
{
|
|
290
290
|
title: import_utils.locales.getText("page.wallet.cardBalance"),
|
|
291
|
-
style: {
|
|
291
|
+
style: { marginBottom: 24 },
|
|
292
292
|
hint: false,
|
|
293
293
|
tags: false,
|
|
294
294
|
number: (state == null ? void 0 : state.total) || 0
|
|
@@ -305,7 +305,7 @@ var RechargeableCard = (0, import_model.Provider)(
|
|
|
305
305
|
modalWrapStyle: {
|
|
306
306
|
overflowY: "auto",
|
|
307
307
|
top: 0,
|
|
308
|
-
height: "
|
|
308
|
+
height: "100%",
|
|
309
309
|
zIndex: 998,
|
|
310
310
|
position: "fixed",
|
|
311
311
|
left: 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.wallet-
|
|
1
|
+
.wallet-rechargeableCard {
|
|
2
2
|
// 充值选项容器
|
|
3
3
|
&-options {
|
|
4
4
|
// 卡片项
|
|
@@ -78,14 +78,13 @@
|
|
|
78
78
|
// 充值卡标题
|
|
79
79
|
&-title {
|
|
80
80
|
color: var(--Gray-900, #101828);
|
|
81
|
-
|
|
82
|
-
/* Text xl/Semibold */
|
|
83
81
|
font-family: Inter;
|
|
84
82
|
font-size: 20px;
|
|
85
83
|
font-style: normal;
|
|
86
84
|
font-weight: 600;
|
|
87
|
-
line-height: 30px;
|
|
88
|
-
margin: 20px
|
|
85
|
+
line-height: 30px;
|
|
86
|
+
margin-top: 20px;
|
|
87
|
+
margin-bottom: 24px;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
// 钱包卡片样式
|
|
@@ -125,7 +125,7 @@ var Voucher = (0, import_model.Provider)((props) => {
|
|
|
125
125
|
modalWrapStyle: {
|
|
126
126
|
overflowY: "auto",
|
|
127
127
|
top: 68,
|
|
128
|
-
height: "calc(
|
|
128
|
+
height: "calc(100% - 68px)",
|
|
129
129
|
zIndex: 998
|
|
130
130
|
},
|
|
131
131
|
pcDetailModalDisplay: platform === "h5" ? true : false,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
.wallet-voucher-title {
|
|
2
2
|
color: var(--Gray-900, #101828);
|
|
3
|
-
|
|
4
|
-
/* Text xl/Semibold */
|
|
5
3
|
font-family: Inter;
|
|
6
4
|
font-size: 20px;
|
|
7
5
|
font-style: normal;
|
|
8
6
|
font-weight: 600;
|
|
9
|
-
line-height: 30px;
|
|
10
|
-
margin: 20px
|
|
7
|
+
line-height: 30px;
|
|
8
|
+
margin-top: 20px;
|
|
9
|
+
margin-bottom: 24px;
|
|
11
10
|
}
|
|
@@ -33,14 +33,15 @@ __export(WalletBar_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(WalletBar_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var
|
|
36
|
+
var import_materials = require("@pisell/materials");
|
|
37
37
|
var import_utils = require("@pisell/utils");
|
|
38
38
|
var import_index = require("./index.less");
|
|
39
39
|
var WalletBar = ({ setup, onBack }) => {
|
|
40
40
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-wallet-bar" }, /* @__PURE__ */ import_react.default.createElement(
|
|
41
|
-
|
|
41
|
+
import_materials.Iconfont,
|
|
42
42
|
{
|
|
43
43
|
onClick: onBack,
|
|
44
|
+
type: "pisell2-chevron-left",
|
|
44
45
|
className: "pisell-lowcode-wallet-header-bar-arrow"
|
|
45
46
|
}
|
|
46
47
|
), /* @__PURE__ */ import_react.default.createElement("span", { className: "header-title" }, setup === "detail" ? import_utils.locales.getText("page.wallet.details") : ""));
|
|
@@ -476,11 +476,12 @@ var Wallet = (0, import_model.Provider)(() => {
|
|
|
476
476
|
const getAddModalClassName = () => {
|
|
477
477
|
return addModalOpen ? "wallet-add-modal" : "pisell-lowcode__wallet__addModal";
|
|
478
478
|
};
|
|
479
|
-
return /* @__PURE__ */ import_react.default.createElement(import_DetailContext.DetailProvider, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-container"
|
|
479
|
+
return /* @__PURE__ */ import_react.default.createElement(import_DetailContext.DetailProvider, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-container", style: { height: "100%" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
480
480
|
"div",
|
|
481
481
|
{
|
|
482
482
|
className: "pisell-lowcode-wallet",
|
|
483
483
|
style: {
|
|
484
|
+
height: platform === "pc" ? "auto" : "100%",
|
|
484
485
|
width: platform === "pc" ? 960 : "100vw",
|
|
485
486
|
padding: platform === "pc" ? 20 : 0
|
|
486
487
|
}
|
|
@@ -525,7 +526,7 @@ var Wallet = (0, import_model.Provider)(() => {
|
|
|
525
526
|
}
|
|
526
527
|
}
|
|
527
528
|
), searchList.map((item) => renderSearchCard(item)))
|
|
528
|
-
)))
|
|
529
|
+
)));
|
|
529
530
|
});
|
|
530
531
|
var wallet_default = Wallet;
|
|
531
532
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
.pisell-lowcode-wallet-mobile {
|
|
36
36
|
display: flex;
|
|
37
|
-
height:
|
|
37
|
+
height: 100%;
|
|
38
38
|
width: 100vw;
|
|
39
39
|
flex-direction: column;
|
|
40
40
|
background-color: #fff;
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
.pisell-lowcode-wallet-header-bar-arrow {
|
|
64
64
|
position: absolute;
|
|
65
65
|
font-size: 24px;
|
|
66
|
-
top:
|
|
67
|
-
left:
|
|
66
|
+
top: 22px;
|
|
67
|
+
left: 22px;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -88,6 +88,12 @@
|
|
|
88
88
|
border-right: none;
|
|
89
89
|
}
|
|
90
90
|
.pisell-lowcode-wallet-title {
|
|
91
|
+
color: var(--Gray-900, #101828);
|
|
92
|
+
font-family: Inter;
|
|
93
|
+
font-size: 30px;
|
|
94
|
+
font-style: normal;
|
|
95
|
+
font-weight: 600;
|
|
96
|
+
line-height: 38px;
|
|
91
97
|
margin: 20px 0;
|
|
92
98
|
}
|
|
93
99
|
|
|
@@ -42,8 +42,25 @@ var import_utils = require("@pisell/utils");
|
|
|
42
42
|
var import_utils2 = require("./../../utils");
|
|
43
43
|
var import_index = require("./index.less");
|
|
44
44
|
var import_classnames = __toESM(require("classnames"));
|
|
45
|
-
var import_antd = require("antd");
|
|
46
45
|
var import_types = require("./types");
|
|
46
|
+
var STORAGE_KEY = "pisell_wallet_list_data";
|
|
47
|
+
var STORAGE_KEY_BALANCE = "pisell_wallet_balance_data";
|
|
48
|
+
var saveToLocalStorage = (key, data) => {
|
|
49
|
+
try {
|
|
50
|
+
localStorage.setItem(key, JSON.stringify(data));
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error("Error saving to localStorage:", error);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var getFromLocalStorage = (key) => {
|
|
56
|
+
try {
|
|
57
|
+
const data = localStorage.getItem(key);
|
|
58
|
+
return data ? JSON.parse(data) : null;
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error("Error reading from localStorage:", error);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
47
64
|
var getLocalizedName = (name, translateLocale) => {
|
|
48
65
|
if (!name) return "";
|
|
49
66
|
return name[translateLocale || "en"] || name.original || "";
|
|
@@ -55,7 +72,7 @@ var DEFAULT_WALLET_CARD = {
|
|
|
55
72
|
name: "Store name"
|
|
56
73
|
},
|
|
57
74
|
isLogin: false,
|
|
58
|
-
showIcon:
|
|
75
|
+
showIcon: true,
|
|
59
76
|
icon: "",
|
|
60
77
|
wallet: {
|
|
61
78
|
name: {
|
|
@@ -230,14 +247,29 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
230
247
|
return;
|
|
231
248
|
}
|
|
232
249
|
if (hasAttempted) return;
|
|
233
|
-
|
|
250
|
+
const cachedList = getFromLocalStorage(STORAGE_KEY);
|
|
251
|
+
const cachedBalance = getFromLocalStorage(STORAGE_KEY_BALANCE);
|
|
252
|
+
if (cachedList && cachedBalance) {
|
|
253
|
+
setState({
|
|
254
|
+
list: cachedList,
|
|
255
|
+
balance: cachedBalance,
|
|
256
|
+
loading: false,
|
|
257
|
+
hasAttempted: false
|
|
258
|
+
});
|
|
259
|
+
}
|
|
234
260
|
try {
|
|
235
261
|
if (!isMountedRef.current) return;
|
|
236
262
|
const [walletListData, walletBalanceData] = await Promise.all([
|
|
237
|
-
(0, import_serve.getWalletList)(
|
|
263
|
+
(0, import_serve.getWalletList)(),
|
|
238
264
|
(0, import_serve.getWalletBalance)()
|
|
239
265
|
]);
|
|
240
266
|
if (!isMountedRef.current || requestIdRef.current !== requestId) return;
|
|
267
|
+
if (walletListData && walletListData.length > 0) {
|
|
268
|
+
saveToLocalStorage(STORAGE_KEY, walletListData);
|
|
269
|
+
}
|
|
270
|
+
if (walletBalanceData) {
|
|
271
|
+
saveToLocalStorage(STORAGE_KEY_BALANCE, walletBalanceData);
|
|
272
|
+
}
|
|
241
273
|
if (!walletBalanceData || Array.isArray(walletListData) && walletListData.length === 0) {
|
|
242
274
|
setTimeout(async () => {
|
|
243
275
|
if (!isMountedRef.current || requestIdRef.current !== requestId) return;
|
|
@@ -246,14 +278,19 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
246
278
|
let retryListData = walletListData;
|
|
247
279
|
if (!walletBalanceData) {
|
|
248
280
|
retryBalanceData = await (0, import_serve.getWalletBalance)();
|
|
281
|
+
if (retryBalanceData) {
|
|
282
|
+
saveToLocalStorage(STORAGE_KEY_BALANCE, retryBalanceData);
|
|
283
|
+
}
|
|
249
284
|
}
|
|
250
285
|
if (Array.isArray(walletListData) && walletListData.length === 0) {
|
|
251
286
|
retryListData = await (0, import_serve.getWalletList)({});
|
|
287
|
+
if (retryListData && retryListData.length > 0) {
|
|
288
|
+
saveToLocalStorage(STORAGE_KEY, retryListData);
|
|
289
|
+
}
|
|
252
290
|
}
|
|
253
291
|
setState({
|
|
254
292
|
list: retryListData || [],
|
|
255
293
|
balance: retryBalanceData,
|
|
256
|
-
// 使用重试后的结果
|
|
257
294
|
loading: false,
|
|
258
295
|
hasAttempted: true
|
|
259
296
|
});
|
|
@@ -396,21 +433,6 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
396
433
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-balance-card", key: balance.id }, /* @__PURE__ */ import_react.default.createElement("div", { className: "balance-card-header" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "balance-card-title" }, balance.name), /* @__PURE__ */ import_react.default.createElement("div", { className: "balance-card-value" }, balance.value)), /* @__PURE__ */ import_react.default.createElement("div", { className: "balance-card-content" }, balance.items && balance.items.map((item) => /* @__PURE__ */ import_react.default.createElement("div", { className: "balance-item", key: item.key }, /* @__PURE__ */ import_react.default.createElement("div", { className: "balance-item-label" }, item.label), /* @__PURE__ */ import_react.default.createElement("div", { className: "balance-item-value" }, item.value)))));
|
|
397
434
|
}, []);
|
|
398
435
|
const renderContent = () => {
|
|
399
|
-
if (loading) {
|
|
400
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-wallet-list-container pisell-wallet-skeleton" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-card-skeleton" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { active: true, paragraph: { rows: 6 } }), /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-card-code-skeleton" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton.Button, { active: true, style: { width: "80%", height: 50 } })))), /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-navigation-skeleton" }, /* @__PURE__ */ import_react.default.createElement(
|
|
401
|
-
import_antd.Skeleton.Button,
|
|
402
|
-
{
|
|
403
|
-
active: true,
|
|
404
|
-
style: { width: 40, height: 40, borderRadius: "50%" }
|
|
405
|
-
}
|
|
406
|
-
), /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-dots-container-skeleton" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton.Button, { active: true, style: { width: 80, height: 20 } })), /* @__PURE__ */ import_react.default.createElement(
|
|
407
|
-
import_antd.Skeleton.Button,
|
|
408
|
-
{
|
|
409
|
-
active: true,
|
|
410
|
-
style: { width: 40, height: 40, borderRadius: "50%" }
|
|
411
|
-
}
|
|
412
|
-
)));
|
|
413
|
-
}
|
|
414
436
|
if (list.length === 0) {
|
|
415
437
|
return null;
|
|
416
438
|
}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { WalletPass, WalletBalance
|
|
1
|
+
import { WalletPass, WalletBalance } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* 获取 wallet 列表
|
|
4
4
|
* @param params
|
|
5
5
|
* @returns
|
|
6
6
|
*/
|
|
7
|
-
export declare const getWalletList: (
|
|
8
|
-
/**
|
|
9
|
-
* 获取wallet pass 余额
|
|
10
|
-
*/
|
|
11
|
-
export declare const getWalletPassBalance: (params?: Record<string, any>) => Promise<WalletBalance | null>;
|
|
7
|
+
export declare const getWalletList: () => Promise<WalletPass[]>;
|
|
12
8
|
/**
|
|
13
9
|
* 获取钱包余额
|
|
14
10
|
* @returns
|
|
@@ -20,27 +20,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var serve_exports = {};
|
|
21
21
|
__export(serve_exports, {
|
|
22
22
|
getWalletBalance: () => getWalletBalance,
|
|
23
|
-
getWalletList: () => getWalletList
|
|
24
|
-
getWalletPassBalance: () => getWalletPassBalance
|
|
23
|
+
getWalletList: () => getWalletList
|
|
25
24
|
});
|
|
26
25
|
module.exports = __toCommonJS(serve_exports);
|
|
27
26
|
var import_utils = require("./../../utils");
|
|
28
|
-
var getWalletList = async (
|
|
27
|
+
var getWalletList = async () => {
|
|
29
28
|
try {
|
|
30
|
-
const { data } = await import_utils.request.getRequest().get("/h5/wallet",
|
|
29
|
+
const { data } = await import_utils.request.getRequest().get("/h5/wallet", {});
|
|
31
30
|
return data || [];
|
|
32
31
|
} catch (error) {
|
|
33
32
|
return [];
|
|
34
33
|
}
|
|
35
34
|
};
|
|
36
|
-
var getWalletPassBalance = async (params = {}) => {
|
|
37
|
-
try {
|
|
38
|
-
const { data } = await import_utils.request.getRequest().get(`/h5/wallet/wallet-pass/balance`, params);
|
|
39
|
-
return data || null;
|
|
40
|
-
} catch (error) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
35
|
var getWalletBalance = async () => {
|
|
45
36
|
try {
|
|
46
37
|
const { data } = await import_utils.request.getRequest().get("/h5/wallet/wallet-pass/balance", {});
|
|
@@ -52,6 +43,5 @@ var getWalletBalance = async () => {
|
|
|
52
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
53
44
|
0 && (module.exports = {
|
|
54
45
|
getWalletBalance,
|
|
55
|
-
getWalletList
|
|
56
|
-
getWalletPassBalance
|
|
46
|
+
getWalletList
|
|
57
47
|
});
|
|
@@ -163,7 +163,7 @@ export declare const DEFAULT_CARD_CONFIG: {
|
|
|
163
163
|
readonly codeDirection: "bottom";
|
|
164
164
|
readonly showShopName: true;
|
|
165
165
|
readonly showWalletName: true;
|
|
166
|
-
readonly showIcon:
|
|
166
|
+
readonly showIcon: true;
|
|
167
167
|
readonly iconImg: "";
|
|
168
168
|
readonly showCardNo: true;
|
|
169
169
|
readonly showCode: true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"react-infinite-scroll-component": "^6.1.0",
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
|
-
"@pisell/materials": "3.2.
|
|
62
|
+
"@pisell/materials": "3.2.6",
|
|
63
|
+
"@pisell/icon": "0.0.11",
|
|
63
64
|
"@pisell/date-picker": "1.0.100",
|
|
64
|
-
"@pisell/utils": "1.0.42"
|
|
65
|
-
"@pisell/icon": "0.0.11"
|
|
65
|
+
"@pisell/utils": "1.0.42"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0",
|