react_hsbc_teller 1.9.18 → 1.9.20
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/lib/hsbc.js +1 -1
- package/package.json +1 -1
- package/packages/demo/demo.js +15 -0
- package/packages/demo/pdf.js +15 -0
- package/packages/pages/video/video.jsx +40 -53
package/package.json
CHANGED
package/packages/demo/demo.js
CHANGED
|
@@ -21,6 +21,7 @@ roomId
|
|
|
21
21
|
// mtoken: '',
|
|
22
22
|
// imRoomId: '',
|
|
23
23
|
// sessionId: '',
|
|
24
|
+
pdfRendering: false,
|
|
24
25
|
isVideo: false,
|
|
25
26
|
tellerAccount: 'wmzTeller',
|
|
26
27
|
// callbackUrl: 'http://182.92.184.31:8720/hsbc/callback',
|
|
@@ -142,6 +143,17 @@ shareMaskClick=()=>{
|
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
}
|
|
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
|
+
}
|
|
145
157
|
createRoomCallback=(data)=>{
|
|
146
158
|
console.log('createRoomCallback', data)
|
|
147
159
|
this.setState({roomId: data.data.roomId});
|
|
@@ -195,6 +207,7 @@ userExit =(val)=>{
|
|
|
195
207
|
<div>
|
|
196
208
|
<HSBC
|
|
197
209
|
shareMask={this.state.shareMask}
|
|
210
|
+
pdfRendering={this.state.pdfRendering}
|
|
198
211
|
roomId={this.state.roomId}
|
|
199
212
|
mtoken={this.state.mtoken}
|
|
200
213
|
sessionId={this.state.sessionId}
|
|
@@ -219,6 +232,7 @@ userExit =(val)=>{
|
|
|
219
232
|
createRoomCallback={this.createRoomCallback}
|
|
220
233
|
joinRoomCallback={this.joinRoomCallback}
|
|
221
234
|
imgCallback={this.imgCallback}
|
|
235
|
+
sfpCallback={()=>{console.log('sfpCallback success')}}
|
|
222
236
|
userExit={this.userExit}
|
|
223
237
|
staffPermission={this.staffPermission}
|
|
224
238
|
>
|
|
@@ -226,6 +240,7 @@ userExit =(val)=>{
|
|
|
226
240
|
<Pdf></Pdf>
|
|
227
241
|
</HSBC>
|
|
228
242
|
<button onClick={this.shareMaskClick.bind(this)}>遮罩层</button>
|
|
243
|
+
<button onClick={this.pdfRenderingClick.bind(this)}>{this.state.pdfRendering?'继续':'暂停'}渲染</button>
|
|
229
244
|
</div>
|
|
230
245
|
:
|
|
231
246
|
<div>
|
package/packages/demo/pdf.js
CHANGED
|
@@ -2,6 +2,7 @@ import React, { Component } from "react";
|
|
|
2
2
|
|
|
3
3
|
class pdf extends Component {
|
|
4
4
|
state = {
|
|
5
|
+
testTime: '',
|
|
5
6
|
isVideo: false,
|
|
6
7
|
tellerAccount: '',
|
|
7
8
|
callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
|
|
@@ -11,6 +12,12 @@ class pdf extends Component {
|
|
|
11
12
|
baseURL:'https://counter-web.leimondata.cn:18082/api/leimon-counter-api',
|
|
12
13
|
resourcePath:'https://counter-web.leimondata.cn:7199',
|
|
13
14
|
}
|
|
15
|
+
componentDidMount () {
|
|
16
|
+
this.countTimer()
|
|
17
|
+
}
|
|
18
|
+
componentWillUnmount() {
|
|
19
|
+
clearInterval(this.state.timer)
|
|
20
|
+
}
|
|
14
21
|
startVideo = () => {
|
|
15
22
|
this.setState({
|
|
16
23
|
isVideo: true
|
|
@@ -53,6 +60,13 @@ handleResourcePath = (event) => {
|
|
|
53
60
|
resourcePath: event.target.value
|
|
54
61
|
})
|
|
55
62
|
}
|
|
63
|
+
countTimer = () => {
|
|
64
|
+
this.state.timer = setInterval(() => {
|
|
65
|
+
this.setState({
|
|
66
|
+
testTime: new Date().toString()
|
|
67
|
+
})
|
|
68
|
+
}, 1000);
|
|
69
|
+
}
|
|
56
70
|
|
|
57
71
|
render() {
|
|
58
72
|
console.log('22',this.props)
|
|
@@ -68,6 +82,7 @@ handleResourcePath = (event) => {
|
|
|
68
82
|
阿里资源服务地址:<input placeholder="请输入阿里资源服务地址" value={this.state.resourcePath} onChange={e => this.handleResourcePath(e)}></input>
|
|
69
83
|
|
|
70
84
|
<button className="button" onClick={this.startVideo.bind(this)}>开启视频</button>
|
|
85
|
+
<div>{this.state.testTime}</div>
|
|
71
86
|
</div>
|
|
72
87
|
}
|
|
73
88
|
</div>
|
|
@@ -287,6 +287,7 @@ class Video extends Component {
|
|
|
287
287
|
cardFailReason: '',
|
|
288
288
|
videoType: '',
|
|
289
289
|
certificateValidityType: true,
|
|
290
|
+
drawCanvasInterval: null,
|
|
290
291
|
};
|
|
291
292
|
// eslint-disable-next-line no-undef
|
|
292
293
|
test_controller = '';
|
|
@@ -294,7 +295,7 @@ class Video extends Component {
|
|
|
294
295
|
saveLog = (val) => {
|
|
295
296
|
axios({
|
|
296
297
|
method: 'get',
|
|
297
|
-
baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.
|
|
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
299
|
|
|
299
300
|
}).then(res => {
|
|
300
301
|
|
|
@@ -1361,6 +1362,9 @@ class Video extends Component {
|
|
|
1361
1362
|
if (Mival.type == 1) {
|
|
1362
1363
|
this.switchExternal()
|
|
1363
1364
|
this.saveLog('whiteboard start, typeId=1218,')
|
|
1365
|
+
if (typeof this.props.sfpCallback === 'function'){
|
|
1366
|
+
this.props.sfpCallback()
|
|
1367
|
+
}
|
|
1364
1368
|
} else if (Mival.type == 2) {
|
|
1365
1369
|
if (streamShare) {
|
|
1366
1370
|
streamShare.getTracks().forEach(track => track.stop());
|
|
@@ -1746,45 +1750,7 @@ class Video extends Component {
|
|
|
1746
1750
|
this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
|
|
1747
1751
|
}
|
|
1748
1752
|
}
|
|
1749
|
-
|
|
1750
|
-
if (this.isFileSuccuse()) {
|
|
1751
|
-
if (!this.state.voiceStatue) {
|
|
1752
|
-
// 静音本地
|
|
1753
|
-
this.setState({
|
|
1754
|
-
voiceStatue: true,
|
|
1755
|
-
voiceImg: voiceImgCloe,
|
|
1756
|
-
voiceName: '解除静音'
|
|
1757
|
-
});
|
|
1758
|
-
let sid = document.getElementById('publish_video1').name || document.getElementById('publish_streamId1').name;
|
|
1759
|
-
this.test_controller.SetLocalAudioEnable(0, parseInt(sid, 10));
|
|
1760
|
-
callNimIM('sendCustomCmdMsg', {
|
|
1761
|
-
customId: this.state.imRoomId,
|
|
1762
|
-
content: JSON.stringify({
|
|
1763
|
-
'typeId': 1013,
|
|
1764
|
-
'muteStatus': 1,
|
|
1765
|
-
'data': {
|
|
1766
|
-
'sessionId': this.state.sessionId,
|
|
1767
|
-
'userId': this.props.tellerAccount
|
|
1768
|
-
}
|
|
1769
|
-
})
|
|
1770
|
-
}, function (code, message, data) {
|
|
1771
|
-
// console.log(data)
|
|
1772
|
-
})
|
|
1773
|
-
}
|
|
1774
|
-
setTimeout(() => {
|
|
1775
|
-
callNimIM('sendCustomCmdMsg', {
|
|
1776
|
-
customId: this.state.imRoomId,
|
|
1777
|
-
content: JSON.stringify({
|
|
1778
|
-
'typeId': 1223,
|
|
1779
|
-
'state': 1, // app解除静音
|
|
1780
|
-
'sessionId': this.state.sessionId,
|
|
1781
|
-
'userId': uid //this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
|
|
1782
|
-
})
|
|
1783
|
-
});
|
|
1784
|
-
}, 1000);
|
|
1785
|
-
}
|
|
1786
|
-
}
|
|
1787
|
-
this.saveLog('mrtc OnReceiveTextMsg info:', uid, msg, JSON.parse(msg).typeId, JSON.parse(msg).data.sessionId, this.state.sessionId)
|
|
1753
|
+
this.saveLog('mrtc OnReceiveTextMsg info:' + msg)
|
|
1788
1754
|
}
|
|
1789
1755
|
this.test_controller.StreamFilterHandler = async (publish_tag, stream, stream_type, publish_device, media_type) => {
|
|
1790
1756
|
console.log(`stream processed by client, publish_device=${publish_device}, media_type=${media_type}, publish_tag=${publish_tag},stream_type=${stream_type}`);
|
|
@@ -2784,6 +2750,7 @@ class Video extends Component {
|
|
|
2784
2750
|
disconnect();
|
|
2785
2751
|
}
|
|
2786
2752
|
message.destroy()
|
|
2753
|
+
clearInterval(this.state.drawCanvasInterval)
|
|
2787
2754
|
}
|
|
2788
2755
|
finishSession = () => {
|
|
2789
2756
|
// clearInterval(this.state.OnVolumeAnalyserMap.get(sid))
|
|
@@ -2974,7 +2941,7 @@ class Video extends Component {
|
|
|
2974
2941
|
}
|
|
2975
2942
|
}
|
|
2976
2943
|
componentWillMount() {
|
|
2977
|
-
console.log('hsbc_teller_sdk', '1.9.
|
|
2944
|
+
console.log('hsbc_teller_sdk', '1.9.20')
|
|
2978
2945
|
let arr = []
|
|
2979
2946
|
for(let i=1;i<=12;i++){
|
|
2980
2947
|
arr.push({
|
|
@@ -4171,6 +4138,21 @@ class Video extends Component {
|
|
|
4171
4138
|
})
|
|
4172
4139
|
}
|
|
4173
4140
|
}
|
|
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
|
+
}
|
|
4174
4156
|
navigatorClick = () => {
|
|
4175
4157
|
const that = this
|
|
4176
4158
|
const publish_config = {};
|
|
@@ -4212,20 +4194,21 @@ class Video extends Component {
|
|
|
4212
4194
|
canvas.width = this.state.whiteboardWidth
|
|
4213
4195
|
}
|
|
4214
4196
|
console.log('addEventListener', !$this.paused, !$this.ended, x, y, width, height)
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
}
|
|
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
|
+
}
|
|
4227
4208
|
}
|
|
4228
4209
|
|
|
4210
|
+
this.state.drawCanvasInterval = setInterval($this.drawFunction , 1000/ 20);
|
|
4211
|
+
|
|
4229
4212
|
if (document.getElementById('video20').name) {
|
|
4230
4213
|
// 代表已经有了进行切流
|
|
4231
4214
|
publish_config.publish_device = 5
|
|
@@ -4726,6 +4709,9 @@ class Video extends Component {
|
|
|
4726
4709
|
if (this.props.shareMask != prevProps.shareMask) {
|
|
4727
4710
|
this.sendNotification()
|
|
4728
4711
|
}
|
|
4712
|
+
if (this.props.pdfRendering != prevProps.pdfRendering) {
|
|
4713
|
+
this.changePdfRendering()
|
|
4714
|
+
}
|
|
4729
4715
|
}
|
|
4730
4716
|
onChangeOCRCustomer = (e) => {
|
|
4731
4717
|
console.log(e)
|
|
@@ -5683,6 +5669,7 @@ Video.defaultProps = {
|
|
|
5683
5669
|
customers: ['--'],
|
|
5684
5670
|
otherAttendees: undefined
|
|
5685
5671
|
},
|
|
5672
|
+
pdfRendering: false,
|
|
5686
5673
|
isTranscribing: false,
|
|
5687
5674
|
shareMask: false,
|
|
5688
5675
|
isOpenSound: false, // true开启进出音效 false不开启
|