react_hsbc_teller 0.8.6 → 0.8.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.
- package/config/webpack.dev.js +1 -1
- package/lib/hsbc.js +1 -1
- package/package.json +1 -1
- package/packages/api/api.js +22 -1
- package/packages/pages/video/video.jsx +71 -16
- package/src/index.js +2 -2
package/package.json
CHANGED
package/packages/api/api.js
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import Server from './server';
|
|
2
2
|
|
|
3
3
|
class API extends Server{
|
|
4
|
+
|
|
5
|
+
async enterRoom(params = {}){
|
|
6
|
+
// return this.axios('get', '/lang/select/2', params);
|
|
7
|
+
try{
|
|
8
|
+
let result = await this.axios('post', '/hsbc/enterRoom', params);
|
|
9
|
+
console.log(result)
|
|
10
|
+
if(result && (result.data instanceof Object) && result.code === 200){
|
|
11
|
+
return result||[];
|
|
12
|
+
}else{
|
|
13
|
+
let err = {
|
|
14
|
+
tip: '服务异常',
|
|
15
|
+
response: result,
|
|
16
|
+
data: params,
|
|
17
|
+
// url: 'https://api.cangdu.org/shopro/data/products',
|
|
18
|
+
}
|
|
19
|
+
throw err;
|
|
20
|
+
}
|
|
21
|
+
}catch(err){
|
|
22
|
+
throw err;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
4
25
|
async sendEmail(params = {}){
|
|
5
26
|
// return this.axios('get', '/lang/select/2', params);
|
|
6
27
|
try{
|
|
@@ -24,7 +45,7 @@ class API extends Server{
|
|
|
24
45
|
async appGetUsername(params = {}){
|
|
25
46
|
// return this.axios('get', '/lang/select/2', params);
|
|
26
47
|
try{
|
|
27
|
-
let result = await this.axios('get', '/app/getUsername?userId=' + params.userId, params);
|
|
48
|
+
let result = await this.axios('get', '/app/getUsername?userId=' + params.userId+ '&sessionId=' + params.sessionId, params);
|
|
28
49
|
console.log(result)
|
|
29
50
|
if(result && (result.data instanceof Object) && result.code === 200){
|
|
30
51
|
return result||[];
|
|
@@ -162,6 +162,15 @@ class Video extends Component {
|
|
|
162
162
|
sessionId: result.sessionId,
|
|
163
163
|
loading: false,
|
|
164
164
|
});
|
|
165
|
+
let publish_config = {}
|
|
166
|
+
publish_config.media_type = 1
|
|
167
|
+
publish_config.publish_device = 1
|
|
168
|
+
publish_config.need_volume_analyser = true
|
|
169
|
+
publish_config.video_profile_type = 3
|
|
170
|
+
publish_config.publish_video_id = 'publish_video1'
|
|
171
|
+
publish_config.publish_streamId_id = 'publish_streamId1'
|
|
172
|
+
publish_config.publish_tag = 'tag1'
|
|
173
|
+
this.test_controller.Publish(publish_config)
|
|
165
174
|
// eslint-disable-next-line no-undef
|
|
166
175
|
if(this.state.imStatus) {
|
|
167
176
|
joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
|
|
@@ -256,7 +265,7 @@ class Video extends Component {
|
|
|
256
265
|
// 初始化视频
|
|
257
266
|
ConnectMRTC = () => {
|
|
258
267
|
const config_param = {};
|
|
259
|
-
config_param.auto_publish_subscribe =
|
|
268
|
+
config_param.auto_publish_subscribe = 4;
|
|
260
269
|
config_param.media_type = 1;
|
|
261
270
|
config_param.publish_device = 1;
|
|
262
271
|
config_param.video_profile_type = '3';
|
|
@@ -1574,6 +1583,7 @@ class Video extends Component {
|
|
|
1574
1583
|
});
|
|
1575
1584
|
}
|
|
1576
1585
|
if(sid == document.getElementById('publish_video1').name) {
|
|
1586
|
+
this.enterRoom()
|
|
1577
1587
|
this.timer = setInterval(
|
|
1578
1588
|
() => {
|
|
1579
1589
|
if(!this.state.voiceStatue) {
|
|
@@ -2448,6 +2458,23 @@ class Video extends Component {
|
|
|
2448
2458
|
}
|
|
2449
2459
|
}
|
|
2450
2460
|
}
|
|
2461
|
+
enterRoom = async () =>{
|
|
2462
|
+
try {
|
|
2463
|
+
let result = await API.enterRoom({
|
|
2464
|
+
appAccount: this.props.tellerAccount,
|
|
2465
|
+
sessionId: this.state.sessionId,
|
|
2466
|
+
username: this.props.meetingInfo.host == '--' ? '' : this.props.meetingInfo.host,
|
|
2467
|
+
type: '2'
|
|
2468
|
+
});
|
|
2469
|
+
console.log(result);
|
|
2470
|
+
this.appGetUsername(document.getElementById('publish_video1').name)
|
|
2471
|
+
} catch (err) {
|
|
2472
|
+
console.error(err);
|
|
2473
|
+
if(err.status == 502 || err.status== 404) {
|
|
2474
|
+
this.roomCallBack(2, '连接服务器失败','SYS-02')
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2451
2478
|
contrastFaceVerify = async data => {
|
|
2452
2479
|
console.log(data);
|
|
2453
2480
|
try {
|
|
@@ -2476,13 +2503,7 @@ class Video extends Component {
|
|
|
2476
2503
|
};
|
|
2477
2504
|
componentWillUnmount() {
|
|
2478
2505
|
if (this.state.roomCustomerList.length == 0 && this.state.sessionType) {
|
|
2479
|
-
|
|
2480
|
-
let result = await API.finishSession({
|
|
2481
|
-
sessionId: this.state.sessionId,
|
|
2482
|
-
tellerId: this.props.tellerAccount
|
|
2483
|
-
});
|
|
2484
|
-
} catch (err) {
|
|
2485
|
-
}
|
|
2506
|
+
this.finishSessionClick()
|
|
2486
2507
|
}
|
|
2487
2508
|
if (this.test_controller&&this.state.sessionType) {
|
|
2488
2509
|
this.test_controller.LeaveRoom()
|
|
@@ -2505,16 +2526,41 @@ class Video extends Component {
|
|
|
2505
2526
|
this.cancel = ''
|
|
2506
2527
|
this.timer && clearInterval(this.timer);
|
|
2507
2528
|
}
|
|
2508
|
-
|
|
2529
|
+
finishSessionClick= async () => {
|
|
2530
|
+
try {
|
|
2531
|
+
let result = await API.finishSession({
|
|
2532
|
+
sessionId: this.state.sessionId,
|
|
2533
|
+
tellerId: this.props.tellerAccount
|
|
2534
|
+
});
|
|
2535
|
+
} catch (err) {
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
finishSession = () => {
|
|
2509
2539
|
|
|
2510
2540
|
|
|
2511
2541
|
if(this.state.isSharedScreen) {
|
|
2512
|
-
|
|
2542
|
+
this.test_controller.UnPublish(document.getElementById('video20').name)
|
|
2543
|
+
this.setState({
|
|
2544
|
+
publishDevic: 1,
|
|
2545
|
+
isSharedScreen: false,
|
|
2546
|
+
screenName: '投屏'
|
|
2547
|
+
});
|
|
2548
|
+
console.log(pictureInPictureVideo)
|
|
2549
|
+
this.tabTitlesClick('RMScreen', 'delect')
|
|
2550
|
+
if (this.state.isPictureInPicture) {
|
|
2551
|
+
document.exitPictureInPicture()
|
|
2552
|
+
}
|
|
2553
|
+
this.props.onLeaveRoom({
|
|
2554
|
+
code: LEAVE_TYPE.TELLER_EXIT,
|
|
2555
|
+
errMsg: '坐席退出'
|
|
2556
|
+
})
|
|
2557
|
+
} else {
|
|
2558
|
+
this.props.onLeaveRoom({
|
|
2559
|
+
code: LEAVE_TYPE.TELLER_EXIT,
|
|
2560
|
+
errMsg: '坐席退出'
|
|
2561
|
+
})
|
|
2513
2562
|
}
|
|
2514
|
-
|
|
2515
|
-
code: LEAVE_TYPE.TELLER_EXIT,
|
|
2516
|
-
errMsg: '坐席退出'
|
|
2517
|
-
})
|
|
2563
|
+
|
|
2518
2564
|
}
|
|
2519
2565
|
getRoomStatus = async data => {
|
|
2520
2566
|
try {
|
|
@@ -3080,9 +3126,13 @@ class Video extends Component {
|
|
|
3080
3126
|
if (document.getElementById('video12').name == sid) {
|
|
3081
3127
|
userId = this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).uid
|
|
3082
3128
|
}
|
|
3129
|
+
if (document.getElementById('publish_video1').name == sid) {
|
|
3130
|
+
userId = this.props.tellerAccount
|
|
3131
|
+
}
|
|
3083
3132
|
try {
|
|
3084
3133
|
let result = await API.appGetUsername({
|
|
3085
|
-
userId: userId
|
|
3134
|
+
userId: userId,
|
|
3135
|
+
sessionId: this.state.sessionId
|
|
3086
3136
|
});
|
|
3087
3137
|
console.log(result)
|
|
3088
3138
|
let data
|
|
@@ -3091,6 +3141,11 @@ class Video extends Component {
|
|
|
3091
3141
|
} else {
|
|
3092
3142
|
this.messageClick('查询失败','error')
|
|
3093
3143
|
}
|
|
3144
|
+
if (document.getElementById('publish_video1').name == sid) {
|
|
3145
|
+
this.setState({
|
|
3146
|
+
titleNameRm: data
|
|
3147
|
+
})
|
|
3148
|
+
}
|
|
3094
3149
|
if (document.getElementById('video1').name == sid) {
|
|
3095
3150
|
|
|
3096
3151
|
this.setState({
|
|
@@ -3482,7 +3537,7 @@ class Video extends Component {
|
|
|
3482
3537
|
/>
|
|
3483
3538
|
}
|
|
3484
3539
|
<canvas style={{ display: (!this.state.voiceStatue) ? '' : 'none',width: '25px',height:'25px',marginTop: '4px' }} className="canvasClass" id="publish_volumeView" width="40" height="70"></canvas>
|
|
3485
|
-
<div className='titleName' style={{ color: this.props.titleColor, fontSize: this.props.fontSize + 'px', fontFamily: this.props.fontFamily }}>{this.
|
|
3540
|
+
<div className='titleName' style={{ color: this.props.titleColor, fontSize: this.props.fontSize + 'px', fontFamily: this.props.fontFamily }}>{this.state.titleNameRm}</div>
|
|
3486
3541
|
</div>
|
|
3487
3542
|
</div>
|
|
3488
3543
|
|
package/src/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import ReactDOM from "react-dom";
|
|
3
3
|
import "./index.less";
|
|
4
4
|
import '@babel/polyfill';
|
|
5
|
-
import { HSBC } from "../lib/hsbc";
|
|
6
|
-
|
|
5
|
+
// import { HSBC } from "../lib/hsbc";
|
|
6
|
+
import {HSBC} from "../packages";
|
|
7
7
|
|
|
8
8
|
ReactDOM.render(
|
|
9
9
|
<div className="hsbc"><HSBC></HSBC></div>,
|