瀏覽代碼

Merge branch 'master' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-FrontendH5

hanchaobo 2 年之前
父節點
當前提交
e09b87b053
共有 1 個文件被更改,包括 34 次插入16 次删除
  1. 34
    16
      src/components/homeh5.vue

+ 34
- 16
src/components/homeh5.vue 查看文件

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