react_hsbc_teller 1.8.9 → 1.9.2

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.
@@ -15,6 +15,8 @@ import cameraImgCloe from '../../assets/img/icon_cameraOne.png'
15
15
  import beautyImg from '../../assets/img/whiteningLut.jpg'
16
16
  import ocrImage from '../../assets/img/jietu.png'
17
17
  import autod from '../../assets/mp3/joinmeeting.mp3'
18
+ import internalJoin from '../../assets/mp3/internalJoin.mp3'
19
+ import internalLeft from '../../assets/mp3/internalLeft.mp3'
18
20
  import leftMetting from '../../assets/mp3/leftmeeting.mp3'
19
21
  import errorPng from '../../assets/img/tooltips2_fail.png'
20
22
  import { callNimIM } from '../../utils/cell.js'
@@ -61,6 +63,7 @@ let isBackgroundBlur = true
61
63
  let isSuccuseHs = false
62
64
  let isGraffiti = false
63
65
  let strokeColor = '#333'
66
+ let clearTime
64
67
  let CanvasHome = styled.div`
65
68
  position: fixed;
66
69
  z-index: ${props => props.zIndexNum};
@@ -308,6 +311,7 @@ class Video extends Component {
308
311
  idCardName: '',
309
312
  idCardNameFace: '',
310
313
  idCardNumberFace: '',
314
+ certificateValidityFace: '',
311
315
  idCardNumber: '',
312
316
  certificateValidity: '',
313
317
  operateShow: false,
@@ -320,8 +324,9 @@ class Video extends Component {
320
324
  customerSelect: '',
321
325
  documentType: '',
322
326
  isCustomerSelect: true,
327
+ documentError: '',
323
328
  customerTitleName: '客户身份识别',
324
- certificateType: 'identityCard',
329
+ certificateType: 'ID_CARD',
325
330
  customerName: '',
326
331
  IDtypeFrontOrBack: '',
327
332
  disabledIdCard: true,
@@ -336,6 +341,9 @@ class Video extends Component {
336
341
  loadingStaff: false,
337
342
  isVideoList: false,
338
343
  faceFailReason: '',
344
+ cardResuly: '',
345
+ cardFailReason: '',
346
+ videoType: ''
339
347
  };
340
348
  // eslint-disable-next-line no-undef
341
349
  test_controller = '';
@@ -343,7 +351,7 @@ class Video extends Component {
343
351
  saveLog = (val) => {
344
352
  axios({
345
353
  method: 'get',
346
- baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.8.9&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
354
+ baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.2&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
347
355
 
348
356
  }).then(res => {
349
357
 
@@ -430,7 +438,7 @@ class Video extends Component {
430
438
  let result = await API.getBase64Image({ fileName: data });
431
439
  console.log('getBase64Image', result)
432
440
  this.tabTitlesClick('customerScreen', 'delect')
433
- this.saveLog('imgCallback success' + Mival.data.type)
441
+ this.saveLog('imgCallback success' + result.data.type)
434
442
  this.props.imgCallback({
435
443
  type: result.data.type + '',
436
444
  file: result.data.base64Image,
@@ -875,7 +883,7 @@ class Video extends Component {
875
883
  list.push({
876
884
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).feedId,
877
885
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).uid,
878
- name: this.state.videoOneName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
886
+ name: this.state.videoOneName,
879
887
  tourist: false
880
888
  })
881
889
  }
@@ -885,7 +893,7 @@ class Video extends Component {
885
893
  list.push({
886
894
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).feedId,
887
895
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).uid,
888
- name: this.state.videoTwoName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
896
+ name: this.state.videoTwoName,
889
897
  tourist: false
890
898
  })
891
899
  }
@@ -895,7 +903,7 @@ class Video extends Component {
895
903
  list.push({
896
904
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).feedId,
897
905
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).uid,
898
- name: this.state.videoThreeName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
906
+ name: this.state.videoThreeName,
899
907
  tourist: false
900
908
  })
901
909
  }
@@ -905,7 +913,7 @@ class Video extends Component {
905
913
  list.push({
906
914
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).feedId,
907
915
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).uid,
908
- name: this.state.videoFourName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
916
+ name: this.state.videoFourName,
909
917
  tourist: false
910
918
  })
911
919
  }
@@ -915,7 +923,7 @@ class Video extends Component {
915
923
  list.push({
916
924
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).feedId,
917
925
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).uid,
918
- name: this.state.videoFiveName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
926
+ name: this.state.videoFiveName,
919
927
  tourist: false
920
928
  })
921
929
  }
@@ -924,7 +932,7 @@ class Video extends Component {
924
932
  list.push({
925
933
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).feedId,
926
934
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid,
927
- name: this.state.videoSixName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
935
+ name: this.state.videoSixName,
928
936
  tourist: false
929
937
  })
930
938
  }
@@ -932,7 +940,7 @@ class Video extends Component {
932
940
  list.push({
933
941
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId7").innerText).feedId,
934
942
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId7").innerText).uid,
935
- name: this.state.videoSevenName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
943
+ name: this.state.videoSevenName,
936
944
  tourist: false
937
945
  })
938
946
  }
@@ -940,7 +948,7 @@ class Video extends Component {
940
948
  list.push({
941
949
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId8").innerText).feedId,
942
950
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId8").innerText).uid,
943
- name: this.state.videoEightName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
951
+ name: this.state.videoEightName,
944
952
  tourist: false
945
953
  })
946
954
  }
@@ -948,7 +956,7 @@ class Video extends Component {
948
956
  list.push({
949
957
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId9").innerText).feedId,
950
958
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId9").innerText).uid,
951
- name: this.state.videoNineName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
959
+ name: this.state.videoNineName,
952
960
  tourist: false
953
961
  })
954
962
  }
@@ -956,15 +964,15 @@ class Video extends Component {
956
964
  list.push({
957
965
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId10").innerText).feedId,
958
966
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId10").innerText).uid,
959
- name: this.state.videoTenName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
967
+ name: this.state.videoTenName,
960
968
  tourist: false
961
969
  })
962
970
  }
963
- if (document.getElementById('video11').name && !this.state.isPIBIntranet[10].type) {
971
+ if (document.getElementById('video11').name && !this.state.isPIBIntranet[10].type) {
964
972
  list.push({
965
973
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId11").innerText).feedId,
966
974
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId11").innerText).uid,
967
- name: this.state.videoElevenName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
975
+ name: this.state.videoElevenName,
968
976
  tourist: false
969
977
  })
970
978
  }
@@ -972,7 +980,7 @@ class Video extends Component {
972
980
  list.push({
973
981
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).feedId,
974
982
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).uid,
975
- name: this.state.videoTwelveName + (this.state.faceCustomerType == 1 ? '--人脸识别' : '--OCR'),
983
+ name: this.state.videoTwelveName,
976
984
  tourist: false
977
985
  })
978
986
  }
@@ -985,10 +993,15 @@ class Video extends Component {
985
993
  console.log('this.state.customerList.length',list.length)
986
994
  this.setState({
987
995
  documentType: '',
988
- isModalVisibleCustomer: true,
989
996
  isCustomerSelect: true,
990
- customerSelect: list.length == 1 ? 0 : '',
997
+ customerSelect: list.length == 1 ? 1 : '',
998
+
991
999
  customerTitleName: '客户身份识别'
1000
+ },()=>{
1001
+ console.log(this.state.customerSelect)
1002
+ this.setState({
1003
+ isModalVisibleCustomer: true,
1004
+ })
992
1005
  })
993
1006
  } else if (val == 'facial') {
994
1007
  this.setState({
@@ -2215,16 +2228,23 @@ class Video extends Component {
2215
2228
  };
2216
2229
  this.test_controller.OnSendTextMsgSucc = (msgId) => {
2217
2230
  console.log('发送成功', msgId)
2231
+ this.setState({
2232
+ documentError: '',
2233
+ isModalVisibleCustomer: false,
2234
+ })
2218
2235
  }
2219
2236
  this.test_controller.OnSendTextMsgFailed = (msgId, code, msg) => {
2220
2237
  console.log('发送失败', msgId, code, msg)
2238
+ this.setState({
2239
+ documentError: '推送授权白板失败,请重试'
2240
+ })
2221
2241
  }
2222
2242
  this.test_controller.OnReceiveTextMsg = (uid, msg) => {
2223
2243
  console.log('收到手机端消息', uid, msg, JSON.parse(msg).typeId, JSON.parse(msg).data.sessionId, this.state.sessionId)
2224
2244
  if (JSON.parse(msg).typeId == 33001 && this.state.sessionId == JSON.parse(msg).data.sessionId) {
2225
2245
  if (JSON.parse(msg).type == 1) {
2226
2246
  this.saveAuthorize(JSON.parse(msg).data.userId)
2227
- this.customerFaceClick(this.state.customerList[this.state.customerSelect])
2247
+ this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
2228
2248
  }
2229
2249
  }
2230
2250
  }
@@ -2756,10 +2776,19 @@ class Video extends Component {
2756
2776
  this.test_controller.OnNewJoinerIn = (participant) => {
2757
2777
  console.log('新加⼊房间者', participant);
2758
2778
  this.state.isCustomer = true
2779
+
2759
2780
  if (this.props.isOpenSound) {
2760
- let src = autod
2761
- let audio = new Audio(src)
2762
- audio.play()
2781
+ this.appGetUsernameClick(participant).then((res) => {
2782
+ if (res.userType == 1) {
2783
+ let src = autod
2784
+ let audio = new Audio(src)
2785
+ audio.play()
2786
+ } else if (res.userType == 2) {
2787
+ let src = internalJoin
2788
+ let audio = new Audio(src)
2789
+ audio.play()
2790
+ }
2791
+ })
2763
2792
  }
2764
2793
 
2765
2794
  // let src = autod
@@ -3180,12 +3209,12 @@ class Video extends Component {
3180
3209
  exitType
3181
3210
  ) => {
3182
3211
  console.log('退出房间者', participant, exitType)
3183
- if (this.props.isOpenSound) {
3184
- let src = leftMetting
3185
- let audio = new Audio(src)
3186
- audio.play()
3187
- }
3188
-
3212
+ // if (this.props.isOpenSound) {
3213
+ // let src = leftMetting
3214
+ // let audio = new Audio(src)
3215
+ // audio.play()
3216
+ // }
3217
+
3189
3218
 
3190
3219
  this.appGetUsernameClick(participant).then((res) => {
3191
3220
  console.log('退出房间者', res)
@@ -3198,7 +3227,18 @@ class Video extends Component {
3198
3227
  userId: participant,
3199
3228
  userType: '1'
3200
3229
  })
3201
- }
3230
+ if (this.props.isOpenSound) {
3231
+ let src = leftMetting
3232
+ let audio = new Audio(src)
3233
+ audio.play()
3234
+ }
3235
+ } else if (res.userType == 2) {
3236
+ if (this.props.isOpenSound) {
3237
+ let src = internalLeft
3238
+ let audio = new Audio(src)
3239
+ audio.play()
3240
+ }
3241
+ }
3202
3242
  // console.log('退出房间者',res)
3203
3243
  // let data = res? res : '客户'
3204
3244
  // console.log(data)
@@ -3826,7 +3866,7 @@ class Video extends Component {
3826
3866
  }
3827
3867
  }
3828
3868
  componentWillMount() {
3829
- console.log('hsbc_teller_sdk', '1.8.9')
3869
+ console.log('hsbc_teller_sdk', '1.9.2')
3830
3870
  if (this.props.sessionId) {
3831
3871
  this.getRoomStatus({
3832
3872
  sessionId: this.props.sessionId
@@ -4218,13 +4258,14 @@ class Video extends Component {
4218
4258
  this.setState({
4219
4259
  idCardNameFace: this.state.idCardName,
4220
4260
  idCardNumberFace: this.state.idCardNumber,
4221
-
4261
+ certificateValidityFace: this.state.certificateValidity
4222
4262
  },()=>{
4223
4263
  this.setState({
4224
4264
  isModalVisibleFacial: false,
4265
+ cardResuly: '',
4225
4266
  idCardNumber: '',
4226
4267
  idCardName: '',
4227
- // certificateValidity: '',
4268
+ certificateValidity: '',
4228
4269
  })
4229
4270
  })
4230
4271
  } else {
@@ -4232,10 +4273,12 @@ class Video extends Component {
4232
4273
  this.setState({
4233
4274
  idCardNameFace: this.state.idCardName,
4234
4275
  idCardNumberFace: this.state.idCardNumber,
4235
-
4276
+ certificateValidityFace: this.state.certificateValidity
4236
4277
  },()=>{
4237
4278
  this.state.faceCustomerType = 1
4238
4279
  this.setState({
4280
+ cardResuly: '',
4281
+ certificateValidity: '',
4239
4282
  idCardNumber: '',
4240
4283
  idCardName: '',
4241
4284
  titleModal: '人脸识别',
@@ -4244,8 +4287,7 @@ class Video extends Component {
4244
4287
  isFaceImage: false
4245
4288
  })
4246
4289
  })
4247
- const videoMedia = document.getElementById('publish_video_2');
4248
- videoMedia.srcObject = document.getElementById(videoName).srcObject
4290
+ this.publishVideoTwo()
4249
4291
  }
4250
4292
 
4251
4293
  } else {
@@ -4264,8 +4306,9 @@ class Video extends Component {
4264
4306
  staffId: this.props.tellerAccount,
4265
4307
  activityId: this.props.businessNumber,
4266
4308
  appAccount: this.state.faceCustomerUid,
4309
+ certificateType: this.state.certificateType,
4267
4310
  fileBase64: val == 1 ? this.state.facialImgFront.replace(/^data:image\/\w+;base64,/, "") : this.state.facialImgBack.replace(/^data:image\/\w+;base64,/, ""),
4268
- type: val
4311
+ type: val == 1 ? true : false
4269
4312
  });
4270
4313
  if (result.code == 200) {
4271
4314
  console.log('ocrCallback', result.data)
@@ -4280,42 +4323,69 @@ class Video extends Component {
4280
4323
  "userId": this.state.faceCustomerUid
4281
4324
  })
4282
4325
  });
4283
- if (result.data.side == 'front') {
4326
+ if(this.state.documentType == 'ID_CARD') {
4327
+ if (result.data.side == 'front') {
4328
+ this.setState({
4329
+ // isModalVisibleFacial: false
4330
+ idCardNumber: result.data.idCardNumber,
4331
+ idCardName: result.data.idCardName
4332
+ })
4333
+ this.ocrCallback(2)
4334
+ } else if (result.data.side == 'back') {
4335
+ console.log(result.data.startDate, result.data.endDate)
4336
+ this.setState({
4337
+ certificateValidity: result.data.startDate + '-' + result.data.endDate,
4338
+ loadingFace: false,
4339
+ cardFailReason: '',
4340
+ cardResuly: 'success',
4341
+ })
4342
+ }
4343
+ }
4344
+ if(this.state.documentType == 'PASSPORT_CARD') {
4284
4345
  this.setState({
4285
- // isModalVisibleFacial: false
4286
4346
  idCardNumber: result.data.idCardNumber,
4287
- idCardName: result.data.idCardName
4288
- })
4289
- this.ocrCallback(2)
4290
- } else if (result.data.side == 'back') {
4291
- console.log(result.data.startDate, result.data.endDate)
4292
- this.setState({
4347
+ idCardName: result.data.idCardName,
4293
4348
  certificateValidity: result.data.startDate + '-' + result.data.endDate,
4294
- loadingFace: false
4349
+ loadingFace: false,
4350
+ cardFailReason: '',
4351
+ cardResuly: 'success',
4295
4352
  })
4296
4353
  }
4354
+
4297
4355
  } else {
4298
4356
  this.setState({
4299
- loadingFace: false
4357
+ loadingFace: false,
4358
+ cardFailReason: result.message,
4359
+ cardResuly: 'fail',
4300
4360
  })
4301
4361
  this.messageClick('识别失败', 'error')
4302
4362
  }
4303
4363
  } catch (err) {
4304
4364
  this.setState({
4305
- loadingFace: false
4365
+ loadingFace: false,
4366
+ cardFailReason: err.response.message,
4367
+ cardResuly: 'fail',
4306
4368
  })
4307
- this.messageClick('识别失败', 'error')
4369
+ // this.messageClick('识别失败', 'error')
4308
4370
  }
4309
4371
  }
4310
4372
  handleOkFacial = () => {
4311
4373
  if (this.state.faceCustomerType == 2) {
4312
- if (this.state.IDtypeFrontOrBack == '请截取证件正面') {
4313
- this.setState({
4314
- facialImg: ocrImage,
4315
- IDtypeFrontOrBack: '请截取证件反面',
4316
- isFaceImage: false,
4317
- })
4318
- } else if (this.state.IDtypeFrontOrBack == '请截取证件反面') {
4374
+ if (this.state.IDtypeFrontOrBack == '请截取证件头像面') {
4375
+ if(this.state.documentType == 'PASSPORT_CARD') {
4376
+ this.setState({
4377
+ loadingFace: true
4378
+ })
4379
+ this.ocrCallback(1)
4380
+ } else {
4381
+ this.setState({
4382
+ facialImg: ocrImage,
4383
+ IDtypeFrontOrBack: '请截取证件国徽面',
4384
+ isFaceImage: false,
4385
+ })
4386
+ }
4387
+
4388
+ } else if (this.state.IDtypeFrontOrBack == '请截取证件国徽面') {
4319
4389
  this.setState({
4320
4390
  loadingFace: true
4321
4391
  })
@@ -4349,14 +4419,60 @@ class Video extends Component {
4349
4419
  isModalVisibleFacial: false
4350
4420
  })
4351
4421
  };
4422
+ publishVideoTwo=()=>{
4423
+ const videoMedia = document.getElementById('publish_video_2');
4424
+ videoMedia.srcObject = document.getElementById(videoName).srcObject
4425
+ clearTime = setTimeout(() => {
4426
+ if(this.state.videoType == '') {
4427
+ this.setState({
4428
+ videoType: 'error'
4429
+ })
4430
+
4431
+ }
4432
+ }, 9000)
4433
+ videoMedia.onloadeddata = () => {
4434
+ console.log('success_publish_video_2')
4435
+ this.setState({
4436
+ videoType: 'success'
4437
+ })
4438
+ clearTimeout(clearTime)
4439
+ }
4440
+ }
4441
+ newFaceClick=()=>{
4442
+ callNimIM('sendCustomCmdMsg', {
4443
+ customId: this.state.imRoomId,
4444
+ content: JSON.stringify({
4445
+ 'typeId': 1020,
4446
+ 'sessionId': this.state.sessionId,
4447
+ 'cameraState': 2, // 1--打开前置 2--打开后置
4448
+ "userId": this.state.faceCustomerUid
4449
+ })
4450
+ });
4451
+ this.setState({
4452
+ clickedFacial: false,
4453
+ clickedOcr: false,
4454
+ isFaceImage: false,
4455
+ facialImg: ocrImage,
4456
+ disabledIdCard: true,
4457
+ IDtypeFrontOrBack: '请截取证件头像面',
4458
+ facialImgFront: '',
4459
+ facialImgBack: '',
4460
+ faceResuly: '',
4461
+ idCardNumber: '',
4462
+ idCardName: '',
4463
+ cardFailReason: '',
4464
+ cardResuly: '',
4465
+ }, () => {
4466
+ this.publishVideoTwo()
4467
+ })
4468
+ }
4352
4469
  ReIdentification = () =>{
4353
4470
  this.setState({
4354
4471
  faceResuly: '',
4355
4472
  facialImg: ocrImage,
4356
4473
  isFaceImage: false
4357
4474
  },()=>{
4358
- const videoMedia = document.getElementById('publish_video_2');
4359
- videoMedia.srcObject = document.getElementById(videoName).srcObject
4475
+ this.publishVideoTwo()
4360
4476
  })
4361
4477
 
4362
4478
  }
@@ -4500,32 +4616,33 @@ class Video extends Component {
4500
4616
  isFaceImage: false,
4501
4617
  facialImg: ocrImage,
4502
4618
  disabledIdCard: true,
4503
- IDtypeFrontOrBack: '请截取证件正面',
4619
+ IDtypeFrontOrBack: '请截取证件头像面',
4504
4620
  facialImgFront: '',
4505
4621
  facialImgBack: '',
4506
4622
  faceResuly: '',
4507
4623
  idCardNumber: '',
4508
4624
  idCardName: '',
4625
+ cardFailReason: '',
4626
+ cardResuly: '',
4509
4627
  }, () => {
4510
4628
 
4511
4629
 
4512
4630
  this.setState({
4513
4631
  isModalVisibleFacial: true,
4514
4632
  }, () => {
4515
- const videoMedia = document.getElementById('publish_video_2');
4516
- videoMedia.srcObject = document.getElementById(videoName).srcObject
4633
+ this.publishVideoTwo()
4517
4634
  })
4518
4635
  })
4519
4636
  }
4520
4637
  }
4521
4638
  sgsinImage = () => {
4522
- if (this.state.IDtypeFrontOrBack == '请截取证件正面') {
4639
+ if (this.state.IDtypeFrontOrBack == '请截取证件头像面') {
4523
4640
  this.setState({
4524
4641
  facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png'),
4525
4642
  isFaceImage: true,
4526
4643
  facialImgFront: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png'),
4527
4644
  })
4528
- } else if (this.state.IDtypeFrontOrBack == '请截取证件反面') {
4645
+ } else if (this.state.IDtypeFrontOrBack == '请截取证件国徽面') {
4529
4646
  this.setState({
4530
4647
  facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png'),
4531
4648
  isFaceImage: true,
@@ -5323,28 +5440,40 @@ class Video extends Component {
5323
5440
  isModalVisibleCustomer: false
5324
5441
  })
5325
5442
  }
5443
+ goBackSelectCustomer=()=>{
5444
+ this.setState({
5445
+ documentType: '',
5446
+ isCustomerSelect: true,
5447
+ customerSelect: this.state.customerList.length == 1 ? 1 : '',
5448
+ customerTitleName: '客户身份识别'
5449
+ })
5450
+ }
5326
5451
  handleOkCustomer = () => {
5327
5452
  if (this.state.isCustomerSelect) {
5328
- if (this.state.customerList[this.state.customerSelect].tourist) {
5329
- this.customerFaceClick(this.state.customerList[this.state.customerSelect])
5453
+ if (this.state.customerList[this.state.customerSelect - 1].tourist) {
5454
+ this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
5330
5455
  } else {
5331
5456
  this.setState({
5332
5457
  isCustomerSelect: false,
5333
- customerTitleName: this.state.customerList[this.state.customerSelect].name
5458
+ documentError: '',
5459
+ customerTitleName: this.state.customerList[this.state.customerSelect - 1].name
5334
5460
  })
5335
5461
  }
5336
5462
 
5337
5463
  } else {
5338
- this.getAuthorizeResult(this.state.customerList[this.state.customerSelect].customId).then((res) => {
5464
+ this.getAuthorizeResult(this.state.customerList[this.state.customerSelect - 1].customId).then((res) => {
5339
5465
  if (res) {
5340
- this.customerFaceClick(this.state.customerList[this.state.customerSelect])
5466
+ this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
5467
+ this.setState({
5468
+ isModalVisibleCustomer: false,
5469
+ })
5341
5470
  } else {
5342
- if (this.state.documentType == 0) {
5471
+ if (this.state.documentType == 'ID_CARD') {
5343
5472
  this.test_controller.SendTextMsg(JSON.stringify({
5344
5473
  'typeId': 3300,
5345
5474
  "data": {
5346
5475
  'sessionId': this.state.sessionId,
5347
- 'userId': this.state.customerList[this.state.customerSelect].customId,
5476
+ 'userId': this.state.customerList[this.state.customerSelect - 1].customId,
5348
5477
  'title': '为了有效确认客户身份,请您配合进行我行的身份识别和核验。请您阅读以下内容,若您同意,请您之后在摄像头前出示您的身份证件,我行将对您的身份证件拍照并采集证件信息;同时,我行会对您进行脸部拍照,采集您的脸部图像。',
5349
5478
  'list': [
5350
5479
  {
@@ -5359,12 +5488,12 @@ class Video extends Component {
5359
5488
  }
5360
5489
 
5361
5490
  }))
5362
- } else if (this.state.documentType == 1) {
5491
+ } else {
5363
5492
  this.test_controller.SendTextMsg(JSON.stringify({
5364
5493
  'typeId': 3300,
5365
5494
  "data": {
5366
5495
  'sessionId': this.state.sessionId,
5367
- 'userId': this.state.customerList[this.state.customerSelect].customId,
5496
+ 'userId': this.state.customerList[this.state.customerSelect - 1].customId,
5368
5497
  'title': '为了有效确认客户身份,请您配合进行我行的身份识别。请您阅读以下内容,若您同意,请您之后在摄像头前出示您的身份证件,我行将对您的身份证件拍照并采集证件信息;',
5369
5498
  'list': [
5370
5499
  {
@@ -5380,16 +5509,14 @@ class Video extends Component {
5380
5509
 
5381
5510
  }
5382
5511
  })
5383
- this.setState({
5384
- isModalVisibleCustomer: false,
5385
- })
5386
5512
  // this.customerFaceClick(this.state.customerList[this.state.customerSelect])
5387
5513
  }
5388
5514
 
5389
5515
  }
5390
5516
  onChangeDocumentType = (e) => {
5391
5517
  this.setState({
5392
- documentType: e.target.value
5518
+ documentType: e.target.value,
5519
+ certificateType: e.target.value
5393
5520
  })
5394
5521
  }
5395
5522
  getAuthorizeResult = async (appAccount) => {
@@ -5416,9 +5543,9 @@ class Video extends Component {
5416
5543
  try {
5417
5544
  let result = await API.saveAuthorize({
5418
5545
  activityId: this.props.businessNumber,
5419
- authorizeType: this.state.documentType == 0 ? 'ID' : 'NID',
5546
+ authorizeType: this.state.documentType == 'ID_CARD' ? 'ID' : 'NID',
5420
5547
  appAccount: appAccount,
5421
- idCardAuthorize: this.state.documentType == 0 ? 'YES' : '',
5548
+ idCardAuthorize: this.state.documentType == 'ID_CARD' ? 'YES' : '',
5422
5549
  pictureAuthorize: 'YES'
5423
5550
  });
5424
5551
  console.log(result)
@@ -6092,8 +6219,8 @@ class Video extends Component {
6092
6219
  ]}>
6093
6220
  <div className='endModal'>是否要结束并退出会议?</div>
6094
6221
  </Modal>
6095
- <Modal title={this.state.titleModal} closable={false} centered={true} visible={this.state.isModalVisibleFacial} footer={[
6096
- !this.state.idCardName && this.state.faceResuly == '' &&<div key='facial'>
6222
+ <Modal title={this.state.titleModal} width={650} closable={false} centered={true} visible={this.state.isModalVisibleFacial} footer={[
6223
+ this.state.cardResuly == '' && this.state.faceResuly == '' &&<div key='facial'>
6097
6224
  <Button className="modelButtonCancel" onClick={this.handleCancelFacial}>取消</Button>
6098
6225
  <Button className="modelButtonCancel" onClick={this.sgsinImage}>截图</Button>
6099
6226
  {
@@ -6104,7 +6231,7 @@ class Video extends Component {
6104
6231
  }
6105
6232
 
6106
6233
  </div>,
6107
- !this.state.idCardName && this.state.faceResuly != '' &&<div key='facial'>
6234
+ this.state.cardResuly == '' && this.state.faceResuly != '' &&<div key='facial'>
6108
6235
  {
6109
6236
  this.state.faceResuly == 'fail' && <Button className="modelButtonOk" type="primary" danger onClick={this.ReIdentification}>重新识别</Button>
6110
6237
  }
@@ -6114,12 +6241,21 @@ class Video extends Component {
6114
6241
  <Button className="modelButtonCancel" onClick={this.handleCancelFacial}>完成</Button>
6115
6242
 
6116
6243
  </div>,
6117
- this.state.idCardName && <div key='facial'>
6244
+ this.state.cardResuly == 'success' && <div key='facial'>
6118
6245
  {
6119
6246
  this.state.disabledIdCard && <Button className="modelButtonFaceOk" danger onClick={(e) => this.updateConfirm('noFace')}>修改</Button>
6120
6247
  }
6121
- <Button className="modelButtonFaceOk" danger onClick={(e) => this.confirmCallback('face')}>完成并发起人脸识别</Button>
6122
- <Button className="modelButtonOk" type="primary" danger onClick={(e) => this.confirmCallback('noFace')}>完成</Button>
6248
+ {
6249
+ this.state.documentType == 'ID_CARD' && <Button className="modelButtonFaceOk" danger onClick={(e) => this.confirmCallback('face')}>完成并发起人脸识别</Button>
6250
+ }
6251
+ {
6252
+ this.state.documentType != 'ID_CARD' && <Button className="modelButtonOk" type="primary" danger onClick={(e) => this.confirmCallback('noFace')}>完成</Button>
6253
+ }
6254
+
6255
+ </div>,
6256
+ this.state.cardResuly == 'fail' && <div key='facial'>
6257
+ <Button className="modelButtonCancel" onClick={this.handleCancelFacial}>取消</Button>
6258
+ <Button className="modelButtonOk" type="primary" danger onClick={this.newFaceClick}>返回重试</Button>
6123
6259
  </div>
6124
6260
  ]}>
6125
6261
  <Spin spinning={this.state.loadingFace} tip="识别中...">
@@ -6130,7 +6266,7 @@ class Video extends Component {
6130
6266
  <Option value="2">反面</Option>
6131
6267
  </Select>
6132
6268
  } */}
6133
- {!this.state.idCardName && <div className='faceCardImg'>
6269
+ {this.state.cardResuly == '' && <div className='faceCardImg'>
6134
6270
 
6135
6271
  {
6136
6272
  this.state.titleModal == 'OCR识别' && <div className='titleDiv'>{this.state.IDtypeFrontOrBack}</div>
@@ -6139,6 +6275,10 @@ class Video extends Component {
6139
6275
  {
6140
6276
  this.state.faceResuly == '' && <span>
6141
6277
  <div>
6278
+ {
6279
+ this.state.videoType == 'error' && <div className='errorClassFace'>
6280
+ <img src={require("../../assets/img/tooltips2_fail.png").default} alt="" ></img>客户视频异常,请重试</div>
6281
+ }
6142
6282
  <video className="faceImg" id="publish_video_2" autoPlay muted={true}></video>
6143
6283
  </div>
6144
6284
  <img className="faceImg" src={this.state.facialImg} alt=""></img>
@@ -6149,14 +6289,24 @@ class Video extends Component {
6149
6289
  </div>
6150
6290
  }
6151
6291
  {
6152
- this.state.idCardName && <div className='resuleCard'>
6292
+ this.state.cardResuly != '' && <div className='resuleCard'>
6293
+ {
6294
+ this.state.cardResuly == 'success' && <div className='successClassFace'>
6295
+ <img src={require("../../assets/img/tooltips1_pass.png").default} alt="" ></img>
6296
+
6297
+ 识别成功</div>
6298
+ }
6299
+ {
6300
+ this.state.cardResuly == 'fail' && <div className='errorClassFace'>
6301
+ <img src={require("../../assets/img/tooltips2_fail.png").default} alt="" ></img>识别失败--{this.state.cardFailReason}</div>
6302
+ }
6153
6303
  <div className='imgDIV'>
6154
6304
  <img className="faceImgCard" src={this.state.facialImgFront} alt=""></img>
6155
6305
  <img className="faceImgCard" src={this.state.facialImgBack} alt=""></img>
6156
6306
  </div>
6157
6307
  <div>证件信息确认</div>
6158
6308
  <div><span>客户姓名</span> <input disabled={this.state.disabledIdCard} type="text" value={this.state.idCardName} onChange={this.handleChangeIdCardName} /></div>
6159
- <div><span>身份证号</span> <input disabled={this.state.disabledIdCard} type="text" value={this.state.idCardNumber} onChange={this.handleChangeIdCardNumber} /></div>
6309
+ <div><span>证件号码</span> <input disabled={this.state.disabledIdCard} type="text" value={this.state.idCardNumber} onChange={this.handleChangeIdCardNumber} /></div>
6160
6310
  <div><span>有效期</span> <input disabled={this.state.disabledIdCard} type="text" value={this.state.certificateValidity} onChange={this.handleChangeCertificateValidity} /></div>
6161
6311
  </div>
6162
6312
  }
@@ -6174,7 +6324,7 @@ class Video extends Component {
6174
6324
  }
6175
6325
  <div><span>客户姓名</span> <input disabled type="text" value={this.state.idCardNameFace}/></div>
6176
6326
  <div><span>身份证号</span> <input disabled type="text" value={this.state.idCardNumberFace}/></div>
6177
- <div><span>有效期</span> <input disabled type="text" value={this.state.certificateValidity}/></div>
6327
+ <div><span>有效期</span> <input disabled type="text" value={this.state.certificateValidityFace}/></div>
6178
6328
  </div>
6179
6329
  }
6180
6330
 
@@ -6185,7 +6335,13 @@ class Video extends Component {
6185
6335
  footer={[
6186
6336
  <div key='end'>
6187
6337
  <Button className="modelButtonCancel" onClick={this.handleCancelSFP}>取消</Button>
6188
- <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkSFP}>确定</Button>
6338
+ {
6339
+ this.state.StaffidSFP && this.state.PasswordSFP && <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkSFP}>确定</Button>
6340
+ }
6341
+ {
6342
+ (this.state.StaffidSFP == '' || this.state.PasswordSFP == '') && <Button className="modelButtonNo" type="primary" danger >确定</Button>
6343
+ }
6344
+
6189
6345
  </div>
6190
6346
  ]}>
6191
6347
  <Spin spinning={this.state.loadingStaff} tip="授权中...">
@@ -6211,8 +6367,33 @@ class Video extends Component {
6211
6367
  <Modal title={this.state.customerTitleName} closable={false} centered={true} visible={this.state.isModalVisibleCustomer}
6212
6368
  footer={[
6213
6369
  <div key='end'>
6370
+
6371
+
6372
+ {
6373
+ !this.state.isCustomerSelect && <Button className="modelButtonCancel" onClick={this.goBackSelectCustomer}>上一步</Button>
6374
+ }
6214
6375
  <Button className="modelButtonCancel" onClick={this.handleCancelCustomer}>取消</Button>
6215
- <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkCustomer}>下一步</Button>
6376
+ {
6377
+ this.state.isCustomerSelect && <span>
6378
+ {
6379
+ this.state.customerSelect == '' && <Button className="modelButtonNo modelNoButton" type="primary" danger>下一步</Button>
6380
+ }
6381
+ {
6382
+ this.state.customerSelect != '' && <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkCustomer}>下一步</Button>
6383
+ }
6384
+ </span>
6385
+ }
6386
+ {
6387
+ !this.state.isCustomerSelect&& <span>
6388
+ {
6389
+ this.state.documentType == '' && <Button className="modelButtonNo modelNoButton" type="primary" danger>下一步</Button>
6390
+ }
6391
+ {
6392
+ this.state.documentType != '' &&<Button className="modelButtonOk" type="primary" danger onClick={this.handleOkCustomer}>下一步</Button>
6393
+ }
6394
+ </span>
6395
+ }
6396
+
6216
6397
  </div>
6217
6398
  ]}>
6218
6399
  <div>
@@ -6227,7 +6408,9 @@ class Video extends Component {
6227
6408
  <Space direction="vertical">
6228
6409
  {
6229
6410
  this.state.customerList.map((item, index) => {
6230
- return <Radio value={index}>{item.name}</Radio>
6411
+ // if(item.name.indexOf("访客") != -1) {
6412
+ return <Radio value={index + 1}>{item.name}</Radio>
6413
+ // }
6231
6414
  })
6232
6415
  }
6233
6416
  </Space>
@@ -6237,14 +6420,23 @@ class Video extends Component {
6237
6420
  }
6238
6421
  {
6239
6422
  !this.state.isCustomerSelect && <div>
6423
+ {
6424
+ this.state.documentError != '' && <div className='errorClassFace'>
6425
+ <img src={require("../../assets/img/tooltips2_fail.png").default} alt="" ></img>{this.state.documentError}</div>
6426
+ }
6240
6427
  <div>
6241
6428
  请您确认您的身份证件类型
6242
6429
  </div>
6243
6430
  <div>
6244
6431
  <Radio.Group onChange={this.onChangeDocumentType} value={this.state.documentType}>
6245
6432
  <Space direction="vertical">
6246
- <Radio value={0}>身份证</Radio>
6247
- <Radio value={1}>护照:或台湾来往大陆通行证;或港澳来往大陆通行证或;外国人永久居住证;或港澳台居民居住证</Radio>
6433
+ <Radio value={'ID_CARD'}>身份证</Radio>
6434
+ <Radio value={'PASSPORT_CARD'}>护照</Radio>
6435
+ <Radio value={'TW_PASS_CARD'}>台湾来往大陆通行证</Radio>
6436
+ <Radio value={'HK_MO_PASS_CARD'}>港澳来往大陆通行证</Radio>
6437
+ <Radio value={'HK_MO_RESIDENCE_CARD'}>港澳台居民居住证</Radio>
6438
+ <Radio value={'TW_RESIDENCE_CARD'}>台湾居民居住证</Radio>
6439
+ <Radio value={'FOREIGNER_RESIDENCE_CARD'}>外国人永久居住证</Radio>
6248
6440
  </Space>
6249
6441
  </Radio.Group>
6250
6442
  </div>