@pisell/materials 1.0.643 → 1.0.645
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +16 -16
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +17 -17
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +1 -1
- package/es/components/pisellAnchor/PisellAnchor.d.ts +14 -0
- package/es/components/pisellAnchor/PisellAnchor.js +18 -0
- package/es/components/pisellAnchor/index.less +8 -0
- package/es/components/pisellNavigationMenu/PisellNavigationMenu.js +20 -7
- package/es/components/pisellNavigationMenu/types.d.ts +4 -0
- package/es/components/walletCard/index.d.ts +45 -7
- package/es/components/walletCard/index.js +190 -137
- package/es/components/walletCard/index.less +138 -105
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/locales/en-US.d.ts +1 -1
- package/es/locales/en-US.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +1 -1
- package/lib/components/pisellAnchor/PisellAnchor.d.ts +14 -0
- package/lib/components/pisellAnchor/PisellAnchor.js +35 -0
- package/lib/components/pisellAnchor/index.less +8 -0
- package/lib/components/pisellNavigationMenu/PisellNavigationMenu.js +15 -4
- package/lib/components/pisellNavigationMenu/types.d.ts +4 -0
- package/lib/components/walletCard/index.d.ts +45 -7
- package/lib/components/walletCard/index.js +122 -149
- package/lib/components/walletCard/index.less +138 -105
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/locales/en-US.d.ts +1 -1
- package/lib/locales/en-US.js +1 -1
- package/lowcode/wallet-card/meta.ts +3 -3
- package/package.json +11 -9
- package/build/lowcode/assets/6fc685dd528aab5ce3c42c88eaec2905.png +0 -0
- package/build/lowcode/assets/7116b3b05dcdff1d0dd3116cd1c96995.png +0 -0
- package/build/lowcode/render/default/assets/6fc685dd528aab5ce3c42c88eaec2905.png +0 -0
- package/build/lowcode/render/default/assets/7116b3b05dcdff1d0dd3116cd1c96995.png +0 -0
- package/es/components/walletCard/img/wallet_bg_black.png +0 -0
- package/es/components/walletCard/img/wallet_bg_white.png +0 -0
- package/lib/components/walletCard/img/wallet_bg_black.png +0 -0
- package/lib/components/walletCard/img/wallet_bg_white.png +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ModeType } from '../../type';
|
|
3
3
|
export interface FormSettingContextType {
|
|
4
|
-
onDataSourceFinish?: (values: any, result: any) => void;
|
|
4
|
+
onDataSourceFinish?: (values: any, result: any, form: any) => void;
|
|
5
5
|
renderMode?: ModeType;
|
|
6
6
|
groupInfoPosition?: 'top' | 'side';
|
|
7
7
|
children?: React.ReactNode;
|
|
@@ -155,7 +155,7 @@ var SubmitButton = function SubmitButton(props) {
|
|
|
155
155
|
result = _context2.sent;
|
|
156
156
|
// 数据源提交成功
|
|
157
157
|
if (onDataSourceFinish) {
|
|
158
|
-
onDataSourceFinish(formattedValues, result);
|
|
158
|
+
onDataSourceFinish(formattedValues, result, form);
|
|
159
159
|
}
|
|
160
160
|
if (refreshData) {
|
|
161
161
|
refreshTableData === null || refreshTableData === void 0 ? void 0 : refreshTableData();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface PisellAnchorProps {
|
|
3
|
+
options: {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}[];
|
|
7
|
+
tab?: string;
|
|
8
|
+
containerRef?: any;
|
|
9
|
+
onChange?: (key: string) => void;
|
|
10
|
+
onTabClick?: () => void;
|
|
11
|
+
hideBorder?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const PisellAnchor: React.FC<PisellAnchorProps>;
|
|
14
|
+
export default PisellAnchor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var PisellAnchor = function PisellAnchor(_ref) {
|
|
2
|
+
var _ref$options = _ref.options,
|
|
3
|
+
options = _ref$options === void 0 ? [] : _ref$options,
|
|
4
|
+
tab = _ref.tab,
|
|
5
|
+
containerRef = _ref.containerRef,
|
|
6
|
+
onChange = _ref.onChange,
|
|
7
|
+
onTabClick = _ref.onTabClick,
|
|
8
|
+
_ref$hideBorder = _ref.hideBorder,
|
|
9
|
+
hideBorder = _ref$hideBorder === void 0 ? false : _ref$hideBorder;
|
|
10
|
+
// ... existing code ...
|
|
11
|
+
|
|
12
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: classNames('pisell-anchor', {
|
|
14
|
+
'pisell-anchor-no-border': hideBorder
|
|
15
|
+
})
|
|
16
|
+
}, "// ... existing code ...");
|
|
17
|
+
};
|
|
18
|
+
export default PisellAnchor;
|
|
@@ -76,7 +76,12 @@ var PisellNavigationMenu = function PisellNavigationMenu(_ref) {
|
|
|
76
76
|
_item$allowDelete = item.allowDelete,
|
|
77
77
|
allowDelete = _item$allowDelete === void 0 ? true : _item$allowDelete,
|
|
78
78
|
_item$allowAddChild = item.allowAddChild,
|
|
79
|
-
allowAddChild = _item$allowAddChild === void 0 ? true : _item$allowAddChild
|
|
79
|
+
allowAddChild = _item$allowAddChild === void 0 ? true : _item$allowAddChild,
|
|
80
|
+
_item$allowAddSubmenu = item.allowAddSubmenu,
|
|
81
|
+
allowAddSubmenu = _item$allowAddSubmenu === void 0 ? true : _item$allowAddSubmenu,
|
|
82
|
+
_item$allowAddPage = item.allowAddPage,
|
|
83
|
+
allowAddPage = _item$allowAddPage === void 0 ? true : _item$allowAddPage;
|
|
84
|
+
var isShowAddButton = item.isGroup && allowAddChild && (allowAddSubmenu || allowAddPage);
|
|
80
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
81
86
|
className: "pisell-lowcode-navigation-menu-item"
|
|
82
87
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -106,13 +111,21 @@ var PisellNavigationMenu = function PisellNavigationMenu(_ref) {
|
|
|
106
111
|
type: "pisell2-edit-05",
|
|
107
112
|
className: "pisell-lowcode-navigation-menu-item-action-button-icon"
|
|
108
113
|
})
|
|
109
|
-
}),
|
|
114
|
+
}), isShowAddButton && /*#__PURE__*/React.createElement(Dropdown, {
|
|
110
115
|
menu: {
|
|
111
|
-
items:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
items: [allowAddSubmenu && {
|
|
117
|
+
key: 'add-child',
|
|
118
|
+
label: getText('pisell-lowcode-navigation-menu-add-sub-menu'),
|
|
119
|
+
onClick: function onClick() {
|
|
120
|
+
return handleClick('add-child', item);
|
|
121
|
+
}
|
|
122
|
+
}, allowAddPage && {
|
|
123
|
+
key: 'add-page',
|
|
124
|
+
label: getText('pisell-lowcode-navigation-menu-add-page'),
|
|
125
|
+
onClick: function onClick() {
|
|
126
|
+
return handleClick('add-page', item);
|
|
127
|
+
}
|
|
128
|
+
}].filter(Boolean)
|
|
116
129
|
}
|
|
117
130
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
118
131
|
type: "text",
|
|
@@ -1,29 +1,67 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.less';
|
|
3
|
+
declare global {
|
|
4
|
+
namespace JSX {
|
|
5
|
+
interface IntrinsicElements {
|
|
6
|
+
[elemName: string]: any;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
interface WalletCardItem {
|
|
11
|
+
key: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
value?: number;
|
|
15
|
+
}
|
|
3
16
|
interface WalletCardProps {
|
|
17
|
+
/** 二维码弹窗适配平台 */
|
|
4
18
|
platform?: 'pc' | 'h5' | 'ipad';
|
|
19
|
+
/** 卡片主题 */
|
|
5
20
|
mode?: 'dark' | 'light';
|
|
21
|
+
/** 默认还是完整显示code */
|
|
6
22
|
cardStyle?: 'normal' | 'full';
|
|
7
|
-
|
|
23
|
+
/** 条形码还是二维码 */
|
|
24
|
+
codeType?: 'barCode' | 'orCode';
|
|
25
|
+
/** 二维码方向 */
|
|
8
26
|
codeDirection?: 'bottom' | 'top';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
27
|
+
/** 图标 */
|
|
28
|
+
icon?: React.ReactNode;
|
|
29
|
+
/** 钱包名称 */
|
|
30
|
+
walletName?: string;
|
|
31
|
+
/** 店铺名称 */
|
|
32
|
+
shopName?: string;
|
|
33
|
+
/** 是否显示店铺名称 */
|
|
34
|
+
isShowShopName?: boolean;
|
|
35
|
+
/** 卡号 */
|
|
13
36
|
cardNo?: string;
|
|
37
|
+
/** 是否显示卡号 */
|
|
14
38
|
isShowCardNo?: boolean;
|
|
39
|
+
/** 是否显示二维码 */
|
|
15
40
|
showCode?: boolean;
|
|
41
|
+
/** 是否显示积分卡信息 */
|
|
16
42
|
points?: boolean;
|
|
43
|
+
/** 是否显示余额信息 */
|
|
17
44
|
balance?: boolean;
|
|
45
|
+
/** 是否显示折扣信息 */
|
|
18
46
|
coupon?: boolean;
|
|
47
|
+
/** 是否显示优惠券数量 */
|
|
19
48
|
isShowVouCher?: boolean;
|
|
49
|
+
/** 是否显示折扣卡数量 */
|
|
20
50
|
isShowDiscountCard?: boolean;
|
|
51
|
+
/** 积分卡金额 */
|
|
21
52
|
pointsValue?: number;
|
|
53
|
+
/** 余额 */
|
|
22
54
|
balanceValue?: number;
|
|
55
|
+
/** 优惠券金额 */
|
|
23
56
|
couponValue?: number;
|
|
57
|
+
/** 优惠券金额 */
|
|
24
58
|
vouCherValue?: number;
|
|
59
|
+
/** 折扣卡金额 */
|
|
25
60
|
discountCardValue?: number;
|
|
26
|
-
|
|
61
|
+
/** 卡片内容项 */
|
|
62
|
+
items: WalletCardItem[];
|
|
63
|
+
/** 点击二维码/条形码的回调 */
|
|
64
|
+
onCodeClick?: () => void;
|
|
27
65
|
}
|
|
28
|
-
declare const WalletCard:
|
|
66
|
+
declare const WalletCard: React.FC<WalletCardProps>;
|
|
29
67
|
export default WalletCard;
|
|
@@ -4,80 +4,114 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
5
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, {
|
|
8
|
-
import { Card,
|
|
7
|
+
import React, { useState, useMemo } from 'react';
|
|
8
|
+
import { Card, QRCode, Divider, Button } from 'antd';
|
|
9
9
|
import Iconfont from "./../iconfont";
|
|
10
|
-
import useEngineContext from "../../hooks/useEngineContext";
|
|
11
10
|
import Barcode from 'react-barcode';
|
|
12
11
|
import Amount from "./../pisellText/components/Amount";
|
|
13
|
-
import "./index.less";
|
|
14
12
|
import PisellModal from "./../pisellModal";
|
|
15
13
|
import classNames from 'classnames';
|
|
16
14
|
import { getText } from "../../locales/index";
|
|
17
|
-
import
|
|
18
|
-
|
|
15
|
+
import "./index.less";
|
|
16
|
+
// 默认值
|
|
17
|
+
var DEFAULT_PROPS = {
|
|
18
|
+
mode: 'dark',
|
|
19
|
+
cardStyle: 'normal',
|
|
20
|
+
codeType: 'barCode',
|
|
21
|
+
platform: 'pc',
|
|
22
|
+
codeDirection: 'bottom',
|
|
23
|
+
isShowShopName: true,
|
|
24
|
+
isShowCardNo: true,
|
|
25
|
+
showCode: true,
|
|
26
|
+
walletName: '',
|
|
27
|
+
points: true,
|
|
28
|
+
balance: true,
|
|
29
|
+
coupon: true,
|
|
30
|
+
isShowVouCher: true,
|
|
31
|
+
isShowDiscountCard: true,
|
|
32
|
+
pointsValue: 0,
|
|
33
|
+
balanceValue: 0,
|
|
34
|
+
vouCherValue: 0,
|
|
35
|
+
couponValue: 0,
|
|
36
|
+
discountCardValue: 0,
|
|
37
|
+
items: []
|
|
38
|
+
};
|
|
19
39
|
var WalletCard = function WalletCard(props) {
|
|
20
|
-
var _context$appHelper;
|
|
21
40
|
var _props$mode = props.mode,
|
|
22
|
-
mode = _props$mode === void 0 ?
|
|
41
|
+
mode = _props$mode === void 0 ? DEFAULT_PROPS.mode : _props$mode,
|
|
23
42
|
_props$cardStyle = props.cardStyle,
|
|
24
|
-
cardStyle = _props$cardStyle === void 0 ?
|
|
43
|
+
cardStyle = _props$cardStyle === void 0 ? DEFAULT_PROPS.cardStyle : _props$cardStyle,
|
|
25
44
|
_props$codeType = props.codeType,
|
|
26
|
-
codeType = _props$codeType === void 0 ?
|
|
27
|
-
_props$
|
|
28
|
-
|
|
29
|
-
_props$
|
|
30
|
-
|
|
45
|
+
codeType = _props$codeType === void 0 ? DEFAULT_PROPS.codeType : _props$codeType,
|
|
46
|
+
_props$platform = props.platform,
|
|
47
|
+
platform = _props$platform === void 0 ? DEFAULT_PROPS.platform : _props$platform,
|
|
48
|
+
_props$codeDirection = props.codeDirection,
|
|
49
|
+
codeDirection = _props$codeDirection === void 0 ? DEFAULT_PROPS.codeDirection : _props$codeDirection,
|
|
50
|
+
icon = props.icon,
|
|
51
|
+
_props$walletName = props.walletName,
|
|
52
|
+
walletName = _props$walletName === void 0 ? DEFAULT_PROPS.walletName : _props$walletName,
|
|
31
53
|
_props$shopName = props.shopName,
|
|
32
|
-
shopName = _props$shopName === void 0 ? '
|
|
54
|
+
shopName = _props$shopName === void 0 ? '' : _props$shopName,
|
|
33
55
|
_props$isShowShopName = props.isShowShopName,
|
|
34
|
-
isShowShopName = _props$isShowShopName === void 0 ?
|
|
35
|
-
_props$pointsValue = props.pointsValue,
|
|
36
|
-
pointsValue = _props$pointsValue === void 0 ? 0 : _props$pointsValue,
|
|
37
|
-
_props$balanceValue = props.balanceValue,
|
|
38
|
-
balanceValue = _props$balanceValue === void 0 ? 0 : _props$balanceValue,
|
|
39
|
-
_props$vouCherValue = props.vouCherValue,
|
|
40
|
-
vouCherValue = _props$vouCherValue === void 0 ? 0 : _props$vouCherValue,
|
|
41
|
-
_props$couponValue = props.couponValue,
|
|
42
|
-
couponValue = _props$couponValue === void 0 ? 0 : _props$couponValue,
|
|
43
|
-
_props$discountCardVa = props.discountCardValue,
|
|
44
|
-
discountCardValue = _props$discountCardVa === void 0 ? 0 : _props$discountCardVa,
|
|
56
|
+
isShowShopName = _props$isShowShopName === void 0 ? DEFAULT_PROPS.isShowShopName : _props$isShowShopName,
|
|
45
57
|
_props$cardNo = props.cardNo,
|
|
46
58
|
cardNo = _props$cardNo === void 0 ? '' : _props$cardNo,
|
|
47
59
|
_props$isShowCardNo = props.isShowCardNo,
|
|
48
|
-
isShowCardNo = _props$isShowCardNo === void 0 ?
|
|
49
|
-
_props$codeDirection = props.codeDirection,
|
|
50
|
-
codeDirection = _props$codeDirection === void 0 ? 'bottom' : _props$codeDirection,
|
|
60
|
+
isShowCardNo = _props$isShowCardNo === void 0 ? DEFAULT_PROPS.isShowCardNo : _props$isShowCardNo,
|
|
51
61
|
_props$showCode = props.showCode,
|
|
52
|
-
showCode = _props$showCode === void 0 ?
|
|
62
|
+
showCode = _props$showCode === void 0 ? DEFAULT_PROPS.showCode : _props$showCode,
|
|
53
63
|
_props$points = props.points,
|
|
54
|
-
points = _props$points === void 0 ?
|
|
64
|
+
points = _props$points === void 0 ? DEFAULT_PROPS.points : _props$points,
|
|
55
65
|
_props$balance = props.balance,
|
|
56
|
-
balance = _props$balance === void 0 ?
|
|
66
|
+
balance = _props$balance === void 0 ? DEFAULT_PROPS.balance : _props$balance,
|
|
57
67
|
_props$coupon = props.coupon,
|
|
58
|
-
coupon = _props$coupon === void 0 ?
|
|
59
|
-
_props$
|
|
60
|
-
|
|
68
|
+
coupon = _props$coupon === void 0 ? DEFAULT_PROPS.coupon : _props$coupon,
|
|
69
|
+
_props$isShowVouCher = props.isShowVouCher,
|
|
70
|
+
isShowVouCher = _props$isShowVouCher === void 0 ? DEFAULT_PROPS.isShowVouCher : _props$isShowVouCher,
|
|
61
71
|
_props$isShowDiscount = props.isShowDiscountCard,
|
|
62
|
-
isShowDiscountCard = _props$isShowDiscount === void 0 ?
|
|
63
|
-
_props$
|
|
64
|
-
|
|
72
|
+
isShowDiscountCard = _props$isShowDiscount === void 0 ? DEFAULT_PROPS.isShowDiscountCard : _props$isShowDiscount,
|
|
73
|
+
_props$pointsValue = props.pointsValue,
|
|
74
|
+
pointsValue = _props$pointsValue === void 0 ? DEFAULT_PROPS.pointsValue : _props$pointsValue,
|
|
75
|
+
_props$balanceValue = props.balanceValue,
|
|
76
|
+
balanceValue = _props$balanceValue === void 0 ? DEFAULT_PROPS.balanceValue : _props$balanceValue,
|
|
77
|
+
_props$vouCherValue = props.vouCherValue,
|
|
78
|
+
vouCherValue = _props$vouCherValue === void 0 ? DEFAULT_PROPS.vouCherValue : _props$vouCherValue,
|
|
79
|
+
_props$couponValue = props.couponValue,
|
|
80
|
+
couponValue = _props$couponValue === void 0 ? DEFAULT_PROPS.couponValue : _props$couponValue,
|
|
81
|
+
_props$discountCardVa = props.discountCardValue,
|
|
82
|
+
discountCardValue = _props$discountCardVa === void 0 ? DEFAULT_PROPS.discountCardValue : _props$discountCardVa,
|
|
65
83
|
_props$items = props.items,
|
|
66
|
-
items = _props$items === void 0 ?
|
|
67
|
-
|
|
84
|
+
items = _props$items === void 0 ? DEFAULT_PROPS.items : _props$items,
|
|
85
|
+
onCodeClick = props.onCodeClick;
|
|
68
86
|
var _useState = useState(false),
|
|
69
87
|
_useState2 = _slicedToArray(_useState, 2),
|
|
70
88
|
isModalOpen = _useState2[0],
|
|
71
|
-
setIsModalOpen = _useState2[1];
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
89
|
+
setIsModalOpen = _useState2[1];
|
|
90
|
+
|
|
91
|
+
// 处理二维码点击
|
|
92
|
+
var handleCodeClick = function handleCodeClick(e) {
|
|
93
|
+
e.stopPropagation();
|
|
94
|
+
if (onCodeClick) {
|
|
95
|
+
onCodeClick();
|
|
96
|
+
} else {
|
|
97
|
+
setIsModalOpen(true);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// 添加按钮点击处理函数
|
|
102
|
+
var handleButtonClick = function handleButtonClick(e) {
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
setIsModalOpen(false);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// 渲染二维码/条形码
|
|
108
|
+
var renderCode = useMemo(function () {
|
|
109
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: "pisell-wallet-card-code",
|
|
111
|
+
style: {
|
|
112
|
+
textAlign: 'center'
|
|
113
|
+
}
|
|
114
|
+
}, codeType === 'barCode' ? /*#__PURE__*/React.createElement(Barcode, {
|
|
81
115
|
value: cardNo,
|
|
82
116
|
height: 114,
|
|
83
117
|
width: 3
|
|
@@ -86,101 +120,120 @@ var WalletCard = function WalletCard(props) {
|
|
|
86
120
|
value: cardNo,
|
|
87
121
|
bordered: false
|
|
88
122
|
}));
|
|
123
|
+
}, [cardNo, codeType]);
|
|
124
|
+
|
|
125
|
+
// 渲染卡片头部
|
|
126
|
+
var renderHeader = function renderHeader() {
|
|
127
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
128
|
+
className: classNames('pisell-wallet-card-header')
|
|
129
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
130
|
+
className: classNames('pisell-wallet-card-header-left')
|
|
131
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
className: classNames('pisell-wallet-card-header-level')
|
|
133
|
+
}, icon && /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
className: "pisell-wallet-card-header-icon"
|
|
135
|
+
}, icon), walletName && /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
className: classNames('pisell-wallet-card-header-level-text')
|
|
137
|
+
}, walletName)), isShowShopName && shopName && /*#__PURE__*/React.createElement("div", null, shopName), isShowCardNo && cardNo && /*#__PURE__*/React.createElement("div", null, cardNo)), /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
className: classNames('pisell-wallet-card-header-right')
|
|
139
|
+
}, showCode && cardStyle === 'normal' && /*#__PURE__*/React.createElement("div", {
|
|
140
|
+
className: classNames('pisell-wallet-card-icon-wrapper'),
|
|
141
|
+
onClick: handleCodeClick
|
|
142
|
+
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
143
|
+
type: codeType === 'barCode' ? 'pisell2-Barcode' : 'pisell2-a-qr-code-02',
|
|
144
|
+
className: classNames('pisell-wallet-card-icon')
|
|
145
|
+
}))));
|
|
89
146
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
147
|
+
|
|
148
|
+
// 渲染卡片内容
|
|
149
|
+
var renderContent = function renderContent() {
|
|
150
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
151
|
+
className: classNames('pisell-wallet-card-list')
|
|
152
|
+
}, items.map(function (item, index) {
|
|
153
|
+
var label = item.label,
|
|
154
|
+
value = item.value;
|
|
155
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
key: index,
|
|
157
|
+
className: "pisell-wallet-card-item"
|
|
158
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
className: "pisell-wallet-card-item-label"
|
|
160
|
+
}, getText("walletCard-".concat(label)) || ''), /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
className: "pisell-wallet-card-item-value"
|
|
162
|
+
}, label === 'rechargeable' || label === 'pionts' ? /*#__PURE__*/React.createElement(Amount, {
|
|
163
|
+
className: "pisell-card-amount-item-value",
|
|
164
|
+
useThousandsSeparator: true,
|
|
165
|
+
showCurrencySymbol: true,
|
|
166
|
+
value: value
|
|
167
|
+
}) : value));
|
|
168
|
+
}));
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// 渲染模态框
|
|
172
|
+
var renderModal = function renderModal() {
|
|
173
|
+
return /*#__PURE__*/React.createElement(PisellModal, {
|
|
174
|
+
title: getText('walletCard-qrcode'),
|
|
175
|
+
platform: platform,
|
|
176
|
+
onCancel: function onCancel(e) {
|
|
177
|
+
e.stopPropagation();
|
|
178
|
+
setIsModalOpen(false);
|
|
179
|
+
},
|
|
180
|
+
open: isModalOpen,
|
|
181
|
+
footer: null,
|
|
182
|
+
mobileModalHeight: "auto",
|
|
183
|
+
className: classNames('pisell-qrcode-modal'),
|
|
184
|
+
bodyStyle: {
|
|
185
|
+
padding: 0
|
|
186
|
+
},
|
|
187
|
+
modalRender: function modalRender(modal) {
|
|
188
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
189
|
+
onClick: function onClick(e) {
|
|
190
|
+
return e.stopPropagation();
|
|
191
|
+
}
|
|
192
|
+
}, modal);
|
|
193
|
+
}
|
|
194
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
195
|
+
onClick: function onClick(e) {
|
|
196
|
+
return e.stopPropagation();
|
|
197
|
+
}
|
|
198
|
+
}, codeType === 'barCode' ? /*#__PURE__*/React.createElement(Barcode, {
|
|
199
|
+
value: cardNo,
|
|
200
|
+
height: 114,
|
|
201
|
+
width: 3
|
|
202
|
+
}) : /*#__PURE__*/React.createElement(QRCode, {
|
|
203
|
+
size: 200,
|
|
204
|
+
value: cardNo,
|
|
205
|
+
style: {
|
|
206
|
+
marginTop: 24
|
|
207
|
+
}
|
|
208
|
+
}), codeType === 'orCode' && /*#__PURE__*/React.createElement("div", {
|
|
209
|
+
className: classNames('pisell-qrcode-modal-value')
|
|
210
|
+
}, cardNo), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(Button, {
|
|
211
|
+
onClick: function onClick(e) {
|
|
212
|
+
e.stopPropagation();
|
|
213
|
+
handleButtonClick(e);
|
|
214
|
+
},
|
|
215
|
+
className: classNames('pisell-qrcode-modal-button')
|
|
216
|
+
}, getText('walletCard-done'))));
|
|
103
217
|
};
|
|
104
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
218
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
105
219
|
className: classNames('pisell-wallet-card-wrapper')
|
|
106
|
-
}, /*#__PURE__*/React.createElement(
|
|
220
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
221
|
+
bordered: false,
|
|
222
|
+
className: classNames('pisell-wallet-card')
|
|
223
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
224
|
+
className: classNames('pisell-wallet-card-container'),
|
|
107
225
|
style: {
|
|
108
|
-
|
|
226
|
+
width: '100%'
|
|
109
227
|
}
|
|
110
|
-
}, /*#__PURE__*/React.createElement(
|
|
111
|
-
vertical: true,
|
|
228
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
229
|
className: classNames('pisell-wallet-card-content', mode),
|
|
113
230
|
style: {
|
|
114
|
-
backgroundImage: "url(".concat(mode === 'dark' ?
|
|
231
|
+
backgroundImage: "url(https://file.mypisell-dev.com/pisel/image/9/".concat(mode === 'dark' ? '3d039c83ff5b84fadafb8a23c33d6cc42025_02_26_00_42_53_288_08413160975__720_456__' : '61dcbe950c9451164a6bb1d17d5bc5f02025_02_26_00_43_42_741_04853453608__720_456__', ".png)"),
|
|
232
|
+
flexDirection: codeDirection === 'bottom' ? 'column' : 'column-reverse',
|
|
233
|
+
display: 'flex'
|
|
115
234
|
}
|
|
116
|
-
}, /*#__PURE__*/React.createElement(
|
|
117
|
-
className: classNames('pisell-wallet-card-header'),
|
|
118
|
-
justify: "space-between",
|
|
119
|
-
align: "start"
|
|
120
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
121
|
-
className: classNames('pisell-wallet-card-header-left'),
|
|
122
|
-
vertical: true
|
|
123
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
124
|
-
className: classNames('pisell-wallet-card-header-level'),
|
|
125
|
-
gap: 10,
|
|
126
|
-
align: "center"
|
|
127
|
-
}, icon && /*#__PURE__*/React.createElement("div", {
|
|
128
|
-
className: "pisell-wallet-card-header-icon"
|
|
129
|
-
}, icon), vipLevel && /*#__PURE__*/React.createElement("p", {
|
|
130
|
-
className: classNames('pisell-wallet-card-header-level-text')
|
|
131
|
-
}, "Level")), isShowShopName && /*#__PURE__*/React.createElement("p", null, shopName), isShowCardNo && /*#__PURE__*/React.createElement("p", null, cardNo)), /*#__PURE__*/React.createElement(Flex, {
|
|
132
|
-
className: classNames('pisell-wallet-card-header-right')
|
|
133
|
-
}, showCode && cardStyle === 'normal' && /*#__PURE__*/React.createElement(React.Fragment, null, codeType === 'one' ? /*#__PURE__*/React.createElement(Iconfont, {
|
|
134
|
-
type: "pisell2-Barcode",
|
|
135
|
-
onClick: function onClick(e) {
|
|
136
|
-
e.stopPropagation();
|
|
137
|
-
setIsModalOpen(true);
|
|
138
|
-
},
|
|
139
|
-
className: classNames('pisell-wallet-card-icon')
|
|
140
|
-
}) : /*#__PURE__*/React.createElement(Iconfont, {
|
|
141
|
-
type: "pisell2-a-qr-code-02",
|
|
142
|
-
onClick: function onClick(e) {
|
|
143
|
-
e.stopPropagation();
|
|
144
|
-
setIsModalOpen(true);
|
|
145
|
-
},
|
|
146
|
-
className: classNames('pisell-wallet-card-icon')
|
|
147
|
-
})))), /*#__PURE__*/React.createElement(Flex, {
|
|
148
|
-
className: classNames('pisell-wallet-card-list'),
|
|
149
|
-
vertical: true,
|
|
150
|
-
justify: "center"
|
|
151
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
152
|
-
className: classNames('pisell-wallet-card-row'),
|
|
153
|
-
justify: "space-around"
|
|
154
|
-
}, items.map(function (item, index) {
|
|
155
|
-
console.log('%c [ item ]-187', 'font-size:13px; background:pink; color:#bf2c9f;', item);
|
|
156
|
-
var _item$hidden = item.hidden,
|
|
157
|
-
hidden = _item$hidden === void 0 ? false : _item$hidden,
|
|
158
|
-
_item$key = item.key,
|
|
159
|
-
key = _item$key === void 0 ? '' : _item$key;
|
|
160
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
161
|
-
key: index,
|
|
162
|
-
hidden: hidden
|
|
163
|
-
}, /*#__PURE__*/React.createElement("p", null, " ", getText("walletCard-".concat(key))), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(Amount, {
|
|
164
|
-
className: "pisell-card-amount-item-value",
|
|
165
|
-
useThousandsSeparator: true,
|
|
166
|
-
showCurrencySymbol: true,
|
|
167
|
-
value: pointsValue
|
|
168
|
-
})));
|
|
169
|
-
})))), showCode && cardStyle === 'full' && /*#__PURE__*/React.createElement("div", {
|
|
235
|
+
}, renderHeader(), renderContent()), showCode && cardStyle === 'full' && /*#__PURE__*/React.createElement("div", {
|
|
170
236
|
className: classNames('pisell-wallet-card-showCode')
|
|
171
|
-
},
|
|
172
|
-
size: 200,
|
|
173
|
-
value: cardNo,
|
|
174
|
-
style: {
|
|
175
|
-
marginTop: 24
|
|
176
|
-
}
|
|
177
|
-
}), /*#__PURE__*/React.createElement("p", {
|
|
178
|
-
className: classNames('pisell-qrcode-modal-value')
|
|
179
|
-
}, cardNo), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(Button, {
|
|
180
|
-
onClick: function onClick() {
|
|
181
|
-
return setIsModalOpen(false);
|
|
182
|
-
},
|
|
183
|
-
className: classNames('pisell-qrcode-modal-button')
|
|
184
|
-
}, getText('walletCard-done'))));
|
|
237
|
+
}, renderCode)))), renderModal());
|
|
185
238
|
};
|
|
186
239
|
export default WalletCard;
|