react_hsbc_teller 0.3.4 → 0.3.8

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.
@@ -21,6 +21,7 @@ import 'antd/lib/spin/style'
21
21
  import { Button } from '../../../node_modules/antd/lib/index';
22
22
  import CanvasDraw from "react-canvas-draw";
23
23
  import { FormattedMessage, injectIntl } from 'react-intl';
24
+ import html2canvas from 'html2canvas';
24
25
  const LEAVE_TYPE = {
25
26
  TELLER_EXIT: '1', // 坐席退出
26
27
  ROOM_DESTROYED: '-1', // 房间异常
@@ -69,6 +70,14 @@ class Video extends Component {
69
70
  sessionId: this.props.sessionId,
70
71
  imRoomId: this.props.imRoomId,
71
72
  isPictureInPicture: false,
73
+ clickedFacial: false,
74
+ clickedOcr: false,
75
+ videoOneName: '',
76
+ videoTwoName: '',
77
+ videoThreeName: '',
78
+ videoFourName: '',
79
+ videoFiveName: '',
80
+ videoSixName: ''
72
81
  };
73
82
  // eslint-disable-next-line no-undef
74
83
  test_controller = '';
@@ -143,8 +152,8 @@ class Video extends Component {
143
152
  config_param.workspaceId = this.state.workSpaceId;
144
153
  config_param.uid = this.props.tellerAccount;
145
154
  config_param.biz_name = this.state.bizName; // 'demo'
146
- config_param.appId = this.state.appId;
147
-
155
+ config_param.sub_biz = this.state.appId;
156
+ config_param.sign = window.sessionStorage.getItem('alimpassSig')
148
157
  config_param.room_server_url = this.props.roomServerUrl;
149
158
  // 允许最大断网时间 (超过未重连, 直接关闭)
150
159
  config_param.network_check_timeout = 10000;
@@ -156,7 +165,7 @@ class Video extends Component {
156
165
  config_param.auto_publish_subscribe = 3;
157
166
  config_param.media_type = 1;
158
167
  config_param.publish_device = 1;
159
- config_param.video_profile_type = '5';
168
+ config_param.video_profile_type = '3';
160
169
  config_param.need_volume_analyser = true;
161
170
  // config_param.audioSource = that.microphone[0].actionid
162
171
  // config_param.videoSource = that.checkOne[0]
@@ -324,7 +333,7 @@ class Video extends Component {
324
333
  }
325
334
  }
326
335
  // 获取人员客户列表
327
- selectCustomer = () => {
336
+ selectCustomer = (val) => {
328
337
  const list = []
329
338
  if (document.getElementById('video1').name) {
330
339
  console.log(this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText))
@@ -332,7 +341,7 @@ class Video extends Component {
332
341
  list.push({
333
342
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).feedId,
334
343
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).uid,
335
- name: '客户1',
344
+ name: this.state.videoOneName,
336
345
  })
337
346
  }
338
347
  if (document.getElementById('video2').name) {
@@ -341,7 +350,7 @@ class Video extends Component {
341
350
  list.push({
342
351
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).feedId,
343
352
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).uid,
344
- name: '客户2'
353
+ name: this.state.videoTwoName
345
354
  })
346
355
  }
347
356
  if (document.getElementById('video3').name) {
@@ -350,7 +359,7 @@ class Video extends Component {
350
359
  list.push({
351
360
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).feedId,
352
361
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).uid,
353
- name: '客户3'
362
+ name: this.state.videoThreeName
354
363
  })
355
364
  }
356
365
  if (document.getElementById('video4').name) {
@@ -359,7 +368,7 @@ class Video extends Component {
359
368
  list.push({
360
369
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).feedId,
361
370
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).uid,
362
- name: '客户4'
371
+ name: this.state.videoFourName
363
372
  })
364
373
  }
365
374
  if (document.getElementById('video5').name) {
@@ -368,7 +377,7 @@ class Video extends Component {
368
377
  list.push({
369
378
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).feedId,
370
379
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).uid,
371
- name: '客户5'
380
+ name: this.state.videoFiveName
372
381
  })
373
382
  }
374
383
  if (document.getElementById('video6').name) {
@@ -377,27 +386,44 @@ class Video extends Component {
377
386
  list.push({
378
387
  feedId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).feedId,
379
388
  customId: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid,
380
- name: '客户6'
389
+ name: this.state.videoSixName
381
390
  })
382
391
  }
392
+ if(list.length > 0) {
393
+ if(val == 'ocr') {
394
+ this.setState({
395
+ clickedOcr: true
396
+ })
397
+ } else if(val == 'facial'){
398
+ this.setState({
399
+ clickedFacial: true
400
+ })
401
+ }
402
+ } else {
403
+ message.success('当前暂无客户')
404
+ }
383
405
  this.setState({
384
406
  customerList: list
385
407
  })
386
408
  }
387
409
  // 人脸识别
388
410
  facialRecognition = () => {
411
+ if (this.isFileSuccuse()) {
389
412
  this.setState({
390
413
  faceCustomerType: 1,
391
414
  titleModal: '人脸识别'
392
415
  })
393
- this.selectCustomer()
416
+ this.selectCustomer('facial')
417
+ }
394
418
  };
395
419
  ocrClick = () => {
420
+ if (this.isFileSuccuse()) {
396
421
  this.setState({
397
422
  faceCustomerType: 2,
398
423
  titleModal: 'OCR识别'
399
424
  })
400
- this.selectCustomer()
425
+ this.selectCustomer('ocr')
426
+ }
401
427
  };
402
428
  endSessionValue = () => {
403
429
  this.test_controller.LeaveRoom()
@@ -409,7 +435,7 @@ class Video extends Component {
409
435
  this.setState({ isBigVideo: 'video1' })
410
436
  }
411
437
  } else if (val == 'isLangPublishVideo1') {
412
- if (document.getElementById('publish_video1').name) {
438
+ if (document.getElementById('publish_video1').name && this.state.isCustomer) {
413
439
  this.setState({ isBigVideo: 'publish_video1' })
414
440
  }
415
441
  } else if (val == 'isLangVideo2') {
@@ -443,32 +469,56 @@ class Video extends Component {
443
469
  } else {
444
470
  const list = []
445
471
  if(document.getElementById('video1').name) {
446
- list.push('video1')
472
+ list.push({
473
+ name: 'video1',
474
+ title: this.state.videoOneName
475
+ })
447
476
  }
448
477
  if(document.getElementById('publish_video1').name) {
449
- list.push('publish_video1')
478
+ list.push({
479
+ name: 'publish_video1',
480
+ title: '坐席'
481
+ })
450
482
  }
451
483
  if(document.getElementById('video2').name) {
452
- list.push('video2')
484
+ list.push({
485
+ name: 'video2',
486
+ title: this.state.videoTwoName
487
+ })
453
488
  }
454
489
  if(document.getElementById('video3').name) {
455
- list.push('video3')
490
+ list.push({
491
+ name: 'video3',
492
+ title: this.state.videoThreeName
493
+ })
456
494
  }
457
495
  if(document.getElementById('video4').name) {
458
- list.push('video4')
496
+ list.push({
497
+ name: 'video4',
498
+ title: this.state.videoFourName
499
+ })
459
500
  }
460
501
  if(document.getElementById('video5').name) {
461
- list.push('video5')
502
+ list.push({
503
+ name: 'video5',
504
+ title: this.state.videoFiveName
505
+ })
462
506
  }
463
507
  if(document.getElementById('video6').name) {
464
- list.push('video6')
508
+ list.push({
509
+ name: 'video6',
510
+ title: this.state.videoSixName
511
+ })
465
512
  }
466
513
  if(document.getElementById('video10').name) {
467
- list.push('video10')
514
+ list.push({
515
+ name: 'video10',
516
+ title: '互动白板'
517
+ })
468
518
  }
469
519
  console.log(list)
470
- const width = 320 * list.length;
471
- const height = 480;
520
+ const width = 640;
521
+ const height = 360 * list.length;
472
522
  const canvas = document.createElement('canvas');
473
523
  const cobj = canvas.getContext('2d'); // 获取绘图环境
474
524
  canvas.width = width;
@@ -477,18 +527,65 @@ class Video extends Component {
477
527
  cobj.clearRect(0, 0, width, height);
478
528
  for(let i=0;i<list.length;i++){
479
529
 
480
- let videoId = list[i];
530
+ let videoId = list[i].name;
481
531
  let videoDiv = document.getElementById(videoId);
482
532
  let videoWidth = videoDiv.videoWidth;
483
533
  let videoHeight = videoDiv.videoHeight;
484
- let newVideoWidth = 320;
485
- let newVideoHeight = 480;
486
- if (videoHeight * 320 / videoWidth > 480) {
487
- newVideoWidth = videoWidth * 480 / videoHeight;
534
+ let newVideoWidth = 640;
535
+ let newVideoHeight = 360;
536
+ if (videoHeight * 640 / videoWidth > 360) {
537
+ newVideoWidth = videoWidth * 360 / videoHeight;
488
538
  } else {
489
- newVideoHeight = videoHeight * 320 / videoWidth;
539
+ newVideoHeight = videoHeight * 640 / videoWidth;
490
540
  }
491
- cobj.drawImage(videoDiv, 320 * i, (480 - newVideoHeight)/2, 320, newVideoHeight);
541
+ console.log(newVideoWidth,videoHeight)
542
+
543
+ cobj.drawImage(videoDiv, (640 - newVideoWidth)/2, 360 * i, newVideoWidth, newVideoHeight);
544
+ var img = document.getElementById("icon_huatong");
545
+ cobj.drawImage(img, 600, 320, canvas.width, canvas.height);
546
+ cobj.beginPath();
547
+ cobj.strokeStyle = this.props.titleColor;
548
+ cobj.fillStyle = this.props.titleBackground;
549
+ cobj.fillRect(0, 360 * (i + 1) - 60, 300, 60 )
550
+ cobj.closePath();
551
+ cobj.fill();
552
+ cobj.stroke();
553
+ cobj.font = "28px auto";
554
+ cobj.textAlign = 'center';
555
+ cobj.strokeText(list[i].title, 150, 360 * (i + 1) - 20);
556
+ console.log(videoDiv.srcObject, videoDiv.srcObject.getAudioTracks(), videoDiv.srcObject.getAudioTracks()[0])
557
+ // const acc = new AudioContext()
558
+ // // 返回一个多媒体流
559
+ // const mic = acc.createMediaStreamSource(videoDiv.srcObject.getAudioTracks()[0])
560
+ // // creates an AnalyserNode 创建一个分析节点
561
+ // this.analyser = acc.createAnalyser()
562
+ // // fftsize默认值2048,是快速傅立叶变换用于频域分析的值,必须为2的幂,而我们得到的数据通常为其的一半,下面会说道
563
+ // this.analyser.fftSize = 256
564
+ // // 调用绘图函数
565
+ // mic.connect(this.analyser)
566
+ // let dataArray = new Uint8Array(this.analyser);
567
+ // this.analyser.getByteFrequencyData(dataArray);
568
+ // let step = Math.round(dataArray.length / 60); //采样步长
569
+ // 以画布左上角为坐标原点
570
+ // let drawArea = {
571
+ // x1: 28/50 * canvas.width, // 波动范围右下角的点坐标
572
+ // y1: 25/50 * canvas.height,
573
+ // x2: 22/50 * canvas.width, // 波动范围左上角的点坐标
574
+ // y2: 10/50 * canvas.height,
575
+ // }
576
+
577
+ // for (var j = 0; j < 40; j++) {
578
+ // let energy = (dataArray[step * j] / 256.0) * 80;
579
+ // ctx.beginPath();
580
+ // ctx.fillStyle = "#0AE544";
581
+ // const { x1,y1,x2,y2} = drawArea
582
+ // let width = x1-x2;
583
+ // let height = (energy>20?(energy-20):0) * (y1 - y2 ) / 70
584
+ // let startX = x2 // 绘制起始点x
585
+ // let startY = y1 - height // 绘制起始点y
586
+ // cobj.fillRect(startX, startY, width, height )
587
+ // }
588
+ // cobj.drawImage(videoDiv, 320 * i, (480 - newVideoHeight)/2, 320, newVideoHeight);
492
589
  }
493
590
  }, 100);
494
591
  const captureStream = canvas.captureStream();
@@ -746,7 +843,7 @@ class Video extends Component {
746
843
  // 订阅媒体流成功
747
844
  this.test_controller.OnSubscribeSucc = (feed, sid) => {
748
845
  console.log('订阅媒体流成功', feed, sid);
749
- console.log(document.getElementById("feedId1").innerText)
846
+ this.appGetUsername(sid)
750
847
  };
751
848
  // 订阅媒体流失败
752
849
  this.test_controller.OnSubscribeFailed = (
@@ -763,6 +860,7 @@ class Video extends Component {
763
860
  // 推送“新加⼊房间者”给与会者
764
861
  this.test_controller.OnNewJoinerIn = (participant) => {
765
862
  console.log('新加⼊房间者', participant);
863
+ this.test_controller.ChangeStreamSize(document.getElementById('publish_video1').name, 5)
766
864
  this.setState(
767
865
  {
768
866
  isCustomer: true
@@ -776,7 +874,8 @@ class Video extends Component {
776
874
  let newArray = [...array];
777
875
  newArray.push({
778
876
  feedId: feed.feedId,
779
- uid: feed.uid
877
+ uid: feed.uid,
878
+ tag: feed.tag
780
879
  });
781
880
  console.log(array, newArray, this.state.roomCustomerList);
782
881
  this.setState({
@@ -805,10 +904,52 @@ class Video extends Component {
805
904
  // 取消订阅媒体流成功
806
905
  this.test_controller.OnUnSubscribeSucc = (sid) => {
807
906
  console.log('取消订阅媒体流成功', sid)
907
+ if(!document.getElementById("video1").name) {
908
+ this.setState({
909
+ videoOneName: ''
910
+ })
911
+ }
912
+ if(!document.getElementById("video2").name) {
913
+ this.setState({
914
+ videoTwoName: ''
915
+ })
916
+ }
917
+ if(!document.getElementById("video3").name) {
918
+ this.setState({
919
+ videoThreeName: ''
920
+ })
921
+ }
922
+ if(!document.getElementById("video4").name) {
923
+ this.setState({
924
+ videoFourName: ''
925
+ })
926
+ }
927
+ if(!document.getElementById("video5").name) {
928
+ this.setState({
929
+ videoFiveName: ''
930
+ })
931
+ }
932
+ if(!document.getElementById("video6").name) {
933
+ this.setState({
934
+ videoSixName: ''
935
+ })
936
+ }
808
937
  };
809
938
  // 推送“取消发布”给与会者
810
939
  this.test_controller.OnUnPublish = (feed) => {
811
940
  console.log('取消发布者', feed)
941
+ for(let i=0;i<this.state.roomCustomerList.length;i++) {
942
+ if(this.state.roomCustomerList[i].uid == feed.uid) {
943
+ this.state.roomCustomerList.splice(i, 1)
944
+ }
945
+ }
946
+
947
+ if(this.state.roomCustomerList.length == 0) {
948
+ this.test_controller.ChangeStreamSize(document.getElementById('publish_video1').name, 3)
949
+ this.setState({
950
+ isCustomer: false
951
+ })
952
+ }
812
953
  };
813
954
  // 推送“取消订阅”给与会者 OnUnSubscribe(unsubscriber,feed)
814
955
  this.test_controller.OnUnSubscribe = (unsubscriber, feed) => {
@@ -1040,6 +1181,8 @@ class Video extends Component {
1040
1181
  return;
1041
1182
  }
1042
1183
  let canvas = document.getElementById(volumeView);
1184
+ canvas.width = this.props.microphoneSize
1185
+ canvas.height = this.props.microphoneSize
1043
1186
  let ctx = canvas.getContext("2d");
1044
1187
 
1045
1188
  let outcanvas = document.createElement("canvas");
@@ -1048,44 +1191,101 @@ class Video extends Component {
1048
1191
  ctx.strokeStyle = "#db0011";
1049
1192
  ctx.lineWidth = 2;
1050
1193
  ctx.clearRect(0, 0, canvas.width, canvas.height); //清理画布
1194
+ // ctx.fillStyle ='rgba(0, 0, 0, 0.2)';
1195
+ // ctx.fillRect(0, 0, canvas.width, canvas.height, )
1051
1196
  let dataArray = new Uint8Array(analyser.frequencyBinCount);
1052
1197
  analyser.getByteFrequencyData(dataArray);
1198
+ // console.log('wwww', dataArray.length, document.getElementById('publish_video1').srcObject)
1053
1199
  let step = Math.round(dataArray.length / 60); //采样步长
1200
+ var img = document.getElementById("icon_huatong");
1201
+ ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
1202
+ // 以画布左上角为坐标原点
1203
+ let drawArea = {
1204
+ x1: 28/50*canvas.width, // 波动范围右下角的点坐标
1205
+ y1: 25/50*canvas.height,
1206
+ x2: 22/50*canvas.width, // 波动范围左上角的点坐标
1207
+ y2: 10/50*canvas.height,
1208
+ }
1209
+
1054
1210
  for (var i = 0; i < 40; i++) {
1055
1211
  let energy = (dataArray[step * i] / 256.0) * 80;
1056
- for (var j = 0; j < energy; j++) {
1057
- ctx.beginPath();
1058
- ctx.moveTo(20 * i + 2, 200 + 4 * j);
1059
- ctx.lineTo(20 * (i + 1) - 2, 200 + 4 * j);
1060
- ctx.stroke();
1061
- ctx.beginPath();
1062
- ctx.moveTo(20 * i + 2, 200 - 4 * j);
1063
- ctx.lineTo(20 * (i + 1) - 2, 200 - 4 * j);
1064
- ctx.stroke();
1065
- }
1066
1212
  ctx.beginPath();
1067
- ctx.moveTo(20 * i + 2, 200);
1068
- ctx.lineTo(20 * (i + 1) - 2, 200);
1069
- ctx.stroke();
1213
+ ctx.fillStyle = this.props.voiceColor;
1214
+ const { x1,y1,x2,y2} = drawArea
1215
+ let width = x1-x2;
1216
+ let height = (energy>20?(energy-20):0) * (y1 - y2 ) / 70
1217
+ let startX = x2 // 绘制起始点x
1218
+ let startY = y1 - height // 绘制起始点y
1219
+ ctx.fillRect(startX, startY, width, height )
1070
1220
  }
1071
1221
 
1072
1222
  //制造半透明投影
1073
1223
  function draw() {
1074
- ctx.drawImage(outcanvas, 0, 0);
1075
- ctx.save();
1076
- ctx.translate(canvas.width / 4, canvas.height / 2);
1077
- ctx.rotate(Math.PI);
1078
- ctx.scale(-1, 1);
1079
- ctx.drawImage(outcanvas, -canvas.width / 2, -canvas.height / 2);
1080
- ctx.restore();
1081
- ctx.fillStyle = 'rgba(192,192,192, .0)';
1082
- ctx.fillRect(0, 0, canvas.width, canvas.height);
1224
+ ctx.drawImage(outcanvas, 0, 0);
1225
+ ctx.save();
1226
+ ctx.translate(canvas.width / 2, canvas.height / 2);
1227
+ ctx.rotate(Math.PI);
1228
+ ctx.scale(-1, 1);
1229
+ ctx.drawImage(outcanvas, -canvas.width / 2, -canvas.height / 2);
1230
+ ctx.restore();
1231
+ ctx.fillStyle = 'rgba(192,192,192, .0)';
1232
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
1083
1233
  }
1084
1234
 
1085
1235
  draw();
1086
1236
  requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser));
1087
- }
1237
+ // let canvas = document.getElementById(volumeView);
1238
+ // let ctx = canvas.getContext("2d");
1239
+
1240
+ // let outcanvas = document.createElement("canvas");
1241
+ // outcanvas.width = canvas.width;
1242
+ // outcanvas.height = canvas.height;
1243
+ // ctx.strokeStyle = this.props.voiceColor;
1244
+ // ctx.lineWidth = 2;
1245
+ // ctx.clearRect(0, 0, canvas.width, canvas.height); //清理画布
1246
+ // let dataArray = new Uint8Array(analyser.frequencyBinCount);
1247
+ // analyser.getByteFrequencyData(dataArray);
1248
+ // let step = Math.round(dataArray.length / 60); //采样步长
1249
+ // for (var i = 0; i < 40; i++) {
1250
+ // let energy = (dataArray[step * i] / 256.0) * 50;
1251
+ // for (var j = 0; j < energy; j++) {
1252
+ // ctx.beginPath();
1253
+ // ctx.moveTo(20 * i + 2, 200 + 4 * j);
1254
+ // ctx.lineTo(20 * (i + 1) - 2, 200 + 4 * j);
1255
+ // ctx.stroke();
1256
+ // ctx.beginPath();
1257
+ // ctx.moveTo(20 * i + 2, 200 - 4 * j);
1258
+ // ctx.lineTo(20 * (i + 1) - 2, 200 - 4 * j);
1259
+ // ctx.stroke();
1260
+ // }
1261
+ // ctx.beginPath();
1262
+ // ctx.moveTo(20 * i + 2, 200);
1263
+ // ctx.lineTo(20 * (i + 1) - 2, 200);
1264
+ // ctx.stroke();
1265
+ // }
1088
1266
 
1267
+ // //制造半透明投影
1268
+ // function draw() {
1269
+ // ctx.drawImage(outcanvas, 0, 0);
1270
+ // ctx.save();
1271
+ // ctx.translate(canvas.width / 4, canvas.height / 2);
1272
+ // ctx.rotate(Math.PI);
1273
+ // ctx.scale(-1, 1);
1274
+ // ctx.drawImage(outcanvas, -canvas.width / 2, -canvas.height / 2);
1275
+ // ctx.restore();
1276
+ // ctx.fillStyle = 'rgba(192,192,192, .0)';
1277
+ // ctx.fillRect(0, 0, canvas.width, canvas.height);
1278
+ // }
1279
+
1280
+ // draw();
1281
+ // requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser));
1282
+ }
1283
+ // 停止共享
1284
+ this.test_controller.OnDesktopDisplayClosed = () => {
1285
+ if (this.state.isSharedScreen) {
1286
+ this.sharedScreen()
1287
+ }
1288
+ }
1089
1289
  }
1090
1290
  contrastFaceVerify = async data => {
1091
1291
  console.log(data);
@@ -1160,6 +1360,9 @@ class Video extends Component {
1160
1360
  })
1161
1361
  const _dependScripts = [
1162
1362
  // https://counter-web.leimondata.cn:7199
1363
+ this.props.resourcePath + "/beauty/beauty.js",
1364
+ this.props.resourcePath + "/beauty/meeting_beautify_stream.js",
1365
+ this.props.resourcePath + "/beauty/backgroundBlur.js",
1163
1366
  this.props.resourcePath + "/adapter.js",
1164
1367
  this.props.resourcePath + "/getMediaInfo.js",
1165
1368
  this.props.resourcePath + "/pdf.js",
@@ -1285,11 +1488,8 @@ class Video extends Component {
1285
1488
  }
1286
1489
  };
1287
1490
  isFileSuccuse = () => {
1288
- if (!this.state.sessionId) {
1289
- return false
1290
- } else if (this.state.isSuspend) {
1291
- return false
1292
- } else if (!this.state.isCustomer) {
1491
+ if (!this.state.sessionId || this.state.isSuspend || !this.state.isCustomer) {
1492
+ message.success(this.props.prohibitPrompt)
1293
1493
  return false
1294
1494
  } else {
1295
1495
  return true
@@ -1591,6 +1791,8 @@ class Video extends Component {
1591
1791
  }
1592
1792
  console.log(sid)
1593
1793
  this.setState({
1794
+ clickedFacial: false,
1795
+ clickedOcr: false,
1594
1796
  faceCustomerUid: item.customId,
1595
1797
  isModalVisibleFacial: true,
1596
1798
  facialImg: this.test_controller.TakePicture(1, undefined, undefined, sid, 'png')
@@ -1604,6 +1806,64 @@ class Video extends Component {
1604
1806
  imRoomId: props.imRoomId
1605
1807
  });
1606
1808
  }
1809
+ appGetUsername = async (sid) => {
1810
+ console.log(sid)
1811
+ let userId = ''
1812
+ if(document.getElementById('video1').name == sid){
1813
+ userId = this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).uid
1814
+ }
1815
+ if(document.getElementById('video2').name == sid){
1816
+ userId = this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).uid
1817
+ }if(document.getElementById('video3').name == sid){
1818
+ userId = this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).uid
1819
+ }if(document.getElementById('video4').name == sid){
1820
+ userId = this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).uid
1821
+ }if(document.getElementById('video5').name == sid){
1822
+ userId = this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).uid
1823
+ }if(document.getElementById('video6').name == sid){
1824
+ userId = this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid
1825
+ }
1826
+ try {
1827
+ let result = await API.appGetUsername({
1828
+ userId: userId
1829
+ });
1830
+ console.log(result)
1831
+ if (result.code == 200) {
1832
+ let data = result.data.userInfo ? result.data.userInfo.userName ? result.data.userInfo.userName : '' : ''
1833
+ if(document.getElementById('video1').name == sid){
1834
+
1835
+ this.setState({
1836
+ videoOneName: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).tag == 'VIDEO_SOURCE_SCREEN' ? '共享屏幕' : data ? data : '客户1'
1837
+ })
1838
+ }
1839
+ if(document.getElementById('video2').name == sid){
1840
+ this.setState({
1841
+ videoTwoName: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).tag == 'VIDEO_SOURCE_SCREEN' ? '共享屏幕' :data? data : '客户2'
1842
+ })
1843
+ }if(document.getElementById('video3').name == sid){
1844
+ this.setState({
1845
+ videoThreeName: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).tag == 'VIDEO_SOURCE_SCREEN' ? '共享屏幕' :data ? data : '客户3'
1846
+ })
1847
+ }if(document.getElementById('video4').name == sid){
1848
+ this.setState({
1849
+ videoFourName: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).tag == 'VIDEO_SOURCE_SCREEN' ? '共享屏幕' :data ? data : '客户4'
1850
+ })
1851
+ }if(document.getElementById('video5').name == sid){
1852
+ this.setState({
1853
+ videoFiveName: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).tag == 'VIDEO_SOURCE_SCREEN' ? '共享屏幕' :data? data : '客户5'
1854
+ })
1855
+ }if(document.getElementById('video6').name == sid){
1856
+ this.setState({
1857
+ videoSixName: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).tag == 'VIDEO_SOURCE_SCREEN' ? '共享屏幕' :data ? data: '客户6'
1858
+ })
1859
+ }
1860
+ } else {
1861
+ message.success('查询失败')
1862
+ }
1863
+ } catch (err) {
1864
+
1865
+ }
1866
+ }
1607
1867
  queryStaff = async () => {
1608
1868
  try {
1609
1869
  let result = await API.getUsername({
@@ -1695,6 +1955,20 @@ class Video extends Component {
1695
1955
  })
1696
1956
  }
1697
1957
  }
1958
+ facialHandleVisibleChange=(value)=>{
1959
+ if(!value) {
1960
+ this.setState({
1961
+ clickedFacial: false
1962
+ })
1963
+ }
1964
+ }
1965
+ ocrHandleVisibleChange=(value)=>{
1966
+ if(!value) {
1967
+ this.setState({
1968
+ clickedOcr: false
1969
+ })
1970
+ }
1971
+ }
1698
1972
  render() {
1699
1973
  var pdfChildren
1700
1974
  if (this.props.children) {
@@ -1733,7 +2007,7 @@ class Video extends Component {
1733
2007
  <div
1734
2008
  className={`itemed ${this.state.isBigVideo == 'video1' ? 'item1' : ""}`}
1735
2009
  // className="itemed item1"
1736
- style={{ position: "relative",'margin-right': '5px', }}
2010
+ style={{ position: "relative",'margin-right': '5px'}}
1737
2011
  onClick={this.enlargeClick.bind(this, 'isLangVideo1')}
1738
2012
  >
1739
2013
  {
@@ -1745,6 +2019,7 @@ class Video extends Component {
1745
2019
  }
1746
2020
  <div className="video1Div" style={{ display: (!this.state.customAudioed) ? '' : 'none', }}>
1747
2021
  <video
2022
+ style={{display: (this.state.isBigVideo == 'video1' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
1748
2023
  id="video1"
1749
2024
  autoPlay
1750
2025
  muted={true}
@@ -1752,7 +2027,7 @@ class Video extends Component {
1752
2027
  />
1753
2028
  <audio id="audio1" autoPlay />
1754
2029
  <label style={{ display: 'none' }} id="feedId1" type="text" />
1755
- <div style={{ display: (this.state.isCustomer) ? '' : 'none', }} className='customerTitle'>客户</div>
2030
+ <div style={{ display: (this.state.videoOneName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video1' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoOneName}</div>
1756
2031
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView1" width="40" height="70"></canvas>
1757
2032
  </div>
1758
2033
  </div>
@@ -1783,22 +2058,22 @@ class Video extends Component {
1783
2058
  </span>
1784
2059
  } */}
1785
2060
  <video
1786
- style={{ display: (!this.state.audioed && !this.state.isSuspend) ? '' : 'none', }}
2061
+ style={{ display: (!this.state.audioed && !this.state.isSuspend) ? ((this.state.isBigVideo == 'publish_video1' && this.state.isSelect == 'noVideo') ? 'none' : '') : 'none', }}
1787
2062
  id="publish_video1"
1788
2063
  className={`publishVideoClass ${this.state.isCustomer ? '' : "videoFit"}`}
1789
2064
  onClick={this.enlargeClick.bind(this, 'isLangVideo2')}
1790
2065
  autoPlay
1791
2066
  muted={true}
1792
2067
  />
1793
- <audio id="audio1" autoPlay />
2068
+ {/* <audio id="publish_audio1" autoPlay /> */}
1794
2069
  <label style={{ display: 'none' }} id="publish_streamId1" type="text" />
1795
- <div style={{ display: (this.state.isCustomer) ? '' : 'none', }} className='tellerTitle'>坐席</div>
2070
+ <div id="publish_video_div" style={{ display: (this.state.isCustomer) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily}} className={`tellerTitle ${this.state.isBigVideo == 'publish_video1' ? 'titleBig' : "titleSamlle"}`}>坐席</div>
1796
2071
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClass" id="publish_volumeView" width="40" height="70"></canvas>
1797
2072
  </div>
1798
2073
 
1799
2074
  </div>
1800
- <div className={`itemed ${this.state.isBigVideo == 'video2' ? 'item1' : ""}`} style={{'margin-top': '5px', }} onClick={this.enlargeClick.bind(this, 'isLangVideo2')}>
1801
- <video
2075
+ <div className={`itemed ${this.state.isBigVideo == 'video2' ? 'item1' : ""}`} style={{'margin-top': '5px'}} onClick={this.enlargeClick.bind(this, 'isLangVideo2')}>
2076
+ <video style={{display: (this.state.isBigVideo == 'video2' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
1802
2077
  id="video2"
1803
2078
  autoPlay
1804
2079
  muted={true}
@@ -1806,13 +2081,14 @@ class Video extends Component {
1806
2081
  />
1807
2082
  <audio id="audio2" autoPlay />
1808
2083
  <label style={{ display: 'none' }} id="feedId2" type="text" />
1809
- {/* <div className='customerTitle'>客户</div> */}
2084
+ <div style={{ display: (this.state.videoTwoName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video2' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoTwoName}</div>
1810
2085
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView2" width="40" height="70"></canvas>
1811
2086
  </div>
1812
2087
  <div className={`itemed ${this.state.isBigVideo == 'video3' ? 'item1' : ""}`}
1813
- style={{'margin-top': '5px', }}
2088
+ style={{'margin-top': '5px' }}
1814
2089
  onClick={this.enlargeClick.bind(this, 'isLangVideo3')}>
1815
2090
  <video
2091
+ style={{ display: (this.state.isBigVideo == 'video3' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
1816
2092
  id="video3"
1817
2093
  autoPlay
1818
2094
  muted={true}
@@ -1820,13 +2096,14 @@ class Video extends Component {
1820
2096
  />
1821
2097
  <audio id="audio3" autoPlay />
1822
2098
  <label style={{ display: 'none' }} id="feedId3" type="text" />
1823
- {/* <div style={{ display: (this.state.isCustomer) ? '' : 'none', }} className='customerTitle'>客户</div> */}
2099
+ <div style={{ display: (this.state.videoThreeName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video3' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoThreeName}</div>
1824
2100
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView3" width="40" height="70"></canvas>
1825
2101
  </div>
1826
2102
  <div className={`itemed ${this.state.isBigVideo == 'video4' ? 'item1' : ""}`}
1827
- style={{'margin-right': '5px', }}
2103
+ style={{'margin-right': '5px'}}
1828
2104
  onClick={this.enlargeClick.bind(this, 'isLangVideo4')}>
1829
2105
  <video
2106
+ style={{display: (this.state.isBigVideo == 'video4' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
1830
2107
  id="video4"
1831
2108
  autoPlay
1832
2109
  muted={true}
@@ -1834,13 +2111,14 @@ class Video extends Component {
1834
2111
  />
1835
2112
  <audio id="audio4" autoPlay />
1836
2113
  <label style={{ display: 'none' }} id="feedId4" type="text" />
1837
- {/* <div style={{ display: (this.state.isCustomer) ? '' : 'none', }} className='customerTitle'>客户</div> */}
2114
+ <div style={{ display: (this.state.videoFourName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video4' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoFourName}</div>
1838
2115
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView4" width="40" height="70"></canvas>
1839
2116
  </div>
1840
2117
  <div className={`itemed ${this.state.isBigVideo == 'video5' ? 'item1' : ""}`}
1841
- style={{'margin-top': '5px', }}
2118
+ style={{'margin-top': '5px' }}
1842
2119
  onClick={this.enlargeClick.bind(this, 'isLangVideo5')}>
1843
2120
  <video
2121
+ style={{display: (this.state.isBigVideo == 'video5' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
1844
2122
  id="video5"
1845
2123
  autoPlay
1846
2124
  muted={true}
@@ -1848,11 +2126,12 @@ class Video extends Component {
1848
2126
  />
1849
2127
  <audio id="audio5" autoPlay />
1850
2128
  <label style={{ display: 'none' }} id="feedId5" type="text" />
1851
- {/* <div style={{ display: (this.state.isCustomer) ? '' : 'none', }} className='customerTitle'>客户</div> */}
2129
+ <div style={{ display: (this.state.videoFiveName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video5' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoFiveName}</div>
1852
2130
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView5" width="40" height="70"></canvas>
1853
2131
  </div>
1854
- <div onClick={this.enlargeClick.bind(this, 'isLangVideo6')} style={{'margin-top': '5px', }} className={`${this.state.isBigVideo == 'video6' ? 'item1' : "itemed"}`}>
2132
+ <div onClick={this.enlargeClick.bind(this, 'isLangVideo6')} style={{'margin-top': '5px'}} className={`${this.state.isBigVideo == 'video6' ? 'item1' : "itemed"}`}>
1855
2133
  <video
2134
+ style={{display: (this.state.isBigVideo == 'video6' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
1856
2135
  id="video6"
1857
2136
  autoPlay
1858
2137
  muted={true}
@@ -1860,12 +2139,12 @@ class Video extends Component {
1860
2139
  />
1861
2140
  <audio id="audio6" autoPlay />
1862
2141
  <label style={{ display: 'none' }} id="feedId6" type="text" />
1863
- {/* <div style={{ display: (this.state.isCustomer) ? '' : 'none', }} className='customerTitle'>客户</div> */}
2142
+ <div style={{ display: (this.state.videoSixName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video6' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoSixName}</div>
1864
2143
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView6" width="40" height="70"></canvas>
1865
2144
 
1866
2145
  </div>
1867
2146
  </div>
1868
-
2147
+ <img id="icon_huatong" style={{display:'none'}} src={require("../../assets/img/icon_huatong.png").default}></img>
1869
2148
  </div>
1870
2149
  <Foot
1871
2150
  img={this.state.voiceImg}
@@ -1873,7 +2152,12 @@ class Video extends Component {
1873
2152
  suspendName={this.state.suspendName}
1874
2153
  cameraImg={this.state.cameraImg}
1875
2154
  customerList={this.state.customerList}
2155
+ clickedOcr={this.state.clickedOcr}
2156
+ clickedFacial={this.state.clickedFacial}
2157
+ {...this.props}
1876
2158
  suspend={this.suspend}
2159
+ facialHandleVisibleChange={this.facialHandleVisibleChange}
2160
+ ocrHandleVisibleChange={this.ocrHandleVisibleChange}
1877
2161
  voice={this.voice}
1878
2162
  cameraClick={this.cameraClick}
1879
2163
  sharedScreen={this.sharedScreen}
@@ -1951,5 +2235,13 @@ Video.defaultProps = {
1951
2235
  callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
1952
2236
  roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
1953
2237
  resourcePath: 'https://counter-web.leimondata.cn:7199',
2238
+ prohibitPrompt: '当前无客户',
2239
+ voiceColor: '#0AE544',
2240
+ titleBackground: 'rgba(219, 0, 17, 0.1)',
2241
+ titleColor: '#DB0011',
2242
+ microphoneSize: '50',
2243
+ fontSize: '14',
2244
+ fontFamily: 'auto',
2245
+ defaultData: ['SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP']
1954
2246
  }
1955
2247
  export default Video