2024-01-18 10:46:33 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="roomFooter">
|
|
|
|
|
<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>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { startVideo, stopVideo, destructionRoom } from '@/api/room.js'
|
|
|
|
|
export default {
|
|
|
|
|
name: 'Footer',
|
|
|
|
|
// props: [
|
|
|
|
|
// "roomId"
|
|
|
|
|
// ],
|
|
|
|
|
components: {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
roomId: null,
|
|
|
|
|
taskId: null,
|
2024-03-05 11:51:02 +08:00
|
|
|
roleFlag: true,
|
2024-01-20 17:32:07 +08:00
|
|
|
caseId:""
|
2024-01-18 10:46:33 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 解散房间
|
|
|
|
|
destructionRoomFn(data) {
|
|
|
|
|
destructionRoom(data).then(res => {
|
|
|
|
|
console.log(res, "解散房间");
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
exitRoom() {
|
|
|
|
|
if (this.roleFlag) {
|
|
|
|
|
this.stopVideoFn();
|
|
|
|
|
this.destructionRoomFn({ roomId: this.roomId })
|
|
|
|
|
this.$emit('exitRoom');
|
|
|
|
|
} else {
|
|
|
|
|
this.$emit('exitRoom');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async startVideoFn() {
|
|
|
|
|
await startVideo({
|
2024-01-20 17:32:07 +08:00
|
|
|
caseId: this.caseId,
|
2024-01-18 10:46:33 +08:00
|
|
|
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");
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
async mounted() {
|
|
|
|
|
this.roomId = this.$route.query.roomId;
|
2024-01-20 17:32:07 +08:00
|
|
|
this.caseId = this.$route.query.caseId;
|
2024-01-18 10:46:33 +08:00
|
|
|
let roleFlag = this.$route.query.flag;
|
|
|
|
|
this.roleFlag = roleFlag;
|
|
|
|
|
if (roleFlag) {
|
|
|
|
|
await this.startVideoFn();
|
|
|
|
|
}
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// console.log(this.roomId, "房间号房间哈房间号房间哈房间号");
|
|
|
|
|
// });
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.roomFooter {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row-reverse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mic,
|
|
|
|
|
.video,
|
|
|
|
|
.record,
|
|
|
|
|
.outRoom {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
width: 10%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.iconImg {
|
|
|
|
|
width: 30%;
|
|
|
|
|
height: 60%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
color: aliceblue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.empty {
|
|
|
|
|
width: 60%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|