react_hsbc_teller 1.9.6 → 1.9.7

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": "1.9.6",
3
+ "version": "1.9.7",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -7,16 +7,16 @@ class Demo extends Component {
7
7
  shareMask: false,
8
8
  imRoomId
9
9
  :
10
- "IZLZMoTxj@conference.ls-im-xmpp.chinawp.dev.ali.cloud.cn.hsbc",
10
+ "vVwWYL84k@conference.ls-im-xmpp.chinawp.dev.ali.cloud.cn.hsbc",
11
11
  sessionId
12
12
  :
13
- "IZLZMoTxj",
13
+ "vVwWYL84k",
14
14
  mtoken
15
15
  :
16
- "bc084d8a922f",
16
+ "d6544d018d07",
17
17
  roomId
18
18
  :
19
- "663912632731275",
19
+ "664439964321531",
20
20
  // roomId: '',
21
21
  // mtoken: '',
22
22
  // imRoomId: '',
@@ -352,7 +352,7 @@ class Video extends Component {
352
352
  saveLog = (val) => {
353
353
  axios({
354
354
  method: 'get',
355
- baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.6&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
355
+ baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.7&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
356
356
 
357
357
  }).then(res => {
358
358
 
@@ -792,7 +792,7 @@ class Video extends Component {
792
792
  cardFailReason: '系统或网络连接异常,请重试。若仍有问题,请联系Support同事。[#'+value+'#]'
793
793
  })
794
794
  }
795
- if(value == 30002) {
795
+ if(value == 30002 || value == 20002 || value == 40002 || value == 50002 ) {
796
796
  this.setState({
797
797
  cardFailReason: '识别成功-证件已过期。[#'+value+'#]'
798
798
  })
@@ -833,7 +833,7 @@ class Video extends Component {
833
833
  fileBase64: this.state.facialImg.replace(/^data:image\/\w+;base64,/, "")
834
834
  });
835
835
  console.log(result);
836
- if (result.code == 200 || result.code == 201) {
836
+ if (result.code == 200 || result.code == 210) {
837
837
  // this.messageClick('人脸识别成功','success')
838
838
  this.setState({
839
839
  loadingFace: false,
@@ -3878,7 +3878,7 @@ class Video extends Component {
3878
3878
  }
3879
3879
  }
3880
3880
  componentWillMount() {
3881
- console.log('hsbc_teller_sdk', '1.9.6')
3881
+ console.log('hsbc_teller_sdk', '1.9.7')
3882
3882
  if (this.props.sessionId) {
3883
3883
  this.getRoomStatus({
3884
3884
  sessionId: this.props.sessionId
@@ -4338,13 +4338,25 @@ class Video extends Component {
4338
4338
  if(this.state.documentType == 'ID_CARD') {
4339
4339
  if (result.data.side == 'front') {
4340
4340
  if(this.state.certificateValidity) {
4341
- this.setState({
4342
- idCardNumber: result.data.idCardNumber,
4343
- idCardName: result.data.idCardName,
4344
- loadingFace: false,
4345
- cardFailReason: '',
4346
- cardResuly: 'success',
4347
- })
4341
+ if(this.dateNewTime(this.state.certificateValidity.split('-')[1])){
4342
+ this.setState({
4343
+ idCardNumber: result.data.idCardNumber,
4344
+ idCardName: result.data.idCardName,
4345
+ loadingFace: false,
4346
+ cardFailReason: '',
4347
+ cardResuly: 'success',
4348
+ })
4349
+ } else {
4350
+ this.setState({
4351
+ idCardNumber: result.data.idCardNumber,
4352
+ idCardName: result.data.idCardName,
4353
+ certificateValidityType: false,
4354
+ cardFailReason: '证件不在有效期内',
4355
+ loadingFace: false,
4356
+ cardResuly: 'success',
4357
+ })
4358
+ }
4359
+
4348
4360
  } else {
4349
4361
  this.setState({
4350
4362
  // isModalVisibleFacial: false
@@ -4355,7 +4367,7 @@ class Video extends Component {
4355
4367
  }
4356
4368
  } else if (result.data.side == 'back') {
4357
4369
  console.log(result.data.startDate, result.data.endDate)
4358
- if(this.state.idCardName && this.dateNewTime(result.data.endDate.split('-')[1])) {
4370
+ if(this.state.idCardName && this.dateNewTime(result.data.endDate)) {
4359
4371
  this.setState({
4360
4372
  certificateValidity: result.data.startDate + '-' + result.data.endDate,
4361
4373
  loadingFace: false,
@@ -4363,27 +4375,19 @@ class Video extends Component {
4363
4375
  cardResuly: 'success',
4364
4376
  certificateValidityType: true,
4365
4377
  })
4366
- } else if(this.state.idCardName && !this.dateNewTime(result.data.endDate.split('-')[1])) {
4378
+ } else if(this.state.idCardName && !this.dateNewTime(result.data.endDate)) {
4367
4379
  this.setState({
4368
4380
  certificateValidity: result.data.startDate + '-' + result.data.endDate,
4369
4381
  loadingFace: false,
4370
4382
  certificateValidityType: false,
4371
4383
  cardFailReason: '证件不在有效期内',
4372
- cardResuly: 'fail',
4384
+ cardResuly: 'success',
4373
4385
  })
4374
- } else if(!this.state.idCardName && this.dateNewTime(result.data.endDate.split('-')[1])) {
4386
+ } else if(!this.state.idCardName) {
4375
4387
  this.setState({
4376
4388
  certificateValidity: result.data.startDate + '-' + result.data.endDate,
4377
4389
  })
4378
4390
  this.ocrCallback(2)
4379
- } else if(!this.state.idCardName && !this.dateNewTime(result.data.endDate.split('-')[1])) {
4380
- this.setState({
4381
- certificateValidity: result.data.startDate + '-' + result.data.endDate,
4382
- loadingFace: false,
4383
- certificateValidityType: false,
4384
- cardFailReason: '证件不在有效期内',
4385
- cardResuly: 'fail',
4386
- })
4387
4391
  }
4388
4392
  // if(this.state.idCardName) {
4389
4393
  // this.setState({
@@ -5390,7 +5394,7 @@ class Video extends Component {
5390
5394
  content: JSON.stringify({
5391
5395
  'typeId': 1223,
5392
5396
  'sessionId': this.state.sessionId,
5393
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5397
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId2').innerText).uid
5394
5398
  })
5395
5399
  });
5396
5400
  } if (value == 'video3') {
@@ -5399,7 +5403,7 @@ class Video extends Component {
5399
5403
  content: JSON.stringify({
5400
5404
  'typeId': 1223,
5401
5405
  'sessionId': this.state.sessionId,
5402
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5406
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId3').innerText).uid
5403
5407
  })
5404
5408
  });
5405
5409
  } if (value == 'video4') {
@@ -5408,7 +5412,7 @@ class Video extends Component {
5408
5412
  content: JSON.stringify({
5409
5413
  'typeId': 1223,
5410
5414
  'sessionId': this.state.sessionId,
5411
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5415
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId4').innerText).uid
5412
5416
  })
5413
5417
  });
5414
5418
  } if (value == 'video5') {
@@ -5417,7 +5421,7 @@ class Video extends Component {
5417
5421
  content: JSON.stringify({
5418
5422
  'typeId': 1223,
5419
5423
  'sessionId': this.state.sessionId,
5420
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5424
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId5').innerText).uid
5421
5425
  })
5422
5426
  });
5423
5427
  } if (value == 'video6') {
@@ -5426,7 +5430,7 @@ class Video extends Component {
5426
5430
  content: JSON.stringify({
5427
5431
  'typeId': 1223,
5428
5432
  'sessionId': this.state.sessionId,
5429
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5433
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId6').innerText).uid
5430
5434
  })
5431
5435
  });
5432
5436
  } if (value == 'video7') {
@@ -5435,7 +5439,7 @@ class Video extends Component {
5435
5439
  content: JSON.stringify({
5436
5440
  'typeId': 1223,
5437
5441
  'sessionId': this.state.sessionId,
5438
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5442
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId7').innerText).uid
5439
5443
  })
5440
5444
  });
5441
5445
  } if (value == 'video8') {
@@ -5444,7 +5448,7 @@ class Video extends Component {
5444
5448
  content: JSON.stringify({
5445
5449
  'typeId': 1223,
5446
5450
  'sessionId': this.state.sessionId,
5447
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5451
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId8').innerText).uid
5448
5452
  })
5449
5453
  });
5450
5454
  } if (value == 'video9') {
@@ -5453,7 +5457,7 @@ class Video extends Component {
5453
5457
  content: JSON.stringify({
5454
5458
  'typeId': 1223,
5455
5459
  'sessionId': this.state.sessionId,
5456
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5460
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId9').innerText).uid
5457
5461
  })
5458
5462
  });
5459
5463
  }
@@ -5463,7 +5467,7 @@ class Video extends Component {
5463
5467
  content: JSON.stringify({
5464
5468
  'typeId': 1223,
5465
5469
  'sessionId': this.state.sessionId,
5466
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5470
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId10').innerText).uid
5467
5471
  })
5468
5472
  });
5469
5473
  }
@@ -5473,7 +5477,7 @@ class Video extends Component {
5473
5477
  content: JSON.stringify({
5474
5478
  'typeId': 1223,
5475
5479
  'sessionId': this.state.sessionId,
5476
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5480
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId11').innerText).uid
5477
5481
  })
5478
5482
  });
5479
5483
  }
@@ -5483,7 +5487,7 @@ class Video extends Component {
5483
5487
  content: JSON.stringify({
5484
5488
  'typeId': 1223,
5485
5489
  'sessionId': this.state.sessionId,
5486
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
5490
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId12').innerText).uid
5487
5491
  })
5488
5492
  });
5489
5493
  }
@@ -6435,8 +6439,14 @@ class Video extends Component {
6435
6439
  {
6436
6440
  this.state.cardResuly == 'success' && <div className='successClassFace'>
6437
6441
  <img src={require("../../assets/img/tooltips1_pass.png").default} alt="" ></img>
6438
-
6439
- 识别成功</div>
6442
+ {
6443
+ this.state.cardFailReason && <span>识别成功 -- {this.state.cardFailReason}</span>
6444
+ }
6445
+ {
6446
+ !this.state.cardFailReason && <span>识别成功</span>
6447
+ }
6448
+
6449
+ </div>
6440
6450
  }
6441
6451
  {
6442
6452
  this.state.cardResuly == 'fail' && <div className='errorClassFace'>