hanchaobo 2 лет назад
Родитель
Сommit
fc3bebb4b4
3 измененных файлов: 103 добавлений и 27 удалений
  1. 1
    1
      src/views/components/footerPhone.vue
  2. 100
    24
      src/views/room.vue
  3. 2
    2
      src/views/test.vue

+ 1
- 1
src/views/components/footerPhone.vue Просмотреть файл

@@ -73,7 +73,7 @@ export default {
73 73
     async mounted() {
74 74
         this.roomId = this.$route.query.roomId;
75 75
         let roleFlag = this.$route.query.flag;
76
-        this.roleFlag = roleFlag;
76
+        this.roleFlag = roleFlag || false;
77 77
         if (roleFlag) {
78 78
             await this.startVideoFn();
79 79
         }

+ 100
- 24
src/views/room.vue Просмотреть файл

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="page">
3
-    <div class="iconImg">
4
-      <i class="el-icon-d-arrow-left"></i>
3
+    <div class="iconImg" v-if="!modileFlag && rightType" @click="checkList(1)">
4
+      <i class="el-icon-d-arrow-left" style="font-size: 30px;color: aqua;"></i>
5 5
       <!-- <i class="el-icon-d-arrow-right"></i> -->
6 6
     </div>
7 7
     <div class="roompage" @mouseover="mouseHover" v-if="modileFlag">
@@ -27,17 +27,22 @@
27 27
           :videoFlag="videoFlag" :sharFlag="sharFlag"></roomFooter>
28 28
       </div>
29 29
     </div>
30
-    <div class="roomPhone" v-if="!modileFlag">
31
-      <div class="bodyPhone">
32
-        <div :class="userClassPhone" id="localStream">
33
-          <div class="userNamePhone">{{ userId }}</div>
30
+    <div class="roomPhone">
31
+      <div class="videoPage">
32
+        <div :class="sharingType">
34 33
         </div>
35
-        <div :class="userClassPhone" v-for="(item, index) in userList" :key="index" :id="item">
36
-          <div class="userNamePhone">{{ item }}</div>
34
+        <div :class="bodyPhoneType">
35
+          <div :class="userClassPhone" id="localStream">
36
+            <div class="userNamePhone">{{ userId }}</div>
37
+          </div>
38
+          <div :class="userClassPhone" v-for="(item, index) in userList" :key="index" :id="item">
39
+            <div class="userNamePhone">{{ item }}</div>
40
+          </div>
41
+          <i class="el-icon-d-arrow-right" style="font-size: 30px;color: aqua;" @click="checkList(2)" v-if="!rightType"></i>
42
+        </div>
43
+        <div class="footerPhone">
44
+          <roomFooterPhone @exitRoom="exitRoom"></roomFooterPhone>
37 45
         </div>
38
-      </div>
39
-      <div class="footerPhone">
40
-        <roomFooterPhone @exitRoom="exitRoom"></roomFooterPhone>
41 46
       </div>
42 47
       <!-- <div class="header">
43 48
         <roomFooterPhone @exitRoom="exitRoom"></roomFooterPhone>
@@ -162,12 +167,15 @@ export default {
162 167
   },
163 168
   data() {
164 169
     return {
170
+      rightType:true,
171
+      sharingType: "sharing",
172
+      bodyPhoneType: "bodyPhone",
165 173
       videoList: "videoList",
166 174
       videoClass: "videoItem",
167 175
       resFlag: null,
168 176
       appFlag: null,
169 177
       userClassPhone: "userVideoPhone",
170
-      userList: [1,2,3,4,5],
178
+      userList: [1, 2],
171 179
       userHeight: "100%",
172 180
       userPhoneHeight: "92%",
173 181
       userSign: "",
@@ -236,6 +244,22 @@ export default {
236 244
     UploadUrl() {
237 245
       return window.location.origin + "/tjformal/video/upload";
238 246
     },
247
+    /**移动端点击换出/隐藏视频列表 */
248
+    checkList(data) {
249
+      if (data == 1) {
250
+        if (this.userList.length < 1) {
251
+          this.userClassPhone = "userVideoPhone2"
252
+        }
253
+        this.sharingType = "sharing1";
254
+        this.bodyPhoneType = "bodyPhone1";
255
+        this.rightType = false;
256
+      } else if (data == 2) {
257
+        console.log("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUu");
258
+        this.sharingType = "sharing1";
259
+        this.bodyPhoneType = "bodyPhone2";
260
+        this.rightType = true;
261
+      }
262
+    },
239 263
     /**点击开启麦克风图标,关闭麦克风 */
240 264
     micClickOn() {
241 265
       trtc.updateLocalAudio({ mute: true }).then(() => {
@@ -740,13 +764,15 @@ export default {
740 764
 </script>
741 765
 
742 766
 <style scoped>
743
-.iconImg{
767
+.iconImg {
744 768
   position: fixed;
745
-  top: 50%;
769
+  z-index: 9999;
770
+  top: 40%;
746 771
   height: 40px;
747 772
   width: 40px;
748
-  /* right: 10px; */
773
+  right: 0px;
749 774
 }
775
+
750 776
 .roompage {
751 777
   width: 100%;
752 778
   height: 100vh;
@@ -884,14 +910,15 @@ export default {
884 910
 .roomPhone {
885 911
   width: 100%;
886 912
   height: 100vh;
887
-  background-color: yellow;
888 913
 }
889
-.footerPhone{
914
+
915
+.footerPhone {
890 916
   width: 100%;
891 917
   height: 8%;
892 918
   background-color: greenyellow;
893 919
 }
894
-.bodyPhone{
920
+
921
+.bodyPhone {
895 922
   width: 100%;
896 923
   height: 92%;
897 924
   display: flex;
@@ -899,7 +926,31 @@ export default {
899 926
   flex-wrap: wrap;
900 927
   align-items: center;
901 928
   overflow-y: scroll;
902
-  background-color: rebeccapurple;
929
+}
930
+
931
+.bodyPhone1 {
932
+  width: 40%;
933
+  height: 92%;
934
+  position: absolute;
935
+  right: 0;
936
+  top: 0;
937
+  display: flex;
938
+  justify-content: space-around;
939
+  flex-wrap: wrap;
940
+  align-items: center;
941
+  overflow-y: scroll;
942
+}
943
+.bodyPhone2{
944
+  width: 0;
945
+  height: 0;
946
+  position: absolute;
947
+  right: 0;
948
+  top: 0;
949
+  display: flex;
950
+  justify-content: space-around;
951
+  flex-wrap: wrap;
952
+  align-items: center;
953
+  overflow-y: scroll;
903 954
 }
904 955
 /* 移动端样式 */
905 956
 
@@ -914,19 +965,21 @@ export default {
914 965
 .userVideoPhone {
915 966
   width: 100%;
916 967
   height: 100%;
917
-  background-color: yellow;
968
+  background-color: rgb(124, 124, 104);
918 969
   position: relative;
919 970
 }
920
-.userVideoPhone1{
971
+
972
+.userVideoPhone1 {
921 973
   width: 100%;
922 974
   height: 49%;
923
-  background-color: rgb(43, 0, 255);
975
+  background-color: rgb(161, 160, 169);
924 976
   position: relative;
925 977
 }
926
-.userVideoPhone2{
978
+
979
+.userVideoPhone2 {
927 980
   width: 150px;
928 981
   height: 150px;
929
-  background-color: rgb(43, 0, 255);
982
+  background-color: rgb(161, 160, 169);
930 983
   position: relative;
931 984
 }
932 985
 
@@ -958,4 +1011,27 @@ export default {
958 1011
   margin-bottom: 10px;
959 1012
   color: #38393b;
960 1013
 }
1014
+
1015
+.videoPage {
1016
+  width: 100%;
1017
+  height: 100vh;
1018
+}
1019
+
1020
+.sharing1 {
1021
+  width: 100%;
1022
+  height: 92%;
1023
+  background: yellow;
1024
+}
1025
+
1026
+.sharing {
1027
+  width: 0;
1028
+  height: 0;
1029
+}
1030
+
1031
+.el-icon-d-arrow-right {
1032
+  position: absolute;
1033
+  left: 0;
1034
+  top: 45%;
1035
+  z-index: 999;
1036
+}
961 1037
 </style>

+ 2
- 2
src/views/test.vue Просмотреть файл

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="page">
3 3
     <div class="content">
4
-      <div class="screenShare" v-if="screenShareFlag"></div>
4
+      <div class="screenShare"></div>
5 5
       <div :class="videoList">
6 6
         <div :class="videoClass" v-for="(item, index) in vivdeoList"></div>
7 7
       </div>
@@ -27,7 +27,7 @@ export default {
27 27
   methods: {
28 28
     screenShare() {
29 29
       this.videoList = "videoList1";
30
-      this.screenShareFlag = true;
30
+      // this.screenShareFlag = true;
31 31
       this.videoClass = "videoItem2";
32 32
     },
33 33
     screenShareQ(){