2024-01-18 10:46:33 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="roomFooter">
|
2024-04-16 09:12:55 +08:00
|
|
|
<div class="outRoom">
|
|
|
|
|
<el-button type="danger" @click="exitRoom" v-if="!roleFlag">退出房间</el-button>
|
|
|
|
|
<el-button type="danger" @click="exitRoom" v-if="roleFlag">解散房间</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="operation">
|
|
|
|
|
<div class="mic">
|
|
|
|
|
<img class="micImg" src="@/assets/mic_on.png" alt="" v-if="micFlag" @click="micClickOn">
|
|
|
|
|
<img class="micImg" src="@/assets/mic_off.png" alt="" v-else @click="micClickOff">
|
2024-01-18 10:46:33 +08:00
|
|
|
</div>
|
2024-04-16 09:12:55 +08:00
|
|
|
<div class="video">
|
|
|
|
|
<img class="videoImg" src="@/assets/video_on.png" alt="" v-if="videoFlag" @click="videoClickOn">
|
|
|
|
|
<img class="videoImg" src="@/assets/video_off.png" alt="" v-else @click="videoClickOff">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sharing">
|
|
|
|
|
<img class="sharImg" src="@/assets/screenShare_on.png" alt="" v-if="sharFlag" @click="sharClickOn">
|
|
|
|
|
<img class="sharImg" src="@/assets/screenShare_off.png" alt="" v-else @click="sharClickOff">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-01-18 10:46:33 +08:00
|
|
|
</div>
|
2024-04-16 09:12:55 +08:00
|
|
|
</template>
|
2024-01-18 10:46:33 +08:00
|
|
|
|
2024-04-16 09:12:55 +08:00
|
|
|
<script>
|
|
|
|
|
import { startVideo, stopVideo, destructionRoom } from '@/api/room.js'
|
|
|
|
|
export default {
|
2024-01-18 10:46:33 +08:00
|
|
|
name: 'Footer',
|
|
|
|
|
// props: [
|
|
|
|
|
// "roomId"
|
|
|
|
|
// ],
|
|
|
|
|
components: {
|
2024-04-16 09:12:55 +08:00
|
|
|
|
2024-01-18 10:46:33 +08:00
|
|
|
},
|
|
|
|
|
data() {
|
2024-04-16 09:12:55 +08:00
|
|
|
return {
|
|
|
|
|
roomId: null,
|
|
|
|
|
taskId: null,
|
|
|
|
|
roleFlag: true,
|
|
|
|
|
caseId: "",
|
|
|
|
|
micFlag: true,
|
|
|
|
|
videoFlag: true,
|
|
|
|
|
sharFlag: true,
|
|
|
|
|
};
|
2024-01-18 10:46:33 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
2024-04-16 09:12:55 +08:00
|
|
|
// 解散房间
|
|
|
|
|
destructionRoomFn(data) {
|
|
|
|
|
destructionRoom(data).then(res => {
|
|
|
|
|
console.log(res, "解散房间");
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/**开启麦克风 */
|
|
|
|
|
micClickOn() {
|
|
|
|
|
this.micFlag = false;
|
|
|
|
|
this.$emit('micClickOn');
|
|
|
|
|
},
|
|
|
|
|
/**关闭麦克风 */
|
|
|
|
|
micClickOff() {
|
|
|
|
|
this.micFlag = true;
|
|
|
|
|
this.$emit('micClickOff');
|
|
|
|
|
},
|
|
|
|
|
/**开启摄像头 */
|
|
|
|
|
videoClickOn() {
|
|
|
|
|
this.videoFlag = false;
|
|
|
|
|
this.$emit('videoClickOn');
|
|
|
|
|
},
|
|
|
|
|
/**关闭摄像头 */
|
|
|
|
|
videoClickOff() {
|
|
|
|
|
this.videoFlag = true;
|
|
|
|
|
this.$emit('videoClickOff');
|
|
|
|
|
},
|
|
|
|
|
/**共享屏幕 */
|
|
|
|
|
sharClickOn(){
|
|
|
|
|
this.sharFlag = false;
|
|
|
|
|
this.$emit('sharClickOn');
|
|
|
|
|
},
|
|
|
|
|
/**关闭共享屏幕 */
|
|
|
|
|
sharClickOff(){
|
|
|
|
|
this.sharFlag = true;
|
|
|
|
|
this.$emit('sharClickOff');
|
|
|
|
|
},
|
|
|
|
|
exitRoom() {
|
|
|
|
|
if (this.roleFlag) {
|
|
|
|
|
this.stopVideoFn();
|
|
|
|
|
this.destructionRoomFn({ roomId: this.roomId })
|
|
|
|
|
this.$emit('exitRoom');
|
|
|
|
|
} else {
|
|
|
|
|
this.$emit('exitRoom');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async startVideoFn() {
|
|
|
|
|
await startVideo({
|
|
|
|
|
caseId: this.caseId,
|
|
|
|
|
roomId: this.roomId
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.taskId = res.data.taskId
|
|
|
|
|
console.log(res.data.taskId, "pppppp");
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
stopVideoFn() {
|
|
|
|
|
stopVideo(this.taskId).then(res => {
|
|
|
|
|
console.log(res, "KKKKKK");
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-01-18 10:46:33 +08:00
|
|
|
},
|
|
|
|
|
async mounted() {
|
2024-04-16 09:12:55 +08:00
|
|
|
this.roomId = this.$route.query.roomId;
|
|
|
|
|
this.caseId = this.$route.query.caseId;
|
|
|
|
|
let roleFlag = this.$route.query.flag;
|
|
|
|
|
this.roleFlag = roleFlag;
|
|
|
|
|
if (roleFlag) {
|
|
|
|
|
await this.startVideoFn();
|
|
|
|
|
}
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// console.log(this.roomId, "房间号房间哈房间号房间哈房间号");
|
|
|
|
|
// });
|
2024-01-18 10:46:33 +08:00
|
|
|
},
|
2024-04-16 09:12:55 +08:00
|
|
|
};
|
|
|
|
|
</script>
|
2024-01-18 10:46:33 +08:00
|
|
|
|
2024-04-16 09:12:55 +08:00
|
|
|
<style scoped>
|
|
|
|
|
.roomFooter {
|
2024-01-18 10:46:33 +08:00
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row-reverse;
|
2024-04-16 09:12:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mic,
|
|
|
|
|
.video,
|
|
|
|
|
.sharing,
|
|
|
|
|
.outRoom {
|
2024-01-18 10:46:33 +08:00
|
|
|
cursor: pointer;
|
|
|
|
|
width: 10%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2024-04-16 09:12:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.operation {
|
|
|
|
|
width: 90%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.iconImg {
|
2024-01-18 10:46:33 +08:00
|
|
|
width: 30%;
|
|
|
|
|
height: 60%;
|
2024-04-16 09:12:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title {
|
2024-01-18 10:46:33 +08:00
|
|
|
color: aliceblue;
|
2024-04-16 09:12:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.empty {
|
2024-01-18 10:46:33 +08:00
|
|
|
width: 60%;
|
|
|
|
|
height: 100%;
|
2024-04-16 09:12:55 +08:00
|
|
|
}
|
2024-01-18 10:46:33 +08:00
|
|
|
|
2024-04-16 09:12:55 +08:00
|
|
|
.mic,
|
|
|
|
|
.video,
|
|
|
|
|
.sharing {
|
|
|
|
|
width: 60px;
|
|
|
|
|
height: 60px;
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
}
|
2024-01-18 10:46:33 +08:00
|
|
|
|
2024-04-16 09:12:55 +08:00
|
|
|
.micImg,
|
|
|
|
|
.videoImg,
|
|
|
|
|
.sharImg {
|
|
|
|
|
width: 40px;
|
|
|
|
|
height: 40px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|