react_hsbc_teller 1.6.5 → 1.6.9

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.
@@ -4,6 +4,7 @@
4
4
  import React, { Component, useState } from 'react';
5
5
  import API from '../../api/api';
6
6
  import { initWebSocket, joinRoom, disconnect } from '../../common/websocket';
7
+ import { BoardOperate } from '../../common/index.esm.js';
7
8
  import './video.less'
8
9
  import Header from '../header/header.jsx'
9
10
  import Foot from '../foot/foot.jsx'
@@ -23,10 +24,11 @@ import Spin from "antd/lib/spin";
23
24
  import 'antd/lib/spin/style'
24
25
  import Select from "antd/lib/select";
25
26
  import 'antd/lib/select/style'
26
-
27
+ import styled from 'styled-components';
27
28
  import { Button } from '../../../node_modules/antd/lib/index';
28
29
  import SignMy from '../sign/signMy.jsx'
29
30
  import axios from 'axios';
31
+ import CryptoJS from "crypto-js";
30
32
  const { Option } = Select;
31
33
  const LEAVE_TYPE = {
32
34
  TELLER_EXIT: 1, // 坐席退出
@@ -42,6 +44,36 @@ let messageValue = ''
42
44
  let beautyNum = 0 // 0-关闭 1--弱 2--中 5---高
43
45
  let rateList = []
44
46
  let beautyDiv = {};
47
+ const CanvasHome = styled.div`
48
+ position: fixed;
49
+ width: 76vw;
50
+ height: 74vh;
51
+ top: 3vh;
52
+ left: 1.5vw;
53
+ z-index:999;
54
+
55
+ .canvas{
56
+ width:100%;
57
+ height:100%;
58
+ box-shadow: 0 0 5px 0 #06a;
59
+ display:none;
60
+ }
61
+ `;
62
+ const OpreateDiv = styled.div`
63
+ display: inline-block;
64
+ margin-left: 10vw;
65
+ padding: 0 6px;
66
+ height: 4vh;
67
+ line-height: 4vh;
68
+ border-radius: 5px;
69
+ background: #fff;
70
+ font-size: 16px;
71
+ border: #333 1px solid;
72
+ span{
73
+ margin-right:10px;
74
+ cursor:pointer;
75
+ }
76
+ `;
45
77
  function clearStreamRemain() {
46
78
  if (!(beautyDiv.beauty_canvas == null || beautyDiv.beauty_canvas == undefined)) {
47
79
  beautyDiv.beauty_canvas = null;
@@ -69,6 +101,7 @@ message.config({
69
101
  class Video extends Component {
70
102
  constructor(props) {
71
103
  super(props)
104
+ this.boardOperate = null;
72
105
  }
73
106
  cancel = axios.CancelToken.source()
74
107
  state = {
@@ -213,10 +246,15 @@ class Video extends Component {
213
246
  ],
214
247
  shareMaskState: false,
215
248
  idCardName: '',
216
- idCardNumber: ''
249
+ idCardNumber: '',
250
+ operateShow: false,
251
+ drawConfig: {
252
+ curryControl: 'pen', // 工具类型
253
+ }
217
254
  };
218
255
  // eslint-disable-next-line no-undef
219
256
  test_controller = '';
257
+
220
258
  /**
221
259
  * 创建房间成功后回调后台
222
260
  * @param {JSON} data 数据类型
@@ -297,6 +335,35 @@ class Video extends Component {
297
335
 
298
336
  }
299
337
  };
338
+ decrypt(data) {
339
+ let keyStr = "le&&If?()*^%$#hA"
340
+ let iv = CryptoJS.enc.Utf8.parse("jwe232DEE?^%$eq3")
341
+ let encryptedHexStr = CryptoJS.enc.Hex.parse(data);
342
+ let content = CryptoJS.enc.Base64.stringify(encryptedHexStr);
343
+ let key = CryptoJS.enc.Utf8.parse(keyStr);
344
+ let decrypt = CryptoJS.AES.decrypt(content, key, {
345
+ iv: iv,
346
+ mode: CryptoJS.mode.CBC,
347
+ padding: CryptoJS.pad.Pkcs7,
348
+ });
349
+ return CryptoJS.enc.Utf8.stringify(decrypt).toString();
350
+ }
351
+ encrypt(data) {
352
+ let keyStr = "le&&If?()*^%$#hA"
353
+ let iv = CryptoJS.enc.Utf8.parse("jwe232DEE?^%$eq3")
354
+ let dataString = data;
355
+ if (typeof data !== "string") {
356
+ dataString = JSON.stringify(data);
357
+ }
358
+ const key = CryptoJS.enc.Utf8.parse(keyStr);
359
+ let sc = CryptoJS.enc.Utf8.parse(dataString);
360
+ let encrypted = CryptoJS.AES.encrypt(sc, key, {
361
+ iv: iv,
362
+ mode: CryptoJS.mode.CBC,
363
+ padding: CryptoJS.pad.Pkcs7,
364
+ });
365
+ return encrypted.ciphertext.toString();
366
+ }
300
367
  /**
301
368
  * 初始化获取数据
302
369
  * @param {JSON} data 数据类型
@@ -304,18 +371,13 @@ class Video extends Component {
304
371
  mpaasSig = async data => {
305
372
  console.log(data);
306
373
  try {
307
- let result = await API.mpaasSig({ account: data.account, type: data.type });
308
- console.log(result);
374
+ // let result = JSON.parse(this.decrypt(await API.mpaasSig({ ciphertext: this.encrypt({account: data.account, type: data.type})})));
375
+ let result = await API.mpaasSig({account: data.account, type: data.type});
376
+ console.log('mpaasSig',result,result.mpsSig);
309
377
  window.sessionStorage.setItem('alimpassSig', result.mpsSig);
310
378
  this.state.workSpaceId = result.workspaceId,
311
379
  this.state.appId = result.appId,
312
380
  this.state.bizName = result.bizName
313
- // const data1={
314
- // hostname: 'im.uat.dsp.hsbcfts.com.cn',
315
- // webPort: '443',
316
- // account: 'web',
317
- // openfireToken: '123'
318
- // }
319
381
  window.sessionStorage.setItem('sigData', JSON.stringify(result));
320
382
  if (data.sigType == 1) {
321
383
  this.handleEdit()
@@ -430,9 +492,9 @@ class Video extends Component {
430
492
  {
431
493
  tag: 'projectionWhiteboard',
432
494
  xPosition: 0,
433
- yPosition: 270,
434
- width: 1280,
435
- height: 720
495
+ yPosition: 175,
496
+ width: 960,
497
+ height: 540
436
498
  },
437
499
  // {
438
500
  // tag: 'VIDEO_SOURCE_SCREEN_ONE',
@@ -452,43 +514,43 @@ class Video extends Component {
452
514
  tag: 'tag1',
453
515
  xPosition: 0,
454
516
  yPosition: 0,
455
- width: 310,
456
- height: 180
517
+ width: 213,
518
+ height: 175
457
519
  },
458
520
  {
459
521
  tag: 'customer1',
460
- xPosition: 320,
522
+ xPosition: 213,
461
523
  yPosition: 0,
462
- width: 310,
463
- height: 180
524
+ width: 213,
525
+ height: 175
464
526
  },
465
527
  {
466
528
  tag: 'customer2',
467
- xPosition: 640,
529
+ xPosition: 426,
468
530
  yPosition: 0,
469
- width: 310,
470
- height: 180
531
+ width: 213,
532
+ height: 175
471
533
  },
472
534
  {
473
535
  tag: 'customer3',
474
- xPosition: 960,
536
+ xPosition: 639,
475
537
  yPosition: 0,
476
- width: 310,
477
- height: 180
538
+ width: 213,
539
+ height: 175
478
540
  },
479
541
  {
480
542
  tag: 'customer4',
481
- xPosition: 1280,
543
+ xPosition: 852,
482
544
  yPosition: 0,
483
- width: 310,
484
- height: 180
545
+ width: 213,
546
+ height: 175
485
547
  },
486
548
  {
487
549
  tag: 'customer5',
488
- xPosition: 1600,
550
+ xPosition: 1065,
489
551
  yPosition: 0,
490
- width: 310,
491
- height: 180
552
+ width: 213,
553
+ height: 175
492
554
  },
493
555
  // {
494
556
  // tag: 'customer6',
@@ -542,17 +604,25 @@ class Video extends Component {
542
604
  width: item.width,
543
605
  height: item.height
544
606
  })
545
- }) : list.push({
607
+ }) :
608
+ list.push({
546
609
  tag: 'VIDEO_SOURCE_SCREEN',
547
- xPosition: 1290,
548
- yPosition: 640,
549
- width: 630,
550
- height: 350
610
+ xPosition: 960,
611
+ yPosition: 535,
612
+ width: 320,
613
+ height: 180
551
614
  })
615
+ // list.push({
616
+ // tag: 'VIDEO_SOURCE_SCREEN_19_9',
617
+ // xPosition: 960,
618
+ // yPosition: 573,
619
+ // width: 304,
620
+ // height: 144
621
+ // })
552
622
  const filePath = 'recordId_' + new Date().valueOf();
553
623
  const recordParam = {};
554
- recordParam.width = 1920;
555
- recordParam.height = 1080;
624
+ recordParam.width = 1280;
625
+ recordParam.height = 720;
556
626
  recordParam.recordTotalStream = 0;
557
627
  recordParam.startTimeout = 10;
558
628
  recordParam.splitType = 0;
@@ -564,7 +634,7 @@ class Video extends Component {
564
634
  type: 1, // 1 为时间戳⽔印;2 为⽂字⽔印;3 为图⽚⽔印
565
635
  id: 1, // ⽔印 ID
566
636
  enable: true,
567
- xPosition: 10, // x 轴位置
637
+ xPosition: 1000, // x 轴位置
568
638
  yPosition: 10, // y 轴位置
569
639
  text: '', // ⽔印⽂字
570
640
  fontSize: 16, // 字体⼤⼩
@@ -614,6 +684,8 @@ class Video extends Component {
614
684
  contrastFaceVerify = async () => {
615
685
  try {
616
686
  let result = await API.contrastFaceVerify({
687
+ staffId: this.props.tellerAccount,
688
+ activityId: this.props.businessNumber,
617
689
  appAccount: this.state.faceCustomerUid,
618
690
  sessionId: this.state.sessionId,
619
691
  fileBase64: this.state.facialImg.replace(/^data:image\/\w+;base64,/,"")
@@ -2490,6 +2562,12 @@ class Video extends Component {
2490
2562
  this.test_controller.OnNewJoinerIn = (participant) => {
2491
2563
  console.log('新加⼊房间者', participant);
2492
2564
  this.state.isCustomer= true
2565
+ if(this.props.isOpenSound) {
2566
+ let src = autod
2567
+ let audio = new Audio(src)
2568
+ audio.play()
2569
+ }
2570
+
2493
2571
  // let src = autod
2494
2572
  // let audio = new Audio(src)
2495
2573
  // audio.play()
@@ -2877,9 +2955,13 @@ class Video extends Component {
2877
2955
  exitType
2878
2956
  ) => {
2879
2957
  console.log('退出房间者', participant, exitType)
2880
- // let src = leftMetting
2881
- // let audio = new Audio(src)
2882
- // audio.play()
2958
+ if(this.props.isOpenSound) {
2959
+ let src = leftMetting
2960
+ let audio = new Audio(src)
2961
+ audio.play()
2962
+ }
2963
+
2964
+
2883
2965
  this.appGetUsernameClick(participant).then((res)=>{
2884
2966
  console.log('退出房间者',res)
2885
2967
  let data = res? res.username ? res.username : '客户' : '客户'
@@ -3205,7 +3287,6 @@ userType:'1'
3205
3287
  this.state.analyserHeight = this.state.analyserHeight
3206
3288
  }
3207
3289
  }
3208
-
3209
3290
  this.state.OnVolumeAnalyserMap.set(sid,setInterval(
3210
3291
  this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser),
3211
3292
  300
@@ -3253,6 +3334,7 @@ userType:'1'
3253
3334
  let result = await API.videoRecordCallback({
3254
3335
  activityId: this.props.businessNumber,
3255
3336
  sessionId: this.state.sessionId,
3337
+ roomId: this.state.channelId,
3256
3338
  type: type,
3257
3339
  status: status
3258
3340
  });
@@ -3802,7 +3884,7 @@ userType:'1'
3802
3884
  isModalVisibleEnd: false
3803
3885
  })
3804
3886
  };
3805
- confirmCallback=async()=>{
3887
+ confirmCallback=async(data)=>{
3806
3888
  try {
3807
3889
  let result = await API.confirmCallback({
3808
3890
  idCardName: this.state.idCardName,
@@ -3812,16 +3894,33 @@ userType:'1'
3812
3894
  idCardNumber: this.state.idCardNumber,
3813
3895
  sessionId: this.state.sessionId,
3814
3896
  });
3897
+ console.log('confirmCallback',result)
3815
3898
  if (result.code == 200) {
3816
- this.setState({
3817
- isModalVisibleFacial: false,
3818
- idCardNumber: '',
3819
- idCardName: ''
3820
- })
3899
+ console.log(data)
3900
+ if(data == 'noFace') {
3901
+ this.setState({
3902
+ isModalVisibleFacial: false,
3903
+ idCardNumber: '',
3904
+ idCardName: ''
3905
+ })
3906
+ } else {
3907
+ console.log('data')
3908
+ this.state.faceCustomerType = 1
3909
+ this.setState({
3910
+ idCardNumber: '',
3911
+ idCardName: '',
3912
+ titleModal: '人脸识别',
3913
+ // clickedFacial: true,
3914
+ facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png')
3915
+ })
3916
+ }
3917
+
3821
3918
  } else {
3919
+ console.log('1')
3822
3920
  this.messageClick('保持信息失败','error')
3823
3921
  }
3824
3922
  } catch (err) {
3923
+ console.log('2')
3825
3924
  this.messageClick('保持信息失败','error')
3826
3925
  }
3827
3926
  }
@@ -3848,9 +3947,9 @@ userType:'1'
3848
3947
  })
3849
3948
  });
3850
3949
  this.setState({
3851
- isModalVisibleFacial: false
3852
- // idCardNumber: result.data.idCardNumber,
3853
- // idCardName: result.data.idCardName
3950
+ // isModalVisibleFacial: false
3951
+ idCardNumber: result.data.idCardNumber,
3952
+ idCardName: result.data.idCardName
3854
3953
  })
3855
3954
  } else {
3856
3955
  this.messageClick('识别失败','error')
@@ -4388,13 +4487,81 @@ userType:'1'
4388
4487
  // }
4389
4488
  }
4390
4489
  }
4391
-
4392
4490
  this.navigatorClick()
4491
+
4393
4492
  } else {
4394
4493
  this.messageClick('internal staff正在共享屏幕,请先关闭','error')
4395
4494
  }
4396
4495
  }
4397
4496
  }
4497
+ openCanvas(drawCanvas) {
4498
+ if (!this.boardOperate) {
4499
+ this.boardOperate = new BoardOperate(drawCanvas, {
4500
+ drawColor: "#000000",
4501
+ drawType: "pen",
4502
+ lineWidth: 5,
4503
+ fillStyle: '', // 初始背景色,若为空则透明背景
4504
+ });
4505
+ }
4506
+ }
4507
+ closeCanvas() {
4508
+ this.boardOperate.destroy();
4509
+ this.boardOperate = null;
4510
+ }
4511
+
4512
+ setTool(type) {
4513
+ const { drawConfig } = this.state;
4514
+ drawConfig.curryControl = type;
4515
+ this.boardOperate.changeWay({
4516
+ type
4517
+ });
4518
+
4519
+ this.setState({ drawConfig });
4520
+ }
4521
+
4522
+ setOpreate(type) {
4523
+ this.boardOperate[type]();
4524
+ }
4525
+ downCanvas() {
4526
+ const canvas = document.getElementById('canvas');
4527
+ const base64 = canvas.toDataURL();
4528
+
4529
+
4530
+ let img = document.createElement('img');
4531
+ img.style.position = 'fixed';
4532
+ img.style.width = '90vw';
4533
+ img.style.height = '95vh';
4534
+ img.style.top = '9vh';
4535
+ img.style.left = '5vw';
4536
+ img.src = base64;
4537
+ document.body.appendChild(img);
4538
+
4539
+ }
4540
+ graffiti=()=>{
4541
+ if(!this.state.operateShow) {
4542
+ this.change(true)
4543
+ }
4544
+
4545
+ }
4546
+ closeGraffiti=()=>{
4547
+ this.change(false)
4548
+ }
4549
+ change(val) {
4550
+ this.setState({ operateShow: val })
4551
+ const canvas = document.getElementById('canvas');
4552
+ if (val) {
4553
+ canvas.style.display = 'block';
4554
+ canvas.width = canvas.clientWidth;
4555
+ canvas.height = canvas.clientHeight;
4556
+ setTimeout(() => {
4557
+ this.openCanvas(canvas)
4558
+ }, 0);
4559
+ } else {
4560
+ // this.downCanvas()
4561
+ this.closeCanvas();
4562
+ canvas.style.display = 'none';
4563
+ }
4564
+ }
4398
4565
  switchSelect = (value) => {
4399
4566
  this.setState({
4400
4567
  isSelect: value,
@@ -4757,7 +4924,19 @@ userType:'1'
4757
4924
  {tabTitleList}
4758
4925
  {/* <img style={sectionStyle} src={require("../../assets/img/placeholder_bg.png").default} alt="" /> */}
4759
4926
  <div id="whiteboardDIV" style={{height: 'calc(100% - 33px)'}}>
4760
-
4927
+ <CanvasHome>
4928
+ {this.state.operateShow &&
4929
+ <OpreateDiv id="operate">
4930
+ <span onClick={() => this.setTool('pen')}>铅笔</span>
4931
+ <span onClick={() => this.setTool('eraser')}>橡皮</span>
4932
+ <span onClick={() => this.setOpreate('undo')}>撤销</span>
4933
+ <span onClick={() => this.setOpreate('redo')}>恢复</span>
4934
+ <span onClick={() => this.setOpreate('clear')}>清除</span>
4935
+ <span onClick={() => this.closeGraffiti()}>关闭</span>
4936
+ </OpreateDiv>
4937
+ }
4938
+ <canvas id="canvas" className="canvas"></canvas>
4939
+ </CanvasHome>
4761
4940
  <div className="videoDiv" style={{ display: (this.state.isSelect == 'RMScreen' || this.state.isSelect == 'staffScreen') ? '' : 'none', }}>
4762
4941
  <div className="videoDiv">
4763
4942
  <video
@@ -5249,6 +5428,7 @@ userType:'1'
5249
5428
  switchExternal={this.switchExternal}
5250
5429
  inspection={this.inspection}
5251
5430
  beautyClick={this.beautyClick}
5431
+ graffiti={this.graffiti}
5252
5432
  ></Foot>
5253
5433
  <Modal cancelText="取消" okText="确定" visible={this.state.isModalVisible} onOk={this.handleOk}
5254
5434
  onCancel={this.handleCancel}>
@@ -5274,7 +5454,8 @@ userType:'1'
5274
5454
  <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkFacial}>确定</Button>
5275
5455
  </div>,
5276
5456
  this.state.idCardName && <div key='facial'>
5277
- <Button className="modelButtonOk" type="primary" danger onClick={this.confirmCallback}>确认</Button>
5457
+ <Button className="modelButtonFaceOk" danger onClick={(e)=>this.confirmCallback('face')}>完成并发起人脸识别</Button>
5458
+ <Button className="modelButtonOk" type="primary" danger onClick={(e)=>this.confirmCallback('noFace')}>完成</Button>
5278
5459
  </div>
5279
5460
  ]}>
5280
5461
  <div className="faceBody">
@@ -5412,7 +5593,7 @@ sessionId: "",
5412
5593
  microphoneSize: 25,
5413
5594
  fontSize: '14',
5414
5595
  fontFamily: 'auto',
5415
- menus: ['BOARD','SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP', 'BEAUTY'],
5596
+ menus: ['BOARD','SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP', 'BEAUTY','GRAFFITI'],
5416
5597
  customLeaveRoom: '客户离开房间',
5417
5598
  meetingInfo: {
5418
5599
  title: '--',
@@ -5422,6 +5603,7 @@ sessionId: "",
5422
5603
  },
5423
5604
  isTranscribing: false,
5424
5605
  shareMask: false,
5606
+ isOpenSound: false, // true开启进出音效 false不开启
5425
5607
  internalUrl: 'https://wp-staff-gateway.wealth-platform.uat.ali.cloud.cn.hsbc/meeting-ui/OHB/CN/HSBC?chnlID=OHB&locale=zh_CN&chnlCC=CN&chnlGMC=HSBC&targetFunc=supervisorMeeting&sourceFunc=rmMeeting'
5426
5608
  }
5427
5609
  export default Video
@@ -378,6 +378,15 @@
378
378
  background: #DB0011!important;
379
379
  border-spacing: 20px!important;
380
380
  }
381
+ .modelButtonFaceOk{
382
+ width: 170px!important;
383
+ height: 40px!important;
384
+ font-size: 16px!important;
385
+ color: #333!important;
386
+ border: 1px #333 solid!important;
387
+ background: #fff!important;
388
+ border-spacing: 20px!important;
389
+ }
381
390
  .endModal{
382
391
  font-size: 16px;
383
392
  padding: 56px 30px 0px 30px;