@pisell/materials 6.2.39 → 6.2.40
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 +4 -4
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +36 -21
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +35 -20
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +23 -12
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +199 -19
- package/es/components/dataSourceComponents/fields/Upload/CameraPopover.js +66 -0
- package/es/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/pisellCamera/index.js +228 -0
- package/es/components/pisellCamera/index.less +131 -0
- package/es/components/pisellWalletPassCard/index.d.ts +1 -0
- package/es/components/pisellWalletPassCard/index.js +6 -1
- package/es/components/table/hooks/useTableSetting.js +1 -1
- package/es/components/walletCard/index.js +29 -3
- package/es/components/walletCard/index.less +27 -0
- package/es/locales/en-US.js +83 -69
- package/es/locales/zh-CN.js +84 -70
- package/es/locales/zh-TW.js +84 -70
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +10 -4
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +168 -5
- package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.js +95 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.less +35 -3
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/pisellCamera/index.js +222 -0
- package/lib/components/pisellCamera/index.less +131 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +1 -0
- package/lib/components/pisellWalletPassCard/index.js +9 -1
- package/lib/components/table/hooks/useTableSetting.js +1 -1
- package/lib/components/walletCard/index.js +27 -3
- package/lib/components/walletCard/index.less +27 -0
- package/lib/locales/en-US.js +15 -1
- package/lib/locales/zh-CN.js +15 -1
- package/lib/locales/zh-TW.js +15 -1
- package/lowcode/data-source-table/meta.ts +119 -66
- package/lowcode/form-item-upload/meta.ts +20 -5
- package/lowcode/pisell-upload/meta.ts +8 -0
- package/lowcode/pisell-wallet-pass-card/meta.ts +19 -0
- package/lowcode/wallet-card/meta.ts +81 -63
- package/package.json +4 -3
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -97
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/es/components/pisell-config-provider/context.d.ts +0 -20
- package/es/components/pisell-config-provider/index.d.ts +0 -12
- package/es/components/pisellAdjustPrice/index.d.ts +0 -4
- package/es/components/pisellAdjustPrice/type.d.ts +0 -20
- package/es/components/pisellCheckboxGroup/index.d.ts +0 -37
- package/es/components/pisellQRScanner/index.d.ts +0 -37
- package/es/components/pisellText/components/Amount/index.d.ts +0 -20
- package/es/components/table/Table/AddFieldModal/index.d.ts +0 -3
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -11
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -21
- package/es/components/virtual-keyboard/Number/index.d.ts +0 -5
- package/es/components/virtual-keyboard/Number/types.d.ts +0 -25
- package/es/components/walletCard/index.d.ts +0 -67
- package/es/locales/en-US.d.ts +0 -278
- package/es/locales/zh-CN.d.ts +0 -273
- package/es/locales/zh-TW.d.ts +0 -273
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +0 -97
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +0 -37
- package/lib/components/pisell-config-provider/context.d.ts +0 -20
- package/lib/components/pisell-config-provider/index.d.ts +0 -12
- package/lib/components/pisellAdjustPrice/index.d.ts +0 -4
- package/lib/components/pisellAdjustPrice/type.d.ts +0 -20
- package/lib/components/pisellCheckboxGroup/index.d.ts +0 -37
- package/lib/components/pisellQRScanner/index.d.ts +0 -37
- package/lib/components/pisellText/components/Amount/index.d.ts +0 -20
- package/lib/components/table/Table/AddFieldModal/index.d.ts +0 -3
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -11
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -21
- package/lib/components/virtual-keyboard/Number/index.d.ts +0 -5
- package/lib/components/virtual-keyboard/Number/types.d.ts +0 -25
- package/lib/components/walletCard/index.d.ts +0 -67
- package/lib/locales/en-US.d.ts +0 -278
- package/lib/locales/zh-CN.d.ts +0 -273
- package/lib/locales/zh-TW.d.ts +0 -273
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
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
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
8
|
+
import { Camera } from 'react-camera-pro';
|
|
9
|
+
import Iconfont from "../iconfont";
|
|
10
|
+
import { getText } from "../../locales";
|
|
11
|
+
import PisellModal from "../../components/pisellModal";
|
|
12
|
+
import "./index.less";
|
|
13
|
+
var PisellCamera = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
14
|
+
var cameraRef = useRef(null);
|
|
15
|
+
var _useState = useState(false),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
open = _useState2[0],
|
|
18
|
+
setOpen = _useState2[1];
|
|
19
|
+
var _useState3 = useState(''),
|
|
20
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
21
|
+
photo = _useState4[0],
|
|
22
|
+
setPhoto = _useState4[1];
|
|
23
|
+
var _useState5 = useState(null),
|
|
24
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
25
|
+
cameraAvailable = _useState6[0],
|
|
26
|
+
setCameraAvailable = _useState6[1]; // null: 检测中, true: 可用, false: 不可用
|
|
27
|
+
var uploadFileRef = useRef(null);
|
|
28
|
+
|
|
29
|
+
// Base64转File对象
|
|
30
|
+
var base64ToFile = function base64ToFile(base64String, filename) {
|
|
31
|
+
var _arr$0$match;
|
|
32
|
+
var arr = base64String.split(',');
|
|
33
|
+
var mime = ((_arr$0$match = arr[0].match(/:(.*?);/)) === null || _arr$0$match === void 0 ? void 0 : _arr$0$match[1]) || '';
|
|
34
|
+
var bstr = atob(arr[1]);
|
|
35
|
+
var n = bstr.length;
|
|
36
|
+
var u8arr = new Uint8Array(n);
|
|
37
|
+
while (n--) {
|
|
38
|
+
u8arr[n] = bstr.charCodeAt(n);
|
|
39
|
+
}
|
|
40
|
+
return new File([u8arr], filename, {
|
|
41
|
+
type: mime
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// 拍照并添加到fileList
|
|
46
|
+
var takePhoto = function takePhoto() {
|
|
47
|
+
if (!cameraRef.current || !cameraRef.current.takePhoto) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
var _cameraRef$current, _cameraRef$current$ta;
|
|
52
|
+
var _photo = (_cameraRef$current = cameraRef.current) === null || _cameraRef$current === void 0 || (_cameraRef$current$ta = _cameraRef$current.takePhoto) === null || _cameraRef$current$ta === void 0 ? void 0 : _cameraRef$current$ta.call(_cameraRef$current);
|
|
53
|
+
var timestamp = Date.now();
|
|
54
|
+
var filename = "photo-".concat(timestamp, ".jpg");
|
|
55
|
+
setPhoto(_photo);
|
|
56
|
+
|
|
57
|
+
// 转换为File对象
|
|
58
|
+
var file = base64ToFile(_photo, filename);
|
|
59
|
+
|
|
60
|
+
// 创建符合Antd Upload格式的文件对象
|
|
61
|
+
var uploadFile = {
|
|
62
|
+
uid: timestamp.toString(),
|
|
63
|
+
name: filename,
|
|
64
|
+
status: 'uploading',
|
|
65
|
+
url: _photo,
|
|
66
|
+
// 用于预览
|
|
67
|
+
originFileObj: file,
|
|
68
|
+
// 原始文件对象,用于上传
|
|
69
|
+
thumbUrl: _photo,
|
|
70
|
+
lastModified: Date.now(),
|
|
71
|
+
lastModifiedDate: new Date(),
|
|
72
|
+
type: 'image/jpeg',
|
|
73
|
+
size: file.size
|
|
74
|
+
};
|
|
75
|
+
console.log('takePhoto_uploadFile', uploadFile);
|
|
76
|
+
uploadFileRef.current = uploadFile;
|
|
77
|
+
return uploadFile;
|
|
78
|
+
} catch (error) {
|
|
79
|
+
console.error('takePhoto_error', error);
|
|
80
|
+
uploadFileRef.current = null;
|
|
81
|
+
setPhoto('');
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var onOpen = function onOpen() {
|
|
86
|
+
setCameraAvailable(null);
|
|
87
|
+
setPhoto('');
|
|
88
|
+
uploadFileRef.current = null;
|
|
89
|
+
setOpen(true);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// 关闭相机弹窗,重置状态
|
|
93
|
+
var onClose = function onClose() {
|
|
94
|
+
cameraRef.current = null;
|
|
95
|
+
uploadFileRef.current = null;
|
|
96
|
+
setOpen(false);
|
|
97
|
+
setPhoto('');
|
|
98
|
+
setCameraAvailable(null);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// 重拍照片
|
|
102
|
+
var onRetakePhoto = function onRetakePhoto() {
|
|
103
|
+
setPhoto('');
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// 使用照片
|
|
107
|
+
var onUsePhoto = function onUsePhoto() {
|
|
108
|
+
var _props$onChange;
|
|
109
|
+
props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, uploadFileRef.current);
|
|
110
|
+
onClose();
|
|
111
|
+
};
|
|
112
|
+
useImperativeHandle(ref, function () {
|
|
113
|
+
return {
|
|
114
|
+
open: onOpen,
|
|
115
|
+
takePhoto: takePhoto,
|
|
116
|
+
isCameraAvailable: function isCameraAvailable() {
|
|
117
|
+
return cameraAvailable;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
console.log('cameraAvailable', cameraAvailable);
|
|
122
|
+
return /*#__PURE__*/React.createElement(PisellModal, {
|
|
123
|
+
open: open,
|
|
124
|
+
onCancel: function onCancel(e) {
|
|
125
|
+
e.stopPropagation();
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
onClose();
|
|
128
|
+
},
|
|
129
|
+
header: false,
|
|
130
|
+
footer: null,
|
|
131
|
+
destroyOnClose: true,
|
|
132
|
+
bodyStyle: {
|
|
133
|
+
padding: 0
|
|
134
|
+
},
|
|
135
|
+
width: '90vw',
|
|
136
|
+
className: "pisell-camera-modal"
|
|
137
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
className: "pisell-camera-container",
|
|
139
|
+
onClick: function onClick(e) {
|
|
140
|
+
e.stopPropagation();
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
}
|
|
143
|
+
}, cameraAvailable === null ?
|
|
144
|
+
/*#__PURE__*/
|
|
145
|
+
// 检测中
|
|
146
|
+
React.createElement("div", {
|
|
147
|
+
className: "pisell-camera-loading"
|
|
148
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
149
|
+
className: "pisell-camera-loading-text"
|
|
150
|
+
}, getText('pisell-camera-checking'))) : cameraAvailable === false ?
|
|
151
|
+
/*#__PURE__*/
|
|
152
|
+
// 无摄像头
|
|
153
|
+
React.createElement("div", {
|
|
154
|
+
className: "pisell-camera-no-camera"
|
|
155
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
className: "pisell-camera-no-camera-icon"
|
|
157
|
+
}, "\uD83D\uDCF7"), /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
className: "pisell-camera-no-camera-text"
|
|
159
|
+
}, getText('pisell-camera-no-camera-accessible')), /*#__PURE__*/React.createElement("div", {
|
|
160
|
+
className: "pisell-camera-no-camera-desc"
|
|
161
|
+
}, getText('pisell-camera-no-camera-desc'))) : null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Camera, {
|
|
162
|
+
ref: cameraRef,
|
|
163
|
+
facingMode: "environment",
|
|
164
|
+
errorMessages: {
|
|
165
|
+
// noCameraAccessible: getText('pisell-camera-no-camera-accessible'),
|
|
166
|
+
// permissionDenied: getText('pisell-camera-permission-denied'),
|
|
167
|
+
// switchCamera: getText('pisell-camera-switch-camera'),
|
|
168
|
+
// canvas: getText('pisell-camera-canvas'),
|
|
169
|
+
},
|
|
170
|
+
numberOfCamerasCallback: function numberOfCamerasCallback(numberOfCameras) {
|
|
171
|
+
console.log('numberOfCameras', numberOfCameras);
|
|
172
|
+
if (!cameraRef.current) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (numberOfCameras <= 0) {
|
|
176
|
+
setTimeout(function () {
|
|
177
|
+
setCameraAvailable(function (pre) {
|
|
178
|
+
if (pre === true) {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
return false;
|
|
182
|
+
});
|
|
183
|
+
}, 5000);
|
|
184
|
+
} else {
|
|
185
|
+
setCameraAvailable(true);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}), cameraAvailable === true && /*#__PURE__*/React.createElement("div", {
|
|
189
|
+
className: "pisell-camera-action"
|
|
190
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
191
|
+
className: "pisell-camera-action-item-wrap",
|
|
192
|
+
onClick: function onClick(e) {
|
|
193
|
+
e.stopPropagation();
|
|
194
|
+
e.preventDefault();
|
|
195
|
+
takePhoto();
|
|
196
|
+
}
|
|
197
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
198
|
+
className: "pisell-camera-action-item"
|
|
199
|
+
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
200
|
+
type: "pisell2-camera-01",
|
|
201
|
+
style: {
|
|
202
|
+
fontSize: 32
|
|
203
|
+
}
|
|
204
|
+
})))), photo && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
205
|
+
className: "pisell-camera-photo-container"
|
|
206
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
207
|
+
src: photo,
|
|
208
|
+
alt: "photo",
|
|
209
|
+
className: "pisell-camera-photo"
|
|
210
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
211
|
+
className: "pisell-camera-photo-img-action"
|
|
212
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
213
|
+
className: "pisell-camera-photo-img-action-item",
|
|
214
|
+
onClick: function onClick(e) {
|
|
215
|
+
e.stopPropagation();
|
|
216
|
+
e.preventDefault();
|
|
217
|
+
onRetakePhoto();
|
|
218
|
+
}
|
|
219
|
+
}, getText('pisell-upload-camera-retake')), /*#__PURE__*/React.createElement("div", {
|
|
220
|
+
className: "pisell-camera-photo-img-action-item",
|
|
221
|
+
onClick: function onClick(e) {
|
|
222
|
+
e.stopPropagation();
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
onUsePhoto();
|
|
225
|
+
}
|
|
226
|
+
}, getText('pisell-upload-camera-use')))))));
|
|
227
|
+
});
|
|
228
|
+
export default PisellCamera;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
.pisell-camera-modal {
|
|
2
|
+
.pisell-camera-container {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 90vh;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
|
|
10
|
+
.pisell-camera-action {
|
|
11
|
+
position: absolute;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
height: 100px;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
|
|
20
|
+
.pisell-camera-action-item-wrap {
|
|
21
|
+
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
padding: 6px;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
border: 2px solid #fff;
|
|
26
|
+
|
|
27
|
+
.pisell-camera-action-item {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
width: 60px;
|
|
32
|
+
height: 60px;
|
|
33
|
+
background-color: #fff;
|
|
34
|
+
border-radius: 50%;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pisell-camera-photo-container {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
bottom: 0;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
|
|
49
|
+
.pisell-camera-photo {
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
object-fit: cover;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.pisell-camera-photo-img-action {
|
|
57
|
+
position: absolute;
|
|
58
|
+
bottom: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
right: 0;
|
|
61
|
+
height: 100px;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: row;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
67
|
+
|
|
68
|
+
.pisell-camera-photo-img-action-item {
|
|
69
|
+
padding: 20px 60px;
|
|
70
|
+
font-size: 20px;
|
|
71
|
+
color: #fff;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.pisell-camera-loading {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 0;
|
|
79
|
+
left: 0;
|
|
80
|
+
right: 0;
|
|
81
|
+
bottom: 0;
|
|
82
|
+
background-color: transparent;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
|
|
87
|
+
.pisell-camera-loading-text {
|
|
88
|
+
font-size: 18px;
|
|
89
|
+
color: #666;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pisell-camera-no-camera {
|
|
94
|
+
position: absolute;
|
|
95
|
+
top: 0;
|
|
96
|
+
left: 0;
|
|
97
|
+
right: 0;
|
|
98
|
+
bottom: 0;
|
|
99
|
+
background-color: #ffffff;
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
background-color: #f5f5f5;
|
|
107
|
+
padding: 40px;
|
|
108
|
+
text-align: center;
|
|
109
|
+
|
|
110
|
+
.pisell-camera-no-camera-icon {
|
|
111
|
+
font-size: 64px;
|
|
112
|
+
margin-bottom: 20px;
|
|
113
|
+
opacity: 0.6;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.pisell-camera-no-camera-text {
|
|
117
|
+
font-size: 20px;
|
|
118
|
+
color: #333;
|
|
119
|
+
margin-bottom: 12px;
|
|
120
|
+
font-weight: 500;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.pisell-camera-no-camera-desc {
|
|
124
|
+
font-size: 14px;
|
|
125
|
+
color: #666;
|
|
126
|
+
line-height: 1.5;
|
|
127
|
+
max-width: 300px;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -335,6 +335,7 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
|
|
|
335
335
|
}, showStoreName && storeName));
|
|
336
336
|
};
|
|
337
337
|
var renderBalanceInfo = function renderBalanceInfo() {
|
|
338
|
+
var _props$metadata;
|
|
338
339
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
339
340
|
className: "pisell-card-amount-wrap"
|
|
340
341
|
}, showRedeem && !disabled && /*#__PURE__*/React.createElement("div", {
|
|
@@ -360,7 +361,11 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
|
|
|
360
361
|
className: "pisell-card-amount-item-label"
|
|
361
362
|
}, getText('pisell-discount-card-title')), /*#__PURE__*/React.createElement("div", {
|
|
362
363
|
className: "pisell-card-amount-item-value"
|
|
363
|
-
},
|
|
364
|
+
}, ((_props$metadata = props.metadata) === null || _props$metadata === void 0 ? void 0 : _props$metadata.discount_card_type) === 'fixed_amount' ? /*#__PURE__*/React.createElement(React.Fragment, null, getText('pisell-discount-card-fixed-amount-prefix'), ' ', /*#__PURE__*/React.createElement(Amount, {
|
|
365
|
+
className: "pisell-card-amount-item-value",
|
|
366
|
+
useThousandsSeparator: true,
|
|
367
|
+
value: discount
|
|
368
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, discount, "% ", getText('pisell-discount-card-unit'))))), /*#__PURE__*/React.createElement("div", {
|
|
364
369
|
className: "pisell-card-code-wrap"
|
|
365
370
|
}, /*#__PURE__*/React.createElement("div", {
|
|
366
371
|
className: "pisell-card-code"
|
|
@@ -232,7 +232,7 @@ var useTableSetting = function useTableSetting(params) {
|
|
|
232
232
|
} else {
|
|
233
233
|
var names = new Set();
|
|
234
234
|
if ( /*#__PURE__*/React.isValidElement(filter)) {
|
|
235
|
-
names = new Set(((filter === null || filter === void 0 ? void 0 : filter.
|
|
235
|
+
names = new Set(((filter === null || filter === void 0 ? void 0 : filter.__items) || []).filter(function (item) {
|
|
236
236
|
return !item.isHidden;
|
|
237
237
|
}).map(function (item) {
|
|
238
238
|
var rawName = item === null || item === void 0 ? void 0 : item.value;
|
|
@@ -18,6 +18,7 @@ import { Card, QRCode } from 'antd';
|
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import React, { useMemo, useState } from 'react';
|
|
20
20
|
import Barcode from 'react-barcode';
|
|
21
|
+
import EyeOff from '@pisell/icon/es/EyeOff';
|
|
21
22
|
import { getText } from "../../locales/index";
|
|
22
23
|
import Iconfont from "./../iconfont";
|
|
23
24
|
import PisellModal from "./../pisellModal";
|
|
@@ -148,13 +149,17 @@ var CardHeader = function CardHeader(_ref2) {
|
|
|
148
149
|
codeType = _ref2$codeType === void 0 ? 'barCode' : _ref2$codeType,
|
|
149
150
|
onCodeClick = _ref2.onCodeClick,
|
|
150
151
|
_ref2$isLogin = _ref2.isLogin,
|
|
151
|
-
isLogin = _ref2$isLogin === void 0 ? false : _ref2$isLogin
|
|
152
|
+
isLogin = _ref2$isLogin === void 0 ? false : _ref2$isLogin,
|
|
153
|
+
_ref2$showViewPin = _ref2.showViewPin,
|
|
154
|
+
showViewPin = _ref2$showViewPin === void 0 ? false : _ref2$showViewPin,
|
|
155
|
+
onViewPinClick = _ref2.onViewPinClick;
|
|
152
156
|
// 处理可能为0/1的布尔值
|
|
153
157
|
var processedShowIcon = toBooleanValue(showIcon);
|
|
154
158
|
var processedShowWalletName = toBooleanValue(showWalletName);
|
|
155
159
|
var processedShowShopName = toBooleanValue(showShopName);
|
|
156
160
|
var processedShowCardNo = toBooleanValue(showCardNo);
|
|
157
161
|
var processedShowCode = toBooleanValue(showCode);
|
|
162
|
+
var processedShowViewPin = toBooleanValue(showViewPin);
|
|
158
163
|
return /*#__PURE__*/React.createElement("div", {
|
|
159
164
|
className: "pisell-wallet-card-header"
|
|
160
165
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -172,7 +177,12 @@ var CardHeader = function CardHeader(_ref2) {
|
|
|
172
177
|
}
|
|
173
178
|
})) : null, processedShowWalletName && walletName && /*#__PURE__*/React.createElement("div", {
|
|
174
179
|
className: "pisell-wallet-card-header-level-text"
|
|
175
|
-
}, walletName)), processedShowShopName && shopName && /*#__PURE__*/React.createElement("div", null, shopName), processedShowCardNo && cardNo && /*#__PURE__*/React.createElement("div", null, cardNo)
|
|
180
|
+
}, walletName)), processedShowShopName && shopName && /*#__PURE__*/React.createElement("div", null, shopName), processedShowCardNo && cardNo && /*#__PURE__*/React.createElement("div", null, cardNo), processedShowViewPin && /*#__PURE__*/React.createElement("div", {
|
|
181
|
+
className: "pisell-wallet-card-header-view-pin",
|
|
182
|
+
onClick: onViewPinClick
|
|
183
|
+
}, getText('walletCard-viewPin'), /*#__PURE__*/React.createElement(EyeOff, {
|
|
184
|
+
className: "pisell-wallet-card-header-view-pin-icon"
|
|
185
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
176
186
|
className: "pisell-wallet-card-header-right"
|
|
177
187
|
}, processedShowCode && cardStyle === 'normal' && /*#__PURE__*/React.createElement("div", {
|
|
178
188
|
className: "pisell-wallet-card-icon-wrapper",
|
|
@@ -339,6 +349,7 @@ var WalletCard = function WalletCard(props) {
|
|
|
339
349
|
var showCardNo = toBooleanValue(mergedProps.showCardNo);
|
|
340
350
|
var showCode = toBooleanValue(mergedProps.showCode);
|
|
341
351
|
var isLogin = toBooleanValue(mergedProps.isLogin);
|
|
352
|
+
var showViewPin = toBooleanValue(mergedProps === null || mergedProps === void 0 ? void 0 : mergedProps.showViewPin);
|
|
342
353
|
var context = useEngineContext();
|
|
343
354
|
var _ref7 = context.appHelper || {},
|
|
344
355
|
utils = _ref7.utils;
|
|
@@ -347,6 +358,7 @@ var WalletCard = function WalletCard(props) {
|
|
|
347
358
|
isModalOpen = _useCodeModal.isModalOpen,
|
|
348
359
|
handleCodeClick = _useCodeModal.handleCodeClick,
|
|
349
360
|
closeModal = _useCodeModal.closeModal;
|
|
361
|
+
console.log('showViewPin', props);
|
|
350
362
|
|
|
351
363
|
// 计算背景样式
|
|
352
364
|
var backgroundStyle = useMemo(function () {
|
|
@@ -378,6 +390,18 @@ var WalletCard = function WalletCard(props) {
|
|
|
378
390
|
callback: function callback() {}
|
|
379
391
|
});
|
|
380
392
|
};
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* 查看PIN的回调
|
|
396
|
+
*/
|
|
397
|
+
var onViewPinClick = function onViewPinClick(e) {
|
|
398
|
+
e.stopPropagation();
|
|
399
|
+
if (props !== null && props !== void 0 && props.onViewPinClick) {
|
|
400
|
+
props.onViewPinClick();
|
|
401
|
+
} else {
|
|
402
|
+
console.error('onViewPinClick方法需要传入');
|
|
403
|
+
}
|
|
404
|
+
};
|
|
381
405
|
return /*#__PURE__*/React.createElement("div", {
|
|
382
406
|
className: classNames('pisell-wallet-card-wrapper', className),
|
|
383
407
|
style: style,
|
|
@@ -415,7 +439,9 @@ var WalletCard = function WalletCard(props) {
|
|
|
415
439
|
cardStyle: cardStyle,
|
|
416
440
|
codeType: codeType,
|
|
417
441
|
onCodeClick: handleCodeClick,
|
|
418
|
-
isLogin: isLogin
|
|
442
|
+
isLogin: isLogin,
|
|
443
|
+
showViewPin: showViewPin,
|
|
444
|
+
onViewPinClick: onViewPinClick
|
|
419
445
|
}), /*#__PURE__*/React.createElement(CardContent, {
|
|
420
446
|
items: items,
|
|
421
447
|
symbol: symbol
|
|
@@ -106,6 +106,33 @@
|
|
|
106
106
|
margin-bottom: 0;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
.pisell-wallet-card-header-view-pin {
|
|
111
|
+
position: relative;
|
|
112
|
+
color: #53b1fd;
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
font-weight: 400;
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
gap: 4px;
|
|
119
|
+
|
|
120
|
+
.pisell-wallet-card-header-view-pin-icon {
|
|
121
|
+
width: 16px;
|
|
122
|
+
height: 16px;
|
|
123
|
+
color: #53b1fd;
|
|
124
|
+
font-size: 16px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&:after {
|
|
128
|
+
content: '';
|
|
129
|
+
position: absolute;
|
|
130
|
+
top: -5px;
|
|
131
|
+
left: -5px;
|
|
132
|
+
right: -5px;
|
|
133
|
+
bottom: -5px; /* 向外扩展5px */
|
|
134
|
+
}
|
|
135
|
+
}
|
|
109
136
|
}
|
|
110
137
|
|
|
111
138
|
// 头部右侧
|