react_hsbc_teller 2.0.58 → 2.0.59
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/README.md +3 -0
- package/lib/hsbc.js +1 -1
- package/package.json +1 -1
- package/packages/pages/components/step/step.jsx +5 -11
- package/packages/pages/video/video.jsx +135 -95
- package/packages/pages/video/video.less +3 -0
package/package.json
CHANGED
|
@@ -10,17 +10,11 @@ export default class step extends Component {
|
|
|
10
10
|
<div style={{...this.props.style}}>
|
|
11
11
|
<div style={{marginBottom: '10px'}}>客户证件识别</div>
|
|
12
12
|
<Steps current={current} direction={this.props.direction} size="small" style={{width:'150px', height: '200px'}}>
|
|
13
|
-
{
|
|
14
|
-
<Step status={current
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{/* step3 */}
|
|
20
|
-
<Step status={current==2? '':'wait'} title="证件信息核查" />
|
|
21
|
-
|
|
22
|
-
{/* step4 */}
|
|
23
|
-
{ current==3 && <Step title="人脸识别" />}
|
|
13
|
+
<Step status={current===0? '':'wait'} title="请选择客户类型" />
|
|
14
|
+
<Step status={current===1? '':'wait'} title="请选择客户" />
|
|
15
|
+
<Step status={current===2? '':'wait'} title="确认客户证件类型" />
|
|
16
|
+
<Step status={current===3? '':'wait'} title="证件信息核查" />
|
|
17
|
+
{ current===4 && <Step title="人脸识别" />}
|
|
24
18
|
</Steps>
|
|
25
19
|
</div>
|
|
26
20
|
)
|
|
@@ -5,6 +5,24 @@ import React, { Component, useState } from 'react';
|
|
|
5
5
|
import QRCode from 'qrcode.react';
|
|
6
6
|
import API from '../../api/api';
|
|
7
7
|
import { BoardOperate } from '../../common/index.esm.js';
|
|
8
|
+
|
|
9
|
+
import Modal from "antd/lib/modal";
|
|
10
|
+
import 'antd/lib/modal/style'
|
|
11
|
+
import message from "antd/lib/message";
|
|
12
|
+
import 'antd/lib/message/style'
|
|
13
|
+
import Spin from "antd/lib/spin";
|
|
14
|
+
import 'antd/lib/spin/style'
|
|
15
|
+
import Select from "antd/lib/select";
|
|
16
|
+
import 'antd/lib/select/style'
|
|
17
|
+
import Radio from "antd/lib/radio";
|
|
18
|
+
import 'antd/lib/radio/style'
|
|
19
|
+
import Space from "antd/lib/space";
|
|
20
|
+
import 'antd/lib/space/style'
|
|
21
|
+
import { Collapse } from 'antd';
|
|
22
|
+
import 'antd/lib/collapse/style'
|
|
23
|
+
const { Panel } = Collapse;
|
|
24
|
+
import { Button } from '../../../node_modules/antd/lib/index';
|
|
25
|
+
|
|
8
26
|
import './video.less'
|
|
9
27
|
import { compressImage, isLight, saveBase64Image, combineBase64Images } from '../../utils/utils'
|
|
10
28
|
import Recorder from "js-audio-recorder";
|
|
@@ -35,35 +53,15 @@ import networkWeakAudio from '../../assets/mp3/networkweak.mp3'
|
|
|
35
53
|
import PIPictureClosedAudio from '../../assets/mp3/pip_close.mp3'
|
|
36
54
|
import screenSharedIntervalAudio from '../../assets/mp3/share_stop_audio.mp3'
|
|
37
55
|
import errorPng from '../../assets/img/tooltips2_fail.png'
|
|
38
|
-
import Modal from "antd/lib/modal";
|
|
39
|
-
import 'antd/lib/modal/style'
|
|
40
|
-
import message from "antd/lib/message";
|
|
41
|
-
import 'antd/lib/message/style'
|
|
42
|
-
import Spin from "antd/lib/spin";
|
|
43
|
-
import 'antd/lib/spin/style'
|
|
44
|
-
import Select from "antd/lib/select";
|
|
45
|
-
import 'antd/lib/select/style'
|
|
46
|
-
|
|
47
|
-
import Radio from "antd/lib/radio";
|
|
48
|
-
import 'antd/lib/radio/style'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
import Space from "antd/lib/space";
|
|
52
|
-
import 'antd/lib/space/style'
|
|
53
|
-
import { Collapse } from 'antd';
|
|
54
|
-
import 'antd/lib/collapse/style'
|
|
55
|
-
const { Panel } = Collapse;
|
|
56
|
-
|
|
57
|
-
|
|
58
56
|
import styled from 'styled-components';
|
|
59
|
-
|
|
57
|
+
|
|
60
58
|
import SignMy from '../sign/signMy.jsx'
|
|
61
59
|
import Step from '../components/step/step.jsx'
|
|
62
60
|
import MultiModule from '../multiModule/multiModule'//签字、抄录
|
|
63
61
|
import axios from 'axios';
|
|
64
62
|
import CryptoJS from "crypto-js";
|
|
65
63
|
|
|
66
|
-
const SDK_VERISON = '2.0.
|
|
64
|
+
const SDK_VERISON = '2.0.59'
|
|
67
65
|
const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
|
|
68
66
|
const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
|
|
69
67
|
const { Option } = Select;
|
|
@@ -318,10 +316,11 @@ class Video extends Component {
|
|
|
318
316
|
},
|
|
319
317
|
zIndexNum: -1,
|
|
320
318
|
selectSpan: 'pen',
|
|
321
|
-
isModalVisibleCustomer: false,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
319
|
+
isModalVisibleCustomer: false, // 证件识别弹窗
|
|
320
|
+
stepIndex: 0, // 证件识别步骤
|
|
321
|
+
customerSelectType: 1, // 选择客户类型
|
|
322
|
+
customerSelect: '', // 选择客户
|
|
323
|
+
documentType: '', // 选择证件类型
|
|
325
324
|
documentError: '',
|
|
326
325
|
customerTitleName: '客户证件识别',
|
|
327
326
|
certificateType: 'ID_CARD',
|
|
@@ -1023,13 +1022,13 @@ class Video extends Component {
|
|
|
1023
1022
|
customerList: list
|
|
1024
1023
|
})
|
|
1025
1024
|
if (list.length > 0) {
|
|
1026
|
-
if (val
|
|
1025
|
+
if (val === 'ocr') {
|
|
1027
1026
|
console.log('this.state.customerList.length',list.length)
|
|
1028
1027
|
this.setState({
|
|
1028
|
+
stepIndex: 0,
|
|
1029
1029
|
documentType: '',
|
|
1030
|
-
|
|
1031
|
-
customerSelect: list.length
|
|
1032
|
-
|
|
1030
|
+
customerSelectType: '',
|
|
1031
|
+
customerSelect: list.length === 1 ? 1 : '',
|
|
1033
1032
|
customerTitleName: '客户证件识别'
|
|
1034
1033
|
},()=>{
|
|
1035
1034
|
console.log(this.state.customerSelect)
|
|
@@ -1037,7 +1036,7 @@ class Video extends Component {
|
|
|
1037
1036
|
isModalVisibleCustomer: true,
|
|
1038
1037
|
})
|
|
1039
1038
|
})
|
|
1040
|
-
} else if (val
|
|
1039
|
+
} else if (val === 'facial') {
|
|
1041
1040
|
this.setState({
|
|
1042
1041
|
clickedFacial: true
|
|
1043
1042
|
})
|
|
@@ -5136,7 +5135,22 @@ class Video extends Component {
|
|
|
5136
5135
|
handleOkFacial = () => {
|
|
5137
5136
|
if (this.state.faceCustomerType == 2) {
|
|
5138
5137
|
if (this.state.IDtypeFrontOrBack == IDtypeFront) {
|
|
5139
|
-
if(this.state.documentType
|
|
5138
|
+
if (this.state.documentType === 'OTHER_CARD') {
|
|
5139
|
+
// 证件类型为其他时不需要OCR,直接截图保存本地
|
|
5140
|
+
saveBase64Image(this.state.facialImgFront, `其他证件-${new Date().getTime()}`)
|
|
5141
|
+
this.setState({
|
|
5142
|
+
isModalVisibleFacial: false,
|
|
5143
|
+
facialImg: '',
|
|
5144
|
+
isFaceImage: false,
|
|
5145
|
+
facialImgFront: '',
|
|
5146
|
+
})
|
|
5147
|
+
this.sendMessage({
|
|
5148
|
+
'typeId': 1020,
|
|
5149
|
+
'sessionId': this.state.sessionId,
|
|
5150
|
+
'cameraState': 1,
|
|
5151
|
+
"userId": this.state.faceCustomerUid
|
|
5152
|
+
})
|
|
5153
|
+
} else if(this.state.documentType == 'PASSPORT_CARD' || this.state.documentType == 'TW_PASS_CARD' || this.state.documentType == 'HK_MO_PASS_CARD') {
|
|
5140
5154
|
this.setState({
|
|
5141
5155
|
loadingFace: true
|
|
5142
5156
|
})
|
|
@@ -5425,14 +5439,14 @@ class Video extends Component {
|
|
|
5425
5439
|
videoName = 'video12'
|
|
5426
5440
|
}
|
|
5427
5441
|
console.log('sid-videoName', sid, videoName)
|
|
5428
|
-
this.state.customOcrSid = sid
|
|
5429
|
-
this.state.faceCustomerUid = item.customId
|
|
5430
|
-
|
|
5442
|
+
this.state.customOcrSid = sid;
|
|
5443
|
+
this.state.faceCustomerUid = item.customId;
|
|
5444
|
+
this.state.customerName = item.name;
|
|
5431
5445
|
this.setState({
|
|
5432
5446
|
clickedFacial: false,
|
|
5433
5447
|
clickedOcr: false,
|
|
5434
5448
|
isFaceImage: false,
|
|
5435
|
-
facialImg: this.state.titleModal
|
|
5449
|
+
facialImg: this.state.titleModal === '身份验证' ? faceImage : ocrImage,
|
|
5436
5450
|
disabledIdCard: true,
|
|
5437
5451
|
IDtypeFrontOrBack: IDtypeFront,
|
|
5438
5452
|
facialImgFront: '',
|
|
@@ -6484,46 +6498,70 @@ class Video extends Component {
|
|
|
6484
6498
|
this.changePdfRendering()
|
|
6485
6499
|
}
|
|
6486
6500
|
}
|
|
6501
|
+
onChangeOCRCustomerType = (e) => {
|
|
6502
|
+
this.setState({
|
|
6503
|
+
customerSelectType: e.target.value
|
|
6504
|
+
})
|
|
6505
|
+
}
|
|
6487
6506
|
onChangeOCRCustomer = (e) => {
|
|
6488
6507
|
console.log(e)
|
|
6489
6508
|
this.setState({
|
|
6490
6509
|
customerSelect: e.target.value
|
|
6491
6510
|
})
|
|
6492
6511
|
}
|
|
6512
|
+
|
|
6513
|
+
// 证件识别取消
|
|
6493
6514
|
handleCancelCustomer = () => {
|
|
6494
6515
|
this.setState({
|
|
6495
6516
|
isModalVisibleCustomer: false
|
|
6496
6517
|
})
|
|
6497
6518
|
}
|
|
6519
|
+
// 证件识别上一步(客户选择、证件类型)
|
|
6498
6520
|
goBackSelectCustomer=()=>{
|
|
6499
|
-
this.
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6521
|
+
if (this.state.stepIndex === 2) {
|
|
6522
|
+
this.setState((preState)=> ({
|
|
6523
|
+
stepIndex: preState.stepIndex - 1,
|
|
6524
|
+
customerSelect: this.state.customerList.length === 1 ? 1 : '',
|
|
6525
|
+
customerTitleName: '客户证件识别'
|
|
6526
|
+
}))
|
|
6527
|
+
} else {
|
|
6528
|
+
this.setState((preState)=> ({
|
|
6529
|
+
stepIndex: preState.stepIndex - 1,
|
|
6530
|
+
customerSelectType: '',
|
|
6531
|
+
}))
|
|
6532
|
+
}
|
|
6505
6533
|
}
|
|
6534
|
+
// 证件识别下一步
|
|
6506
6535
|
handleOkCustomer = () => {
|
|
6507
|
-
if (this.state.
|
|
6536
|
+
if (this.state.stepIndex === 0) {
|
|
6537
|
+
// 选择客户类型
|
|
6538
|
+
this.setState((preState)=> ({
|
|
6539
|
+
stepIndex: preState.stepIndex + 1,
|
|
6540
|
+
customerSelect: this.state.customerList.length === 1 ? 1 : '',
|
|
6541
|
+
}))
|
|
6542
|
+
} else if (this.state.stepIndex === 1) {
|
|
6543
|
+
// 选择客户
|
|
6508
6544
|
if (this.state.customerList[this.state.customerSelect - 1].tourist) {
|
|
6509
6545
|
this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
|
|
6510
6546
|
} else {
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
} else {
|
|
6547
|
+
this.setState((preState)=> ({
|
|
6548
|
+
stepIndex: preState.stepIndex + 1,
|
|
6549
|
+
documentError: '',
|
|
6550
|
+
documentType: '',
|
|
6551
|
+
customerTitleName: this.state.customerList[this.state.customerSelect - 1].name
|
|
6552
|
+
}))
|
|
6553
|
+
}
|
|
6554
|
+
} else if (this.state.stepIndex === 2) {
|
|
6555
|
+
// 选择证件类型
|
|
6519
6556
|
this.getAuthorizeResult(this.state.customerList[this.state.customerSelect - 1].customId).then((res) => {
|
|
6520
|
-
if (res) {
|
|
6557
|
+
if (res || this.state.customerSelectType === 1 || this.state.documentType === 'OTHER_CARD') {
|
|
6558
|
+
// 客户类型为保险、或者证件类型为其他时不需要授权
|
|
6521
6559
|
this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
|
|
6522
6560
|
this.setState({
|
|
6523
6561
|
isModalVisibleCustomer: false,
|
|
6524
6562
|
})
|
|
6525
6563
|
} else {
|
|
6526
|
-
if (this.state.documentType
|
|
6564
|
+
if (this.state.documentType === 'ID_CARD') {
|
|
6527
6565
|
this.test_controller.SendTextMsg(JSON.stringify({
|
|
6528
6566
|
'typeId': 3300,
|
|
6529
6567
|
"data": {
|
|
@@ -6553,7 +6591,6 @@ class Video extends Component {
|
|
|
6553
6591
|
}
|
|
6554
6592
|
]
|
|
6555
6593
|
}
|
|
6556
|
-
|
|
6557
6594
|
}))
|
|
6558
6595
|
} else {
|
|
6559
6596
|
this.test_controller.SendTextMsg(JSON.stringify({
|
|
@@ -6580,7 +6617,6 @@ class Video extends Component {
|
|
|
6580
6617
|
}
|
|
6581
6618
|
]
|
|
6582
6619
|
}
|
|
6583
|
-
|
|
6584
6620
|
}))
|
|
6585
6621
|
}
|
|
6586
6622
|
this.setState({
|
|
@@ -6589,10 +6625,9 @@ class Video extends Component {
|
|
|
6589
6625
|
})
|
|
6590
6626
|
}
|
|
6591
6627
|
})
|
|
6592
|
-
// this.customerFaceClick(this.state.customerList[this.state.customerSelect])
|
|
6593
6628
|
}
|
|
6594
|
-
|
|
6595
6629
|
}
|
|
6630
|
+
|
|
6596
6631
|
onChangeDocumentType = (e) => {
|
|
6597
6632
|
this.setState({
|
|
6598
6633
|
documentType: e.target.value,
|
|
@@ -7230,13 +7265,14 @@ class Video extends Component {
|
|
|
7230
7265
|
<Button className="modelButtonCancel" onClick={this.handleCancelFacial}>取消</Button>
|
|
7231
7266
|
<Button className="modelButtonCancel" onClick={this.sgsinImage}>拍照</Button>
|
|
7232
7267
|
{/* 再截图后按钮高亮 */}
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7268
|
+
<Button
|
|
7269
|
+
className={this.state.isFaceImage ? 'modelButtonOk' : 'modelButtonNo'}
|
|
7270
|
+
type="primary"
|
|
7271
|
+
danger
|
|
7272
|
+
onClick={this.handleOkFacial}
|
|
7273
|
+
>
|
|
7274
|
+
{this.state.documentType === 'OTHER_CARD' ? '确认' : '下一步'}
|
|
7275
|
+
</Button>
|
|
7240
7276
|
</div>,
|
|
7241
7277
|
// 人脸识别后的结果界面的按钮
|
|
7242
7278
|
this.state.cardResuly == '' && this.state.faceResuly != '' &&<div key='facial'>
|
|
@@ -7283,7 +7319,7 @@ class Video extends Component {
|
|
|
7283
7319
|
]}>
|
|
7284
7320
|
<Spin spinning={this.state.loadingFace} tip="识别中...">
|
|
7285
7321
|
<div style={{display: 'flex', padding: '10px 20px'}}>
|
|
7286
|
-
<Step style={{marginTop: '10px'}} current={this.state.titleModal
|
|
7322
|
+
<Step style={{marginTop: '10px'}} current={this.state.titleModal === '身份验证'? 4 : 3} />
|
|
7287
7323
|
<div className="faceBody">
|
|
7288
7324
|
{this.state.cardResuly == '' && <div className='faceCardImg'>
|
|
7289
7325
|
|
|
@@ -7398,44 +7434,49 @@ class Video extends Component {
|
|
|
7398
7434
|
</div>
|
|
7399
7435
|
</Spin>
|
|
7400
7436
|
</Modal>
|
|
7437
|
+
{/*证件识别弹窗*/}
|
|
7401
7438
|
<Modal width={650} title={this.state.customerTitleName} closable={false} centered={true} visible={this.state.isModalVisibleCustomer} maskClosable={false}
|
|
7402
7439
|
footer={[
|
|
7403
7440
|
<div key='end'>
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
7441
|
{
|
|
7407
|
-
|
|
7442
|
+
this.state.stepIndex !== 0 && <Button className="modelButtonCancel" onClick={this.goBackSelectCustomer}>上一步</Button>
|
|
7408
7443
|
}
|
|
7409
7444
|
<Button className="modelButtonCancel" onClick={this.handleCancelCustomer}>取消</Button>
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
this.state.
|
|
7445
|
+
<Button
|
|
7446
|
+
className={
|
|
7447
|
+
(this.state.stepIndex === 0 && this.state.customerSelectType) ||
|
|
7448
|
+
(this.state.stepIndex === 1 && this.state.customerSelect) ||
|
|
7449
|
+
(this.state.stepIndex === 2 && this.state.documentType) ? 'modelButtonOk' : 'modelButtonNo modelNoButton'
|
|
7414
7450
|
}
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
}
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
!this.state.isCustomerSelect&& <span>
|
|
7422
|
-
{
|
|
7423
|
-
this.state.documentType == '' && <Button className="modelButtonNo modelNoButton" type="primary" danger>下一步</Button>
|
|
7424
|
-
}
|
|
7425
|
-
{
|
|
7426
|
-
this.state.documentType != '' &&<Button className="modelButtonOk" type="primary" danger onClick={this.handleOkCustomer}>下一步</Button>
|
|
7427
|
-
}
|
|
7428
|
-
</span>
|
|
7429
|
-
}
|
|
7430
|
-
|
|
7451
|
+
type="primary"
|
|
7452
|
+
danger
|
|
7453
|
+
onClick={this.handleOkCustomer}
|
|
7454
|
+
>
|
|
7455
|
+
下一步
|
|
7456
|
+
</Button>
|
|
7431
7457
|
</div>
|
|
7432
7458
|
]}>
|
|
7433
7459
|
<div style={{display: 'flex', padding: '10px 20px'}}>
|
|
7434
|
-
<Step current={this.state.
|
|
7460
|
+
<Step current={this.state.stepIndex} />
|
|
7435
7461
|
<div>
|
|
7436
7462
|
{
|
|
7437
|
-
this.state.
|
|
7463
|
+
this.state.stepIndex === 0 && <div>
|
|
7438
7464
|
<div className='CustomerSelectTitle'>
|
|
7465
|
+
请选择客户类型
|
|
7466
|
+
</div>
|
|
7467
|
+
<div>
|
|
7468
|
+
<Radio.Group onChange={this.onChangeOCRCustomerType} value={this.state.customerSelectType}>
|
|
7469
|
+
<Space direction="vertical">
|
|
7470
|
+
<Radio value={1}>保险</Radio>
|
|
7471
|
+
<Radio value={2}>ECN陪同者</Radio>
|
|
7472
|
+
</Space>
|
|
7473
|
+
</Radio.Group>
|
|
7474
|
+
</div>
|
|
7475
|
+
</div>
|
|
7476
|
+
}
|
|
7477
|
+
{
|
|
7478
|
+
this.state.stepIndex === 1 && <div>
|
|
7479
|
+
<div className='CustomerSelectTitle'>
|
|
7439
7480
|
请选择客户
|
|
7440
7481
|
</div>
|
|
7441
7482
|
<div>
|
|
@@ -7443,9 +7484,7 @@ class Video extends Component {
|
|
|
7443
7484
|
<Space direction="vertical">
|
|
7444
7485
|
{
|
|
7445
7486
|
this.state.customerList.map((item, index) => {
|
|
7446
|
-
|
|
7447
|
-
return <Radio value={index + 1}>{item.name}</Radio>
|
|
7448
|
-
// }
|
|
7487
|
+
return <Radio value={index + 1}>{item.name}</Radio>
|
|
7449
7488
|
})
|
|
7450
7489
|
}
|
|
7451
7490
|
</Space>
|
|
@@ -7455,9 +7494,9 @@ class Video extends Component {
|
|
|
7455
7494
|
</div>
|
|
7456
7495
|
}
|
|
7457
7496
|
{
|
|
7458
|
-
|
|
7497
|
+
this.state.stepIndex === 2 && <div>
|
|
7459
7498
|
{
|
|
7460
|
-
this.state.documentError
|
|
7499
|
+
this.state.documentError !== '' && <div className='errorClassFace'>
|
|
7461
7500
|
<img src={require("../../assets/img/tooltips2_fail.png").default} alt="" ></img>{this.state.documentError}</div>
|
|
7462
7501
|
}
|
|
7463
7502
|
<div className='CustomerSelectTitle'>
|
|
@@ -7472,6 +7511,7 @@ class Video extends Component {
|
|
|
7472
7511
|
<Radio value={'HK_MO_PASS_CARD'}>港澳来往大陆通行证</Radio>
|
|
7473
7512
|
<Radio value={'HK_MO_RESIDENCE_CARD'}>港澳居民居住证</Radio>
|
|
7474
7513
|
<Radio value={'TW_RESIDENCE_CARD'}>台湾居民居住证</Radio>
|
|
7514
|
+
<Radio value={'OTHER_CARD'}>其他证件</Radio>
|
|
7475
7515
|
{/* <Radio value={'FOREIGNER_RESIDENCE_CARD'}>外国人永久居住证</Radio> */}
|
|
7476
7516
|
</Space>
|
|
7477
7517
|
</Radio.Group>
|