react_hsbc_teller 2.0.22 → 2.0.23
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/lib/hsbc.js +1 -1
- package/package.json +1 -1
- package/packages/pages/video/video.jsx +3 -15
- package/packages/utils/utils.js +3 -6
package/package.json
CHANGED
|
@@ -53,7 +53,7 @@ import Step from '../components/step/step.jsx'
|
|
|
53
53
|
import axios from 'axios';
|
|
54
54
|
import CryptoJS from "crypto-js";
|
|
55
55
|
|
|
56
|
-
const SDK_VERISON = '2.0.
|
|
56
|
+
const SDK_VERISON = '2.0.23'
|
|
57
57
|
const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
|
|
58
58
|
const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
|
|
59
59
|
const { Option } = Select;
|
|
@@ -3298,6 +3298,7 @@ class Video extends Component {
|
|
|
3298
3298
|
roomId: this.state.channelId + '',
|
|
3299
3299
|
appId: this.state.appId,
|
|
3300
3300
|
recordId: this.state.recordId,
|
|
3301
|
+
customerId: this.props.customerId,
|
|
3301
3302
|
type: type,
|
|
3302
3303
|
status: status
|
|
3303
3304
|
});
|
|
@@ -3328,6 +3329,7 @@ class Video extends Component {
|
|
|
3328
3329
|
id: businessId,
|
|
3329
3330
|
appId: this.state.appId,
|
|
3330
3331
|
recordId: this.state.businessRecordId,
|
|
3332
|
+
customerId: this.props.customerId,
|
|
3331
3333
|
type: type,
|
|
3332
3334
|
status: status
|
|
3333
3335
|
});
|
|
@@ -3651,20 +3653,6 @@ class Video extends Component {
|
|
|
3651
3653
|
}
|
|
3652
3654
|
componentWillMount() {
|
|
3653
3655
|
console.log('hsbc_teller_sdk', SDK_VERISON)
|
|
3654
|
-
// window.document.startRecord = () => {
|
|
3655
|
-
// this.enableServerRecording();
|
|
3656
|
-
// }
|
|
3657
|
-
// window.document.stopRecord = (recordId) => {
|
|
3658
|
-
// this.test_controller.StopRemoteRecord(recordId || this.state.recordId)
|
|
3659
|
-
// }
|
|
3660
|
-
// window.document.detectNetworkWeak = () => {
|
|
3661
|
-
// console.log('detectNetworkWeak')
|
|
3662
|
-
// this.test_controller.detectNetworkWeak()
|
|
3663
|
-
// }
|
|
3664
|
-
// window.document.start = () => {
|
|
3665
|
-
// this.startFaceDetection();
|
|
3666
|
-
// this.startImageDetection();
|
|
3667
|
-
// }
|
|
3668
3656
|
let arr = []
|
|
3669
3657
|
for(let i=1;i<=12;i++){
|
|
3670
3658
|
arr.push({
|
package/packages/utils/utils.js
CHANGED
|
@@ -51,7 +51,7 @@ function debounce(fn, delay = 500) {
|
|
|
51
51
|
}
|
|
52
52
|
function isLight(src) {
|
|
53
53
|
let gray = new cv.Mat()
|
|
54
|
-
cv.cvtColor(src, gray, cv.
|
|
54
|
+
cv.cvtColor(src, gray, cv.COLOR_BGR2GRAY)
|
|
55
55
|
let sum = 0;
|
|
56
56
|
let avg = 0;
|
|
57
57
|
let scalar = new cv.Scalar()
|
|
@@ -59,15 +59,12 @@ function isLight(src) {
|
|
|
59
59
|
let size = gray.rows * gray.cols;
|
|
60
60
|
for (let i = 0; i < 256; i++)
|
|
61
61
|
ls[i] = 0;
|
|
62
|
-
const data = gray.data;
|
|
63
|
-
// console.log(data)
|
|
64
62
|
|
|
65
63
|
for (let i = 0; i < gray.rows; i++)
|
|
66
64
|
{
|
|
67
65
|
for (let j = 0; j < gray.cols; j++)
|
|
68
66
|
{
|
|
69
|
-
|
|
70
|
-
scalar = [data[pos*3], data[pos*3+1], data[pos*3+2]]
|
|
67
|
+
scalar = gray.ucharPtr(i, j);
|
|
71
68
|
sum += (scalar[0] - 128);
|
|
72
69
|
let x = scalar[0];
|
|
73
70
|
ls[x]++;
|
|
@@ -78,7 +75,7 @@ function isLight(src) {
|
|
|
78
75
|
let mean = 0;
|
|
79
76
|
for (let i = 0; i < 256; i++)
|
|
80
77
|
{
|
|
81
|
-
total += Math.abs(
|
|
78
|
+
total += Math.abs((i - 128) - avg) * ls[i];
|
|
82
79
|
}
|
|
83
80
|
mean = total / size;
|
|
84
81
|
let cast = Math.abs(avg / mean);
|