react_hsbc_teller 2.0.58 → 2.0.60

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react_hsbc_teller",
3
- "version": "2.0.58",
3
+ "version": "2.0.60",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -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
- {/* step1 */}
14
- <Step status={current==0? '':'wait'} title="请选择客户" />
15
-
16
- {/* step2 */}
17
- <Step status={current==1? '':'wait'} title="确认客户证件类型" />
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
- import { Button } from '../../../node_modules/antd/lib/index';
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.58'
64
+ const SDK_VERISON = '2.0.60'
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
- customerSelect: '',
323
- documentType: '',
324
- isCustomerSelect: true,
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 == 'ocr') {
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
- isCustomerSelect: true,
1031
- customerSelect: list.length == 1 ? 1 : '',
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 == 'facial') {
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 == 'PASSPORT_CARD' || this.state.documentType == 'TW_PASS_CARD' || this.state.documentType == 'HK_MO_PASS_CARD') {
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
- this.state.customerName = item.name
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=='身份验证'? faceImage : ocrImage,
5449
+ facialImg: this.state.titleModal === '身份验证' ? faceImage : ocrImage,
5436
5450
  disabledIdCard: true,
5437
5451
  IDtypeFrontOrBack: IDtypeFront,
5438
5452
  facialImgFront: '',
@@ -6164,6 +6178,11 @@ class Video extends Component {
6164
6178
  this.setState({
6165
6179
  isModalVisibleEnvironment: false,
6166
6180
  })
6181
+ const cMicrophone = this.state.microphoneList.find((item)=> item.actionid === this.state.microphoneValue);
6182
+ const cSpeaker = this.state.speakerList[0];
6183
+ console.log(`当前麦克风设备: ${cMicrophone?.actionname ||''}, 当前扬声器设备: ${cSpeaker?.actionname || ''}`);
6184
+ this.saveLog(`当前麦克风设备: ${cMicrophone?.actionname ||''}, 当前扬声器设备: ${cSpeaker?.actionname || ''}`);
6185
+ // 开启画中画
6167
6186
  if (!this.state.isPictureInPicture) {
6168
6187
  this.pictureInPicture()
6169
6188
  }
@@ -6484,46 +6503,70 @@ class Video extends Component {
6484
6503
  this.changePdfRendering()
6485
6504
  }
6486
6505
  }
6506
+ onChangeOCRCustomerType = (e) => {
6507
+ this.setState({
6508
+ customerSelectType: e.target.value
6509
+ })
6510
+ }
6487
6511
  onChangeOCRCustomer = (e) => {
6488
6512
  console.log(e)
6489
6513
  this.setState({
6490
6514
  customerSelect: e.target.value
6491
6515
  })
6492
6516
  }
6517
+
6518
+ // 证件识别取消
6493
6519
  handleCancelCustomer = () => {
6494
6520
  this.setState({
6495
6521
  isModalVisibleCustomer: false
6496
6522
  })
6497
6523
  }
6524
+ // 证件识别上一步(客户选择、证件类型)
6498
6525
  goBackSelectCustomer=()=>{
6499
- this.setState({
6500
- documentType: '',
6501
- isCustomerSelect: true,
6502
- customerSelect: this.state.customerList.length == 1 ? 1 : '',
6503
- customerTitleName: '客户证件识别'
6504
- })
6526
+ if (this.state.stepIndex === 2) {
6527
+ this.setState((preState)=> ({
6528
+ stepIndex: preState.stepIndex - 1,
6529
+ customerSelect: this.state.customerList.length === 1 ? 1 : '',
6530
+ customerTitleName: '客户证件识别'
6531
+ }))
6532
+ } else {
6533
+ this.setState((preState)=> ({
6534
+ stepIndex: preState.stepIndex - 1,
6535
+ customerSelectType: '',
6536
+ }))
6537
+ }
6505
6538
  }
6539
+ // 证件识别下一步
6506
6540
  handleOkCustomer = () => {
6507
- if (this.state.isCustomerSelect) {
6541
+ if (this.state.stepIndex === 0) {
6542
+ // 选择客户类型
6543
+ this.setState((preState)=> ({
6544
+ stepIndex: preState.stepIndex + 1,
6545
+ customerSelect: this.state.customerList.length === 1 ? 1 : '',
6546
+ }))
6547
+ } else if (this.state.stepIndex === 1) {
6548
+ // 选择客户
6508
6549
  if (this.state.customerList[this.state.customerSelect - 1].tourist) {
6509
6550
  this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
6510
6551
  } else {
6511
- this.setState({
6512
- isCustomerSelect: false,
6513
- documentError: '',
6514
- customerTitleName: this.state.customerList[this.state.customerSelect - 1].name
6515
- })
6516
- }
6517
-
6518
- } else {
6552
+ this.setState((preState)=> ({
6553
+ stepIndex: preState.stepIndex + 1,
6554
+ documentError: '',
6555
+ documentType: '',
6556
+ customerTitleName: this.state.customerList[this.state.customerSelect - 1].name
6557
+ }))
6558
+ }
6559
+ } else if (this.state.stepIndex === 2) {
6560
+ // 选择证件类型
6519
6561
  this.getAuthorizeResult(this.state.customerList[this.state.customerSelect - 1].customId).then((res) => {
6520
- if (res) {
6562
+ if (res || this.state.customerSelectType === 1 || this.state.documentType === 'OTHER_CARD') {
6563
+ // 客户类型为保险、或者证件类型为其他时不需要授权
6521
6564
  this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
6522
6565
  this.setState({
6523
6566
  isModalVisibleCustomer: false,
6524
6567
  })
6525
6568
  } else {
6526
- if (this.state.documentType == 'ID_CARD') {
6569
+ if (this.state.documentType === 'ID_CARD') {
6527
6570
  this.test_controller.SendTextMsg(JSON.stringify({
6528
6571
  'typeId': 3300,
6529
6572
  "data": {
@@ -6553,7 +6596,6 @@ class Video extends Component {
6553
6596
  }
6554
6597
  ]
6555
6598
  }
6556
-
6557
6599
  }))
6558
6600
  } else {
6559
6601
  this.test_controller.SendTextMsg(JSON.stringify({
@@ -6580,7 +6622,6 @@ class Video extends Component {
6580
6622
  }
6581
6623
  ]
6582
6624
  }
6583
-
6584
6625
  }))
6585
6626
  }
6586
6627
  this.setState({
@@ -6589,10 +6630,9 @@ class Video extends Component {
6589
6630
  })
6590
6631
  }
6591
6632
  })
6592
- // this.customerFaceClick(this.state.customerList[this.state.customerSelect])
6593
6633
  }
6594
-
6595
6634
  }
6635
+
6596
6636
  onChangeDocumentType = (e) => {
6597
6637
  this.setState({
6598
6638
  documentType: e.target.value,
@@ -7230,13 +7270,14 @@ class Video extends Component {
7230
7270
  <Button className="modelButtonCancel" onClick={this.handleCancelFacial}>取消</Button>
7231
7271
  <Button className="modelButtonCancel" onClick={this.sgsinImage}>拍照</Button>
7232
7272
  {/* 再截图后按钮高亮 */}
7233
- {
7234
- this.state.isFaceImage && <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkFacial}>下一步</Button>
7235
- }
7236
- {
7237
- !this.state.isFaceImage && <Button className="modelButtonNo" type="primary" danger>下一步</Button>
7238
- }
7239
-
7273
+ <Button
7274
+ className={this.state.isFaceImage ? 'modelButtonOk' : 'modelButtonNo'}
7275
+ type="primary"
7276
+ danger
7277
+ onClick={this.handleOkFacial}
7278
+ >
7279
+ {this.state.documentType === 'OTHER_CARD' ? '确认' : '下一步'}
7280
+ </Button>
7240
7281
  </div>,
7241
7282
  // 人脸识别后的结果界面的按钮
7242
7283
  this.state.cardResuly == '' && this.state.faceResuly != '' &&<div key='facial'>
@@ -7283,7 +7324,7 @@ class Video extends Component {
7283
7324
  ]}>
7284
7325
  <Spin spinning={this.state.loadingFace} tip="识别中...">
7285
7326
  <div style={{display: 'flex', padding: '10px 20px'}}>
7286
- <Step style={{marginTop: '10px'}} current={this.state.titleModal == '身份验证'?3:2} ></Step>
7327
+ <Step style={{marginTop: '10px'}} current={this.state.titleModal === '身份验证'? 4 : 3} />
7287
7328
  <div className="faceBody">
7288
7329
  {this.state.cardResuly == '' && <div className='faceCardImg'>
7289
7330
 
@@ -7398,44 +7439,49 @@ class Video extends Component {
7398
7439
  </div>
7399
7440
  </Spin>
7400
7441
  </Modal>
7442
+ {/*证件识别弹窗*/}
7401
7443
  <Modal width={650} title={this.state.customerTitleName} closable={false} centered={true} visible={this.state.isModalVisibleCustomer} maskClosable={false}
7402
7444
  footer={[
7403
7445
  <div key='end'>
7404
-
7405
-
7406
7446
  {
7407
- !this.state.isCustomerSelect && <Button className="modelButtonCancel" onClick={this.goBackSelectCustomer}>上一步</Button>
7447
+ this.state.stepIndex !== 0 && <Button className="modelButtonCancel" onClick={this.goBackSelectCustomer}>上一步</Button>
7408
7448
  }
7409
7449
  <Button className="modelButtonCancel" onClick={this.handleCancelCustomer}>取消</Button>
7410
- {
7411
- this.state.isCustomerSelect && <span>
7412
- {
7413
- this.state.customerSelect == '' && <Button className="modelButtonNo modelNoButton" type="primary" danger>下一步</Button>
7450
+ <Button
7451
+ className={
7452
+ (this.state.stepIndex === 0 && this.state.customerSelectType) ||
7453
+ (this.state.stepIndex === 1 && this.state.customerSelect) ||
7454
+ (this.state.stepIndex === 2 && this.state.documentType) ? 'modelButtonOk' : 'modelButtonNo modelNoButton'
7414
7455
  }
7415
- {
7416
- this.state.customerSelect != '' && <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkCustomer}>下一步</Button>
7417
- }
7418
- </span>
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
-
7456
+ type="primary"
7457
+ danger
7458
+ onClick={this.handleOkCustomer}
7459
+ >
7460
+ 下一步
7461
+ </Button>
7431
7462
  </div>
7432
7463
  ]}>
7433
7464
  <div style={{display: 'flex', padding: '10px 20px'}}>
7434
- <Step current={this.state.isCustomerSelect?0:1} ocr={true} />
7465
+ <Step current={this.state.stepIndex} />
7435
7466
  <div>
7436
7467
  {
7437
- this.state.isCustomerSelect && <div>
7468
+ this.state.stepIndex === 0 && <div>
7438
7469
  <div className='CustomerSelectTitle'>
7470
+ 请选择客户类型
7471
+ </div>
7472
+ <div>
7473
+ <Radio.Group onChange={this.onChangeOCRCustomerType} value={this.state.customerSelectType}>
7474
+ <Space direction="vertical">
7475
+ <Radio value={1}>保险客户</Radio>
7476
+ <Radio value={2}>ECN陪同者</Radio>
7477
+ </Space>
7478
+ </Radio.Group>
7479
+ </div>
7480
+ </div>
7481
+ }
7482
+ {
7483
+ this.state.stepIndex === 1 && <div>
7484
+ <div className='CustomerSelectTitle'>
7439
7485
  请选择客户
7440
7486
  </div>
7441
7487
  <div>
@@ -7443,9 +7489,7 @@ class Video extends Component {
7443
7489
  <Space direction="vertical">
7444
7490
  {
7445
7491
  this.state.customerList.map((item, index) => {
7446
- // if(item.name.indexOf("访客") != -1) {
7447
- return <Radio value={index + 1}>{item.name}</Radio>
7448
- // }
7492
+ return <Radio value={index + 1}>{item.name}</Radio>
7449
7493
  })
7450
7494
  }
7451
7495
  </Space>
@@ -7455,9 +7499,9 @@ class Video extends Component {
7455
7499
  </div>
7456
7500
  }
7457
7501
  {
7458
- !this.state.isCustomerSelect && <div>
7502
+ this.state.stepIndex === 2 && <div>
7459
7503
  {
7460
- this.state.documentError != '' && <div className='errorClassFace'>
7504
+ this.state.documentError !== '' && <div className='errorClassFace'>
7461
7505
  <img src={require("../../assets/img/tooltips2_fail.png").default} alt="" ></img>{this.state.documentError}</div>
7462
7506
  }
7463
7507
  <div className='CustomerSelectTitle'>
@@ -7472,6 +7516,7 @@ class Video extends Component {
7472
7516
  <Radio value={'HK_MO_PASS_CARD'}>港澳来往大陆通行证</Radio>
7473
7517
  <Radio value={'HK_MO_RESIDENCE_CARD'}>港澳居民居住证</Radio>
7474
7518
  <Radio value={'TW_RESIDENCE_CARD'}>台湾居民居住证</Radio>
7519
+ <Radio value={'OTHER_CARD'}>其他证件</Radio>
7475
7520
  {/* <Radio value={'FOREIGNER_RESIDENCE_CARD'}>外国人永久居住证</Radio> */}
7476
7521
  </Space>
7477
7522
  </Radio.Group>
@@ -713,3 +713,6 @@ display: inline-flex;
713
713
  }
714
714
  }
715
715
  }
716
+ body {
717
+ font-size: 100%;
718
+ }