|
@@ -1,14 +1,17 @@
|
|
<template>
|
|
<template>
|
|
<div class="live">
|
|
<div class="live">
|
|
- <div>
|
|
|
|
|
|
+ <!--顶部-->
|
|
|
|
+ <div class="live-top">
|
|
<div class="live-page-title">直播间</div>
|
|
<div class="live-page-title">直播间</div>
|
|
<div class="live-desc">{{ roomData.desc }}</div>
|
|
<div class="live-desc">{{ roomData.desc }}</div>
|
|
<div class="live-info">
|
|
<div class="live-info">
|
|
<span class="live-name">{{ roomData.name }}</span>
|
|
<span class="live-name">{{ roomData.name }}</span>
|
|
- <el-button @click="stopLive">下课</el-button>
|
|
|
|
|
|
+ <el-button @click="stopLive">结束直播</el-button>
|
|
|
|
+ <!-- <el-button @click="startLive">开启直播</el-button> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="live-container">
|
|
<div class="live-container">
|
|
|
|
+ <!--左侧-->
|
|
<div class="live-container-left">
|
|
<div class="live-container-left">
|
|
<div id="draw-parent">
|
|
<div id="draw-parent">
|
|
<div v-show="isDrawSetting" class="draw-setting">
|
|
<div v-show="isDrawSetting" class="draw-setting">
|
|
@@ -31,30 +34,6 @@
|
|
</div>
|
|
</div>
|
|
<div class="button-group">
|
|
<div class="button-group">
|
|
<div>
|
|
<div>
|
|
- <el-dropdown placement="top" @command="invite">
|
|
|
|
- <el-button>语音连麦</el-button>
|
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
|
- <el-dropdown-item
|
|
|
|
- v-for="item in roomContext.onlineUsers"
|
|
|
|
- :key="item.id"
|
|
|
|
- :command="item.uid"
|
|
|
|
- >
|
|
|
|
- {{ item.name }}
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- </el-dropdown-menu>
|
|
|
|
- </el-dropdown>
|
|
|
|
- <el-dropdown placement="top" @command="invite">
|
|
|
|
- <el-button>视屏连麦</el-button>
|
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
|
- <el-dropdown-item
|
|
|
|
- v-for="item in roomContext.onlineUsers"
|
|
|
|
- :key="item.id"
|
|
|
|
- :command="item.uid"
|
|
|
|
- >
|
|
|
|
- {{ item.name }}
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- </el-dropdown-menu>
|
|
|
|
- </el-dropdown>
|
|
|
|
<!-- <el-button>群组讨论</el-button>
|
|
<!-- <el-button>群组讨论</el-button>
|
|
<el-button>推送课件</el-button> -->
|
|
<el-button>推送课件</el-button> -->
|
|
<el-button @click="showDrawSetting">屏幕画笔</el-button>
|
|
<el-button @click="showDrawSetting">屏幕画笔</el-button>
|
|
@@ -88,12 +67,32 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!--右侧-->
|
|
<div class="live-container-right">
|
|
<div class="live-container-right">
|
|
<div class="live-teacher-lens">
|
|
<div class="live-teacher-lens">
|
|
<div id="live"></div>
|
|
<div id="live"></div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="student-list">
|
|
|
|
+ <ul>
|
|
|
|
+ <li v-for="item in student_list" :key="item.room_user_id">
|
|
|
|
+ <div class="student-list-left">
|
|
|
|
+ <el-avatar icon="el-icon-user" size="small" :src="item.student_image_url" />
|
|
|
|
+ <span class="name">{{ item.student_name }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="student-list-right">
|
|
|
|
+ <svg-icon
|
|
|
|
+ v-if="userType === 'TEACHER'"
|
|
|
|
+ icon-class="video"
|
|
|
|
+ @click="invite(item.room_user_id)"
|
|
|
|
+ />
|
|
|
|
+ <span @click="handsDown(item.room_user_id)">下麦</span>
|
|
|
|
+ </div>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div id="student" style="width: 300px; height: 200px"></div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -105,6 +104,7 @@ export default {
|
|
name: 'Live',
|
|
name: 'Live',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ userType: this.$store.state.user.user_type,
|
|
task_id: this.$route.query.task_id,
|
|
task_id: this.$route.query.task_id,
|
|
rtc: null,
|
|
rtc: null,
|
|
roomData: {
|
|
roomData: {
|
|
@@ -143,6 +143,7 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.downloadWebSDK();
|
|
this.downloadWebSDK();
|
|
|
|
+ this.getLiveRoomStudentList();
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
document.addEventListener(
|
|
document.addEventListener(
|
|
@@ -237,6 +238,10 @@ export default {
|
|
common.stopLive();
|
|
common.stopLive();
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ startLive() {
|
|
|
|
+ common.startLive();
|
|
|
|
+ },
|
|
|
|
+
|
|
// 推送桌面共享
|
|
// 推送桌面共享
|
|
publishShareStream() {
|
|
publishShareStream() {
|
|
common.publishShareStream();
|
|
common.publishShareStream();
|
|
@@ -247,10 +252,17 @@ export default {
|
|
this.rtc.unPubShareStream();
|
|
this.rtc.unPubShareStream();
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 老师邀请学生上麦
|
|
invite(uid) {
|
|
invite(uid) {
|
|
common.invite(uid);
|
|
common.invite(uid);
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 下麦
|
|
|
|
+ handsDown(uid) {
|
|
|
|
+ common.handsDown(uid);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 发消息
|
|
sendMsg() {
|
|
sendMsg() {
|
|
common.sendMsg(this.msg);
|
|
common.sendMsg(this.msg);
|
|
this.msg = '';
|
|
this.msg = '';
|
|
@@ -278,7 +290,7 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
getLiveRoomStudentList() {
|
|
getLiveRoomStudentList() {
|
|
- GetLiveRoomStudentList(this.task_id).then(({ student_list }) => {
|
|
|
|
|
|
+ GetLiveRoomStudentList({ task_id: this.task_id }).then(({ student_list }) => {
|
|
this.student_list = student_list;
|
|
this.student_list = student_list;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -317,12 +329,11 @@ export default {
|
|
margin-top: 17px;
|
|
margin-top: 17px;
|
|
|
|
|
|
&-left {
|
|
&-left {
|
|
- width: 661px;
|
|
|
|
- margin-right: 18px;
|
|
|
|
|
|
+ width: 832px;
|
|
|
|
|
|
#draw-parent {
|
|
#draw-parent {
|
|
width: 100%;
|
|
width: 100%;
|
|
- height: 331px;
|
|
|
|
|
|
+ height: 468px;
|
|
margin-bottom: 14px;
|
|
margin-bottom: 14px;
|
|
border: 1px solid #ccc;
|
|
border: 1px solid #ccc;
|
|
position: relative;
|
|
position: relative;
|
|
@@ -448,8 +459,42 @@ export default {
|
|
|
|
|
|
&-right {
|
|
&-right {
|
|
#live {
|
|
#live {
|
|
- width: 321px;
|
|
|
|
- height: 91px;
|
|
|
|
|
|
+ width: 352px;
|
|
|
|
+ height: 198px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .student-list {
|
|
|
|
+ width: 100%;
|
|
|
|
+ padding: 24px;
|
|
|
|
+ margin-top: 2px;
|
|
|
|
+ height: calc(100% - 200px);
|
|
|
|
+ background-color: #2c2c2c;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ color: #fff;
|
|
|
|
+
|
|
|
|
+ li {
|
|
|
|
+ display: flex;
|
|
|
|
+
|
|
|
|
+ .student-list-left {
|
|
|
|
+ flex: 8;
|
|
|
|
+
|
|
|
|
+ .name {
|
|
|
|
+ vertical-align: super;
|
|
|
|
+ margin-left: 8px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .student-list-right {
|
|
|
|
+ flex: 2;
|
|
|
|
+
|
|
|
|
+ .svg-icon {
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ margin-top: 7px;
|
|
|
|
+ margin-right: 8px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|