仲裁视频会议H5

roomFooter.vue 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div class="roomFooter">
  3. <div class="outRoom">
  4. <el-button type="danger" @click="exitRoom" v-if="!roleFlag">退出房间</el-button>
  5. <el-button type="danger" @click="exitRoom" v-if="roleFlag">解散房间</el-button>
  6. </div>
  7. <div class="operation">
  8. <div class="mic">
  9. <img class="micImg" src="@/assets/mic_on.png" alt="" v-if="micFlag" @click="micClickOn" />
  10. <img class="micImg" src="@/assets/mic_off.png" alt="" v-else @click="micClickOff" />
  11. </div>
  12. <div class="video">
  13. <img class="videoImg" src="@/assets/video_on.png" alt="" v-if="videoFlag" @click="videoClickOn" />
  14. <img class="videoImg" src="@/assets/video_off.png" alt="" v-else @click="videoClickOff" />
  15. </div>
  16. <div class="sharing">
  17. <img class="sharImg" src="@/assets/screenShare_on.png" alt="" v-if="sharFlag" @click="sharClickOn" />
  18. <img class="sharImg" src="@/assets/screenShare_off.png" alt="" v-else @click="sharClickOff" />
  19. </div>
  20. <div class="mediationPop">
  21. <el-button type="warning" @click="mediationPop">调解</el-button>
  22. </div>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. import { startVideo, stopVideo, destructionRoom } from "@/api/room.js";
  28. export default {
  29. name: "Footer",
  30. props: ["micFlag", "videoFlag", "sharFlag"],
  31. components: {},
  32. data() {
  33. return {
  34. roomId: null,
  35. taskId: null,
  36. roleFlag: true,
  37. caseId: "",
  38. };
  39. },
  40. methods: {
  41. // 解散房间
  42. destructionRoomFn(data) {
  43. destructionRoom(data).then((res) => {
  44. console.log(res, "解散房间");
  45. });
  46. },
  47. /**开启麦克风 */
  48. micClickOn() {
  49. this.$emit("micClickOn");
  50. },
  51. /**关闭麦克风 */
  52. micClickOff() {
  53. this.$emit("micClickOff");
  54. },
  55. /**开启摄像头 */
  56. videoClickOn() {
  57. this.$emit("videoClickOn");
  58. },
  59. /**关闭摄像头 */
  60. videoClickOff() {
  61. this.$emit("videoClickOff");
  62. },
  63. /**共享屏幕 */
  64. sharClickOn() {
  65. this.$emit("sharClickOn");
  66. },
  67. /**关闭共享屏幕 */
  68. sharClickOff() {
  69. this.sharFlag = true;
  70. this.$emit("sharClickOff");
  71. },
  72. // 弹出调解内容
  73. mediationPop() {
  74. this.$emit("mediationPop");
  75. },
  76. exitRoom() {
  77. if (this.roleFlag) {
  78. this.stopVideoFn();
  79. this.destructionRoomFn({ roomId: this.roomId });
  80. this.$emit("exitRoom");
  81. } else {
  82. this.$emit("exitRoom");
  83. }
  84. },
  85. async startVideoFn() {
  86. await startVideo({
  87. caseId: this.caseId,
  88. roomId: this.roomId,
  89. }).then((res) => {
  90. this.taskId = res.data.taskId;
  91. console.log(res.data.taskId, "pppppp");
  92. });
  93. },
  94. stopVideoFn() {
  95. stopVideo(this.taskId).then((res) => {
  96. console.log(res, "KKKKKK");
  97. });
  98. },
  99. },
  100. async mounted() {
  101. this.roomId = this.$route.query.roomId;
  102. this.caseId = this.$route.query.caseId;
  103. let roleFlag = this.$route.query.flag;
  104. this.roleFlag = roleFlag || false;
  105. if (roleFlag) {
  106. await this.startVideoFn();
  107. }
  108. // setTimeout(() => {
  109. // console.log(this.roomId, "房间号房间哈房间号房间哈房间号");
  110. // });
  111. },
  112. };
  113. </script>
  114. <style scoped>
  115. .roomFooter {
  116. width: 100%;
  117. height: 100%;
  118. display: flex;
  119. flex-direction: row-reverse;
  120. }
  121. .mic,
  122. .video,
  123. .sharing,
  124. .outRoom {
  125. cursor: pointer;
  126. width: 10%;
  127. height: 100%;
  128. display: flex;
  129. align-items: center;
  130. justify-content: center;
  131. }
  132. .operation {
  133. width: 90%;
  134. height: 100%;
  135. display: flex;
  136. align-items: center;
  137. }
  138. .iconImg {
  139. width: 30%;
  140. height: 60%;
  141. }
  142. .title {
  143. color: aliceblue;
  144. }
  145. .empty {
  146. width: 60%;
  147. height: 100%;
  148. }
  149. .mic,
  150. .video,
  151. .sharing {
  152. width: 60px;
  153. height: 60px;
  154. margin-left: 20px;
  155. }
  156. .mediationPop {
  157. margin-left: 20px;
  158. }
  159. .micImg,
  160. .videoImg,
  161. .sharImg {
  162. width: 40px;
  163. height: 40px;
  164. }
  165. </style>