|
@@ -41,23 +41,16 @@
|
|
|
</div>
|
|
|
<div class="button-group">
|
|
|
<div class="button-group-left">
|
|
|
- <span v-if="userType === 'TEACHER'" @click="publishShareStream">
|
|
|
+ <span v-if="userType === 'TEACHER'" title="屏幕共享" @click="publishShareStream">
|
|
|
<svg-icon icon-class="share" />
|
|
|
</span>
|
|
|
- <span v-if="userType === 'TEACHER'" @click="showDrawSetting">
|
|
|
- <svg-icon icon-class="draw"></svg-icon>
|
|
|
+ <span v-if="userType === 'TEACHER'" title="白板" @click="showDrawSetting">
|
|
|
+ <svg-icon icon-class="draw" />
|
|
|
</span>
|
|
|
- <span v-if="userType === 'TEACHER'">
|
|
|
- <svg-icon icon-class="push"></svg-icon>
|
|
|
+ <span v-if="userType === 'TEACHER'" title="课件推送" @click="dialogVisible = true">
|
|
|
+ <svg-icon icon-class="push" />
|
|
|
</span>
|
|
|
</div>
|
|
|
- <!-- <el-button>群组讨论</el-button>
|
|
|
- <el-button>推送课件</el-button> -->
|
|
|
- <!-- <el-button @click="showDrawSetting">屏幕画笔</el-button>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-button @click="publishShareStream">共享屏幕</el-button>
|
|
|
- </div> -->
|
|
|
<div class="button-group-right"></div>
|
|
|
</div>
|
|
|
<div class="live-container-left-chat">
|
|
@@ -112,20 +105,64 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 推送资料 -->
|
|
|
+ <select-material
|
|
|
+ v-if="userType === 'TEACHER'"
|
|
|
+ :dialog-visible="dialogVisible"
|
|
|
+ :task-id="task_id"
|
|
|
+ @dialogClose="dialogClose"
|
|
|
+ @dialogPush="dialogPush"
|
|
|
+ />
|
|
|
+
|
|
|
+ <complete-list
|
|
|
+ v-if="userType === 'TEACHER'"
|
|
|
+ :task-id="task_id"
|
|
|
+ :dialog-visible-complete="dialogVisibleComplete"
|
|
|
+ @dialogCompleteClose="dialogCompleteClose"
|
|
|
+ />
|
|
|
+
|
|
|
+ <cur-material
|
|
|
+ v-if="userType === 'STUDENT'"
|
|
|
+ :dialog-visible-material="dialogVisibleMaterial"
|
|
|
+ :material-id="material_id"
|
|
|
+ :material-name="material_name"
|
|
|
+ :material-type="material_type"
|
|
|
+ :material-picture-url="material_picture_url"
|
|
|
+ @dialogMaterialClose="dialogMaterialClose"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { GetLiveRoomStudentList, StudentExitLiveRoom } from '@/api/live';
|
|
|
+import { GetLiveRoomStudentList, StudentExitLiveRoom, GetCurMaterialSent } from '@/api/live';
|
|
|
+import SelectMaterial from '@/components/live/SelectMaterial.vue';
|
|
|
+import CurMaterial from '@/components/live/CurMaterial.vue';
|
|
|
+import CompleteList from './CompleteList.vue';
|
|
|
import * as common from './live';
|
|
|
|
|
|
export default {
|
|
|
name: 'Live',
|
|
|
+ components: {
|
|
|
+ SelectMaterial,
|
|
|
+ CurMaterial,
|
|
|
+ CompleteList
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
userType: this.$store.state.user.user_type,
|
|
|
task_id: this.$route.query.task_id,
|
|
|
connection: false,
|
|
|
+ dialogVisible: false,
|
|
|
+ dialogVisibleMaterial: false,
|
|
|
+ material_id: '',
|
|
|
+ material_name: '',
|
|
|
+ material_type: '',
|
|
|
+ material_picture_url: '',
|
|
|
+ // 学员完成
|
|
|
+ dialogVisibleComplete: false,
|
|
|
+ // 定时器
|
|
|
+ timer: null,
|
|
|
rtc: null,
|
|
|
roomData: {
|
|
|
desc: '直播间标题',
|
|
@@ -187,9 +224,9 @@ export default {
|
|
|
},
|
|
|
true
|
|
|
);
|
|
|
- },
|
|
|
- beforeDestroy() {
|
|
|
- // document.querySelector('script[src="https://image.csslcloud.net/js/dpc.js"]').remove();
|
|
|
+ if (this.userType === 'STUDENT') {
|
|
|
+ this.getCurMaterialSent();
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
// 加载直播所需 SDK,加载完成后才能初始化
|
|
@@ -337,6 +374,41 @@ export default {
|
|
|
|
|
|
publishStream() {
|
|
|
common.publishStream('main');
|
|
|
+ },
|
|
|
+
|
|
|
+ dialogClose() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ dialogPush() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.dialogVisibleComplete = true;
|
|
|
+ },
|
|
|
+
|
|
|
+ dialogMaterialClose() {
|
|
|
+ this.dialogVisibleMaterial = false;
|
|
|
+ this.getCurMaterialSent();
|
|
|
+ },
|
|
|
+
|
|
|
+ dialogCompleteClose() {
|
|
|
+ this.dialogVisibleComplete = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ getCurMaterialSent() {
|
|
|
+ const timer = setInterval(() => {
|
|
|
+ GetCurMaterialSent({ task_id: this.task_id }).then(
|
|
|
+ ({ material_id, material_name, material_type, material_picture_url }) => {
|
|
|
+ if (material_id !== undefined && material_id.length > 0) {
|
|
|
+ this.dialogVisibleMaterial = true;
|
|
|
+ this.material_id = material_id;
|
|
|
+ this.material_name = material_name;
|
|
|
+ this.material_type = material_type;
|
|
|
+ this.material_picture_url = material_picture_url;
|
|
|
+ clearInterval(timer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }, 2000);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -398,6 +470,7 @@ $live-bc: #3d3938;
|
|
|
border: 1px solid #ccc;
|
|
|
position: relative;
|
|
|
background-color: $live-bc;
|
|
|
+ overflow: hidden;
|
|
|
|
|
|
// 设置屏幕画笔
|
|
|
.draw-setting {
|
|
@@ -479,7 +552,6 @@ $live-bc: #3d3938;
|
|
|
height: 48px;
|
|
|
background-color: #4d4d4d;
|
|
|
padding: 0 15px;
|
|
|
- border-bottom-right-radius: 5px;
|
|
|
border-bottom-left-radius: 5px;
|
|
|
|
|
|
.svg-icon {
|
|
@@ -593,17 +665,8 @@ $live-bc: #3d3938;
|
|
|
}
|
|
|
|
|
|
.el-button {
|
|
|
- background-color: #ececec;
|
|
|
- border-radius: 8px;
|
|
|
+ border-radius: 4px;
|
|
|
padding: 7px 12px;
|
|
|
}
|
|
|
-
|
|
|
- .el-dropdown + .el-dropdown {
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
-
|
|
|
- .el-dropdown + .el-button {
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|