react_hsbc_teller 1.9.20 → 2.0.0

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.
@@ -26,6 +26,12 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26
26
  PERFORMANCE OF THIS SOFTWARE.
27
27
  ***************************************************************************** */
28
28
 
29
+ /**
30
+ * @license qrcode.react
31
+ * Copyright (c) Paul O'Shannessy
32
+ * SPDX-License-Identifier: ISC
33
+ */
34
+
29
35
  /** @license React v16.13.1
30
36
  * react-is.production.min.js
31
37
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react_hsbc_teller",
3
- "version": "1.9.20",
3
+ "version": "2.0.0",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -89,6 +89,7 @@
89
89
  "axios": "0.19.0",
90
90
  "crypto-js": "^4.1.1",
91
91
  "html2canvas": "^1.4.0",
92
+ "qrcode.react": "^3.1.0",
92
93
  "react": "^17.0.1",
93
94
  "react-canvas-draw": "^1.1.1",
94
95
  "react-dom": "^17.0.1",
@@ -21,7 +21,6 @@ roomId
21
21
  // mtoken: '',
22
22
  // imRoomId: '',
23
23
  // sessionId: '',
24
- pdfRendering: false,
25
24
  isVideo: false,
26
25
  tellerAccount: 'wmzTeller',
27
26
  // callbackUrl: 'http://182.92.184.31:8720/hsbc/callback',
@@ -143,17 +142,6 @@ shareMaskClick=()=>{
143
142
  }
144
143
 
145
144
  }
146
- pdfRenderingClick=()=>{
147
- if(this.state.pdfRendering) {
148
- this.setState({
149
- pdfRendering: false
150
- })
151
- } else {
152
- this.setState({
153
- pdfRendering: true
154
- })
155
- }
156
- }
157
145
  createRoomCallback=(data)=>{
158
146
  console.log('createRoomCallback', data)
159
147
  this.setState({roomId: data.data.roomId});
@@ -207,7 +195,6 @@ userExit =(val)=>{
207
195
  <div>
208
196
  <HSBC
209
197
  shareMask={this.state.shareMask}
210
- pdfRendering={this.state.pdfRendering}
211
198
  roomId={this.state.roomId}
212
199
  mtoken={this.state.mtoken}
213
200
  sessionId={this.state.sessionId}
@@ -232,7 +219,6 @@ userExit =(val)=>{
232
219
  createRoomCallback={this.createRoomCallback}
233
220
  joinRoomCallback={this.joinRoomCallback}
234
221
  imgCallback={this.imgCallback}
235
- sfpCallback={()=>{console.log('sfpCallback success')}}
236
222
  userExit={this.userExit}
237
223
  staffPermission={this.staffPermission}
238
224
  >
@@ -240,7 +226,6 @@ userExit =(val)=>{
240
226
  <Pdf></Pdf>
241
227
  </HSBC>
242
228
  <button onClick={this.shareMaskClick.bind(this)}>遮罩层</button>
243
- <button onClick={this.pdfRenderingClick.bind(this)}>{this.state.pdfRendering?'继续':'暂停'}渲染</button>
244
229
  </div>
245
230
  :
246
231
  <div>
@@ -2,7 +2,6 @@ import React, { Component } from "react";
2
2
 
3
3
  class pdf extends Component {
4
4
  state = {
5
- testTime: '',
6
5
  isVideo: false,
7
6
  tellerAccount: '',
8
7
  callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
@@ -12,12 +11,6 @@ class pdf extends Component {
12
11
  baseURL:'https://counter-web.leimondata.cn:18082/api/leimon-counter-api',
13
12
  resourcePath:'https://counter-web.leimondata.cn:7199',
14
13
  }
15
- componentDidMount () {
16
- this.countTimer()
17
- }
18
- componentWillUnmount() {
19
- clearInterval(this.state.timer)
20
- }
21
14
  startVideo = () => {
22
15
  this.setState({
23
16
  isVideo: true
@@ -60,13 +53,6 @@ handleResourcePath = (event) => {
60
53
  resourcePath: event.target.value
61
54
  })
62
55
  }
63
- countTimer = () => {
64
- this.state.timer = setInterval(() => {
65
- this.setState({
66
- testTime: new Date().toString()
67
- })
68
- }, 1000);
69
- }
70
56
 
71
57
  render() {
72
58
  console.log('22',this.props)
@@ -82,7 +68,6 @@ countTimer = () => {
82
68
  阿里资源服务地址:<input placeholder="请输入阿里资源服务地址" value={this.state.resourcePath} onChange={e => this.handleResourcePath(e)}></input>
83
69
 
84
70
  <button className="button" onClick={this.startVideo.bind(this)}>开启视频</button>
85
- <div>{this.state.testTime}</div>
86
71
  </div>
87
72
  }
88
73
  </div>
@@ -2,6 +2,7 @@
2
2
  /* eslint-disable no-unused-vars */
3
3
  /* eslint-disable eqeqeq */
4
4
  import React, { Component, useState } from 'react';
5
+ import QRCode from 'qrcode.react';
5
6
  import API from '../../api/api';
6
7
  import { initWebSocket, joinRoom, disconnect } from '../../common/websocket';
7
8
  import { BoardOperate } from '../../common/index.esm.js';
@@ -287,7 +288,6 @@ class Video extends Component {
287
288
  cardFailReason: '',
288
289
  videoType: '',
289
290
  certificateValidityType: true,
290
- drawCanvasInterval: null,
291
291
  };
292
292
  // eslint-disable-next-line no-undef
293
293
  test_controller = '';
@@ -295,7 +295,7 @@ class Video extends Component {
295
295
  saveLog = (val) => {
296
296
  axios({
297
297
  method: 'get',
298
- baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.20&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
298
+ baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=2.0.0&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
299
299
 
300
300
  }).then(res => {
301
301
 
@@ -1362,9 +1362,6 @@ class Video extends Component {
1362
1362
  if (Mival.type == 1) {
1363
1363
  this.switchExternal()
1364
1364
  this.saveLog('whiteboard start, typeId=1218,')
1365
- if (typeof this.props.sfpCallback === 'function'){
1366
- this.props.sfpCallback()
1367
- }
1368
1365
  } else if (Mival.type == 2) {
1369
1366
  if (streamShare) {
1370
1367
  streamShare.getTracks().forEach(track => track.stop());
@@ -1431,6 +1428,47 @@ class Video extends Component {
1431
1428
  this.tabTitlesClick('customerScreen', 'delect')
1432
1429
  this.saveLog('app stop sharing screen, typeId=4001, ')
1433
1430
 
1431
+ } else if (Mival.typeId == 4004) {
1432
+ // 线下demo静音处理
1433
+ if (Mival.data.sessionId == this.state.sessionId && this.isFileSuccuse()) {
1434
+ if (!this.state.voiceStatue) {
1435
+ // 静音本地
1436
+ this.setState({
1437
+ voiceStatue: true,
1438
+ voiceImg: voiceImgCloe,
1439
+ voiceName: '解除静音'
1440
+ });
1441
+ let sid = document.getElementById('publish_video1').name || document.getElementById('publish_streamId1').name;
1442
+ this.test_controller.SetLocalAudioEnable(0, parseInt(sid, 10));
1443
+ callNimIM('sendCustomCmdMsg', {
1444
+ customId: this.state.imRoomId,
1445
+ content: JSON.stringify({
1446
+ 'typeId': 1013,
1447
+ 'muteStatus': 1,
1448
+ 'data': {
1449
+ 'sessionId': this.state.sessionId,
1450
+ 'userId': this.props.tellerAccount
1451
+ }
1452
+ })
1453
+ }, function (code, message, data) {
1454
+ // console.log(data)
1455
+ })
1456
+ }
1457
+ document.getElementById('audio1').muted = true
1458
+ console.log('音频流静音')
1459
+ console.log(document.getElementById('audio1').muted)
1460
+ setTimeout(() => {
1461
+ callNimIM('sendCustomCmdMsg', {
1462
+ customId: this.state.imRoomId,
1463
+ content: JSON.stringify({
1464
+ 'typeId': 1223,
1465
+ 'state': 1, // app解除静音
1466
+ 'sessionId': this.state.sessionId,
1467
+ 'userId': Mival.data.userId //this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
1468
+ })
1469
+ });
1470
+ }, 1000);
1471
+ }
1434
1472
  } else if (Mival.typeId == 1401) {
1435
1473
  // 用户修改名字
1436
1474
  if (Mival.sessionId == this.state.sessionId) {
@@ -1750,6 +1788,48 @@ class Video extends Component {
1750
1788
  this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
1751
1789
  }
1752
1790
  }
1791
+ // 线下demo静音处理
1792
+ if (JSON.parse(msg).typeId == 4004 && this.state.sessionId == JSON.parse(msg).data.sessionId) {
1793
+ if (this.isFileSuccuse()) {
1794
+ if (!this.state.voiceStatue) {
1795
+ // 静音本地
1796
+ this.setState({
1797
+ voiceStatue: true,
1798
+ voiceImg: voiceImgCloe,
1799
+ voiceName: '解除静音'
1800
+ });
1801
+ let sid = document.getElementById('publish_video1').name || document.getElementById('publish_streamId1').name;
1802
+ this.test_controller.SetLocalAudioEnable(0, parseInt(sid, 10));
1803
+ callNimIM('sendCustomCmdMsg', {
1804
+ customId: this.state.imRoomId,
1805
+ content: JSON.stringify({
1806
+ 'typeId': 1013,
1807
+ 'muteStatus': 1,
1808
+ 'data': {
1809
+ 'sessionId': this.state.sessionId,
1810
+ 'userId': this.props.tellerAccount
1811
+ }
1812
+ })
1813
+ }, function (code, message, data) {
1814
+ // console.log(data)
1815
+ })
1816
+ }
1817
+ document.getElementById('audio1').muted = true
1818
+ console.log('音频流静音')
1819
+ console.log(document.getElementById('audio1').muted)
1820
+ setTimeout(() => {
1821
+ callNimIM('sendCustomCmdMsg', {
1822
+ customId: this.state.imRoomId,
1823
+ content: JSON.stringify({
1824
+ 'typeId': 1223,
1825
+ 'state': 1, // app解除静音
1826
+ 'sessionId': this.state.sessionId,
1827
+ 'userId': uid //this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
1828
+ })
1829
+ });
1830
+ }, 1000);
1831
+ }
1832
+ }
1753
1833
  this.saveLog('mrtc OnReceiveTextMsg info:' + msg)
1754
1834
  }
1755
1835
  this.test_controller.StreamFilterHandler = async (publish_tag, stream, stream_type, publish_device, media_type) => {
@@ -2217,16 +2297,9 @@ class Video extends Component {
2217
2297
  })
2218
2298
  }
2219
2299
  }
2220
- // if (!document.getElementById("video1").name) {
2221
- // this.state.isPIBIntranet[0].type = false
2222
- // this.setState({
2223
- // videoOneName: '',
2224
- // voiceVideoOne: false,
2225
- // noVideoOne: false
2226
- // },()=>{
2227
- // this.videoListClick()
2228
- // })
2229
- // }
2300
+ if (!document.getElementById("video1").name) {
2301
+ document.getElementById('audio1').muted = false
2302
+ }
2230
2303
  this.state.analyserData.delete(sid)
2231
2304
  if (this.state.isPictureInPicture) {
2232
2305
  this.pictureInPicture('Refresh')
@@ -2750,7 +2823,6 @@ class Video extends Component {
2750
2823
  disconnect();
2751
2824
  }
2752
2825
  message.destroy()
2753
- clearInterval(this.state.drawCanvasInterval)
2754
2826
  }
2755
2827
  finishSession = () => {
2756
2828
  // clearInterval(this.state.OnVolumeAnalyserMap.get(sid))
@@ -2941,7 +3013,7 @@ class Video extends Component {
2941
3013
  }
2942
3014
  }
2943
3015
  componentWillMount() {
2944
- console.log('hsbc_teller_sdk', '1.9.20')
3016
+ console.log('hsbc_teller_sdk', '2.0.0')
2945
3017
  let arr = []
2946
3018
  for(let i=1;i<=12;i++){
2947
3019
  arr.push({
@@ -4138,21 +4210,6 @@ class Video extends Component {
4138
4210
  })
4139
4211
  }
4140
4212
  }
4141
- changePdfRendering = () => {
4142
- if (this.props.pdfRendering) {
4143
- // 暂停绘制
4144
- clearInterval(this.state.drawCanvasInterval)
4145
- } else {
4146
- // 继续绘制
4147
- if (!this.drawFunction) {
4148
- console.log('未开始远程签署')
4149
- return
4150
- }
4151
- clearInterval(this.state.drawCanvasInterval)
4152
- this.state.drawCanvasInterval = setInterval(this.drawFunction, 1000 / 20);
4153
- }
4154
-
4155
- }
4156
4213
  navigatorClick = () => {
4157
4214
  const that = this
4158
4215
  const publish_config = {};
@@ -4194,21 +4251,20 @@ class Video extends Component {
4194
4251
  canvas.width = this.state.whiteboardWidth
4195
4252
  }
4196
4253
  console.log('addEventListener', !$this.paused, !$this.ended, x, y, width, height)
4197
-
4198
- if (this.state.drawCanvasInterval) clearInterval(this.state.drawCanvasInterval)
4199
- $this.drawFunction = () => {
4200
- if (!$this.paused && !$this.ended) {
4201
- // if(!that.state.tabTitles.find(el=>el.value == 'customerScreen')) {
4202
- cobj.drawImage(videoMedia, x, y, width, height, 0, 0, 960, 540);
4203
- // } else {
4204
- // cobj.fillStyle = 'rgb(0 0 0)'
4205
- // cobj.fillRect(0,0,960,540)
4206
- // }
4207
- }
4254
+ loop()
4255
+ function loop() {
4256
+ if (!$this.paused && !$this.ended) {
4257
+ // if(!that.state.tabTitles.find(el=>el.value == 'customerScreen')) {
4258
+ cobj.drawImage(videoMedia, x, y, width, height, 0, 0, 960, 540);
4259
+ // } else {
4260
+ // cobj.fillStyle = 'rgb(0 0 0)'
4261
+ // cobj.fillRect(0,0,960,540)
4262
+ // }
4263
+
4264
+ setTimeout(loop, 1000 / 20); // drawing at 30fps
4265
+ }
4208
4266
  }
4209
4267
 
4210
- this.state.drawCanvasInterval = setInterval($this.drawFunction , 1000/ 20);
4211
-
4212
4268
  if (document.getElementById('video20').name) {
4213
4269
  // 代表已经有了进行切流
4214
4270
  publish_config.publish_device = 5
@@ -4709,9 +4765,6 @@ class Video extends Component {
4709
4765
  if (this.props.shareMask != prevProps.shareMask) {
4710
4766
  this.sendNotification()
4711
4767
  }
4712
- if (this.props.pdfRendering != prevProps.pdfRendering) {
4713
- this.changePdfRendering()
4714
- }
4715
4768
  }
4716
4769
  onChangeOCRCustomer = (e) => {
4717
4770
  console.log(e)
@@ -5136,6 +5189,13 @@ class Video extends Component {
5136
5189
 
5137
5190
  </ul>
5138
5191
  </div>
5192
+ {!this.state.loading && this.state.sessionId?
5193
+ <QRCode
5194
+ style={{'position': 'absolute', 'right': '10px', 'top': '-110px'}}
5195
+ value={this.state.sessionId} //value参数为生成二维码的链接
5196
+ size={100} //二维码的宽高尺寸
5197
+ fgColor="#000000" //二维码的颜色
5198
+ /> : null}
5139
5199
  </div>
5140
5200
  }
5141
5201
 
@@ -5669,7 +5729,6 @@ Video.defaultProps = {
5669
5729
  customers: ['--'],
5670
5730
  otherAttendees: undefined
5671
5731
  },
5672
- pdfRendering: false,
5673
5732
  isTranscribing: false,
5674
5733
  shareMask: false,
5675
5734
  isOpenSound: false, // true开启进出音效 false不开启