react_hsbc_teller 0.5.5 → 0.5.6
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/lib/index.html +1 -1
- package/package.json +1 -1
- package/packages/common/websocket.js +1 -0
- package/packages/pages/video/video.jsx +52 -7
- package/packages/pages/video/video.less +26 -1
- package/packages/utils/cell.js +3 -3
- package/public/index.html +6 -0
- package/src/index.js +2 -2
package/lib/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html><head><meta charset="utf-8"/><link rel="shortcut icon" href="favicon.ico"><meta content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no" name="viewport"/><title>汇丰银行营业厅 | lib 创建 library</title><script defer="defer" src="hsbc.js"></script></head><body><div id="root"></div></body></html>
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8"/><link rel="shortcut icon" href="favicon.ico"><meta content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no" name="viewport"/><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/><title>汇丰银行营业厅 | lib 创建 library</title><script defer="defer" src="hsbc.js"></script></head><body><div id="root"></div></body></html>
|
package/package.json
CHANGED
|
@@ -102,7 +102,9 @@ class Video extends Component {
|
|
|
102
102
|
microphoneList: [],
|
|
103
103
|
isModalVisibleInspection: false,
|
|
104
104
|
cameraValue: '',
|
|
105
|
-
microphoneValue: ''
|
|
105
|
+
microphoneValue: '',
|
|
106
|
+
imStatus: false,
|
|
107
|
+
imJoinRoom: false
|
|
106
108
|
};
|
|
107
109
|
// eslint-disable-next-line no-undef
|
|
108
110
|
test_controller = '';
|
|
@@ -132,7 +134,13 @@ class Video extends Component {
|
|
|
132
134
|
sessionId: result.sessionId
|
|
133
135
|
});
|
|
134
136
|
// eslint-disable-next-line no-undef
|
|
135
|
-
|
|
137
|
+
if(this.state.imStatus) {
|
|
138
|
+
joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
|
|
139
|
+
this.setState({
|
|
140
|
+
imJoinRoom:true
|
|
141
|
+
})
|
|
142
|
+
console.log('加入IM房间')
|
|
143
|
+
}
|
|
136
144
|
this.props.createRoomCallback({
|
|
137
145
|
type: 1,
|
|
138
146
|
errorManage: '',
|
|
@@ -1006,7 +1014,24 @@ class Video extends Component {
|
|
|
1006
1014
|
}
|
|
1007
1015
|
}
|
|
1008
1016
|
};
|
|
1017
|
+
window.IMOpenfire = msg =>{
|
|
1018
|
+
console.log('im登录', msg)
|
|
1019
|
+
if(!msg) {
|
|
1020
|
+
this.roomCallBack(2, 'im建立连接失败')
|
|
1021
|
+
} else {
|
|
1022
|
+
this.setState({
|
|
1023
|
+
imStatus: msg
|
|
1024
|
+
})
|
|
1025
|
+
if(this.state.imRoomId && !this.state.imJoinRoom) {
|
|
1026
|
+
joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
|
|
1027
|
+
this.setState({
|
|
1028
|
+
imJoinRoom:true
|
|
1029
|
+
})
|
|
1030
|
+
console.log('加入im房间')
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1009
1033
|
|
|
1034
|
+
}
|
|
1010
1035
|
let data = {
|
|
1011
1036
|
account: this.props.tellerAccount,
|
|
1012
1037
|
type: '2',
|
|
@@ -1086,7 +1111,7 @@ class Video extends Component {
|
|
|
1086
1111
|
this.test_controller.OnGetDevicesFailed = (code, msg) => {
|
|
1087
1112
|
console.log('获取设备失败', code, msg)
|
|
1088
1113
|
this.messageClick('获取设备失败,请检查摄像头设备是否可用或是否禁用摄像头','error')
|
|
1089
|
-
this.roomCallBack(2, '
|
|
1114
|
+
this.roomCallBack(2, '获取失败')
|
|
1090
1115
|
};
|
|
1091
1116
|
// 建立连接成功
|
|
1092
1117
|
this.test_controller.OnConnectOK = () => {
|
|
@@ -1371,6 +1396,21 @@ class Video extends Component {
|
|
|
1371
1396
|
})
|
|
1372
1397
|
}, function (code, message, data) {
|
|
1373
1398
|
})
|
|
1399
|
+
if(this.state.voiceStatue) {
|
|
1400
|
+
callNimIM('sendCustomCmdMsg', {
|
|
1401
|
+
customId: this.state.imRoomId,
|
|
1402
|
+
content: JSON.stringify({
|
|
1403
|
+
'typeId': 1013,
|
|
1404
|
+
'muteStatus': 0,
|
|
1405
|
+
'data': {
|
|
1406
|
+
'sessionId': this.state.sessionId,
|
|
1407
|
+
'userId': this.props.tellerAccount
|
|
1408
|
+
}
|
|
1409
|
+
})
|
|
1410
|
+
}, function (code, message, data) {
|
|
1411
|
+
console.log(data)
|
|
1412
|
+
})
|
|
1413
|
+
}
|
|
1374
1414
|
let array = this.state.roomCustomerList;
|
|
1375
1415
|
let newArray = [...array];
|
|
1376
1416
|
newArray.push({
|
|
@@ -2015,6 +2055,8 @@ class Video extends Component {
|
|
|
2015
2055
|
isCustomer: false,
|
|
2016
2056
|
isWhiteboard: false,
|
|
2017
2057
|
isPictureInPicture: false,
|
|
2058
|
+
imStatus: false,
|
|
2059
|
+
imJoinRoom: false
|
|
2018
2060
|
});
|
|
2019
2061
|
this.props.onLeaveRoom({
|
|
2020
2062
|
code: LEAVE_TYPE.TELLER_EXIT,
|
|
@@ -2786,7 +2828,7 @@ class Video extends Component {
|
|
|
2786
2828
|
{
|
|
2787
2829
|
this.state.cameraList.map((item, index) => {
|
|
2788
2830
|
return <div>
|
|
2789
|
-
<input type="radio" name="camere" value={item.actionid} checked={this.state.cameraValue == item.actionid} onChange={(e) => this.getCameraValue(e)}
|
|
2831
|
+
<input type="radio" name="camere" value={item.actionid} checked={this.state.cameraValue == item.actionid} onChange={(e) => this.getCameraValue(e)} /><label for={item.actionid}>{item.actionname}</label> <br />
|
|
2790
2832
|
</div>
|
|
2791
2833
|
})
|
|
2792
2834
|
}
|
|
@@ -2798,7 +2840,7 @@ class Video extends Component {
|
|
|
2798
2840
|
{
|
|
2799
2841
|
this.state.microphoneList.map((item, index) => {
|
|
2800
2842
|
return <div class="cameraAnMicrophone">
|
|
2801
|
-
<input type="radio" name="microphone" value={item.actionid} checked={this.state.microphoneValue == item.actionid} onChange={(e) => this.getMicrophoneValue(e)}
|
|
2843
|
+
<input type="radio" name="microphone" value={item.actionid} checked={this.state.microphoneValue == item.actionid} onChange={(e) => this.getMicrophoneValue(e)} /><label for={item.actionid}>{item.actionname}</label> <br />
|
|
2802
2844
|
</div>
|
|
2803
2845
|
})
|
|
2804
2846
|
}
|
|
@@ -2808,12 +2850,15 @@ class Video extends Component {
|
|
|
2808
2850
|
'z-index': '-1',
|
|
2809
2851
|
width:'100%',
|
|
2810
2852
|
height:'100%',
|
|
2811
|
-
position: 'absolute'
|
|
2853
|
+
position: 'absolute',
|
|
2854
|
+
left: 0
|
|
2855
|
+
|
|
2812
2856
|
} :{
|
|
2813
2857
|
'z-index': '0',
|
|
2814
2858
|
width:'100%',
|
|
2815
2859
|
height:'100%',
|
|
2816
|
-
position: 'absolute'
|
|
2860
|
+
position: 'absolute',
|
|
2861
|
+
left: 0
|
|
2817
2862
|
};
|
|
2818
2863
|
return (
|
|
2819
2864
|
<div className="all">
|
|
@@ -276,7 +276,7 @@
|
|
|
276
276
|
// position: absolute;
|
|
277
277
|
// bottom: 0;
|
|
278
278
|
// left: 0;
|
|
279
|
-
transform: rotateY(180deg);
|
|
279
|
+
// transform: rotateY(180deg);
|
|
280
280
|
}
|
|
281
281
|
.cameraAnMicrophone{
|
|
282
282
|
margin: 10px 20px;
|
|
@@ -361,4 +361,29 @@
|
|
|
361
361
|
margin-bottom: 3px;
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
input[type="radio"]+label::before {
|
|
367
|
+
content: " ";
|
|
368
|
+
display: inline-block;
|
|
369
|
+
vertical-align: middle;
|
|
370
|
+
width: 13px;
|
|
371
|
+
height: 13px;
|
|
372
|
+
border-radius: 50%;
|
|
373
|
+
border: 1px solid #999999;
|
|
374
|
+
margin-right: 0.2rem;
|
|
375
|
+
box-sizing: border-box;
|
|
376
|
+
margin-top: -0.1rem;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
input[type="radio"]:checked+label::before {
|
|
380
|
+
background-color: #269792;
|
|
381
|
+
background-clip: content-box;
|
|
382
|
+
border: 1px solid #269792;
|
|
383
|
+
padding: 0.1rem;
|
|
384
|
+
box-sizing: border-box;
|
|
385
|
+
}
|
|
386
|
+
input[type="radio"] {
|
|
387
|
+
position: absolute;
|
|
388
|
+
clip: rect(0, 0, 0, 0);
|
|
364
389
|
}
|
package/packages/utils/cell.js
CHANGED
|
@@ -25,9 +25,9 @@ function callNimIM(method, json, callback) {
|
|
|
25
25
|
|
|
26
26
|
callbackRegister.set(callId, fn)
|
|
27
27
|
if (method == 'sendGroupMsg') {
|
|
28
|
-
sendMessage(json.groupId, (window.sessionStorage.getItem('
|
|
28
|
+
sendMessage(json.groupId, (JSON.parse(window.sessionStorage.getItem('sigData')).account + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), 'groupchat', json.content)
|
|
29
29
|
} else if (method == 'sendCustomCmdMsg') {
|
|
30
|
-
sendMessage(json.customId, (window.sessionStorage.getItem('
|
|
30
|
+
sendMessage(json.customId, (JSON.parse(window.sessionStorage.getItem('sigData')).account + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), 'groupchat', json.content)
|
|
31
31
|
} else if (method == 'transfer' || method == 'transferreject' || method == 'transferagree') {
|
|
32
32
|
// 发起转接或者邀请
|
|
33
33
|
json.event = 'IMVedio'
|
|
@@ -39,7 +39,7 @@ function callNimIM(method, json, callback) {
|
|
|
39
39
|
json.command = 'transfer_reject'
|
|
40
40
|
}
|
|
41
41
|
console.log('json', json)
|
|
42
|
-
sendMessage((json.distUserId + '@' + window.sessionStorage.getItem('
|
|
42
|
+
sendMessage((json.distUserId + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), (JSON.parse(window.sessionStorage.getItem('sigData')).account + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), 'chat', JSON.stringify(json))
|
|
43
43
|
}
|
|
44
44
|
// window.RemoteShellBridge.callNimIM(method, JSON.stringify(json), callId)
|
|
45
45
|
}
|
package/public/index.html
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
<meta charset="utf-8"/>
|
|
5
5
|
<link rel="shortcut icon" href="favicon.ico">
|
|
6
6
|
<meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport" />
|
|
7
|
+
<!-- // 强制Chromium内核,作用于360浏览器、QQ浏览器等国产双核浏览器: -->
|
|
8
|
+
<meta name="renderer" content="webkit"/>
|
|
9
|
+
<!-- // 强制Chromium内核,作用于其他双核浏览器: -->
|
|
10
|
+
<meta name="force-rendering" content="webkit"/>
|
|
11
|
+
<!-- // 如果有安装 Google Chrome Frame 插件则强制为Chromium内核,否则强制本机支持的最高版本IE内核,作用于IE浏览器: -->
|
|
12
|
+
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
|
|
7
13
|
<!-- <script src="/mrtc1.4.7/lib/tfjs.js"></script>
|
|
8
14
|
<script src="./mrtc1.4.7/lib/pix.js"></script>
|
|
9
15
|
<script src="./mrtc1.4.7/lib/log4b.js"></script>
|
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>,
|