react_hsbc_teller 1.7.2 → 1.7.5

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.7.2",
3
+ "version": "1.7.5",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
Binary file
@@ -5,11 +5,10 @@ import Pdf from './pdf.js'
5
5
  class Demo extends Component {
6
6
  state = {
7
7
  shareMask: false,
8
- imRoomId: "AIByYlxRE@conference.openfire2.leimondata.cn",
9
- sessionId: "AIByYlxRE",
10
- mtoken: "101046e69f16",
11
- roomId: "657007173551208",
12
-
8
+ mtoken: "492948d0a7ec",
9
+ roomId: "656467744508298",
10
+ imRoomId: "ACkhcdtat@conference.openfire2.leimondata.cn",
11
+ sessionId: "ACkhcdtat",
13
12
  // roomId: '',
14
13
  // mtoken: '',
15
14
  // imRoomId: '',
@@ -12,6 +12,7 @@ import voiceImgOpen from '../../assets/img/icon_Mute.png'
12
12
  import voiceImgCloe from '../../assets/img/icon_MuteOne.png'
13
13
  import cameraImgOpen from '../../assets/img/icon_camera.png'
14
14
  import cameraImgCloe from '../../assets/img/icon_cameraOne.png'
15
+ import ocrImage from '../../assets/img/jietu.png'
15
16
  import autod from '../../assets/mp3/joinmeeting.mp3'
16
17
  import leftMetting from '../../assets/mp3/leftmeeting.mp3'
17
18
  import errorPng from '../../assets/img/tooltips2_fail.png'
@@ -44,6 +45,8 @@ let messageValue = ''
44
45
  let beautyNum = 0 // 0-关闭 1--弱 2--中 5---高
45
46
  let rateList = []
46
47
  let beautyDiv = {};
48
+ let isBackgroundBlur = false
49
+ let isSuccuseHs = false
47
50
  let CanvasHome = styled.div`
48
51
  position: fixed;
49
52
  z-index: ${props=>props.zIndexNum};
@@ -71,6 +74,7 @@ const OpreateDiv = styled.div`
71
74
  cursor:pointer;
72
75
  }
73
76
  `;
77
+
74
78
  function clearStreamRemain() {
75
79
  if (!(beautyDiv.beauty_canvas == null || beautyDiv.beauty_canvas == undefined)) {
76
80
  beautyDiv.beauty_canvas = null;
@@ -90,6 +94,28 @@ function startBeauty(stream) {
90
94
  beautyDiv = meetingBeautifyStream(newStream, beautyNum);
91
95
  newStream = beautyDiv.stream;
92
96
  return newStream
97
+ }
98
+ async function startHs(stream) {
99
+ // var canvas = document.getElementById('publish_video_canvas');
100
+ var video_src = document.getElementById("publish_video1");
101
+ var mode = 'blur';
102
+ video_src.srcObject = stream;
103
+
104
+ await hsInit();
105
+ isSuccuseHs = true;
106
+ hsStart(stream, mode);
107
+
108
+ }
109
+
110
+ async function stopHs() {
111
+ var video_src = document.getElementById("publish_video1");
112
+ if(video_src) {
113
+ console.log('video_src',video_src)
114
+ video_src.srcObject = null;
115
+ isSuccuseHs = false
116
+ hsStop();
117
+ }
118
+
93
119
  }
94
120
  message.config({
95
121
  getContainer: ()=>document.getElementById('allHSBC')
@@ -126,6 +152,7 @@ class Video extends Component {
126
152
  linkData: '',
127
153
  roomCustomerList: [],
128
154
  facialImg: '',
155
+ isFaceImage: false,
129
156
  isModalVisibleFacial: false,
130
157
  isModalVisibleEnd: false,
131
158
  isModalVisible: false,
@@ -373,8 +400,8 @@ class Video extends Component {
373
400
  mpaasSig = async data => {
374
401
  console.log(data);
375
402
  try {
376
- // let result = JSON.parse(this.decrypt(await API.mpaasSig({ ciphertext: this.encrypt({account: data.account, type: data.type})})));
377
- let result = await API.mpaasSig({account: data.account, type: data.type});
403
+ let result = JSON.parse(this.decrypt(await API.mpaasSig({ ciphertext: this.encrypt({account: data.account, type: data.type})})));
404
+ // let result = await API.mpaasSig({account: data.account, type: data.type});
378
405
  console.log('mpaasSig',result,result.mpsSig);
379
406
  window.sessionStorage.setItem('alimpassSig', result.mpsSig);
380
407
  this.state.workSpaceId = result.workspaceId,
@@ -397,11 +424,11 @@ class Video extends Component {
397
424
  handleEdit = () => {
398
425
  console.log(JSON.parse(window.sessionStorage.getItem('sigData')));
399
426
  // eslint-disable-next-line no-undef
400
- // initWebSocket('wss://im.uat.dsp.hsbcfts.com.cn:443/wealth/im/ws/')
427
+ initWebSocket('wss://im.uat.dsp.hsbcfts.com.cn:443/wealth/im/ws/')
401
428
  // initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + '15603' + '/ws/');
402
429
  if(!this.state.imStatus){
403
430
  this.state.manualClose = false
404
- initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
431
+ // initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
405
432
 
406
433
  }
407
434
  const config_param = {};
@@ -494,9 +521,9 @@ class Video extends Component {
494
521
  {
495
522
  tag: 'projectionWhiteboard',
496
523
  xPosition: 0,
497
- yPosition: 270,
498
- width: 1280,
499
- height: 720
524
+ yPosition: 175,
525
+ width: 960,
526
+ height: 540
500
527
  },
501
528
  // {
502
529
  // tag: 'VIDEO_SOURCE_SCREEN_ONE',
@@ -516,43 +543,43 @@ class Video extends Component {
516
543
  tag: 'tag1',
517
544
  xPosition: 0,
518
545
  yPosition: 0,
519
- width: 310,
520
- height: 180
546
+ width: 213,
547
+ height: 175
521
548
  },
522
549
  {
523
550
  tag: 'customer1',
524
- xPosition: 320,
551
+ xPosition: 213,
525
552
  yPosition: 0,
526
- width: 310,
527
- height: 180
553
+ width: 213,
554
+ height: 175
528
555
  },
529
556
  {
530
557
  tag: 'customer2',
531
- xPosition: 640,
558
+ xPosition: 426,
532
559
  yPosition: 0,
533
- width: 310,
534
- height: 180
560
+ width: 213,
561
+ height: 175
535
562
  },
536
563
  {
537
564
  tag: 'customer3',
538
- xPosition: 960,
565
+ xPosition: 639,
539
566
  yPosition: 0,
540
- width: 310,
541
- height: 180
567
+ width: 213,
568
+ height: 175
542
569
  },
543
570
  {
544
571
  tag: 'customer4',
545
- xPosition: 1280,
572
+ xPosition: 852,
546
573
  yPosition: 0,
547
- width: 310,
548
- height: 180
574
+ width: 213,
575
+ height: 175
549
576
  },
550
577
  {
551
578
  tag: 'customer5',
552
- xPosition: 1600,
579
+ xPosition: 1065,
553
580
  yPosition: 0,
554
- width: 310,
555
- height: 180
581
+ width: 213,
582
+ height: 175
556
583
  },
557
584
  // {
558
585
  // tag: 'customer6',
@@ -606,17 +633,25 @@ class Video extends Component {
606
633
  width: item.width,
607
634
  height: item.height
608
635
  })
609
- }) : list.push({
636
+ }) :
637
+ list.push({
610
638
  tag: 'VIDEO_SOURCE_SCREEN',
611
- xPosition: 1290,
612
- yPosition: 640,
613
- width: 630,
614
- height: 350
639
+ xPosition: 960,
640
+ yPosition: 535,
641
+ width: 320,
642
+ height: 180
615
643
  })
644
+ // list.push({
645
+ // tag: 'VIDEO_SOURCE_SCREEN_19_9',
646
+ // xPosition: 960,
647
+ // yPosition: 573,
648
+ // width: 304,
649
+ // height: 144
650
+ // })
616
651
  const filePath = 'recordId_' + new Date().valueOf();
617
652
  const recordParam = {};
618
- recordParam.width = 1920;
619
- recordParam.height = 1080;
653
+ recordParam.width = 1280;
654
+ recordParam.height = 720;
620
655
  recordParam.recordTotalStream = 0;
621
656
  recordParam.startTimeout = 10;
622
657
  recordParam.splitType = 0;
@@ -1817,6 +1852,72 @@ class Video extends Component {
1817
1852
  // 手机端停止投屏
1818
1853
  this.tabTitlesClick('customerScreen', 'delect')
1819
1854
 
1855
+ } else if (Mival.typeId == 1401) {
1856
+ if (Mival.sessionId == this.state.sessionId) {
1857
+ if (Mival.userId == this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).uid) {
1858
+ this.setState({
1859
+ videoOneName: Mival.name
1860
+ })
1861
+
1862
+ }
1863
+ if (Mival.userId == (document.getElementById("feedId2").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).uid : '')) {
1864
+ this.setState({
1865
+ videoTwoName: Mival.name
1866
+ })
1867
+ }
1868
+ if (Mival.userId == (document.getElementById("feedId3").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).uid : '')) {
1869
+ this.setState({
1870
+ videoThreeName: Mival.name
1871
+ })
1872
+ }
1873
+ if (Mival.userId == (document.getElementById("feedId4").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).uid : '')) {
1874
+ this.setState({
1875
+ videoFourName: Mival.name
1876
+ })
1877
+ }
1878
+ if (Mival.userId == (document.getElementById("feedId5").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).uid : '')) {
1879
+ this.setState({
1880
+ videoFiveName: Mival.name
1881
+ })
1882
+ }
1883
+ if (Mival.userId == (document.getElementById("feedId6").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid : '')) {
1884
+ this.setState({
1885
+ videoSixName: Mival.name
1886
+ })
1887
+ }
1888
+
1889
+ if (Mival.userId == (document.getElementById("feedId7").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId7").innerText).uid : '')) {
1890
+ this.setState({
1891
+ videoSevenName: Mival.name
1892
+ })
1893
+ }
1894
+ if (Mival.userId == (document.getElementById("feedId8").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId8").innerText).uid : '')) {
1895
+ this.setState({
1896
+ videoEightName: Mival.name
1897
+ })
1898
+ }
1899
+ if (Mival.userId == (document.getElementById("feedId9").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId9").innerText).uid : '')) {
1900
+ this.setState({
1901
+ videoNineName: Mival.name
1902
+ })
1903
+ }
1904
+ if (Mival.userId == (document.getElementById("feedId10").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId10").innerText).uid : '')) {
1905
+ this.setState({
1906
+ videoTenName: Mival.name
1907
+ })
1908
+ }
1909
+ if (Mival.userId == (document.getElementById("feedId11").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId11").innerText).uid : '')) {
1910
+ this.setState({
1911
+ videoElevenName: Mival.name
1912
+ })
1913
+ }
1914
+ if (Mival.userId == (document.getElementById("feedId12").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).uid : '')) {
1915
+ this.setState({
1916
+ videoTwelveName: Mival.name
1917
+ })
1918
+ }
1919
+
1920
+ }
1820
1921
  }
1821
1922
  };
1822
1923
  window.IMOpenfire = msg =>{
@@ -2153,6 +2254,14 @@ class Video extends Component {
2153
2254
  }
2154
2255
  }
2155
2256
  if(sid == document.getElementById('publish_video1').name) {
2257
+ var box=document.getElementById("whiteboardDIV");
2258
+ if(box){ //此处在加一层判断,更加严密,如果box存在的情况下获取
2259
+ this.setState({
2260
+ whiteboardTop: box.getBoundingClientRect().top * 1.08 - 40,
2261
+ whiteboardLeft: box.getBoundingClientRect().left
2262
+ })
2263
+ console.log('whiteboardDIV',this.state.whiteboardTop,this.state.whiteboardLeft)
2264
+ }
2156
2265
  this.setState({
2157
2266
 
2158
2267
  loading: false,
@@ -2941,6 +3050,10 @@ class Video extends Component {
2941
3050
  };
2942
3051
  // 退出房间回调
2943
3052
  this.test_controller.OnLeaveRoom = (leaveType) => {
3053
+ if(isSuccuseHs) {
3054
+ stopHs();
3055
+ }
3056
+
2944
3057
  console.log('退出房间回调', leaveType);
2945
3058
  };
2946
3059
  // 推送“退出房间者”给与会者
@@ -3526,6 +3639,10 @@ userType:'1'
3526
3639
  this.props.resourcePath + "/iconfont.js",
3527
3640
  this.props.resourcePath + "/html2canvas.js",
3528
3641
  this.props.resourcePath + "/dom-to-image.js",
3642
+
3643
+ // this.props.resourcePath + "/hs/hs_human_segmentation_wrapper.js",
3644
+ // this.props.resourcePath + "/hs/hs_human_segmentation.js",
3645
+ // this.props.resourcePath + "/hs/hs_human_segmentation.wasm",
3529
3646
 
3530
3647
 
3531
3648
 
@@ -3920,7 +4037,8 @@ userType:'1'
3920
4037
  idCardName: '',
3921
4038
  titleModal: '人脸识别',
3922
4039
  // clickedFacial: true,
3923
- facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png')
4040
+ facialImg: ocrImage,
4041
+ isFaceImage: false
3924
4042
  })
3925
4043
  }
3926
4044
 
@@ -4117,26 +4235,27 @@ userType:'1'
4117
4235
  this.setState({
4118
4236
  clickedFacial: false,
4119
4237
  clickedOcr: false,
4120
- isModalVisibleFacial: true,
4121
- facialImg: this.test_controller.TakePicture(1, undefined, undefined, sid, 'png')
4122
- })
4123
- setTimeout(() => {
4238
+ isFaceImage: false,
4239
+ facialImg: ocrImage,
4240
+ },()=>{
4124
4241
  this.setState({
4125
- facialImg: this.test_controller.TakePicture(1, undefined, undefined, sid, 'png')
4242
+ isModalVisibleFacial: true,
4126
4243
  })
4127
- },1000)
4244
+ })
4128
4245
  }
4129
4246
  }
4130
4247
  sgsinImage=()=>{
4131
4248
  this.setState({
4132
- facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png')
4249
+ facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png'),
4250
+ isFaceImage: true
4133
4251
  })
4134
4252
  }
4135
4253
  handleChangeOcr =(val)=> {
4136
4254
  console.log(val)
4137
4255
  this.setState({
4138
4256
  defaultValue: 1,
4139
- facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png')
4257
+ facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png'),
4258
+ isFaceImage: true
4140
4259
  })
4141
4260
  }
4142
4261
  componentWillReceiveProps(props) {
@@ -4652,7 +4771,7 @@ userType:'1'
4652
4771
  this.state.whiteboardHeight = box.offsetHeight * 0.92,
4653
4772
  this.state.whiteboardTop = box.getBoundingClientRect().top * 1.08 - 40
4654
4773
  this.state.whiteboardLeft = box.getBoundingClientRect().left
4655
- console.log('whiteboardDIV', this.state.whiteboardHeight,box.clientHeight,this.state.whiteboardWidth)
4774
+ console.log('whiteboardDIV', this.state.whiteboardHeight,this.state.whiteboardWidth,this.state.whiteboardTop,this.state.whiteboardLeft)
4656
4775
  }
4657
4776
  }
4658
4777
  muteOpposite = (value) => {
@@ -5467,8 +5586,14 @@ userType:'1'
5467
5586
  <Modal title={this.state.titleModal} closable={false} centered={true} visible={this.state.isModalVisibleFacial} footer={[
5468
5587
  !this.state.idCardName && <div key='facial'>
5469
5588
  <Button className="modelButtonCancel" onClick={this.handleCancelFacial}>取消</Button>
5470
- <Button className="modelButtonCancel" onClick={this.sgsinImage}>重新截图</Button>
5471
- <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkFacial}>确定</Button>
5589
+ <Button className="modelButtonCancel" onClick={this.sgsinImage}>截图</Button>
5590
+ {
5591
+ this.state.isFaceImage && <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkFacial}>确定</Button>
5592
+ }
5593
+ {
5594
+ !this.state.isFaceImage && <Button className="modelButtonNo" type="primary" danger>确定</Button>
5595
+ }
5596
+
5472
5597
  </div>,
5473
5598
  this.state.idCardName && <div key='facial'>
5474
5599
  <Button className="modelButtonFaceOk" danger onClick={(e)=>this.confirmCallback('face')}>完成并发起人脸识别</Button>
@@ -378,6 +378,15 @@
378
378
  background: #DB0011!important;
379
379
  border-spacing: 20px!important;
380
380
  }
381
+ .modelButtonNo{
382
+ width: 100px!important;
383
+ height: 40px!important;
384
+ font-size: 16px!important;
385
+ color: #5C5C5C!important;
386
+ border: 1px #5C5C5C solid!important;
387
+ background: #d9d9d9!important;
388
+ border-spacing: 20px!important;
389
+ }
381
390
  .modelButtonFaceOk{
382
391
  width: 170px!important;
383
392
  height: 40px!important;