react_hsbc_teller 1.9.36 → 1.9.38

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.
@@ -3,7 +3,6 @@
3
3
  /* eslint-disable eqeqeq */
4
4
  import React, { Component, useState } from 'react';
5
5
  import API from '../../api/api';
6
- import { initWebSocket, joinRoom, disconnect } from '../../common/websocket';
7
6
  import { BoardOperate } from '../../common/index.esm.js';
8
7
  import './video.less'
9
8
  import { compressImage } from '../../utils/utils'
@@ -22,7 +21,6 @@ import internalLeft from '../../assets/mp3/internalLeft.mp3'
22
21
  import leftMetting from '../../assets/mp3/leftmeeting.mp3'
23
22
  import networkWeakAudio from '../../assets/mp3/networkweak.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";
@@ -47,7 +45,7 @@ import Step from '../components/step/step.jsx'
47
45
  import axios from 'axios';
48
46
  import CryptoJS from "crypto-js";
49
47
 
50
- const SDK_VERISON = '1.9.36'
48
+ const SDK_VERISON = '1.9.38'
51
49
  const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
52
50
  const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
53
51
  const { Option } = Select;
@@ -253,11 +251,9 @@ class Video extends Component {
253
251
  cameraValue: '',
254
252
  microphoneValue: '',
255
253
  imStatus: false,
256
- imJoinRoom: false,
257
254
  analyserData: new Map(),
258
255
  analyserHeight: new Map(),
259
256
  OnVolumeAnalyserMap: new Map(),
260
- manualClose: false,
261
257
  defaultValue: '1',
262
258
  customOcrSid: '',
263
259
  shareMaskState: false,
@@ -348,15 +344,7 @@ class Video extends Component {
348
344
  publish_config.publish_streamId_id = 'publish_streamId1'
349
345
  publish_config.publish_tag = 'tag1'
350
346
  this.test_controller.Publish(publish_config)
351
- // eslint-disable-next-line no-undef
352
- setTimeout(() => {
353
- if (this.state.imStatus && !this.state.imJoinRoom) {
354
- joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
355
- this.state.imJoinRoom = true
356
- this.saveLog('Join im room')
357
- console.log('加入IM房间')
358
- }
359
- })
347
+
360
348
  this.props.createRoomCallback({
361
349
  type: 1,
362
350
  errorManage: '',
@@ -466,11 +454,6 @@ class Video extends Component {
466
454
  handleEdit = () => {
467
455
  console.log(JSON.parse(window.sessionStorage.getItem('sigData')));
468
456
  // eslint-disable-next-line no-undef
469
- // initWebSocket('wss://im.uat.dsp.hsbcfts.com.cn:443/wealth/im/ws/')
470
- if (!this.state.imStatus) {
471
- this.state.manualClose = false
472
- initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
473
- }
474
457
  const config_param = {};
475
458
  config_param.workspaceId = this.state.workSpaceId;
476
459
  config_param.uid = this.props.tellerAccount;
@@ -730,6 +713,14 @@ class Video extends Component {
730
713
  })
731
714
  }
732
715
  };
716
+ sendMessage = (msg) => {
717
+ try {
718
+ this.test_controller.SendTextMsg(JSON.stringify(msg))
719
+ } catch (err) {
720
+ console.error(`内部错误, msg = ${JSON.stringify(msg)} `)
721
+ console.error(err)
722
+ }
723
+ }
733
724
  errorCodeClick=(type,value)=>{
734
725
  if(type == 'ocr'){
735
726
  if(value == -1007 || value == -100701 || value == -100702 || value == -200001 || value == -300901 || value == -300902 || value == -400001) {
@@ -1386,9 +1377,8 @@ class Video extends Component {
1386
1377
  })
1387
1378
  }
1388
1379
  }
1389
- mountClick = () => {
1390
- window.IMEvt = msg => {
1391
- console.log(JSON.parse(msg));
1380
+ handleReceiveMsg = (msg) => {
1381
+ console.log(JSON.parse(msg));
1392
1382
  const Mival = JSON.parse(msg);
1393
1383
  if (Mival.typeId == 1210) {
1394
1384
  // 进行初始化操作
@@ -1555,36 +1545,15 @@ class Video extends Component {
1555
1545
  this.pictureInPicture('Refresh')
1556
1546
  }
1557
1547
  }
1558
- }
1559
- };
1560
- window.IMOpenfire = msg => {
1561
- console.log('im登录', msg)
1562
- if (msg.status == 'error') {
1563
- this.state.imStatus = false
1564
- this.saveLog('Im connection establishment failed')
1565
- this.roomCallBack(2, 'im建立连接失败', 5)
1566
- } else if (msg.status == 'success') {
1567
- this.state.imStatus = true
1568
- setTimeout(() => {
1569
- if (this.state.imRoomId && !this.state.imJoinRoom) {
1570
- joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
1571
- this.state.imJoinRoom = true
1572
- console.log('IMOpenfire 加入im房间')
1573
- }
1574
- }, 200);
1575
- } else if (msg.status == 'close') {
1576
- if (!this.state.manualClose) {
1577
- this.timer && clearInterval(this.timer);
1578
- this.state.imStatus = false
1579
- console.log('IMOpenfireclose')
1580
- this.saveLog('Repeated login of account')
1581
- this.roomCallBack(2, '账号重复登录', 9)
1582
-
1548
+ } else if (Mival.typeId == 33001 && this.state.sessionId == Mival.data.sessionId) {
1549
+ if (Mival.type == 1) {
1550
+ this.saveAuthorize(Mival.data.userId)
1551
+ this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
1583
1552
  }
1584
-
1553
+ console.log('33001 done')
1585
1554
  }
1586
-
1587
- }
1555
+ }
1556
+ mountClick = () => {
1588
1557
  let data = {
1589
1558
  account: this.props.tellerAccount,
1590
1559
  type: '2',
@@ -1686,8 +1655,10 @@ class Video extends Component {
1686
1655
  speakerList: objList2.length > 0 ? [objList2[0]] : []
1687
1656
  })
1688
1657
  let indexId = 0
1689
- objList.map((item, index) => {
1690
- if (item.actionname.indexOf('Integrated Camera') != -1) {
1658
+ objList.forEach((item, index) => {
1659
+ if (item.actionname.indexOf('HP Full-HD Camera') != -1) {
1660
+ indexId = index
1661
+ } else if (item.actionname.indexOf('Integrated Camera') != -1) {
1691
1662
  indexId = index
1692
1663
  }
1693
1664
  })
@@ -1762,6 +1733,10 @@ class Video extends Component {
1762
1733
  this.state.rtoken = rtoken
1763
1734
  this.createRoom()
1764
1735
  this.saveLog('RM mrtc create room successfully, room_id=' + room_id)
1736
+
1737
+ this.state.imStatus = true
1738
+ this.saveLog('Join im room')
1739
+ console.log('加入IM房间')
1765
1740
  };
1766
1741
  // 创建房间失败
1767
1742
  this.test_controller.OnCreateRoomFailed = (err_code, err_msg) => {
@@ -1810,6 +1785,10 @@ class Video extends Component {
1810
1785
  this.test_controller.Publish(publish_config)
1811
1786
  this.roomCallBack(1, '', 0)
1812
1787
  this.saveLog('mrtc join room success')
1788
+
1789
+ this.state.imStatus = true
1790
+ this.saveLog('Join im room')
1791
+ console.log('加入IM房间')
1813
1792
  };
1814
1793
  // 加入房间失败
1815
1794
  this.test_controller.OnJoinRoomFailed = (err_code, err_msg) => {
@@ -1824,12 +1803,9 @@ class Video extends Component {
1824
1803
  this.state.rtoken = '',
1825
1804
  this.state.sessionId = '',
1826
1805
  this.state.imRoomId = ''
1827
- this.state.imJoinRoom = false
1828
1806
  if (this.state.imStatus) {
1829
1807
  console.log('disconnect断开连接')
1830
- this.state.manualClose = true
1831
1808
  this.state.imStatus = false
1832
- disconnect();
1833
1809
  }
1834
1810
  this.test_controller.Disconnect()
1835
1811
  let data = {
@@ -1849,20 +1825,26 @@ class Video extends Component {
1849
1825
  }
1850
1826
  this.test_controller.OnSendTextMsgFailed = (msgId, code, msg) => {
1851
1827
  console.log('发送失败', msgId, code, msg)
1852
- this.setState({
1853
- documentError: '推送授权白板失败,请重试'
1854
- })
1828
+ const Mival = JSON.parse(msg)
1829
+ // 失败处理
1830
+ if (Mival.typeId == '3300') {
1831
+ this.setState({
1832
+ documentError: '推送授权白板失败,请重试'
1833
+ })
1834
+ }
1855
1835
  this.saveLog('mrtc OnSendTextMsgFail:' + msgId +', code=' + code + ',msg=' + msg)
1856
1836
  }
1857
1837
  this.test_controller.OnReceiveTextMsg = (uid, msg) => {
1858
- console.log('收到手机端消息', uid, msg, JSON.parse(msg).typeId, JSON.parse(msg).data.sessionId, this.state.sessionId)
1859
- if (JSON.parse(msg).typeId == 33001 && this.state.sessionId == JSON.parse(msg).data.sessionId) {
1860
- if (JSON.parse(msg).type == 1) {
1861
- this.saveAuthorize(JSON.parse(msg).data.userId)
1862
- this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
1863
- }
1864
- }
1838
+ console.log('收到手机端消息',uid, msg, JSON.parse(msg))
1865
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
+ // }
1866
1848
  }
1867
1849
  this.test_controller.StreamFilterHandler = async (publish_tag, stream, stream_type, publish_device, media_type) => {
1868
1850
  console.log(`stream processed by client, publish_device=${publish_device}, media_type=${media_type}, publish_tag=${publish_tag},stream_type=${stream_type}`);
@@ -1970,15 +1952,12 @@ class Video extends Component {
1970
1952
  console.log('发布媒体流成功', sid)
1971
1953
  this.state.sessionType = true
1972
1954
  if (sid == document.getElementById('video20').name) {
1973
- callNimIM('sendCustomCmdMsg', {
1974
- customId: this.state.imRoomId,
1975
- content: JSON.stringify({
1976
- 'typeId': 2030,
1977
- 'sessionId': this.state.sessionId,
1978
- 'sharedScreen': 1,
1979
- 'tellerId': this.props.tellerAccount
1980
- })
1981
- });
1955
+ this.sendMessage({
1956
+ 'typeId': 2030,
1957
+ 'sessionId': this.state.sessionId,
1958
+ 'sharedScreen': 1,
1959
+ 'tellerId': this.props.tellerAccount
1960
+ })
1982
1961
  // if (this.state.screenName == '切换共享') {
1983
1962
  // this.state.isSharedScreen = true
1984
1963
  // this.state.isScreenSwitching = false
@@ -2000,19 +1979,15 @@ class Video extends Component {
2000
1979
  this.timer = setInterval(
2001
1980
  () => {
2002
1981
  if (!this.state.voiceStatue && this.state.analyserHeight.get(sid).toFixed(2) > 0.1) {
2003
- callNimIM('sendCustomCmdMsg', {
2004
- customId: this.state.imRoomId,
2005
- content: JSON.stringify({
2006
- 'typeId': 3200,
2007
- 'decibelValue': this.state.analyserHeight.get(sid).toFixed(2),
2008
- "data": {
2009
- 'sessionId': this.state.sessionId,
2010
- 'userId': this.props.tellerAccount,
2011
- 'data': (new Date()).valueOf()
2012
- }
2013
-
2014
- })
2015
- });
1982
+ this.sendMessage({
1983
+ 'typeId': 3200,
1984
+ 'decibelValue': this.state.analyserHeight.get(sid).toFixed(2),
1985
+ "data": {
1986
+ 'sessionId': this.state.sessionId,
1987
+ 'userId': this.props.tellerAccount,
1988
+ 'data': (new Date()).valueOf()
1989
+ }
1990
+ })
2016
1991
  }
2017
1992
  },
2018
1993
  1000
@@ -2179,22 +2154,15 @@ class Video extends Component {
2179
2154
  console.log('过滤订阅的tag:', feed.tag)
2180
2155
  return
2181
2156
  }
2182
- callNimIM('sendCustomCmdMsg', {
2183
- customId: this.state.imRoomId,
2184
- content: JSON.stringify({
2157
+ this.sendMessage({
2185
2158
  'typeId': 1013,
2186
2159
  'muteStatus': this.state.voiceStatue ? 1 : 0,
2187
2160
  'data': {
2188
2161
  'sessionId': this.state.sessionId,
2189
2162
  'userId': this.props.tellerAccount
2190
2163
  }
2191
- })
2192
- }, function (code, message, data) {
2193
- console.log(data)
2194
2164
  })
2195
- callNimIM('sendCustomCmdMsg', {
2196
- customId: this.state.imRoomId,
2197
- content: JSON.stringify({
2165
+ this.sendMessage({
2198
2166
  'typeId': 1014,
2199
2167
  'sessionId': this.state.sessionId,
2200
2168
  'meetingInfo': {
@@ -2203,9 +2171,6 @@ class Video extends Component {
2203
2171
  'customers': this.props.meetingInfo.customers,
2204
2172
  'otherAttendees': this.props.meetingInfo.otherAttendees
2205
2173
  }
2206
-
2207
- })
2208
- }, function (code, message, data) {
2209
2174
  })
2210
2175
  this.sendNotification()
2211
2176
  let array = this.state.roomCustomerList;
@@ -2292,14 +2257,11 @@ class Video extends Component {
2292
2257
  this.test_controller.OnUnPublishSucc = (sid) => {
2293
2258
  console.log('取消发布成功', sid, document.getElementById('publish_video1').name)
2294
2259
  if (document.getElementById('publish_video1').name && sid != document.getElementById('publish_video1').name) {
2295
- callNimIM('sendCustomCmdMsg', {
2296
- customId: this.state.imRoomId,
2297
- content: JSON.stringify({
2260
+ this.sendMessage({
2298
2261
  'typeId': 2030,
2299
2262
  'sessionId': this.state.sessionId,
2300
2263
  'sharedScreen': 0,
2301
2264
  'tellerId': this.props.tellerAccount
2302
- })
2303
2265
  })
2304
2266
  this.state.isSharedScreen = false
2305
2267
  this.setState({
@@ -2895,9 +2857,7 @@ class Video extends Component {
2895
2857
  });
2896
2858
  console.log(result);
2897
2859
  this.appGetUsername(document.getElementById('publish_video1').name)
2898
- callNimIM('sendCustomCmdMsg', {
2899
- customId: this.state.imRoomId,
2900
- content: JSON.stringify({
2860
+ this.sendMessage({
2901
2861
  'typeId': 1014,
2902
2862
  'sessionId': this.state.sessionId,
2903
2863
  'meetingInfo': {
@@ -2906,9 +2866,6 @@ class Video extends Component {
2906
2866
  'customers': this.props.meetingInfo.customers,
2907
2867
  'otherAttendees': this.props.meetingInfo.otherAttendees
2908
2868
  }
2909
-
2910
- })
2911
- }, function (code, message, data) {
2912
2869
  })
2913
2870
  } catch (err) {
2914
2871
  console.error(err);
@@ -2931,11 +2888,6 @@ class Video extends Component {
2931
2888
  console.error(err)
2932
2889
  }
2933
2890
  }
2934
- if (this.state.imStatus) {
2935
- console.log('disconnect断开连接')
2936
- this.state.manualClose = true
2937
- disconnect();
2938
- }
2939
2891
  message.destroy()
2940
2892
  clearInterval(this.state.drawCanvasInterval)
2941
2893
  }
@@ -3180,20 +3132,14 @@ class Video extends Component {
3180
3132
  sid = document.getElementById('publish_streamId1').name
3181
3133
  }
3182
3134
  this.test_controller.SetLocalAudioEnable(0, parseInt(sid, 10));
3183
- callNimIM('sendCustomCmdMsg', {
3184
- customId: this.state.imRoomId,
3185
- content: JSON.stringify({
3135
+ this.sendMessage({
3186
3136
  'typeId': 1013,
3187
3137
  'muteStatus': 1,
3188
3138
  'data': {
3189
3139
  'sessionId': this.state.sessionId,
3190
3140
  'userId': this.props.tellerAccount
3191
3141
  }
3192
- })
3193
- }, function (code, message, data) {
3194
- console.log(data)
3195
3142
  })
3196
-
3197
3143
  } else if (this.state.voiceStatue) {
3198
3144
  // 打开本地
3199
3145
  this.setState({
@@ -3207,18 +3153,13 @@ class Video extends Component {
3207
3153
  sid = document.getElementById('publish_streamId1').name
3208
3154
  }
3209
3155
  this.test_controller.SetLocalAudioEnable(1, parseInt(sid, 10));
3210
- callNimIM('sendCustomCmdMsg', {
3211
- customId: this.state.imRoomId,
3212
- content: JSON.stringify({
3156
+ this.sendMessage({
3213
3157
  'typeId': 1013,
3214
3158
  'muteStatus': 0,
3215
3159
  'data': {
3216
3160
  'sessionId': this.state.sessionId,
3217
3161
  'userId': this.props.tellerAccount
3218
3162
  }
3219
- })
3220
- }, function (code, message, data) {
3221
- console.log(data)
3222
3163
  })
3223
3164
  }
3224
3165
  if (this.state.isPictureInPicture) {
@@ -3250,17 +3191,12 @@ class Video extends Component {
3250
3191
  sid = document.getElementById('publish_streamId1').name
3251
3192
  }
3252
3193
  this.test_controller.SetLocalVideoEnable(0, parseInt(sid, 10));
3253
- callNimIM('sendCustomCmdMsg', {
3254
- customId: this.state.imRoomId,
3255
- content: JSON.stringify({
3194
+ this.sendMessage({
3256
3195
  'typeId': 1012,
3257
3196
  'state': 0,
3258
3197
  'sessionId': this.state.sessionId,
3259
3198
  'userId': this.props.tellerAccount
3260
- })
3261
- }, function (code, message, data) {
3262
- console.log(data)
3263
- })
3199
+ })
3264
3200
  } else if (this.state.audioed) {
3265
3201
  this.state.audioed = false,
3266
3202
  this.setState({
@@ -3272,16 +3208,11 @@ class Video extends Component {
3272
3208
  sid = document.getElementById('publish_streamId1').name
3273
3209
  }
3274
3210
  this.test_controller.SetLocalVideoEnable(1, parseInt(sid, 10));
3275
- callNimIM('sendCustomCmdMsg', {
3276
- customId: this.state.imRoomId,
3277
- content: JSON.stringify({
3278
- 'typeId': 1012,
3279
- 'state': 1,
3280
- 'sessionId': this.state.sessionId,
3281
- 'userId': this.props.tellerAccount
3282
- })
3283
- }, function (code, message, data) {
3284
- console.log(data)
3211
+ this.sendMessage({
3212
+ 'typeId': 1012,
3213
+ 'state': 1,
3214
+ 'sessionId': this.state.sessionId,
3215
+ 'userId': this.props.tellerAccount
3285
3216
  })
3286
3217
  }
3287
3218
  }
@@ -3434,15 +3365,11 @@ class Video extends Component {
3434
3365
  voiceName: '静音'
3435
3366
  })
3436
3367
  }
3437
- callNimIM('sendCustomCmdMsg', {
3438
- customId: this.state.imRoomId,
3439
- content: JSON.stringify({
3440
- 'typeId': 1011,
3441
- 'state': 1,
3442
- 'sessionId': this.state.sessionId,
3443
- 'userId': this.props.tellerAccount
3444
- })
3445
- }, function (code, message, data) {
3368
+ this.sendMessage({
3369
+ 'typeId': 1011,
3370
+ 'state': 1,
3371
+ 'sessionId': this.state.sessionId,
3372
+ 'userId': this.props.tellerAccount
3446
3373
  })
3447
3374
  } else {
3448
3375
  this.setState({
@@ -3453,32 +3380,22 @@ class Video extends Component {
3453
3380
  };
3454
3381
  handleOk = () => {
3455
3382
  // 代表此时按钮是暂停会话,把isSuspend改成true变成恢复会话
3456
- callNimIM('sendCustomCmdMsg', {
3457
- customId: this.state.imRoomId,
3458
- content: JSON.stringify({
3459
- 'typeId': 1012,
3460
- 'state': 1,
3461
- 'sessionId': this.state.sessionId,
3462
- 'userId': this.props.tellerAccount
3463
- })
3464
- }, function (code, message, data) {
3465
- console.log(data)
3466
- });
3383
+ this.sendMessage({
3384
+ 'typeId': 1012,
3385
+ 'state': 1,
3386
+ 'sessionId': this.state.sessionId,
3387
+ 'userId': this.props.tellerAccount
3388
+ })
3467
3389
  this.setState({
3468
3390
  isSuspend: true,
3469
3391
  suspendName: '恢复'
3470
3392
  });
3471
- callNimIM('sendCustomCmdMsg', {
3472
- customId: this.state.imRoomId,
3473
- content: JSON.stringify({
3474
- 'typeId': 1011,
3475
- 'state': 0,
3476
- 'sessionId': this.state.sessionId,
3477
- 'userId': this.props.tellerAccount
3478
- })
3479
- }, function (code, message, data) {
3480
- console.log(data)
3481
- });
3393
+ this.sendMessage({
3394
+ 'typeId': 1011,
3395
+ 'state': 0,
3396
+ 'sessionId': this.state.sessionId,
3397
+ 'userId': this.props.tellerAccount
3398
+ })
3482
3399
  let sid = document.getElementById('publish_video1').name;
3483
3400
  if (!sid) {
3484
3401
  // 纯音频的时候sid在publish_streamId标签中
@@ -3692,15 +3609,12 @@ class Video extends Component {
3692
3609
  console.log('ocrCallback', result.data,val)
3693
3610
  // this.messageClick('姓名:' + result.data.idCardName + ',身份证号:' + result.data.idCardNumber,'success')
3694
3611
  // this.messageClick('识别成功','success')
3695
- callNimIM('sendCustomCmdMsg', {
3696
- customId: this.state.imRoomId,
3697
- content: JSON.stringify({
3698
- 'typeId': 1020,
3699
- 'sessionId': this.state.sessionId,
3700
- 'cameraState': 1,
3701
- "userId": this.state.faceCustomerUid
3702
- })
3703
- });
3612
+ this.sendMessage({
3613
+ 'typeId': 1020,
3614
+ 'sessionId': this.state.sessionId,
3615
+ 'cameraState': 1,
3616
+ "userId": this.state.faceCustomerUid
3617
+ })
3704
3618
  if(this.state.documentType == 'ID_CARD') {
3705
3619
  if (result.data.side == 'front' && val == 1) {
3706
3620
  if(this.state.certificateValidity) {
@@ -3972,15 +3886,12 @@ class Video extends Component {
3972
3886
  }
3973
3887
  };
3974
3888
  handleCancelFacial = () => {
3975
- callNimIM('sendCustomCmdMsg', {
3976
- customId: this.state.imRoomId,
3977
- content: JSON.stringify({
3978
- 'typeId': 1020,
3979
- 'sessionId': this.state.sessionId,
3980
- 'cameraState': 1, // 1--打开前置 2--打开后置
3981
- "userId": this.state.faceCustomerUid
3982
- })
3983
- });
3889
+ this.sendMessage({
3890
+ 'typeId': 1020,
3891
+ 'sessionId': this.state.sessionId,
3892
+ 'cameraState': 1, // 1--打开前置 2--打开后置
3893
+ "userId": this.state.faceCustomerUid
3894
+ })
3984
3895
  this.setState({
3985
3896
  isModalVisibleFacial: false
3986
3897
  })
@@ -4005,15 +3916,12 @@ class Video extends Component {
4005
3916
  }
4006
3917
  }
4007
3918
  newFaceClick=()=>{
4008
- callNimIM('sendCustomCmdMsg', {
4009
- customId: this.state.imRoomId,
4010
- content: JSON.stringify({
4011
- 'typeId': 1020,
4012
- 'sessionId': this.state.sessionId,
4013
- 'cameraState': 2, // 1--打开前置 2--打开后置
4014
- "userId": this.state.faceCustomerUid
4015
- })
4016
- });
3919
+ this.sendMessage({
3920
+ 'typeId': 1020,
3921
+ 'sessionId': this.state.sessionId,
3922
+ 'cameraState': 2, // 1--打开前置 2--打开后置
3923
+ "userId": this.state.faceCustomerUid
3924
+ })
4017
3925
  this.setState({
4018
3926
  clickedFacial: false,
4019
3927
  clickedOcr: false,
@@ -4124,15 +4032,12 @@ class Video extends Component {
4124
4032
  } else {
4125
4033
  if (this.state.faceCustomerType == 2) {
4126
4034
  // ocr
4127
- callNimIM('sendCustomCmdMsg', {
4128
- customId: this.state.imRoomId,
4129
- content: JSON.stringify({
4130
- 'typeId': 1020,
4131
- 'sessionId': this.state.sessionId,
4132
- 'cameraState': 2, // 1--打开前置 2--打开后置
4133
- "userId": item.customId
4134
- })
4135
- });
4035
+ this.sendMessage({
4036
+ 'typeId': 1020,
4037
+ 'sessionId': this.state.sessionId,
4038
+ 'cameraState': 2, // 1--打开前置 2--打开后置
4039
+ "userId": item.customId
4040
+ })
4136
4041
  }
4137
4042
  var sid
4138
4043
  if (item.feedId == document.getElementById("feedId1").innerText) {
@@ -4792,117 +4697,81 @@ class Video extends Component {
4792
4697
  muteOpposite = (value) => {
4793
4698
  console.log(value);
4794
4699
  if (value == 'video1') {
4795
- callNimIM('sendCustomCmdMsg', {
4796
- customId: this.state.imRoomId,
4797
- content: JSON.stringify({
4798
- 'typeId': 1223,
4799
- 'sessionId': this.state.sessionId,
4800
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
4801
- })
4802
- });
4700
+ this.sendMessage({
4701
+ 'typeId': 1223,
4702
+ 'sessionId': this.state.sessionId,
4703
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
4704
+ })
4803
4705
  }
4804
4706
  if (value == 'video2') {
4805
- callNimIM('sendCustomCmdMsg', {
4806
- customId: this.state.imRoomId,
4807
- content: JSON.stringify({
4808
- 'typeId': 1223,
4809
- 'sessionId': this.state.sessionId,
4810
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId2').innerText).uid
4811
- })
4812
- });
4707
+ this.sendMessage({
4708
+ 'typeId': 1223,
4709
+ 'sessionId': this.state.sessionId,
4710
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId2').innerText).uid
4711
+ })
4813
4712
  } if (value == 'video3') {
4814
- callNimIM('sendCustomCmdMsg', {
4815
- customId: this.state.imRoomId,
4816
- content: JSON.stringify({
4817
- 'typeId': 1223,
4818
- 'sessionId': this.state.sessionId,
4819
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId3').innerText).uid
4820
- })
4821
- });
4713
+ this.sendMessage({
4714
+ 'typeId': 1223,
4715
+ 'sessionId': this.state.sessionId,
4716
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId3').innerText).uid
4717
+ })
4822
4718
  } if (value == 'video4') {
4823
- callNimIM('sendCustomCmdMsg', {
4824
- customId: this.state.imRoomId,
4825
- content: JSON.stringify({
4826
- 'typeId': 1223,
4827
- 'sessionId': this.state.sessionId,
4828
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId4').innerText).uid
4829
- })
4830
- });
4719
+ this.sendMessage({
4720
+ 'typeId': 1223,
4721
+ 'sessionId': this.state.sessionId,
4722
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId4').innerText).uid
4723
+ })
4831
4724
  } if (value == 'video5') {
4832
- callNimIM('sendCustomCmdMsg', {
4833
- customId: this.state.imRoomId,
4834
- content: JSON.stringify({
4835
- 'typeId': 1223,
4836
- 'sessionId': this.state.sessionId,
4837
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId5').innerText).uid
4838
- })
4839
- });
4725
+ this.sendMessage({
4726
+ 'typeId': 1223,
4727
+ 'sessionId': this.state.sessionId,
4728
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId5').innerText).uid
4729
+ })
4840
4730
  } if (value == 'video6') {
4841
- callNimIM('sendCustomCmdMsg', {
4842
- customId: this.state.imRoomId,
4843
- content: JSON.stringify({
4844
- 'typeId': 1223,
4845
- 'sessionId': this.state.sessionId,
4846
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId6').innerText).uid
4847
- })
4848
- });
4731
+ this.sendMessage({
4732
+ 'typeId': 1223,
4733
+ 'sessionId': this.state.sessionId,
4734
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId6').innerText).uid
4735
+ })
4849
4736
  } if (value == 'video7') {
4850
- callNimIM('sendCustomCmdMsg', {
4851
- customId: this.state.imRoomId,
4852
- content: JSON.stringify({
4853
- 'typeId': 1223,
4854
- 'sessionId': this.state.sessionId,
4855
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId7').innerText).uid
4856
- })
4857
- });
4737
+ this.sendMessage({
4738
+ 'typeId': 1223,
4739
+ 'sessionId': this.state.sessionId,
4740
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId7').innerText).uid
4741
+ })
4858
4742
  } if (value == 'video8') {
4859
- callNimIM('sendCustomCmdMsg', {
4860
- customId: this.state.imRoomId,
4861
- content: JSON.stringify({
4862
- 'typeId': 1223,
4863
- 'sessionId': this.state.sessionId,
4864
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId8').innerText).uid
4865
- })
4866
- });
4743
+ this.sendMessage({
4744
+ 'typeId': 1223,
4745
+ 'sessionId': this.state.sessionId,
4746
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId8').innerText).uid
4747
+ })
4867
4748
  } if (value == 'video9') {
4868
- callNimIM('sendCustomCmdMsg', {
4869
- customId: this.state.imRoomId,
4870
- content: JSON.stringify({
4871
- 'typeId': 1223,
4872
- 'sessionId': this.state.sessionId,
4873
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId9').innerText).uid
4874
- })
4875
- });
4749
+ this.sendMessage({
4750
+ 'typeId': 1223,
4751
+ 'sessionId': this.state.sessionId,
4752
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId9').innerText).uid
4753
+ })
4876
4754
  }
4877
4755
  if (value == 'video10') {
4878
- callNimIM('sendCustomCmdMsg', {
4879
- customId: this.state.imRoomId,
4880
- content: JSON.stringify({
4881
- 'typeId': 1223,
4882
- 'sessionId': this.state.sessionId,
4883
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId10').innerText).uid
4884
- })
4885
- });
4756
+ this.sendMessage({
4757
+ 'typeId': 1223,
4758
+ 'sessionId': this.state.sessionId,
4759
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId10').innerText).uid
4760
+ })
4886
4761
  }
4887
4762
  if (value == 'video11') {
4888
- callNimIM('sendCustomCmdMsg', {
4889
- customId: this.state.imRoomId,
4890
- content: JSON.stringify({
4891
- 'typeId': 1223,
4892
- 'sessionId': this.state.sessionId,
4893
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId11').innerText).uid
4894
- })
4895
- });
4763
+ this.sendMessage({
4764
+ 'typeId': 1223,
4765
+ 'sessionId': this.state.sessionId,
4766
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId11').innerText).uid
4767
+ })
4896
4768
  }
4897
4769
  if (value == 'video12') {
4898
- callNimIM('sendCustomCmdMsg', {
4899
- customId: this.state.imRoomId,
4900
- content: JSON.stringify({
4901
- 'typeId': 1223,
4902
- 'sessionId': this.state.sessionId,
4903
- 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId12').innerText).uid
4904
- })
4905
- });
4770
+ this.sendMessage({
4771
+ 'typeId': 1223,
4772
+ 'sessionId': this.state.sessionId,
4773
+ 'userId': this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId12').innerText).uid
4774
+ })
4906
4775
  }
4907
4776
 
4908
4777
  }
@@ -4911,14 +4780,11 @@ class Video extends Component {
4911
4780
  this.state.shareMaskState = this.props.shareMask
4912
4781
  // 加延迟是因为在关闭的时候可以看到部分rm的操作
4913
4782
  setTimeout(() => {
4914
- callNimIM('sendCustomCmdMsg', {
4915
- customId: this.state.imRoomId,
4916
- content: JSON.stringify({
4917
- 'typeId': 1230,
4918
- 'sessionId': this.state.sessionId,
4919
- 'type': this.state.shareMaskState ? 1 : 2
4920
- })
4921
- });
4783
+ this.sendMessage({
4784
+ 'typeId': 1230,
4785
+ 'sessionId': this.state.sessionId,
4786
+ 'type': this.state.shareMaskState ? 1 : 2
4787
+ })
4922
4788
  }, 100)
4923
4789
 
4924
4790
  }