react_hsbc_teller 0.7.1 → 0.7.5
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/pages/index.jsx +1 -2
- package/packages/pages/video/video.jsx +208 -67
- package/packages/pages/video/video.less +14 -0
- package/packages/utils/cell.js +2 -2
- package/src/index.js +2 -2
package/package.json
CHANGED
package/packages/pages/index.jsx
CHANGED
|
@@ -10,7 +10,7 @@ class Main extends Component {
|
|
|
10
10
|
zh: {},
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
// 获取语言包
|
|
15
15
|
updateLanguage = async () => {
|
|
16
16
|
let res = await API.selectLang()
|
|
@@ -32,7 +32,6 @@ class Main extends Component {
|
|
|
32
32
|
// console.log(JSON.parse(localStorage.getItem("langData")))
|
|
33
33
|
this.updateLanguage()
|
|
34
34
|
}
|
|
35
|
-
|
|
36
35
|
render() {
|
|
37
36
|
const lang = this.props.lang
|
|
38
37
|
|
|
@@ -30,8 +30,14 @@ const LEAVE_TYPE = {
|
|
|
30
30
|
let pictureInPictureVideo = ''
|
|
31
31
|
@injectIntl
|
|
32
32
|
class Video extends Component {
|
|
33
|
+
constructor(props) {
|
|
34
|
+
super(props)
|
|
35
|
+
// this.cancel = axios.CancelToken.source()
|
|
36
|
+
}
|
|
37
|
+
cancel = axios.CancelToken.source()
|
|
33
38
|
signCanvas = React.createRef();
|
|
34
39
|
state = {
|
|
40
|
+
sessionType: true,
|
|
35
41
|
isWhiteboard: false,
|
|
36
42
|
isSelect: '',
|
|
37
43
|
loading: false,
|
|
@@ -43,6 +49,7 @@ class Video extends Component {
|
|
|
43
49
|
employeeNumber: '',
|
|
44
50
|
employeeName: '',
|
|
45
51
|
isModalVisibleInvitation: false,
|
|
52
|
+
linkData: '',
|
|
46
53
|
roomCustomerList: [],
|
|
47
54
|
facialImg: '',
|
|
48
55
|
isModalVisibleFacial: false,
|
|
@@ -106,7 +113,8 @@ class Video extends Component {
|
|
|
106
113
|
cameraValue: '',
|
|
107
114
|
microphoneValue: '',
|
|
108
115
|
imStatus: false,
|
|
109
|
-
imJoinRoom: false
|
|
116
|
+
imJoinRoom: false,
|
|
117
|
+
analyserData: new Map(),
|
|
110
118
|
};
|
|
111
119
|
// eslint-disable-next-line no-undef
|
|
112
120
|
test_controller = '';
|
|
@@ -156,6 +164,9 @@ class Video extends Component {
|
|
|
156
164
|
})
|
|
157
165
|
} catch (err) {
|
|
158
166
|
console.error(err);
|
|
167
|
+
this.setState({
|
|
168
|
+
sessionType: false
|
|
169
|
+
})
|
|
159
170
|
this.props.createRoomCallback({
|
|
160
171
|
type: 2,
|
|
161
172
|
errorManage: '保存房间信息失败',
|
|
@@ -533,7 +544,12 @@ class Video extends Component {
|
|
|
533
544
|
}
|
|
534
545
|
};
|
|
535
546
|
endSessionValue = () => {
|
|
536
|
-
this.
|
|
547
|
+
if(this.state.sessionType) {
|
|
548
|
+
this.test_controller.LeaveRoom()
|
|
549
|
+
} else {
|
|
550
|
+
this.finishSession()
|
|
551
|
+
}
|
|
552
|
+
|
|
537
553
|
};
|
|
538
554
|
// 画中画
|
|
539
555
|
pictureInPicture = () => {
|
|
@@ -546,80 +562,93 @@ class Video extends Component {
|
|
|
546
562
|
if (document.getElementById('video1').name) {
|
|
547
563
|
list.push({
|
|
548
564
|
name: 'video1',
|
|
549
|
-
title: this.state.videoOneName
|
|
565
|
+
title: this.state.videoOneName,
|
|
566
|
+
voice: 'voiceVideoOne'
|
|
550
567
|
})
|
|
551
568
|
}
|
|
552
569
|
if (document.getElementById('publish_video1').name) {
|
|
553
570
|
list.push({
|
|
554
571
|
name: 'publish_video1',
|
|
555
|
-
title: '坐席'
|
|
572
|
+
title: this.props.meetingInfo.host ? this.props.meetingInfo.host : '坐席',
|
|
573
|
+
voice: 'voiceStatue'
|
|
556
574
|
})
|
|
557
575
|
}
|
|
558
576
|
if (document.getElementById('video2').name) {
|
|
559
577
|
list.push({
|
|
560
578
|
name: 'video2',
|
|
561
|
-
title: this.state.videoTwoName
|
|
579
|
+
title: this.state.videoTwoName,
|
|
580
|
+
voice: 'voiceVideoTwo'
|
|
562
581
|
})
|
|
563
582
|
}
|
|
564
583
|
if (document.getElementById('video3').name) {
|
|
565
584
|
list.push({
|
|
566
585
|
name: 'video3',
|
|
567
|
-
title: this.state.videoThreeName
|
|
586
|
+
title: this.state.videoThreeName,
|
|
587
|
+
voice: 'voiceVideoThree'
|
|
568
588
|
})
|
|
569
589
|
}
|
|
570
590
|
if (document.getElementById('video4').name) {
|
|
571
591
|
list.push({
|
|
572
592
|
name: 'video4',
|
|
573
|
-
title: this.state.videoFourName
|
|
593
|
+
title: this.state.videoFourName,
|
|
594
|
+
voice: 'voiceVideoFour'
|
|
574
595
|
})
|
|
575
596
|
}
|
|
576
597
|
if (document.getElementById('video5').name) {
|
|
577
598
|
list.push({
|
|
578
599
|
name: 'video5',
|
|
579
|
-
title: this.state.videoFiveName
|
|
600
|
+
title: this.state.videoFiveName,
|
|
601
|
+
voice: 'voiceVideoFive'
|
|
580
602
|
})
|
|
581
603
|
}
|
|
582
604
|
if (document.getElementById('video6').name) {
|
|
583
605
|
list.push({
|
|
584
606
|
name: 'video6',
|
|
585
|
-
title: this.state.videoSixName
|
|
607
|
+
title: this.state.videoSixName,
|
|
608
|
+
voice: 'voiceVideoSix'
|
|
586
609
|
})
|
|
587
610
|
}
|
|
588
611
|
|
|
589
612
|
if (document.getElementById('video7').name) {
|
|
590
613
|
list.push({
|
|
591
614
|
name: 'video7',
|
|
592
|
-
title: this.state.videoSevenName
|
|
615
|
+
title: this.state.videoSevenName,
|
|
616
|
+
voice: 'voiceVideoSeven'
|
|
593
617
|
})
|
|
594
618
|
}
|
|
595
619
|
if (document.getElementById('video8').name) {
|
|
596
620
|
list.push({
|
|
597
621
|
name: 'video8',
|
|
598
|
-
title: this.state.videoEightName
|
|
622
|
+
title: this.state.videoEightName,
|
|
623
|
+
voice: 'voiceVideoEight'
|
|
599
624
|
})
|
|
600
625
|
}
|
|
601
626
|
if (document.getElementById('video9').name) {
|
|
602
627
|
list.push({
|
|
603
628
|
name: 'video9',
|
|
604
|
-
title: this.state.videoNineName
|
|
629
|
+
title: this.state.videoNineName,
|
|
630
|
+
voice: 'voiceVideoNine'
|
|
605
631
|
})
|
|
606
632
|
}
|
|
607
633
|
if (document.getElementById('video10').name) {
|
|
608
634
|
list.push({
|
|
609
635
|
name: 'video10',
|
|
610
|
-
title: this.state.videoTenName
|
|
636
|
+
title: this.state.videoTenName,
|
|
637
|
+
voice: 'voiceVideoTen'
|
|
611
638
|
})
|
|
612
639
|
}
|
|
613
640
|
if (document.getElementById('video11').name) {
|
|
614
641
|
list.push({
|
|
615
642
|
name: 'video11',
|
|
616
|
-
title: this.state.videoElevenName
|
|
643
|
+
title: this.state.videoElevenName,
|
|
644
|
+
voice: 'voiceVideoEleven'
|
|
617
645
|
})
|
|
618
646
|
}
|
|
619
647
|
if (document.getElementById('video12').name) {
|
|
620
648
|
list.push({
|
|
621
649
|
name: 'video12',
|
|
622
|
-
title: this.state.videoTwelveName
|
|
650
|
+
title: this.state.videoTwelveName,
|
|
651
|
+
voice: 'voiceVideoTwelve'
|
|
623
652
|
})
|
|
624
653
|
}
|
|
625
654
|
console.log(list)
|
|
@@ -631,7 +660,7 @@ class Video extends Component {
|
|
|
631
660
|
canvas.height = height;
|
|
632
661
|
|
|
633
662
|
interval = setInterval(() => {
|
|
634
|
-
cobj.clearRect(0, 0, width, height);
|
|
663
|
+
// cobj.clearRect(0, 0, width, height);
|
|
635
664
|
for (let i = 0; i < list.length; i++) {
|
|
636
665
|
|
|
637
666
|
let videoId = list[i].name;
|
|
@@ -655,20 +684,20 @@ class Video extends Component {
|
|
|
655
684
|
cobj.stroke();
|
|
656
685
|
cobj.beginPath();
|
|
657
686
|
cobj.font = "28px auto";
|
|
658
|
-
cobj.textAlign = '
|
|
687
|
+
cobj.textAlign = 'left';
|
|
659
688
|
cobj.lineWidth = 1;
|
|
660
689
|
// 文字
|
|
661
690
|
let str = list[i].title
|
|
662
691
|
for (let k = 0; k < str.length; k++){
|
|
663
692
|
// console.log(str.substring(0,k+1))
|
|
664
693
|
// console.log(cobj.measureText(str.substring(0,k+1)).width)
|
|
665
|
-
if (cobj.measureText(str.substring(0,k+1)).width>
|
|
694
|
+
if (cobj.measureText(str.substring(0,k+1)).width>210){
|
|
666
695
|
str = str.substring(0,k-2)
|
|
667
696
|
str += '...'
|
|
668
697
|
break;
|
|
669
698
|
}
|
|
670
699
|
}
|
|
671
|
-
cobj.strokeText(str,
|
|
700
|
+
cobj.strokeText(str, 70, 360 * (i + 1) - 20);
|
|
672
701
|
cobj.stroke();
|
|
673
702
|
//左边框
|
|
674
703
|
cobj.beginPath();
|
|
@@ -706,44 +735,60 @@ class Video extends Component {
|
|
|
706
735
|
cobj.lineWidth = 5; //线的边框为10像素
|
|
707
736
|
cobj.strokeStyle = '#d9363e';
|
|
708
737
|
cobj.stroke(); //绘制定义的图形
|
|
738
|
+
|
|
739
|
+
// 绘制话筒图标
|
|
740
|
+
let microphoneSize = 50
|
|
741
|
+
var img = document.getElementById("icon_huatong");
|
|
742
|
+
var img1 = document.getElementById("icon_huatong_close");
|
|
743
|
+
if(this.state[list[i].voice]) {
|
|
744
|
+
cobj.drawImage(img1, 10, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
|
|
745
|
+
} else {
|
|
746
|
+
cobj.drawImage(img, 10, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
|
|
747
|
+
|
|
748
|
+
// 绘制实时音量
|
|
749
|
+
let sid = document.getElementById(list[i].name).name
|
|
750
|
+
let analyser = this.state.analyserData.get(sid)
|
|
751
|
+
aou(analyser)
|
|
752
|
+
// let sid = document.getElementById(list[i].name).name
|
|
753
|
+
// let stream = this.test_controller.GetMediaInfo(sid).audio_
|
|
754
|
+
// let acc = new AudioContext()
|
|
755
|
+
// let mic = acc.createMediaStreamSource(stream)
|
|
756
|
+
// let analyser = acc.createAnalyser()
|
|
757
|
+
// analyser.fftSize = 256
|
|
758
|
+
// mic.connect(analyser)
|
|
759
|
+
// aou(analyser)
|
|
760
|
+
// let microphoneSize = 50
|
|
761
|
+
// var img = document.getElementById("icon_huatong");
|
|
762
|
+
// cobj.drawImage(img, 600, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
|
|
763
|
+
function aou(analyser){
|
|
764
|
+
let dataArray = new Uint8Array(analyser.frequencyBinCount);
|
|
765
|
+
analyser.getByteFrequencyData(dataArray);
|
|
766
|
+
let step = Math.round(dataArray.length / 60); //采样步长
|
|
767
|
+
// 以画布左上角为坐标原点
|
|
768
|
+
let drawArea = {
|
|
769
|
+
x1: 28/50 * microphoneSize + 10, // 波动范围右下角的点坐标
|
|
770
|
+
y1: 25/50 * microphoneSize + 360 * (i + 1) - 60,
|
|
771
|
+
x2: 22/50 * microphoneSize + 10, // 波动范围左上角的点坐标
|
|
772
|
+
y2: 10/50 * microphoneSize + 360 * (i + 1) - 60,
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
for (var j = 0; j < 40; j++) {
|
|
777
|
+
let energy = (dataArray[step * j] / 256.0) * 80;
|
|
778
|
+
cobj.beginPath();
|
|
779
|
+
cobj.fillStyle = "#0AE544";
|
|
780
|
+
const { x1,y1,x2,y2} = drawArea
|
|
781
|
+
let width = x1-x2;
|
|
782
|
+
let height = (energy>20?(energy-20):0) * (y1 - y2 ) / 70
|
|
783
|
+
let startX = x2 // 绘制起始点x
|
|
784
|
+
let startY = y1 - height // 绘制起始点y
|
|
785
|
+
cobj.fillRect(startX, startY, width, height )
|
|
786
|
+
}
|
|
787
|
+
requestAnimationFrame(aou.bind(this, analyser));
|
|
709
788
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
// let mic = acc.createMediaStreamSource(stream)
|
|
714
|
-
// let analyser = acc.createAnalyser()
|
|
715
|
-
// analyser.fftSize = 256
|
|
716
|
-
// mic.connect(analyser)
|
|
717
|
-
// aou(analyser)
|
|
718
|
-
// let microphoneSize = this.props.microphoneSize
|
|
719
|
-
// var img = document.getElementById("icon_huatong");
|
|
720
|
-
// cobj.drawImage(img, 600, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
|
|
721
|
-
// function aou(analyser){
|
|
722
|
-
// let dataArray = new Uint8Array(analyser.frequencyBinCount);
|
|
723
|
-
// analyser.getByteFrequencyData(dataArray);
|
|
724
|
-
// let step = Math.round(dataArray.length / 60); //采样步长
|
|
725
|
-
// // 以画布左上角为坐标原点
|
|
726
|
-
// let drawArea = {
|
|
727
|
-
// x1: 28/50 * microphoneSize + 600, // 波动范围右下角的点坐标
|
|
728
|
-
// y1: 25/50 * microphoneSize + 360 * (i + 1) - 60,
|
|
729
|
-
// x2: 22/50 * microphoneSize + 600, // 波动范围左上角的点坐标
|
|
730
|
-
// y2: 10/50 * microphoneSize + 360 * (i + 1) - 60,
|
|
731
|
-
// }
|
|
732
|
-
|
|
733
|
-
// for (var j = 0; j < 40; j++) {
|
|
734
|
-
// let energy = (dataArray[step * j] / 256.0) * 80;
|
|
735
|
-
// cobj.beginPath();
|
|
736
|
-
// cobj.fillStyle = "#0AE544";
|
|
737
|
-
// const { x1,y1,x2,y2} = drawArea
|
|
738
|
-
// let width = x1-x2;
|
|
739
|
-
// let height = (energy>20?(energy-20):0) * (y1 - y2 ) / 70
|
|
740
|
-
// let startX = x2 // 绘制起始点x
|
|
741
|
-
// let startY = y1 - height // 绘制起始点y
|
|
742
|
-
// cobj.fillRect(startX, startY, width, height )
|
|
743
|
-
// }
|
|
744
|
-
// requestAnimationFrame(aou.bind(this, analyser));
|
|
745
|
-
|
|
746
|
-
// }
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
747
792
|
}
|
|
748
793
|
}, 100);
|
|
749
794
|
const captureStream = canvas.captureStream();
|
|
@@ -1045,6 +1090,9 @@ class Video extends Component {
|
|
|
1045
1090
|
window.IMOpenfire = msg =>{
|
|
1046
1091
|
console.log('im登录', msg)
|
|
1047
1092
|
if(!msg) {
|
|
1093
|
+
this.setState({
|
|
1094
|
+
sessionType: false
|
|
1095
|
+
})
|
|
1048
1096
|
this.roomCallBack(2, 'im建立连接失败',-7)
|
|
1049
1097
|
} else {
|
|
1050
1098
|
this.setState({
|
|
@@ -1080,6 +1128,7 @@ class Video extends Component {
|
|
|
1080
1128
|
console.log('deviceId' + devicesInfo[i].deviceId);
|
|
1081
1129
|
|
|
1082
1130
|
b.actionid = devicesInfo[i].deviceId;
|
|
1131
|
+
b.groupId = devicesInfo[i].groupId;
|
|
1083
1132
|
if (
|
|
1084
1133
|
devicesInfo[i].label === '' ||
|
|
1085
1134
|
devicesInfo[i].label === undefined ||
|
|
@@ -1093,6 +1142,7 @@ class Video extends Component {
|
|
|
1093
1142
|
} else if (devicesInfo[i].kind === 'audioinput') {
|
|
1094
1143
|
// 麦克风
|
|
1095
1144
|
b.actionid = devicesInfo[i].deviceId;
|
|
1145
|
+
b.groupId = devicesInfo[i].groupId;
|
|
1096
1146
|
if (
|
|
1097
1147
|
devicesInfo[i].label === '' ||
|
|
1098
1148
|
devicesInfo[i].label === undefined ||
|
|
@@ -1106,6 +1156,7 @@ class Video extends Component {
|
|
|
1106
1156
|
} else if (devicesInfo[i].kind === 'audiooutput') {
|
|
1107
1157
|
// 喇叭
|
|
1108
1158
|
b.actionid = devicesInfo[i].deviceId;
|
|
1159
|
+
b.groupId = devicesInfo[i].groupId;
|
|
1109
1160
|
if (
|
|
1110
1161
|
devicesInfo[i].label === '' ||
|
|
1111
1162
|
devicesInfo[i].label === undefined ||
|
|
@@ -1118,12 +1169,36 @@ class Video extends Component {
|
|
|
1118
1169
|
obj2.push(b)
|
|
1119
1170
|
}
|
|
1120
1171
|
}
|
|
1172
|
+
const objList = []
|
|
1173
|
+
const arr = {}
|
|
1174
|
+
const objList1 = []
|
|
1175
|
+
const arr1 = {}
|
|
1176
|
+
const objList2 = []
|
|
1177
|
+
const arr2 = {}
|
|
1178
|
+
for(var i =0; i<obj.length; i++){
|
|
1179
|
+
if(!arr[obj[i].groupId]){
|
|
1180
|
+
objList.push(obj[i]);
|
|
1181
|
+
arr[obj[i].groupId] = true;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
for(var i =0; i<obj1.length; i++){
|
|
1185
|
+
if(!arr1[obj1[i].groupId]){
|
|
1186
|
+
objList1.push(obj1[i]);
|
|
1187
|
+
arr1[obj1[i].groupId] = true;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
for(var i =0; i<obj2.length; i++){
|
|
1191
|
+
if(!arr2[obj2[i].groupId]){
|
|
1192
|
+
objList2.push(obj2[i]);
|
|
1193
|
+
arr2[obj2[i].groupId] = true;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1121
1196
|
this.setState({
|
|
1122
|
-
cameraList:
|
|
1123
|
-
microphoneList:
|
|
1124
|
-
speakerList:
|
|
1197
|
+
cameraList: objList,
|
|
1198
|
+
microphoneList: objList1,
|
|
1199
|
+
speakerList: [objList2[0]]
|
|
1125
1200
|
})
|
|
1126
|
-
if (!this.state.appId) {
|
|
1201
|
+
if (!this.state.appId && this.state.sessionType) {
|
|
1127
1202
|
this.mpaasSig(data);
|
|
1128
1203
|
this.setState({
|
|
1129
1204
|
cameraValue: obj[0].actionid,
|
|
@@ -1139,6 +1214,9 @@ class Video extends Component {
|
|
|
1139
1214
|
// 获取设备失败
|
|
1140
1215
|
this.test_controller.OnGetDevicesFailed = (code, msg) => {
|
|
1141
1216
|
console.log('获取设备失败', code, msg)
|
|
1217
|
+
this.setState({
|
|
1218
|
+
sessionType: false
|
|
1219
|
+
})
|
|
1142
1220
|
this.messageClick('获取设备失败,请检查摄像头设备是否可用或是否禁用摄像头','error')
|
|
1143
1221
|
this.roomCallBack(2, '获取设备失败',-1)
|
|
1144
1222
|
};
|
|
@@ -1149,6 +1227,9 @@ class Video extends Component {
|
|
|
1149
1227
|
};
|
|
1150
1228
|
this.test_controller.OnConnectFailed = (code, msg) => {
|
|
1151
1229
|
console.log('建立连接失败', code, msg)
|
|
1230
|
+
this.setState({
|
|
1231
|
+
sessionType: false
|
|
1232
|
+
})
|
|
1152
1233
|
this.roomCallBack(2, '连接失败',-2)
|
|
1153
1234
|
};
|
|
1154
1235
|
// 断开连接回调
|
|
@@ -1163,6 +1244,9 @@ class Video extends Component {
|
|
|
1163
1244
|
// 初始化房间失败
|
|
1164
1245
|
this.test_controller.OnInitRoomConfigFail = (err_code, err_msg) => {
|
|
1165
1246
|
console.log('初始化房间失败', err_code, err_msg)
|
|
1247
|
+
this.setState({
|
|
1248
|
+
sessionType: false
|
|
1249
|
+
})
|
|
1166
1250
|
this.roomCallBack(2, '初始化失败',-3)
|
|
1167
1251
|
};
|
|
1168
1252
|
// 初始化成功回调
|
|
@@ -1189,6 +1273,9 @@ class Video extends Component {
|
|
|
1189
1273
|
// 创建房间失败
|
|
1190
1274
|
this.test_controller.OnCreateRoomFailed = (err_code, err_msg) => {
|
|
1191
1275
|
console.log('创建房间失败', err_code, err_msg)
|
|
1276
|
+
this.setState({
|
|
1277
|
+
sessionType: false
|
|
1278
|
+
})
|
|
1192
1279
|
this.roomCallBack(2, '创建房间失败',-4)
|
|
1193
1280
|
};
|
|
1194
1281
|
// 初始化⾳视频成功
|
|
@@ -1211,6 +1298,9 @@ class Video extends Component {
|
|
|
1211
1298
|
// 加入房间失败
|
|
1212
1299
|
this.test_controller.OnJoinRoomFailed = (err_code, err_msg) => {
|
|
1213
1300
|
console.log('加入房间失败', err_code, err_msg)
|
|
1301
|
+
this.setState({
|
|
1302
|
+
sessionType: false
|
|
1303
|
+
})
|
|
1214
1304
|
this.roomCallBack(2, '加入失败',-5)
|
|
1215
1305
|
};
|
|
1216
1306
|
// 发布媒体流成功
|
|
@@ -1231,6 +1321,9 @@ class Video extends Component {
|
|
|
1231
1321
|
// 发布媒体流失败
|
|
1232
1322
|
this.test_controller.OnPublishFailed = (sid, err_code, err_msg) => {
|
|
1233
1323
|
console.log('发布媒体流失败', sid, err_code, err_msg)
|
|
1324
|
+
this.setState({
|
|
1325
|
+
sessionType: false
|
|
1326
|
+
})
|
|
1234
1327
|
this.roomCallBack(2, '发布失败',-6)
|
|
1235
1328
|
};
|
|
1236
1329
|
// 订阅媒体流成功
|
|
@@ -1412,6 +1505,21 @@ class Video extends Component {
|
|
|
1412
1505
|
// 推送“有新发布”给与会者
|
|
1413
1506
|
this.test_controller.OnNewPublish = (feed) => {
|
|
1414
1507
|
console.log('有新发布者', feed);
|
|
1508
|
+
// callNimIM('sendChatMsg', {
|
|
1509
|
+
// customId: feed.uid,
|
|
1510
|
+
// content: JSON.stringify({
|
|
1511
|
+
// 'typeId': 1014,
|
|
1512
|
+
// 'sessionId': this.state.sessionId,
|
|
1513
|
+
// 'meetingInfo': {
|
|
1514
|
+
// 'title': this.props.meetingInfo.title,
|
|
1515
|
+
// 'host': this.props.meetingInfo.host,
|
|
1516
|
+
// 'customers': this.props.meetingInfo.customers
|
|
1517
|
+
// }
|
|
1518
|
+
|
|
1519
|
+
// })
|
|
1520
|
+
// }, function (code, message, data) {
|
|
1521
|
+
// })
|
|
1522
|
+
|
|
1415
1523
|
callNimIM('sendCustomCmdMsg', {
|
|
1416
1524
|
customId: this.state.imRoomId,
|
|
1417
1525
|
content: JSON.stringify({
|
|
@@ -1767,6 +1875,7 @@ class Video extends Component {
|
|
|
1767
1875
|
exitType
|
|
1768
1876
|
) => {
|
|
1769
1877
|
console.log('退出房间者', participant, exitType)
|
|
1878
|
+
this.messageClick(this.props.customLeaveRoom,'error')
|
|
1770
1879
|
};
|
|
1771
1880
|
// 弱网回调
|
|
1772
1881
|
this.test_controller.OnNetworkWeak = (bpsSend, bpsRecv, sid) => {
|
|
@@ -2038,6 +2147,11 @@ class Video extends Component {
|
|
|
2038
2147
|
ctx.fillRect(startX, startY, width, height)
|
|
2039
2148
|
}
|
|
2040
2149
|
requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser));
|
|
2150
|
+
|
|
2151
|
+
this.state.analyserData.set(sid, analyser)
|
|
2152
|
+
this.setState({
|
|
2153
|
+
analyserData: this.state.analyserData
|
|
2154
|
+
})
|
|
2041
2155
|
}
|
|
2042
2156
|
// 停止共享
|
|
2043
2157
|
this.test_controller.OnDesktopDisplayClosed = () => {
|
|
@@ -2072,7 +2186,7 @@ class Video extends Component {
|
|
|
2072
2186
|
finishSession = async () => {
|
|
2073
2187
|
|
|
2074
2188
|
|
|
2075
|
-
if (this.state.roomCustomerList.length == 0) {
|
|
2189
|
+
if (this.state.roomCustomerList.length == 0 && this.state.sessionType) {
|
|
2076
2190
|
try {
|
|
2077
2191
|
let result = await API.finishSession({
|
|
2078
2192
|
sessionId: this.state.sessionId,
|
|
@@ -2086,7 +2200,8 @@ class Video extends Component {
|
|
|
2086
2200
|
isWhiteboard: false,
|
|
2087
2201
|
isPictureInPicture: false,
|
|
2088
2202
|
imStatus: false,
|
|
2089
|
-
imJoinRoom: false
|
|
2203
|
+
imJoinRoom: false,
|
|
2204
|
+
sessionType: true
|
|
2090
2205
|
});
|
|
2091
2206
|
this.props.onLeaveRoom({
|
|
2092
2207
|
code: LEAVE_TYPE.TELLER_EXIT,
|
|
@@ -2123,8 +2238,12 @@ class Video extends Component {
|
|
|
2123
2238
|
axios.get(this.props.resourcePath + "/beauty/beauty.js")
|
|
2124
2239
|
.then(response => this.addToScriptClick()).catch(function (error) {
|
|
2125
2240
|
console.log(error);
|
|
2241
|
+
this.setState({
|
|
2242
|
+
sessionType: false
|
|
2243
|
+
})
|
|
2126
2244
|
this.roomCallBack(2, '创建房间失败',-4)
|
|
2127
2245
|
|
|
2246
|
+
|
|
2128
2247
|
})
|
|
2129
2248
|
|
|
2130
2249
|
}
|
|
@@ -2195,6 +2314,12 @@ class Video extends Component {
|
|
|
2195
2314
|
}
|
|
2196
2315
|
}
|
|
2197
2316
|
}
|
|
2317
|
+
componentWillUnmount() {
|
|
2318
|
+
this.setState = (state, callback) => {
|
|
2319
|
+
return
|
|
2320
|
+
}
|
|
2321
|
+
this.cancel = ''
|
|
2322
|
+
}
|
|
2198
2323
|
componentWillMount() {
|
|
2199
2324
|
if (this.props.sessionId) {
|
|
2200
2325
|
this.getRoomStatus({
|
|
@@ -2513,7 +2638,8 @@ class Video extends Component {
|
|
|
2513
2638
|
isModalVisibleInvitation: true,
|
|
2514
2639
|
employeeNumber: '',
|
|
2515
2640
|
employeeName: '',
|
|
2516
|
-
employeeError: ''
|
|
2641
|
+
employeeError: '',
|
|
2642
|
+
linkData: ''
|
|
2517
2643
|
})
|
|
2518
2644
|
|
|
2519
2645
|
}
|
|
@@ -2710,6 +2836,11 @@ class Video extends Component {
|
|
|
2710
2836
|
employeeName: result.data.staffName,
|
|
2711
2837
|
employeeError: result.data.staffName ? '' : '查无此人',
|
|
2712
2838
|
})
|
|
2839
|
+
if(result.data.staffName){
|
|
2840
|
+
this.setState({
|
|
2841
|
+
linkData:'https://wp-staff-gateway.wealth-platform.uat.ali.cloud.cn.hsbc/meeting-ui/OHB/CN/HSBC?chnlID=OHB&locale=zh_CN&chnlCC=CN&chnlGMC=HSBC&targetFunc=supervisorMeeting&sourceFunc=rmMeeting&appointmentID='+ this.props.businessNumber + '&staffID='+this.state.employeeNumber+'&staffName='+ encodeURIComponent(result.data.staffName)
|
|
2842
|
+
})
|
|
2843
|
+
}
|
|
2713
2844
|
} else {
|
|
2714
2845
|
this.messageClick('查询失败','error')
|
|
2715
2846
|
}
|
|
@@ -2976,11 +3107,11 @@ class Video extends Component {
|
|
|
2976
3107
|
<label className='labelClass'>{meetingInfo.title}</label>
|
|
2977
3108
|
</li>
|
|
2978
3109
|
<li>
|
|
2979
|
-
<span
|
|
3110
|
+
<span>客户经理:</span>
|
|
2980
3111
|
<label className='labelClass'>{meetingInfo.host}</label>
|
|
2981
3112
|
</li>
|
|
2982
3113
|
<li>
|
|
2983
|
-
<span
|
|
3114
|
+
<span>参会者:</span>
|
|
2984
3115
|
{customerNameList}
|
|
2985
3116
|
</li>
|
|
2986
3117
|
</ul>
|
|
@@ -3014,7 +3145,7 @@ class Video extends Component {
|
|
|
3014
3145
|
/>
|
|
3015
3146
|
}
|
|
3016
3147
|
<canvas style={{ display: (!this.state.voiceStatue) ? '' : 'none',width: '25px',height:'25px',marginTop: '4px' }} className="canvasClass" id="publish_volumeView" width="40" height="70"></canvas>
|
|
3017
|
-
<div className='titleName' style={{ color: this.props.titleColor, fontSize: this.props.fontSize + 'px', fontFamily: this.props.fontFamily }}
|
|
3148
|
+
<div className='titleName' style={{ color: this.props.titleColor, fontSize: this.props.fontSize + 'px', fontFamily: this.props.fontFamily }}>{this.props.meetingInfo.host ? this.props.meetingInfo.host : '坐席'}</div>
|
|
3018
3149
|
</div>
|
|
3019
3150
|
</div>
|
|
3020
3151
|
|
|
@@ -3357,6 +3488,7 @@ class Video extends Component {
|
|
|
3357
3488
|
|
|
3358
3489
|
</div>
|
|
3359
3490
|
<img id="icon_huatong" style={{ display: 'none' }} src={require("../../assets/img/icon_huatong.png").default}></img>
|
|
3491
|
+
<img id="icon_huatong_close" style={{ display: 'none' }} src={require("../../assets/img/jingyin.png").default}></img>
|
|
3360
3492
|
</div>
|
|
3361
3493
|
</div>
|
|
3362
3494
|
<Foot
|
|
@@ -3422,7 +3554,12 @@ class Video extends Component {
|
|
|
3422
3554
|
<Modal className="modelClass" title="新增预约" closable={false} centered={true} visible={this.state.isModalVisibleInvitation} footer={[
|
|
3423
3555
|
<div key='invitation'>
|
|
3424
3556
|
<Button className="modelButtonCancel" onClick={this.handleCancelInvitation}>取消</Button>
|
|
3425
|
-
|
|
3557
|
+
{
|
|
3558
|
+
this.state.employeeName &&<Button className='modelButtonOk'type="primary" danger onClick={this.handleOkInvitation}>确定</Button>
|
|
3559
|
+
}
|
|
3560
|
+
{
|
|
3561
|
+
!this.state.employeeName &&<Button className='modelButtonCancelOne' type="primary" danger >确定</Button>
|
|
3562
|
+
}
|
|
3426
3563
|
</div>
|
|
3427
3564
|
]}>
|
|
3428
3565
|
<div>
|
|
@@ -3434,6 +3571,9 @@ class Video extends Component {
|
|
|
3434
3571
|
<div className="invitationDiv">
|
|
3435
3572
|
<span className="modalSpan"> 姓名:</span><span>{this.state.employeeName}</span>
|
|
3436
3573
|
</div>
|
|
3574
|
+
<div className='linkClass'>
|
|
3575
|
+
<span>{this.state.linkData}</span>
|
|
3576
|
+
</div>
|
|
3437
3577
|
</div>
|
|
3438
3578
|
{
|
|
3439
3579
|
this.state.employeeError && <div className='errorClassInvitation'>
|
|
@@ -3499,6 +3639,7 @@ Video.defaultProps = {
|
|
|
3499
3639
|
fontSize: '14',
|
|
3500
3640
|
fontFamily: 'auto',
|
|
3501
3641
|
menus: ['SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP'],
|
|
3642
|
+
customLeaveRoom: '客户离开房间',
|
|
3502
3643
|
meetingInfo: {
|
|
3503
3644
|
title: '测试',
|
|
3504
3645
|
host: 'wmz',
|
|
@@ -312,6 +312,15 @@
|
|
|
312
312
|
border: 1px #5C5C5C solid!important;
|
|
313
313
|
border-spacing: 20px!important;
|
|
314
314
|
}
|
|
315
|
+
.modelButtonCancelOne{
|
|
316
|
+
width: 100px!important;
|
|
317
|
+
height: 40px!important;
|
|
318
|
+
font-size: 16px!important;
|
|
319
|
+
color: #5C5C5C!important;
|
|
320
|
+
border: 1px #5C5C5C solid!important;
|
|
321
|
+
border-spacing: 20px!important;
|
|
322
|
+
background: #d9d9d9!important;
|
|
323
|
+
}
|
|
315
324
|
.modelButtonOk{
|
|
316
325
|
width: 100px!important;
|
|
317
326
|
height: 40px!important;
|
|
@@ -434,4 +443,9 @@
|
|
|
434
443
|
width: 18px;
|
|
435
444
|
height: 18px;
|
|
436
445
|
}
|
|
446
|
+
}
|
|
447
|
+
.linkClass{
|
|
448
|
+
margin: 20px 40px;
|
|
449
|
+
font-size: 14px;
|
|
450
|
+
word-break: break-all;
|
|
437
451
|
}
|
package/packages/utils/cell.js
CHANGED
|
@@ -24,8 +24,8 @@ function callNimIM(method, json, callback) {
|
|
|
24
24
|
const callId = _generateId()
|
|
25
25
|
|
|
26
26
|
callbackRegister.set(callId, fn)
|
|
27
|
-
if (method == '
|
|
28
|
-
sendMessage(json.
|
|
27
|
+
if (method == 'sendChatMsg') {
|
|
28
|
+
sendMessage(json.customId, (JSON.parse(window.sessionStorage.getItem('sigData')).account + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), 'chat', json.content)
|
|
29
29
|
} else if (method == 'sendCustomCmdMsg') {
|
|
30
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') {
|
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
|
-
|
|
6
|
-
import {HSBC} from "../packages";
|
|
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>,
|