|
|
@@ -7,7 +7,9 @@
|
|
7
|
7
|
<el-form-item>
|
|
8
|
8
|
<el-input placeholder="请输入房间号" v-model="enterRoomFrom.roomId">
|
|
9
|
9
|
<template slot="append">
|
|
10
|
|
- <el-button type="primary" @click="enterRoom" icon="el-icon-right">进入</el-button>
|
|
|
10
|
+ <el-button type="primary" @click="enterRoom" icon="el-icon-right"
|
|
|
11
|
+ >进入</el-button
|
|
|
12
|
+ >
|
|
11
|
13
|
</template>
|
|
12
|
14
|
</el-input>
|
|
13
|
15
|
</el-form-item>
|
|
|
@@ -17,7 +19,7 @@
|
|
17
|
19
|
</template>
|
|
18
|
20
|
|
|
19
|
21
|
<script>
|
|
20
|
|
-import { reserveConferenceList } from "@/api/home.js";
|
|
|
22
|
+import { reserveConferenceList, getEncryptInfoByid } from "@/api/home.js";
|
|
21
|
23
|
import TRTC from "trtc-sdk-v5";
|
|
22
|
24
|
let trtc = null;
|
|
23
|
25
|
export default {
|
|
|
@@ -31,10 +33,17 @@ export default {
|
|
31
|
33
|
userCode: null,
|
|
32
|
34
|
caseId: null,
|
|
33
|
35
|
roleFlag: false,
|
|
34
|
|
- token:""
|
|
|
36
|
+ token: "",
|
|
|
37
|
+ queryObj: {},
|
|
35
|
38
|
};
|
|
36
|
39
|
},
|
|
37
|
40
|
methods: {
|
|
|
41
|
+ /**获取链接参数 */
|
|
|
42
|
+ async getEncryptInfoByidFn(data) {
|
|
|
43
|
+ await getEncryptInfoByid(data).then((res) => {
|
|
|
44
|
+ this.queryObj = res;
|
|
|
45
|
+ });
|
|
|
46
|
+ },
|
|
38
|
47
|
async enterRoom() {
|
|
39
|
48
|
// if (this.roomId != this.enterRoomFrom.roomId) {
|
|
40
|
49
|
// this.$message({
|
|
|
@@ -51,35 +60,44 @@ export default {
|
|
51
|
60
|
flag: this.roleFlag,
|
|
52
|
61
|
caseId: this.caseId,
|
|
53
|
62
|
id: this.userCode,
|
|
54
|
|
- token: this.token
|
|
55
|
|
- }
|
|
|
63
|
+ token: this.token,
|
|
|
64
|
+ },
|
|
56
|
65
|
});
|
|
57
|
66
|
},
|
|
58
|
67
|
submitRoom() {
|
|
59
|
|
- this.$refs["formLabelAlign"].validate(valid => {});
|
|
|
68
|
+ this.$refs["formLabelAlign"].validate((valid) => {});
|
|
60
|
69
|
},
|
|
61
|
70
|
// 根据案件id查询主持人信息
|
|
62
|
71
|
async reserveConferenceListFn(data) {
|
|
63
|
|
- await reserveConferenceList(data).then(res => {
|
|
|
72
|
+ await reserveConferenceList(data).then((res) => {
|
|
64
|
73
|
if (res.data.length >= 1) {
|
|
65
|
74
|
if (this.userCode == res.data[0].userId) {
|
|
66
|
75
|
this.roleFlag = true;
|
|
67
|
76
|
} else {
|
|
68
|
77
|
this.roleFlag = false;
|
|
69
|
78
|
}
|
|
70
|
|
- }else{
|
|
|
79
|
+ } else {
|
|
71
|
80
|
this.roleFlag = false;
|
|
72
|
81
|
}
|
|
73
|
82
|
});
|
|
74
|
|
- }
|
|
|
83
|
+ },
|
|
75
|
84
|
},
|
|
76
|
85
|
async mounted() {
|
|
77
|
86
|
let routeParams = this.$route.query;
|
|
78
|
|
- this.userId = routeParams.name;
|
|
79
|
|
- this.roomId = routeParams.roomId;
|
|
80
|
|
- this.userCode = routeParams.userId;
|
|
81
|
|
- this.caseId = routeParams.id;
|
|
82
|
|
- this.token = routeParams.token;
|
|
|
87
|
+ await this.getEncryptInfoByidFn(routeParams.authId);
|
|
|
88
|
+ if (routeParams.authId) {
|
|
|
89
|
+ this.userId = this.queryObj.userName;
|
|
|
90
|
+ this.roomId = this.queryObj.roomId;
|
|
|
91
|
+ this.userCode = this.queryObj.userId;
|
|
|
92
|
+ this.caseId = this.queryObj.caseId;
|
|
|
93
|
+ this.token = this.queryObj.token;
|
|
|
94
|
+ } else {
|
|
|
95
|
+ this.userId = routeParams.name;
|
|
|
96
|
+ this.roomId = routeParams.roomId;
|
|
|
97
|
+ this.userCode = routeParams.userId;
|
|
|
98
|
+ this.caseId = routeParams.id;
|
|
|
99
|
+ this.token = routeParams.token;
|
|
|
100
|
+ }
|
|
83
|
101
|
if (this.caseId) {
|
|
84
|
102
|
await this.reserveConferenceListFn(this.caseId);
|
|
85
|
103
|
await this.enterRoom();
|
|
|
@@ -87,10 +105,10 @@ export default {
|
|
87
|
105
|
trtc = TRTC.create();
|
|
88
|
106
|
const config = {
|
|
89
|
107
|
view: document.getElementById("video"),
|
|
90
|
|
- publish: false
|
|
|
108
|
+ publish: false,
|
|
91
|
109
|
};
|
|
92
|
110
|
await trtc.startLocalVideo(config);
|
|
93
|
|
- }
|
|
|
111
|
+ },
|
|
94
|
112
|
};
|
|
95
|
113
|
</script>
|
|
96
|
114
|
|