react_hsbc_teller 1.4.3 → 1.4.6

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.4.3",
3
+ "version": "1.4.6",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -1,6 +1,26 @@
1
1
  import Server from './server';
2
2
 
3
3
  class API extends Server{
4
+
5
+ async rateAll(params = {}){
6
+ // return this.axios('get', '/lang/select/2', params);
7
+ try{
8
+ let result = await this.axios('get', '/hsbc/rate/all', params);
9
+ if(result && (result.data instanceof Object) && result.code === 200){
10
+ return result||[];
11
+ }else{
12
+ let err = {
13
+ tip: '服务异常',
14
+ response: result,
15
+ data: params,
16
+ // url: 'https://api.cangdu.org/shopro/data/products',
17
+ }
18
+ throw err;
19
+ }
20
+ }catch(err){
21
+ throw err;
22
+ }
23
+ }
4
24
  async getBase64Image(params = {}){
5
25
  // return this.axios('get', '/lang/select/2', params);
6
26
  try{
@@ -4,17 +4,22 @@ import Pdf from './pdf.js'
4
4
 
5
5
  class Demo extends Component {
6
6
  state = {
7
- // imRoomId: "9K9ea1vOM@conference.ls-im-xmpp.chinawp.dev.ali.cloud.cn.hsbc",
8
- // sessionId: "9K9ea1vOM",
9
- // mtoken: "d4e648858b03",
10
- // roomId: "645110140224386",
11
- roomId: '',
12
- mtoken: '',
13
- imRoomId: '',
14
- sessionId: '',
7
+ shareMask: false,
8
+ mtoken: "84d0410ab406",
9
+
10
+ roomId: "651114052525526",
11
+
12
+ imRoomId: "VPP0Ejwae@conference.openfire2.leimondata.cn",
13
+
14
+ sessionId: "VPP0Ejwae",
15
+ // roomId: '',
16
+ // mtoken: '',
17
+ // imRoomId: '',
18
+ // sessionId: '',
15
19
  isVideo: false,
16
20
  tellerAccount: '00000000',
17
21
  callbackUrl: 'http://182.92.184.31:8720/hsbc/callback',
22
+ // callbackUrl: 'https://aag.wealth-platform.uat.ali.cloud.cn.hsbc/nosaml/api/appointment/wealth/api/v1/appointment/ali/createMeetingRoom',
18
23
  businessNumber: '',
19
24
  lang: 'zh',
20
25
  roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
@@ -29,7 +34,7 @@ class Demo extends Component {
29
34
  microphoneSize: 50,
30
35
  fontSize: 14,
31
36
  fontFamily: 'auto',
32
- isTranscribing: false
37
+ isTranscribing: true
33
38
  }
34
39
  componentWillMount() {
35
40
  // if(window.localStorage.getItem('roomId')) {
@@ -111,7 +116,25 @@ handleResourcePath = (event) => {
111
116
  })
112
117
  }
113
118
  imgCallback=(file)=>{
114
- console.log(file)
119
+ console.log('errorType',file)
120
+ }
121
+ shareMaskClick=()=>{
122
+ console.log(this.state.shareMask)
123
+
124
+ if(this.state.shareMask) {
125
+ this.setState({
126
+ shareMask: false
127
+ }, ()=>{
128
+ console.log(this.state.shareMask)
129
+ })
130
+ } else {
131
+ this.setState({
132
+ shareMask: true
133
+ }, ()=>{
134
+ console.log(this.state.shareMask)
135
+ })
136
+ }
137
+
115
138
  }
116
139
  createRoomCallback=(data)=>{
117
140
  console.log('createRoomCallback', data)
@@ -143,7 +166,9 @@ joinRoomCallback=(data)=>{
143
166
  <div className="test">
144
167
  {
145
168
  this.state.isVideo ?
169
+ <div>
146
170
  <HSBC
171
+ shareMask={this.state.shareMask}
147
172
  roomId={this.state.roomId}
148
173
  mtoken={this.state.mtoken}
149
174
  sessionId={this.state.sessionId}
@@ -171,6 +196,8 @@ joinRoomCallback=(data)=>{
171
196
 
172
197
  <Pdf></Pdf>
173
198
  </HSBC>
199
+ <button onClick={this.shareMaskClick.bind(this)}>遮罩层</button>
200
+ </div>
174
201
  :
175
202
  <div>
176
203
  坐席账号:<input placeholder="请输入坐席账号" value={this.state.tellerAccount} onChange={e => this.handleChangeTeller(e)}></input>
@@ -38,6 +38,7 @@ let streamShare
38
38
  let muteJson = new Map()
39
39
  let dateTime = 0
40
40
  let messageValue = ''
41
+ let rateList = []
41
42
  var os = function() {
42
43
  var ua = navigator.userAgent,
43
44
  isWindowsPhone = /(?:Windows Phone)/.test(ua),
@@ -68,6 +69,7 @@ class Video extends Component {
68
69
  cancel = axios.CancelToken.source()
69
70
  signCanvas = React.createRef();
70
71
  state = {
72
+ signNoClick: false,
71
73
  listVideoPicture: [],
72
74
  isScreenSwitching: false,
73
75
  whiteboardWidth: '',
@@ -204,11 +206,11 @@ class Video extends Component {
204
206
  {
205
207
  type: false
206
208
  }
207
- ]
209
+ ],
210
+ shareMaskState: false,
208
211
  };
209
212
  // eslint-disable-next-line no-undef
210
213
  test_controller = '';
211
-
212
214
  /**
213
215
  * 创建房间成功后回调后台
214
216
  * @param {JSON} data 数据类型
@@ -278,6 +280,7 @@ class Video extends Component {
278
280
  try {
279
281
  let result = await API.getBase64Image({ fileName: data});
280
282
  console.log('getBase64Image',result)
283
+ this.tabTitlesClick('customerScreen', 'delect')
281
284
  this.props.imgCallback({
282
285
  type: result.data.type + '',
283
286
  file: result.data.base64Image}
@@ -397,132 +400,168 @@ class Video extends Component {
397
400
  ];
398
401
  this.test_controller.InitRoomConfig(config_param)
399
402
  };
403
+ rateAll = async() =>{
404
+ let data = ''
405
+ try {
406
+ let result = await API.rateAll();
407
+ console.log(result)
408
+
409
+ if (result.code == 200) {
410
+ data = result.data ? result.data : ''
411
+ }
412
+ return data
413
+ }catch (err) {
414
+ return data
415
+ }
416
+ }
400
417
  // 开启录制
401
418
  enableServerRecording = () => {
402
- const filePath = 'recordId_' + new Date().valueOf();
403
- const recordParam = {};
404
- recordParam.width = 1920;
405
- recordParam.height = 1080;
406
- recordParam.recordTotalStream = 0;
407
- recordParam.startTimeout = 10;
408
- recordParam.splitType = 0;
409
- recordParam.endType = 1;
410
- recordParam.crf = 26
411
- recordParam.overlaps = [
412
- {
413
- tag: '', // 流 tag,如果不设置或为空,则为全局⽔印
414
- type: 1, // 1 为时间戳⽔印;2 为⽂字⽔印;3 为图⽚⽔印
415
- id: 1, // ⽔印 ID
416
- enable: true,
417
- xPosition: 10, // x 轴位置
418
- yPosition: 10, // y 轴位置
419
- text: '', // ⽔印⽂字
420
- fontSize: 16, // 字体⼤⼩
421
- url: '' // ⽔印图⽚ HTTP 地址
422
- },
423
- ];
424
- recordParam.tagPositions = [
425
- {
426
- tag: 'projectionWhiteboard',
427
- xPosition: 0,
428
- yPosition: 270,
429
- width: 1280,
430
- height: 720
431
- },
432
- {
433
- tag: 'VIDEO_SOURCE_SCREEN',
434
- xPosition: 1290,
435
- yPosition: 640,
436
- width: 630,
437
- height: 350
438
- },
439
- {
440
- tag: 'tag1',
441
- xPosition: 0,
442
- yPosition: 0,
443
- width: 310,
444
- height: 180
445
- },
446
- {
447
- tag: 'customer1',
448
- xPosition: 320,
449
- yPosition: 0,
450
- width: 310,
451
- height: 180
452
- },
453
- {
454
- tag: 'customer2',
455
- xPosition: 640,
456
- yPosition: 0,
457
- width: 310,
458
- height: 180
459
- },
460
- {
461
- tag: 'customer3',
462
- xPosition: 960,
463
- yPosition: 0,
464
- width: 310,
465
- height: 180
466
- },
467
- {
468
- tag: 'customer4',
469
- xPosition: 1280,
470
- yPosition: 0,
471
- width: 310,
472
- height: 180
473
- },
474
- {
475
- tag: 'customer5',
476
- xPosition: 1600,
477
- yPosition: 0,
478
- width: 310,
479
- height: 180
480
- },
481
- // {
482
- // tag: 'customer6',
483
- // xPosition: 1440,
484
- // yPosition: 0,
485
- // width: 240,
486
- // height: 180
487
- // },
488
- // {
489
- // tag: 'customer7',
490
- // xPosition: 1680,
491
- // yPosition: 0,
492
- // width: 240,
493
- // height: 180
494
- // },
495
- // {
496
- // tag: 'customer8',
497
- // xPosition: 1680,
498
- // yPosition: 180,
499
- // width: 240,
500
- // height: 180
501
- // },
502
- // {
503
- // tag: 'customer9',
504
- // xPosition: 1680,
505
- // yPosition: 360,
506
- // width: 240,
507
- // height: 180
508
- // },
509
- // {
510
- // tag: 'customer10',
511
- // xPosition: 1680,
512
- // yPosition: 540,
513
- // width: 240,
514
- // height: 180
515
- // },
516
- // {
517
- // tag: 'customer11',
518
- // xPosition: 1680,
519
- // yPosition: 720,
520
- // width: 240,
521
- // height: 180
522
- // }
523
- ]
524
- console.log('recordParam', recordParam);
525
- this.test_controller.StartRemoteRecord(filePath, recordParam, '')
419
+ const that = this
420
+ this.rateAll().then((res)=>{
421
+ console.log('退出房间者',res)
422
+ let list = [
423
+ {
424
+ tag: 'projectionWhiteboard',
425
+ xPosition: 0,
426
+ yPosition: 270,
427
+ width: 1280,
428
+ height: 720
429
+ },
430
+ // {
431
+ // tag: 'VIDEO_SOURCE_SCREEN_ONE',
432
+ // xPosition: 1290,
433
+ // yPosition: 724,
434
+ // width: 570,
435
+ // height: 270
436
+ // },
437
+ // {
438
+ // tag: 'VIDEO_SOURCE_SCREEN',
439
+ // xPosition: 1290,
440
+ // yPosition: 640,
441
+ // width: 630,
442
+ // height: 350
443
+ // },
444
+ {
445
+ tag: 'tag1',
446
+ xPosition: 0,
447
+ yPosition: 0,
448
+ width: 310,
449
+ height: 180
450
+ },
451
+ {
452
+ tag: 'customer1',
453
+ xPosition: 320,
454
+ yPosition: 0,
455
+ width: 310,
456
+ height: 180
457
+ },
458
+ {
459
+ tag: 'customer2',
460
+ xPosition: 640,
461
+ yPosition: 0,
462
+ width: 310,
463
+ height: 180
464
+ },
465
+ {
466
+ tag: 'customer3',
467
+ xPosition: 960,
468
+ yPosition: 0,
469
+ width: 310,
470
+ height: 180
471
+ },
472
+ {
473
+ tag: 'customer4',
474
+ xPosition: 1280,
475
+ yPosition: 0,
476
+ width: 310,
477
+ height: 180
478
+ },
479
+ {
480
+ tag: 'customer5',
481
+ xPosition: 1600,
482
+ yPosition: 0,
483
+ width: 310,
484
+ height: 180
485
+ },
486
+ // {
487
+ // tag: 'customer6',
488
+ // xPosition: 1440,
489
+ // yPosition: 0,
490
+ // width: 240,
491
+ // height: 180
492
+ // },
493
+ // {
494
+ // tag: 'customer7',
495
+ // xPosition: 1680,
496
+ // yPosition: 0,
497
+ // width: 240,
498
+ // height: 180
499
+ // },
500
+ // {
501
+ // tag: 'customer8',
502
+ // xPosition: 1680,
503
+ // yPosition: 180,
504
+ // width: 240,
505
+ // height: 180
506
+ // },
507
+ // {
508
+ // tag: 'customer9',
509
+ // xPosition: 1680,
510
+ // yPosition: 360,
511
+ // width: 240,
512
+ // height: 180
513
+ // },
514
+ // {
515
+ // tag: 'customer10',
516
+ // xPosition: 1680,
517
+ // yPosition: 540,
518
+ // width: 240,
519
+ // height: 180
520
+ // },
521
+ // {
522
+ // tag: 'customer11',
523
+ // xPosition: 1680,
524
+ // yPosition: 720,
525
+ // width: 240,
526
+ // height: 180
527
+ // }
528
+ ]
529
+ res.map((item)=>{
530
+ list.push({
531
+ tag: item.tag,
532
+ xPosition: item.xaxis,
533
+ yPosition: item.yaxis,
534
+ width: item.width,
535
+ height: item.height
536
+ })
537
+ })
538
+ const filePath = 'recordId_' + new Date().valueOf();
539
+ const recordParam = {};
540
+ recordParam.width = 1920;
541
+ recordParam.height = 1080;
542
+ recordParam.recordTotalStream = 0;
543
+ recordParam.startTimeout = 10;
544
+ recordParam.splitType = 0;
545
+ recordParam.endType = 1;
546
+ recordParam.crf = 26
547
+ recordParam.overlaps = [
548
+ {
549
+ tag: '', // 流 tag,如果不设置或为空,则为全局⽔印
550
+ type: 1, // 1 为时间戳⽔印;2 为⽂字⽔印;3 为图⽚⽔印
551
+ id: 1, // ⽔印 ID
552
+ enable: true,
553
+ xPosition: 10, // x 轴位置
554
+ yPosition: 10, // y 轴位置
555
+ text: '', // ⽔印⽂字
556
+ fontSize: 16, // 字体⼤⼩
557
+ url: '' // ⽔印图⽚ HTTP 地址
558
+ },
559
+ ];
560
+ recordParam.tagPositions = list
561
+ console.log('recordParam', recordParam);
562
+ that.test_controller.StartRemoteRecord(filePath, recordParam, '')
563
+
564
+ })
526
565
 
527
566
  };
528
567
  // 结束会话
@@ -1451,19 +1490,24 @@ class Video extends Component {
1451
1490
  }
1452
1491
  }
1453
1492
  else if (Mival.typeId == 1220) {
1454
- // 一炒多的图片
1493
+ // 一炒多的图片 1214
1455
1494
  if (Mival.sessionId == this.state.sessionId) {
1495
+ this.tabTitlesClick('customerScreen', 'delect')
1456
1496
  this.props.imgCallback({
1457
1497
  type: Mival.data.type + '',
1458
- file: Mival.data.file}
1498
+ file: Mival.data.file,
1499
+ errorType: 0}
1459
1500
  ) // 文字抄录和风险抄录,3--风险,,2--文字
1460
1501
  }
1461
1502
  } else if (Mival.typeId == 1321) {
1462
1503
  this.getBase64Image(Mival.fileName)
1463
1504
  } else if (Mival.typeId == 1216) {
1464
- // 签字回调
1505
+ // 签字回调 1213
1465
1506
  if (Mival.sessionId == this.state.sessionId) {
1466
- this.props.signatureCallback()
1507
+ this.tabTitlesClick('customerScreen', 'delect')
1508
+ this.props.signatureCallback({
1509
+ errorType: 0
1510
+ })
1467
1511
  }
1468
1512
  } else if (Mival.typeId == 1218) {
1469
1513
  if (Mival.sessionId == this.state.sessionId) {
@@ -1653,6 +1697,21 @@ class Video extends Component {
1653
1697
 
1654
1698
  }
1655
1699
  }
1700
+ } else if (Mival.typeId == 121305) {
1701
+ if (Mival.sessionId == this.state.sessionId) {
1702
+ this.props.signatureCallback({
1703
+ errorType: -1
1704
+ })
1705
+ }
1706
+ } else if (Mival.typeId == 121405) {
1707
+ if (Mival.sessionId == this.state.sessionId) {
1708
+ console.log('imgCallback')
1709
+ this.props.imgCallback({
1710
+ type: '',
1711
+ file: '',
1712
+ errorType: -1
1713
+ })
1714
+ }
1656
1715
  }
1657
1716
  };
1658
1717
  window.IMOpenfire = msg =>{
@@ -1687,6 +1746,13 @@ class Video extends Component {
1687
1746
  sigType: 1
1688
1747
  };
1689
1748
  this.workerClick()
1749
+ rateList = []
1750
+ this.rateAll().then((res)=>{
1751
+ res.map((item)=>{
1752
+ rateList.push(item.tag)
1753
+ })
1754
+ console.log('rateList',rateList)
1755
+ })
1690
1756
  this.test_controller.GetDevices();
1691
1757
  // 获取设备成功
1692
1758
  this.test_controller.OnGetDevicesSuccess = (devicesInfo) => {
@@ -2382,6 +2448,7 @@ class Video extends Component {
2382
2448
  }, function (code, message, data) {
2383
2449
  console.log(data)
2384
2450
  })
2451
+ this.sendNotification()
2385
2452
  let array = this.state.roomCustomerList;
2386
2453
  let newArray = [...array];
2387
2454
  newArray.push({
@@ -2393,7 +2460,8 @@ class Video extends Component {
2393
2460
  this.state.roomCustomerList = newArray
2394
2461
  let config_param
2395
2462
  if (feed.uid != this.state.tellerAccount) {
2396
- if (feed.tag == 'VIDEO_SOURCE_SCREEN') {
2463
+ if (rateList.indexOf(feed.tag) > -1) {
2464
+ // if (feed.tag == 'VIDEO_SOURCE_SCREEN') {
2397
2465
  config_param = {
2398
2466
  subscribe_video_id: 'video21',
2399
2467
  subscribe_audio_id: 'audio21',
@@ -4017,11 +4085,30 @@ class Video extends Component {
4017
4085
  }
4018
4086
  }
4019
4087
  handleOkSign = () => {
4088
+ console.log(this.signCanvas.current.canvas.drawing.toDataURL('image/png'))
4020
4089
  this.props.imgRMCallback(
4021
4090
  this.signCanvas.current.canvas.drawing.toDataURL('image/png').replace(/data.+?;base64,/, "")
4022
4091
  )
4023
4092
  }
4093
+ onCancelSign=()=>{
4094
+ this.setState({
4095
+ signNoClick: false
4096
+ })
4097
+ this.props.onCancelSign()
4098
+ }
4099
+ signImage=()=>{
4100
+ if(!this.state.signNoClick) {
4101
+ this.setState({
4102
+ signNoClick: true
4103
+ })
4104
+ }
4105
+ }
4024
4106
  handleCancelSign=()=>{
4107
+ if(this.state.signNoClick) {
4108
+ this.setState({
4109
+ signNoClick: false
4110
+ })
4111
+ }
4025
4112
  this.signCanvas.current.clear()
4026
4113
  }
4027
4114
 
@@ -4047,9 +4134,9 @@ class Video extends Component {
4047
4134
  let x = 0
4048
4135
  let y = 0
4049
4136
  // if(os.isTablet){
4050
- width = (right - left)* window.screen.width / document.body.clientWidth
4137
+ width = ((right - left)* window.screen.width / document.body.clientWidth) - 5
4051
4138
  height = ((bottom - top)* window.screen.width / document.body.clientWidth) - 50
4052
- x = left * window.screen.width / document.body.clientWidth + 3
4139
+ x = left * window.screen.width / document.body.clientWidth + 5
4053
4140
  y = top* window.screen.width / document.body.clientWidth
4054
4141
  // }
4055
4142
  // if(os.isPc) {
@@ -4343,6 +4430,43 @@ class Video extends Component {
4343
4430
  }
4344
4431
 
4345
4432
  }
4433
+ sendNotification = () =>{
4434
+ console.log(this.props.shareMask,this.state.shareMaskState)
4435
+ this.state.shareMaskState = this.props.shareMask
4436
+ callNimIM('sendCustomCmdMsg', {
4437
+ customId: this.state.imRoomId,
4438
+ content: JSON.stringify({
4439
+ 'typeId': 1230,
4440
+ 'sessionId': this.state.sessionId,
4441
+ 'type': this.state.shareMaskState ? 1 : 2
4442
+ })
4443
+ });
4444
+ }
4445
+ componentDidUpdate(prevProps){
4446
+ console.log('componentDidUpdate',prevProps,prevProps.shareMask,this.props.shareMask)
4447
+ if(this.props.shareMask != prevProps.shareMask) {
4448
+ this.sendNotification()
4449
+ }
4450
+ }
4451
+ // shouldComponentUpdate(nextProps,nextState){
4452
+ // console.log('componentDidUpdate',nextProps,nextState)
4453
+ // if(nextProps.shareMask != nextState.shareMaskState){
4454
+ // this.state.shareMaskState = nextProps.shareMask
4455
+ // this.sendNotification()
4456
+ // }
4457
+ // }
4458
+ // static getDerivedStateFromProps(props, state) {
4459
+ // console.log('getDerivedStateFromProps',props,state,props.shareMask)
4460
+ // if(props.shareMask!==state.shareMaskState){
4461
+ // // this.sendNotification()
4462
+ // return {
4463
+
4464
+ // shareMaskState:shareMask,
4465
+
4466
+ // }
4467
+ // }
4468
+ // return null
4469
+ // }
4346
4470
  render() {
4347
4471
  const { meetingInfo,isTranscribing } = this.props
4348
4472
  var pdfChildren
@@ -5034,15 +5158,25 @@ class Video extends Component {
5034
5158
 
5035
5159
 
5036
5160
  </Modal>
5037
- <Modal title="签字白板" width={600} destroyOnClose={true} closable={false} centered={true} visible={isTranscribing} footer={
5161
+ <Modal title="签字白板" width={600} destroyOnClose={true} centered={true} visible={isTranscribing} onCancel={this.onCancelSign} footer={
5038
5162
  [
5039
5163
  <div key='okSign'>
5040
- <Button className="modelButtonCancel" onClick={this.handleCancelSign}>清除</Button>
5041
- <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkSign}>确定</Button>
5164
+ {
5165
+ !this.state.signNoClick && <Button className="modelButtonCancelNo">清除</Button>
5166
+ }
5167
+ {
5168
+ this.state.signNoClick && <Button className="modelButtonCancel" onClick={this.handleCancelSign}>清除</Button>
5169
+ }
5170
+ {
5171
+ this.state.signNoClick && <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkSign}>确定</Button>
5172
+ }
5173
+ {
5174
+ !this.state.signNoClick && <Button className="modelButtonCancelNo" type="primary" danger >确定</Button>
5175
+ }
5042
5176
  </div>
5043
5177
  ]
5044
5178
  }>
5045
- <div className="content">
5179
+ <div className="content" onClick={this.signImage}>
5046
5180
  <CanvasDraw
5047
5181
  ref={this.signCanvas}
5048
5182
  brushColor="#000"
@@ -5051,6 +5185,7 @@ class Video extends Component {
5051
5185
  canvasWidth="100%"
5052
5186
  canvasHeight="100%"
5053
5187
  hideGrid={true}
5188
+
5054
5189
  ></CanvasDraw>
5055
5190
  </div>
5056
5191
  </Modal>
@@ -5113,6 +5248,7 @@ sessionId: "",
5113
5248
  otherAttendees: undefined
5114
5249
  },
5115
5250
  isTranscribing: false,
5251
+ shareMask: false,
5116
5252
  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'
5117
5253
  }
5118
5254
  export default Video