@pisell/private-materials 3.2.3 → 3.2.5
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/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 +78 -85
- package/es/components/walletList/serve.d.ts +2 -6
- package/es/components/walletList/serve.js +17 -52
- 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 +43 -20
- package/lib/components/walletList/serve.d.ts +2 -6
- package/lib/components/walletList/serve.js +4 -14
- package/package.json +4 -4
|
@@ -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
|
});
|
|
@@ -323,6 +360,7 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
323
360
|
// 再应用globalState作为兜底
|
|
324
361
|
...globalState,
|
|
325
362
|
// 最后应用API返回的数据,这些拥有最高优先级
|
|
363
|
+
iconImg: icon,
|
|
326
364
|
symbol,
|
|
327
365
|
cardNo: code,
|
|
328
366
|
walletName: getLocalizedName(name, (_a2 = dvaStore == null ? void 0 : dvaStore.core) == null ? void 0 : _a2.translateLocale),
|
|
@@ -395,21 +433,6 @@ var WalletList = (0, import_model.Provider)((props) => {
|
|
|
395
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)))));
|
|
396
434
|
}, []);
|
|
397
435
|
const renderContent = () => {
|
|
398
|
-
if (loading) {
|
|
399
|
-
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(
|
|
400
|
-
import_antd.Skeleton.Button,
|
|
401
|
-
{
|
|
402
|
-
active: true,
|
|
403
|
-
style: { width: 40, height: 40, borderRadius: "50%" }
|
|
404
|
-
}
|
|
405
|
-
), /* @__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(
|
|
406
|
-
import_antd.Skeleton.Button,
|
|
407
|
-
{
|
|
408
|
-
active: true,
|
|
409
|
-
style: { width: 40, height: 40, borderRadius: "50%" }
|
|
410
|
-
}
|
|
411
|
-
)));
|
|
412
|
-
}
|
|
413
436
|
if (list.length === 0) {
|
|
414
437
|
return null;
|
|
415
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
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.5",
|
|
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/
|
|
62
|
+
"@pisell/utils": "1.0.42",
|
|
63
|
+
"@pisell/materials": "3.2.5",
|
|
63
64
|
"@pisell/icon": "0.0.11",
|
|
64
|
-
"@pisell/date-picker": "1.0.100"
|
|
65
|
-
"@pisell/utils": "1.0.42"
|
|
65
|
+
"@pisell/date-picker": "1.0.100"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0",
|