react_hsbc_teller 2.0.5 → 2.0.7

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,7 +4,6 @@
4
4
  import React, { Component, useState } from 'react';
5
5
  import QRCode from 'qrcode.react';
6
6
  import API from '../../api/api';
7
- import { initWebSocket, joinRoom, disconnect } from '../../common/websocket';
8
7
  import { BoardOperate } from '../../common/index.esm.js';
9
8
  import './video.less'
10
9
  import Header from '../header/header.jsx'
@@ -22,7 +21,6 @@ import internalJoin from '../../assets/mp3/internalJoin.mp3'
22
21
  import internalLeft from '../../assets/mp3/internalLeft.mp3'
23
22
  import leftMetting from '../../assets/mp3/leftmeeting.mp3'
24
23
  import errorPng from '../../assets/img/tooltips2_fail.png'
25
- import { callNimIM } from '../../utils/cell.js'
26
24
  import Modal from "antd/lib/modal";
27
25
  import 'antd/lib/modal/style'
28
26
  import message from "antd/lib/message";
@@ -251,11 +249,9 @@ class Video extends Component {
251
249
  cameraValue: '',
252
250
  microphoneValue: '',
253
251
  imStatus: false,
254
- imJoinRoom: false,
255
252
  analyserData: new Map(),
256
253
  analyserHeight: new Map(),
257
254
  OnVolumeAnalyserMap: new Map(),
258
- manualClose: false,
259
255
  defaultValue: '1',
260
256
  customOcrSid: '',
261
257
  shareMaskState: false,
@@ -303,7 +299,7 @@ class Video extends Component {
303
299
  saveLog = (val) => {
304
300
  axios({
305
301
  method: 'get',
306
- baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=2.0.5&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
302
+ baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=2.0.7&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
307
303
 
308
304
  }).then(res => {
309
305
 
@@ -348,17 +344,8 @@ class Video extends Component {
348
344
  publish_config.publish_tag = 'tag' + (i+1)
349
345
  this.test_controller.Publish(publish_config)
350
346
  })
351
- this.publishAllScreen();
352
-
353
- // eslint-disable-next-line no-undef
354
- setTimeout(() => {
355
- if (this.state.imStatus && !this.state.imJoinRoom) {
356
- joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
357
- this.state.imJoinRoom = true
358
- this.saveLog('Join im room')
359
- console.log('加入IM房间')
360
- }
361
- })
347
+ // this.publishAllScreen();
348
+
362
349
  this.props.createRoomCallback({
363
350
  type: 1,
364
351
  errorManage: '',
@@ -468,11 +455,6 @@ class Video extends Component {
468
455
  handleEdit = () => {
469
456
  console.log(JSON.parse(window.sessionStorage.getItem('sigData')));
470
457
  // eslint-disable-next-line no-undef
471
- // initWebSocket('wss://im.uat.dsp.hsbcfts.com.cn:443/wealth/im/ws/')
472
- if (!this.state.imStatus) {
473
- this.state.manualClose = false
474
- initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
475
- }
476
458
  const config_param = {};
477
459
  config_param.workspaceId = this.state.workSpaceId;
478
460
  config_param.uid = this.props.tellerAccount;
@@ -714,6 +696,14 @@ class Video extends Component {
714
696
  })
715
697
  }
716
698
  };
699
+ sendMessage = (msg) => {
700
+ try {
701
+ this.test_controller.SendTextMsg(JSON.stringify(msg))
702
+ } catch (err) {
703
+ console.error(`内部错误, msg = ${JSON.stringify(msg)} `)
704
+ console.error(err)
705
+ }
706
+ }
717
707
  errorCodeClick=(type,value)=>{
718
708
  if(type == 'ocr'){
719
709
  if(value == -1007 || value == -100701 || value == -100702 || value == -200001 || value == -300901 || value == -300902 || value == -400001) {
@@ -964,6 +954,18 @@ class Video extends Component {
964
954
  this.selectCustomer('ocr')
965
955
  }
966
956
  };
957
+ paperOcrClick = () => {
958
+ setTimeout(() => {
959
+ // this.messageClick('系统检测到您已签署2/3个地方,还有1处未签署', 'error')
960
+ message.error({
961
+ content: '系统检测到您已签署2/3个地方,还有1处未签署',
962
+ icon: <img src={require("../../assets/img/tooltips2_fail.png").default} alt="" ></img>,
963
+ className: 'errorClassName',
964
+ top: 200,
965
+ duration: 10
966
+ })
967
+ }, 1500);
968
+ };
967
969
  endSessionValue = () => {
968
970
  this.saveLog('RM actively exits the meeting')
969
971
  if (streamShare) {
@@ -1195,8 +1197,9 @@ class Video extends Component {
1195
1197
  let str = this.state.sensitiveTitle || ''
1196
1198
  if (str)
1197
1199
  cobj.fillStyle = 'red';
1200
+ cobj.font = "normal lighter 32px sans-serif";
1198
1201
  const textWidth = Math.min(cobj.measureText(str).width, 610)
1199
- cobj.fillRect(320 - textWidth/ 2, 26, textWidth, 32)
1202
+ cobj.fillRect(320 - textWidth/ 2, 24, textWidth, 32)
1200
1203
  cobj.textAlign = 'center';
1201
1204
  cobj.strokeStyle = 'white';
1202
1205
  cobj.lineWidth = 2
@@ -1299,9 +1302,8 @@ class Video extends Component {
1299
1302
  })
1300
1303
  }
1301
1304
  }
1302
- mountClick = () => {
1303
- window.IMEvt = msg => {
1304
- console.log(JSON.parse(msg));
1305
+ handleReceiveMsg = (msg) => {
1306
+ console.log(JSON.parse(msg));
1305
1307
  const Mival = JSON.parse(msg);
1306
1308
  if (Mival.typeId == 1210) {
1307
1309
  // 进行初始化操作
@@ -1458,33 +1460,25 @@ class Video extends Component {
1458
1460
  });
1459
1461
  let sid = document.getElementById('publish_video1').name || document.getElementById('publish_streamId1').name;
1460
1462
  this.test_controller.SetLocalAudioEnable(0, parseInt(sid, 10));
1461
- callNimIM('sendCustomCmdMsg', {
1462
- customId: this.state.imRoomId,
1463
- content: JSON.stringify({
1463
+ this.sendMessage({
1464
1464
  'typeId': 1013,
1465
1465
  'muteStatus': 1,
1466
1466
  'data': {
1467
1467
  'sessionId': this.state.sessionId,
1468
1468
  'userId': this.props.tellerAccount
1469
1469
  }
1470
- })
1471
- }, function (code, message, data) {
1472
- // console.log(data)
1473
1470
  })
1474
1471
  }
1475
1472
  document.getElementById('audio1').muted = true
1476
1473
  console.log('音频流静音')
1477
1474
  console.log(document.getElementById('audio1').muted)
1478
1475
  setTimeout(() => {
1479
- callNimIM('sendCustomCmdMsg', {
1480
- customId: this.state.imRoomId,
1481
- content: JSON.stringify({
1482
- 'typeId': 1223,
1483
- 'state': 1, // app解除静音
1484
- 'sessionId': this.state.sessionId,
1485
- 'userId': Mival.data.userId //this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
1486
- })
1487
- });
1476
+ this.sendMessage({
1477
+ 'typeId': 1223,
1478
+ 'state': 1, // app解除静音
1479
+ 'sessionId': this.state.sessionId,
1480
+ 'userId': Mival.data.userId //this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
1481
+ })
1488
1482
  }, 1000);
1489
1483
  }
1490
1484
  } else if (Mival.typeId == 1401) {
@@ -1504,36 +1498,15 @@ class Video extends Component {
1504
1498
  this.messageClick('录制服务异常中断,请重试', 'error')
1505
1499
  let audio = new Audio(recordErrorAudio)
1506
1500
  audio.play()
1507
- }
1508
- };
1509
- window.IMOpenfire = msg => {
1510
- console.log('im登录', msg)
1511
- if (msg.status == 'error') {
1512
- this.state.imStatus = false
1513
- this.saveLog('Im connection establishment failed')
1514
- this.roomCallBack(2, 'im建立连接失败', 5)
1515
- } else if (msg.status == 'success') {
1516
- this.state.imStatus = true
1517
- setTimeout(() => {
1518
- if (this.state.imRoomId && !this.state.imJoinRoom) {
1519
- joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
1520
- this.state.imJoinRoom = true
1521
- console.log('IMOpenfire 加入im房间')
1522
- }
1523
- }, 200);
1524
- } else if (msg.status == 'close') {
1525
- if (!this.state.manualClose) {
1526
- this.timer && clearInterval(this.timer);
1527
- this.state.imStatus = false
1528
- console.log('IMOpenfireclose')
1529
- this.saveLog('Repeated login of account')
1530
- this.roomCallBack(2, '账号重复登录', 9)
1531
-
1501
+ } else if (Mival.typeId == 33001 && this.state.sessionId == Mival.data.sessionId) {
1502
+ if (Mival.type == 1) {
1503
+ this.saveAuthorize(Mival.data.userId)
1504
+ this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
1532
1505
  }
1533
-
1506
+ console.log('33001 done')
1534
1507
  }
1535
-
1536
- }
1508
+ }
1509
+ mountClick = () => {
1537
1510
  let data = {
1538
1511
  account: this.props.tellerAccount,
1539
1512
  type: '2',
@@ -1713,6 +1686,10 @@ class Video extends Component {
1713
1686
  this.state.rtoken = rtoken
1714
1687
  this.createRoom()
1715
1688
  this.saveLog('RM mrtc create room successfully, room_id=' + room_id)
1689
+
1690
+ this.state.imStatus = true
1691
+ this.saveLog('Join im room')
1692
+ console.log('加入IM房间')
1716
1693
  };
1717
1694
  // 创建房间失败
1718
1695
  this.test_controller.OnCreateRoomFailed = (err_code, err_msg) => {
@@ -1762,10 +1739,14 @@ class Video extends Component {
1762
1739
  publish_config.publish_tag = 'tag' + (i+1)
1763
1740
  this.test_controller.Publish(publish_config)
1764
1741
  })
1765
- this.publishAllScreen();
1742
+ // this.publishAllScreen();
1766
1743
 
1767
1744
  this.roomCallBack(1, '', 0)
1768
1745
  this.saveLog('mrtc join room success')
1746
+
1747
+ this.state.imStatus = true
1748
+ this.saveLog('Join im room')
1749
+ console.log('加入IM房间')
1769
1750
  };
1770
1751
  // 加入房间失败
1771
1752
  this.test_controller.OnJoinRoomFailed = (err_code, err_msg) => {
@@ -1780,12 +1761,9 @@ class Video extends Component {
1780
1761
  this.state.rtoken = '',
1781
1762
  this.state.sessionId = '',
1782
1763
  this.state.imRoomId = ''
1783
- this.state.imJoinRoom = false
1784
1764
  if (this.state.imStatus) {
1785
1765
  console.log('disconnect断开连接')
1786
- this.state.manualClose = true
1787
1766
  this.state.imStatus = false
1788
- disconnect();
1789
1767
  }
1790
1768
  this.test_controller.Disconnect()
1791
1769
  let data = {
@@ -1805,62 +1783,68 @@ class Video extends Component {
1805
1783
  }
1806
1784
  this.test_controller.OnSendTextMsgFailed = (msgId, code, msg) => {
1807
1785
  console.log('发送失败', msgId, code, msg)
1808
- this.setState({
1809
- documentError: '推送授权白板失败,请重试'
1810
- })
1786
+ const Mival = JSON.parse(msg)
1787
+ // 失败处理
1788
+ if (Mival.typeId == '3300') {
1789
+ this.setState({
1790
+ documentError: '推送授权白板失败,请重试'
1791
+ })
1792
+ }
1811
1793
  this.saveLog('mrtc OnSendTextMsgFail:' + msgId +', code=' + code + ',msg=' + msg)
1812
1794
  }
1813
1795
  this.test_controller.OnReceiveTextMsg = (uid, msg) => {
1814
- console.log('收到手机端消息', uid, msg, JSON.parse(msg).typeId, JSON.parse(msg).data.sessionId, this.state.sessionId)
1815
- if (JSON.parse(msg).typeId == 33001 && this.state.sessionId == JSON.parse(msg).data.sessionId) {
1816
- if (JSON.parse(msg).type == 1) {
1817
- this.saveAuthorize(JSON.parse(msg).data.userId)
1818
- this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
1819
- }
1820
- }
1796
+ console.log('收到手机端消息',uid, msg, JSON.parse(msg))
1821
1797
  // 线下demo静音处理
1822
- if (JSON.parse(msg).typeId == 4004 && this.state.sessionId == JSON.parse(msg).data.sessionId) {
1823
- if (this.isFileSuccuse()) {
1824
- if (!this.state.voiceStatue) {
1825
- // 静音本地
1826
- this.setState({
1827
- voiceStatue: true,
1828
- voiceImg: voiceImgCloe,
1829
- voiceName: '解除静音'
1830
- });
1831
- let sid = document.getElementById('publish_video1').name || document.getElementById('publish_streamId1').name;
1832
- this.test_controller.SetLocalAudioEnable(0, parseInt(sid, 10));
1833
- callNimIM('sendCustomCmdMsg', {
1834
- customId: this.state.imRoomId,
1835
- content: JSON.stringify({
1836
- 'typeId': 1013,
1837
- 'muteStatus': 1,
1838
- 'data': {
1839
- 'sessionId': this.state.sessionId,
1840
- 'userId': this.props.tellerAccount
1841
- }
1842
- })
1843
- }, function (code, message, data) {
1844
- // console.log(data)
1845
- })
1846
- }
1847
- document.getElementById('audio1').muted = true
1848
- console.log('音频流静音')
1849
- console.log(document.getElementById('audio1').muted)
1850
- setTimeout(() => {
1851
- callNimIM('sendCustomCmdMsg', {
1852
- customId: this.state.imRoomId,
1853
- content: JSON.stringify({
1854
- 'typeId': 1223,
1855
- 'state': 1, // app解除静音
1856
- 'sessionId': this.state.sessionId,
1857
- 'userId': uid //this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
1858
- })
1859
- });
1860
- }, 1000);
1861
- }
1862
- }
1798
+ // if (JSON.parse(msg).typeId == 4004 && this.state.sessionId == JSON.parse(msg).data.sessionId) {
1799
+ // if (this.isFileSuccuse()) {
1800
+ // if (!this.state.voiceStatue) {
1801
+ // // 静音本地
1802
+ // this.setState({
1803
+ // voiceStatue: true,
1804
+ // voiceImg: voiceImgCloe,
1805
+ // voiceName: '解除静音'
1806
+ // });
1807
+ // let sid = document.getElementById('publish_video1').name || document.getElementById('publish_streamId1').name;
1808
+ // this.test_controller.SetLocalAudioEnable(0, parseInt(sid, 10));
1809
+ // callNimIM('sendCustomCmdMsg', {
1810
+ // customId: this.state.imRoomId,
1811
+ // content: JSON.stringify({
1812
+ // 'typeId': 1013,
1813
+ // 'muteStatus': 1,
1814
+ // 'data': {
1815
+ // 'sessionId': this.state.sessionId,
1816
+ // 'userId': this.props.tellerAccount
1817
+ // }
1818
+ // })
1819
+ // }, function (code, message, data) {
1820
+ // // console.log(data)
1821
+ // })
1822
+ // }
1823
+ // document.getElementById('audio1').muted = true
1824
+ // console.log('音频流静音')
1825
+ // console.log(document.getElementById('audio1').muted)
1826
+ // setTimeout(() => {
1827
+ // callNimIM('sendCustomCmdMsg', {
1828
+ // customId: this.state.imRoomId,
1829
+ // content: JSON.stringify({
1830
+ // 'typeId': 1223,
1831
+ // 'state': 1, // app解除静音
1832
+ // 'sessionId': this.state.sessionId,
1833
+ // 'userId': uid //this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
1834
+ // })
1835
+ // });
1836
+ // }, 1000);
1837
+ // }
1838
+ // }
1863
1839
  this.saveLog('mrtc OnReceiveTextMsg info:' + msg)
1840
+ this.handleReceiveMsg(msg)
1841
+ // 33001 已合并到 handleReceiveMsg
1842
+ // if (JSON.parse(msg).typeId == 33001 && this.state.sessionId == JSON.parse(msg).data.sessionId) {
1843
+ // if (JSON.parse(msg).type == 1) {
1844
+ // this.saveAuthorize(JSON.parse(msg).data.userId)
1845
+ // this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
1846
+ // }
1847
+ // }
1864
1848
  }
1865
1849
  this.test_controller.StreamFilterHandler = async (publish_tag, stream, stream_type, publish_device, media_type) => {
1866
1850
  console.log(`stream processed by client, publish_device=${publish_device}, media_type=${media_type}, publish_tag=${publish_tag},stream_type=${stream_type}`);
@@ -1948,15 +1932,12 @@ class Video extends Component {
1948
1932
  console.log('发布媒体流成功', sid)
1949
1933
  this.state.sessionType = true
1950
1934
  if (sid == document.getElementById('video20').name) {
1951
- callNimIM('sendCustomCmdMsg', {
1952
- customId: this.state.imRoomId,
1953
- content: JSON.stringify({
1954
- 'typeId': 2030,
1955
- 'sessionId': this.state.sessionId,
1956
- 'sharedScreen': 1,
1957
- 'tellerId': this.props.tellerAccount
1958
- })
1959
- });
1935
+ this.sendMessage({
1936
+ 'typeId': 2030,
1937
+ 'sessionId': this.state.sessionId,
1938
+ 'sharedScreen': 1,
1939
+ 'tellerId': this.props.tellerAccount
1940
+ })
1960
1941
  if (this.state.screenName == '切换共享') {
1961
1942
  this.state.isSharedScreen = true
1962
1943
  this.state.isScreenSwitching = false
@@ -1974,19 +1955,15 @@ class Video extends Component {
1974
1955
  this.timer = setInterval(
1975
1956
  () => {
1976
1957
  if (!this.state.voiceStatue && this.state.analyserHeight.get(sid).toFixed(2) > 0.1) {
1977
- callNimIM('sendCustomCmdMsg', {
1978
- customId: this.state.imRoomId,
1979
- content: JSON.stringify({
1980
- 'typeId': 3200,
1981
- 'decibelValue': this.state.analyserHeight.get(sid).toFixed(2),
1982
- "data": {
1983
- 'sessionId': this.state.sessionId,
1984
- 'userId': this.props.tellerAccount,
1985
- 'data': (new Date()).valueOf()
1986
- }
1987
-
1988
- })
1989
- });
1958
+ this.sendMessage({
1959
+ 'typeId': 3200,
1960
+ 'decibelValue': this.state.analyserHeight.get(sid).toFixed(2),
1961
+ "data": {
1962
+ 'sessionId': this.state.sessionId,
1963
+ 'userId': this.props.tellerAccount,
1964
+ 'data': (new Date()).valueOf()
1965
+ }
1966
+ })
1990
1967
  }
1991
1968
  },
1992
1969
  1000
@@ -2142,22 +2119,15 @@ class Video extends Component {
2142
2119
  this.test_controller.OnNewPublish = (feed) => {
2143
2120
  console.log('有新发布者', feed);
2144
2121
  console.log(new Date())
2145
- callNimIM('sendCustomCmdMsg', {
2146
- customId: this.state.imRoomId,
2147
- content: JSON.stringify({
2122
+ this.sendMessage({
2148
2123
  'typeId': 1013,
2149
2124
  'muteStatus': this.state.voiceStatue ? 1 : 0,
2150
2125
  'data': {
2151
2126
  'sessionId': this.state.sessionId,
2152
2127
  'userId': this.props.tellerAccount
2153
2128
  }
2154
- })
2155
- }, function (code, message, data) {
2156
- console.log(data)
2157
2129
  })
2158
- callNimIM('sendCustomCmdMsg', {
2159
- customId: this.state.imRoomId,
2160
- content: JSON.stringify({
2130
+ this.sendMessage({
2161
2131
  'typeId': 1014,
2162
2132
  'sessionId': this.state.sessionId,
2163
2133
  'meetingInfo': {
@@ -2166,9 +2136,6 @@ class Video extends Component {
2166
2136
  'customers': this.props.meetingInfo.customers,
2167
2137
  'otherAttendees': this.props.meetingInfo.otherAttendees
2168
2138
  }
2169
-
2170
- })
2171
- }, function (code, message, data) {
2172
2139
  })
2173
2140
  this.sendNotification()
2174
2141
  let array = this.state.roomCustomerList;
@@ -2255,14 +2222,11 @@ class Video extends Component {
2255
2222
  this.test_controller.OnUnPublishSucc = (sid) => {
2256
2223
  console.log('取消发布成功', sid, document.getElementById('publish_video1').name)
2257
2224
  if (document.getElementById('publish_video1').name && sid != document.getElementById('publish_video1').name) {
2258
- callNimIM('sendCustomCmdMsg', {
2259
- customId: this.state.imRoomId,
2260
- content: JSON.stringify({
2225
+ this.sendMessage({
2261
2226
  'typeId': 2030,
2262
2227
  'sessionId': this.state.sessionId,
2263
2228
  'sharedScreen': 0,
2264
2229
  'tellerId': this.props.tellerAccount
2265
- })
2266
2230
  })
2267
2231
  this.state.isSharedScreen = false
2268
2232
  this.setState({
@@ -2925,9 +2889,7 @@ class Video extends Component {
2925
2889
  });
2926
2890
  console.log(result);
2927
2891
  this.appGetUsername(document.getElementById('publish_video1').name)
2928
- callNimIM('sendCustomCmdMsg', {
2929
- customId: this.state.imRoomId,
2930
- content: JSON.stringify({
2892
+ this.sendMessage({
2931
2893
  'typeId': 1014,
2932
2894
  'sessionId': this.state.sessionId,
2933
2895
  'meetingInfo': {
@@ -2936,9 +2898,6 @@ class Video extends Component {
2936
2898
  'customers': this.props.meetingInfo.customers,
2937
2899
  'otherAttendees': this.props.meetingInfo.otherAttendees
2938
2900
  }
2939
-
2940
- })
2941
- }, function (code, message, data) {
2942
2901
  })
2943
2902
  } catch (err) {
2944
2903
  console.error(err);
@@ -2965,11 +2924,6 @@ class Video extends Component {
2965
2924
  this.stopASR()
2966
2925
  this.asr_controller.Disconnect()
2967
2926
  }
2968
- if (this.state.imStatus) {
2969
- console.log('disconnect断开连接')
2970
- this.state.manualClose = true
2971
- disconnect();
2972
- }
2973
2927
  message.destroy()
2974
2928
  }
2975
2929
  finishSession = () => {
@@ -3169,7 +3123,7 @@ class Video extends Component {
3169
3123
  }
3170
3124
  }
3171
3125
  componentWillMount() {
3172
- console.log('hsbc_teller_sdk', '2.0.5')
3126
+ console.log('hsbc_teller_sdk', '2.0.7')
3173
3127
  let arr = []
3174
3128
  for(let i=1;i<=12;i++){
3175
3129
  arr.push({
@@ -3208,20 +3162,14 @@ class Video extends Component {
3208
3162
  sid = document.getElementById('publish_streamId1').name
3209
3163
  }
3210
3164
  this.test_controller.SetLocalAudioEnable(0, parseInt(sid, 10));
3211
- callNimIM('sendCustomCmdMsg', {
3212
- customId: this.state.imRoomId,
3213
- content: JSON.stringify({
3165
+ this.sendMessage({
3214
3166
  'typeId': 1013,
3215
3167
  'muteStatus': 1,
3216
3168
  'data': {
3217
3169
  'sessionId': this.state.sessionId,
3218
3170
  'userId': this.props.tellerAccount
3219
3171
  }
3220
- })
3221
- }, function (code, message, data) {
3222
- console.log(data)
3223
3172
  })
3224
-
3225
3173
  } else if (this.state.voiceStatue) {
3226
3174
  // 打开本地
3227
3175
  this.setState({
@@ -3235,18 +3183,13 @@ class Video extends Component {
3235
3183
  sid = document.getElementById('publish_streamId1').name
3236
3184
  }
3237
3185
  this.test_controller.SetLocalAudioEnable(1, parseInt(sid, 10));
3238
- callNimIM('sendCustomCmdMsg', {
3239
- customId: this.state.imRoomId,
3240
- content: JSON.stringify({
3186
+ this.sendMessage({
3241
3187
  'typeId': 1013,
3242
3188
  'muteStatus': 0,
3243
3189
  'data': {
3244
3190
  'sessionId': this.state.sessionId,
3245
3191
  'userId': this.props.tellerAccount
3246
3192
  }
3247
- })
3248
- }, function (code, message, data) {
3249
- console.log(data)
3250
3193
  })
3251
3194
  }
3252
3195
  }
@@ -3273,17 +3216,12 @@ class Video extends Component {
3273
3216
  sid = document.getElementById('publish_streamId1').name
3274
3217
  }
3275
3218
  this.test_controller.SetLocalVideoEnable(0, parseInt(sid, 10));
3276
- callNimIM('sendCustomCmdMsg', {
3277
- customId: this.state.imRoomId,
3278
- content: JSON.stringify({
3219
+ this.sendMessage({
3279
3220
  'typeId': 1012,
3280
3221
  'state': 0,
3281
3222
  'sessionId': this.state.sessionId,
3282
3223
  'userId': this.props.tellerAccount
3283
- })
3284
- }, function (code, message, data) {
3285
- console.log(data)
3286
- })
3224
+ })
3287
3225
  } else if (this.state.audioed) {
3288
3226
  this.state.audioed = false,
3289
3227
  this.setState({
@@ -3295,16 +3233,11 @@ class Video extends Component {
3295
3233
  sid = document.getElementById('publish_streamId1').name
3296
3234
  }
3297
3235
  this.test_controller.SetLocalVideoEnable(1, parseInt(sid, 10));
3298
- callNimIM('sendCustomCmdMsg', {
3299
- customId: this.state.imRoomId,
3300
- content: JSON.stringify({
3301
- 'typeId': 1012,
3302
- 'state': 1,
3303
- 'sessionId': this.state.sessionId,
3304
- 'userId': this.props.tellerAccount
3305
- })
3306
- }, function (code, message, data) {
3307
- console.log(data)
3236
+ this.sendMessage({
3237
+ 'typeId': 1012,
3238
+ 'state': 1,
3239
+ 'sessionId': this.state.sessionId,
3240
+ 'userId': this.props.tellerAccount
3308
3241
  })
3309
3242
  }
3310
3243
  }
@@ -3429,15 +3362,11 @@ class Video extends Component {
3429
3362
  voiceName: '静音'
3430
3363
  })
3431
3364
  }
3432
- callNimIM('sendCustomCmdMsg', {
3433
- customId: this.state.imRoomId,
3434
- content: JSON.stringify({
3435
- 'typeId': 1011,
3436
- 'state': 1,
3437
- 'sessionId': this.state.sessionId,
3438
- 'userId': this.props.tellerAccount
3439
- })
3440
- }, function (code, message, data) {
3365
+ this.sendMessage({
3366
+ 'typeId': 1011,
3367
+ 'state': 1,
3368
+ 'sessionId': this.state.sessionId,
3369
+ 'userId': this.props.tellerAccount
3441
3370
  })
3442
3371
  } else {
3443
3372
  this.setState({
@@ -3448,32 +3377,22 @@ class Video extends Component {
3448
3377
  };
3449
3378
  handleOk = () => {
3450
3379
  // 代表此时按钮是暂停会话,把isSuspend改成true变成恢复会话
3451
- callNimIM('sendCustomCmdMsg', {
3452
- customId: this.state.imRoomId,
3453
- content: JSON.stringify({
3454
- 'typeId': 1012,
3455
- 'state': 1,
3456
- 'sessionId': this.state.sessionId,
3457
- 'userId': this.props.tellerAccount
3458
- })
3459
- }, function (code, message, data) {
3460
- console.log(data)
3461
- });
3380
+ this.sendMessage({
3381
+ 'typeId': 1012,
3382
+ 'state': 1,
3383
+ 'sessionId': this.state.sessionId,
3384
+ 'userId': this.props.tellerAccount
3385
+ })
3462
3386
  this.setState({
3463
3387
  isSuspend: true,
3464
3388
  suspendName: '恢复'
3465
3389
  });
3466
- callNimIM('sendCustomCmdMsg', {
3467
- customId: this.state.imRoomId,
3468
- content: JSON.stringify({
3469
- 'typeId': 1011,
3470
- 'state': 0,
3471
- 'sessionId': this.state.sessionId,
3472
- 'userId': this.props.tellerAccount
3473
- })
3474
- }, function (code, message, data) {
3475
- console.log(data)
3476
- });
3390
+ this.sendMessage({
3391
+ 'typeId': 1011,
3392
+ 'state': 0,
3393
+ 'sessionId': this.state.sessionId,
3394
+ 'userId': this.props.tellerAccount
3395
+ })
3477
3396
  let sid = document.getElementById('publish_video1').name;
3478
3397
  if (!sid) {
3479
3398
  // 纯音频的时候sid在publish_streamId标签中
@@ -3684,15 +3603,12 @@ class Video extends Component {
3684
3603
  console.log('ocrCallback', result.data,val)
3685
3604
  // this.messageClick('姓名:' + result.data.idCardName + ',身份证号:' + result.data.idCardNumber,'success')
3686
3605
  // this.messageClick('识别成功','success')
3687
- callNimIM('sendCustomCmdMsg', {
3688
- customId: this.state.imRoomId,
3689
- content: JSON.stringify({
3690
- 'typeId': 1020,
3691
- 'sessionId': this.state.sessionId,
3692
- 'cameraState': 1,
3693
- "userId": this.state.faceCustomerUid
3694
- })
3695
- });
3606
+ this.sendMessage({
3607
+ 'typeId': 1020,
3608
+ 'sessionId': this.state.sessionId,
3609
+ 'cameraState': 1,
3610
+ "userId": this.state.faceCustomerUid
3611
+ })
3696
3612
  if(this.state.documentType == 'ID_CARD') {
3697
3613
  if (result.data.side == 'front' && val == 1) {
3698
3614
  if(this.state.certificateValidity) {
@@ -3960,15 +3876,12 @@ class Video extends Component {
3960
3876
  }
3961
3877
  };
3962
3878
  handleCancelFacial = () => {
3963
- callNimIM('sendCustomCmdMsg', {
3964
- customId: this.state.imRoomId,
3965
- content: JSON.stringify({
3966
- 'typeId': 1020,
3967
- 'sessionId': this.state.sessionId,
3968
- 'cameraState': 1, // 1--打开前置 2--打开后置
3969
- "userId": this.state.faceCustomerUid
3970
- })
3971
- });
3879
+ this.sendMessage({
3880
+ 'typeId': 1020,
3881
+ 'sessionId': this.state.sessionId,
3882
+ 'cameraState': 1, // 1--打开前置 2--打开后置
3883
+ "userId": this.state.faceCustomerUid
3884
+ })
3972
3885
  this.setState({
3973
3886
  isModalVisibleFacial: false
3974
3887
  })
@@ -3993,15 +3906,12 @@ class Video extends Component {
3993
3906
  }
3994
3907
  }
3995
3908
  newFaceClick=()=>{
3996
- callNimIM('sendCustomCmdMsg', {
3997
- customId: this.state.imRoomId,
3998
- content: JSON.stringify({
3999
- 'typeId': 1020,
4000
- 'sessionId': this.state.sessionId,
4001
- 'cameraState': 2, // 1--打开前置 2--打开后置
4002
- "userId": this.state.faceCustomerUid
4003
- })
4004
- });
3909
+ this.sendMessage({
3910
+ 'typeId': 1020,
3911
+ 'sessionId': this.state.sessionId,
3912
+ 'cameraState': 2, // 1--打开前置 2--打开后置
3913
+ "userId": this.state.faceCustomerUid
3914
+ })
4005
3915
  this.setState({
4006
3916
  clickedFacial: false,
4007
3917
  clickedOcr: false,
@@ -4112,15 +4022,12 @@ class Video extends Component {
4112
4022
  } else {
4113
4023
  if (this.state.faceCustomerType == 2) {
4114
4024
  // ocr
4115
- callNimIM('sendCustomCmdMsg', {
4116
- customId: this.state.imRoomId,
4117
- content: JSON.stringify({
4118
- 'typeId': 1020,
4119
- 'sessionId': this.state.sessionId,
4120
- 'cameraState': 2, // 1--打开前置 2--打开后置
4121
- "userId": item.customId
4122
- })
4123
- });
4025
+ this.sendMessage({
4026
+ 'typeId': 1020,
4027
+ 'sessionId': this.state.sessionId,
4028
+ 'cameraState': 2, // 1--打开前置 2--打开后置
4029
+ "userId": item.customId
4030
+ })
4124
4031
  }
4125
4032
  var sid
4126
4033
  if (item.feedId == document.getElementById("feedId1").innerText) {
@@ -4907,117 +4814,81 @@ class Video extends Component {
4907
4814
  muteOpposite = (value) => {
4908
4815
  console.log(value);
4909
4816
  if (value == 'video1') {
4910
- callNimIM('sendCustomCmdMsg', {
4911
- customId: this.state.imRoomId,
4912
- content: JSON.stringify({
4913
- 'typeId': 1223,
4914
- 'sessionId': this.state.sessionId,
4915
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
4916
- })
4917
- });
4817
+ this.sendMessage({
4818
+ 'typeId': 1223,
4819
+ 'sessionId': this.state.sessionId,
4820
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
4821
+ })
4918
4822
  }
4919
4823
  if (value == 'video2') {
4920
- callNimIM('sendCustomCmdMsg', {
4921
- customId: this.state.imRoomId,
4922
- content: JSON.stringify({
4923
- 'typeId': 1223,
4924
- 'sessionId': this.state.sessionId,
4925
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId2').innerText).uid
4926
- })
4927
- });
4824
+ this.sendMessage({
4825
+ 'typeId': 1223,
4826
+ 'sessionId': this.state.sessionId,
4827
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId2').innerText).uid
4828
+ })
4928
4829
  } if (value == 'video3') {
4929
- callNimIM('sendCustomCmdMsg', {
4930
- customId: this.state.imRoomId,
4931
- content: JSON.stringify({
4932
- 'typeId': 1223,
4933
- 'sessionId': this.state.sessionId,
4934
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId3').innerText).uid
4935
- })
4936
- });
4830
+ this.sendMessage({
4831
+ 'typeId': 1223,
4832
+ 'sessionId': this.state.sessionId,
4833
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId3').innerText).uid
4834
+ })
4937
4835
  } if (value == 'video4') {
4938
- callNimIM('sendCustomCmdMsg', {
4939
- customId: this.state.imRoomId,
4940
- content: JSON.stringify({
4941
- 'typeId': 1223,
4942
- 'sessionId': this.state.sessionId,
4943
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId4').innerText).uid
4944
- })
4945
- });
4836
+ this.sendMessage({
4837
+ 'typeId': 1223,
4838
+ 'sessionId': this.state.sessionId,
4839
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId4').innerText).uid
4840
+ })
4946
4841
  } if (value == 'video5') {
4947
- callNimIM('sendCustomCmdMsg', {
4948
- customId: this.state.imRoomId,
4949
- content: JSON.stringify({
4950
- 'typeId': 1223,
4951
- 'sessionId': this.state.sessionId,
4952
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId5').innerText).uid
4953
- })
4954
- });
4842
+ this.sendMessage({
4843
+ 'typeId': 1223,
4844
+ 'sessionId': this.state.sessionId,
4845
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId5').innerText).uid
4846
+ })
4955
4847
  } if (value == 'video6') {
4956
- callNimIM('sendCustomCmdMsg', {
4957
- customId: this.state.imRoomId,
4958
- content: JSON.stringify({
4959
- 'typeId': 1223,
4960
- 'sessionId': this.state.sessionId,
4961
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId6').innerText).uid
4962
- })
4963
- });
4848
+ this.sendMessage({
4849
+ 'typeId': 1223,
4850
+ 'sessionId': this.state.sessionId,
4851
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId6').innerText).uid
4852
+ })
4964
4853
  } if (value == 'video7') {
4965
- callNimIM('sendCustomCmdMsg', {
4966
- customId: this.state.imRoomId,
4967
- content: JSON.stringify({
4968
- 'typeId': 1223,
4969
- 'sessionId': this.state.sessionId,
4970
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId7').innerText).uid
4971
- })
4972
- });
4854
+ this.sendMessage({
4855
+ 'typeId': 1223,
4856
+ 'sessionId': this.state.sessionId,
4857
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId7').innerText).uid
4858
+ })
4973
4859
  } if (value == 'video8') {
4974
- callNimIM('sendCustomCmdMsg', {
4975
- customId: this.state.imRoomId,
4976
- content: JSON.stringify({
4977
- 'typeId': 1223,
4978
- 'sessionId': this.state.sessionId,
4979
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId8').innerText).uid
4980
- })
4981
- });
4860
+ this.sendMessage({
4861
+ 'typeId': 1223,
4862
+ 'sessionId': this.state.sessionId,
4863
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId8').innerText).uid
4864
+ })
4982
4865
  } if (value == 'video9') {
4983
- callNimIM('sendCustomCmdMsg', {
4984
- customId: this.state.imRoomId,
4985
- content: JSON.stringify({
4986
- 'typeId': 1223,
4987
- 'sessionId': this.state.sessionId,
4988
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId9').innerText).uid
4989
- })
4990
- });
4866
+ this.sendMessage({
4867
+ 'typeId': 1223,
4868
+ 'sessionId': this.state.sessionId,
4869
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId9').innerText).uid
4870
+ })
4991
4871
  }
4992
4872
  if (value == 'video10') {
4993
- callNimIM('sendCustomCmdMsg', {
4994
- customId: this.state.imRoomId,
4995
- content: JSON.stringify({
4996
- 'typeId': 1223,
4997
- 'sessionId': this.state.sessionId,
4998
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId10').innerText).uid
4999
- })
5000
- });
4873
+ this.sendMessage({
4874
+ 'typeId': 1223,
4875
+ 'sessionId': this.state.sessionId,
4876
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId10').innerText).uid
4877
+ })
5001
4878
  }
5002
4879
  if (value == 'video11') {
5003
- callNimIM('sendCustomCmdMsg', {
5004
- customId: this.state.imRoomId,
5005
- content: JSON.stringify({
5006
- 'typeId': 1223,
5007
- 'sessionId': this.state.sessionId,
5008
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId11').innerText).uid
5009
- })
5010
- });
4880
+ this.sendMessage({
4881
+ 'typeId': 1223,
4882
+ 'sessionId': this.state.sessionId,
4883
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId11').innerText).uid
4884
+ })
5011
4885
  }
5012
4886
  if (value == 'video12') {
5013
- callNimIM('sendCustomCmdMsg', {
5014
- customId: this.state.imRoomId,
5015
- content: JSON.stringify({
5016
- 'typeId': 1223,
5017
- 'sessionId': this.state.sessionId,
5018
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId12').innerText).uid
5019
- })
5020
- });
4887
+ this.sendMessage({
4888
+ 'typeId': 1223,
4889
+ 'sessionId': this.state.sessionId,
4890
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId12').innerText).uid
4891
+ })
5021
4892
  }
5022
4893
 
5023
4894
  }
@@ -5026,14 +4897,11 @@ class Video extends Component {
5026
4897
  this.state.shareMaskState = this.props.shareMask
5027
4898
  // 加延迟是因为在关闭的时候可以看到部分rm的操作
5028
4899
  setTimeout(() => {
5029
- callNimIM('sendCustomCmdMsg', {
5030
- customId: this.state.imRoomId,
5031
- content: JSON.stringify({
5032
- 'typeId': 1230,
5033
- 'sessionId': this.state.sessionId,
5034
- 'type': this.state.shareMaskState ? 1 : 2
5035
- })
5036
- });
4900
+ this.sendMessage({
4901
+ 'typeId': 1230,
4902
+ 'sessionId': this.state.sessionId,
4903
+ 'type': this.state.shareMaskState ? 1 : 2
4904
+ })
5037
4905
  }, 100)
5038
4906
 
5039
4907
  }
@@ -5704,6 +5572,7 @@ class Video extends Component {
5704
5572
  invitationClick={this.invitationClick}
5705
5573
  customerFaceClick={this.customerFaceClick}
5706
5574
  ocrClick={this.ocrClick}
5575
+ paperOcrClick={this.paperOcrClick}
5707
5576
  switchExternal={this.switchExternal}
5708
5577
  inspection={this.inspection}
5709
5578
  toggleAsr={this.toggleAsr}
@@ -6145,7 +6014,7 @@ Video.defaultProps = {
6145
6014
  microphoneSize: 25,
6146
6015
  fontSize: '14',
6147
6016
  fontFamily: 'auto',
6148
- menus: ['BOARD', 'SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP', 'BEAUTY', 'GRAFFITI', 'BACKGROUND'],
6017
+ menus: ['BOARD', 'SHARE', 'FRIES', 'OCR', 'PAPER_OCR', 'INVITE', 'PIP', 'BEAUTY', 'GRAFFITI', 'BACKGROUND'],
6149
6018
  customLeaveRoom: '客户离开房间',
6150
6019
  sensitiveWords: ['保本保息', '无风险'],
6151
6020
  meetingInfo: {