Files
Arbitrate-FrontendH5/src/views/components/roomFooter.vue
T

176 lines
3.8 KiB
Vue
Raw Normal View History

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