1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198 |
- <template>
- <div class="live">
- <!--顶部-->
- <div class="live-top">
- <div class="live-title">
- <div class="live-title-name">
- {{ roomInfo.course_name }} - {{ roomInfo.cs_item_name }} - {{ roomInfo.task_name }}
- </div>
- <div>
- <el-button v-if="!liveStat" @click="startLive">开启直播</el-button>
- <el-button v-if="liveStat" icon="el-icon-switch-button" @click="closeLiveRoom">
- 结束直播
- </el-button>
- <el-button v-if="liveStat" @click="reconnection">重连</el-button>
- <el-button @click="setDevice(true)">设置设备</el-button>
- </div>
- </div>
- </div>
- <!-- 主容器 -->
- <div class="live-container">
- <!-- 左侧 -->
- <div class="live-container-left">
- <div v-show="callLoading" class="loading">
- <div class="loading-wrapper">
- <el-avatar icon="el-icon-user" :src="connectStudent.student_image_url" />
- <p class="loading-title">
- 正在呼叫【{{ connectStudent.student_name }}】,等待对方接通...
- </p>
- <div>
- <el-button type="danger" circle @click="handsDown">
- <svg-icon icon-class="hang-up" />
- </el-button>
- </div>
- </div>
- </div>
- <div v-show="connect" class="student-parent">
- <div v-show="roomInfo.video_mode === 1 || remoteStreamType === 1" id="student"></div>
- <template v-if="remoteStreamType !== 1">
- <template v-if="roomInfo.video_mode === 1">
- <el-button type="danger" @click="handsDown">
- <svg-icon icon-class="hang-up" /> 挂断
- </el-button>
- </template>
- <template v-else>
- <div class="student-audio">
- <el-avatar icon="el-icon-user" :src="connectStudent.student_image_url" />
- <span class="connect-name">{{ connectStudent.student_name }}</span>
- <el-button type="danger" circle @click="handsDown">
- <svg-icon icon-class="hang-up" />
- </el-button>
- </div>
- </template>
- </template>
- </div>
- <div v-show="isDraw" id="draw-parent">
- <!-- 画笔设置 -->
- <div v-show="isDrawSetting" class="draw-setting">
- <span class="brush-shape" @click="drawChange('type', 2)">
- <svg-icon icon-class="brush-shape" />
- </span>
- <!-- 画笔颜色 -->
- <span
- v-for="item in drawColorList"
- :key="item"
- :class="['draw-color', item === curColor ? 'current' : '']"
- :style="{ 'background-color': item }"
- @click="drawChange('color', item)"
- />
- <span
- v-for="item in drawThicknessList"
- :key="item"
- class="draw-thickness"
- @click="drawChange('thickNess', item)"
- >
- <span :style="{ width: item * 2 + 'px', height: item * 2 + 'px' }"></span>
- </span>
- <span class="eraser" @click="drawChange('type', 9)">
- <svg-icon icon-class="back" />
- </span>
- <span class="eraser" @click="drawChange('type', 10)">
- <svg-icon icon-class="eraser" />
- </span>
- <span class="brush-clear" @click="drawChange('type', 0)">
- <svg-icon icon-class="clear" />
- </span>
- </div>
- </div>
- <div class="button-group">
- <div class="button-group-left">
- <span class="icon-button" @click="publishShareStream">
- <svg-icon icon-class="share" />
- </span>
- <span class="icon-button" @click="showDrawSetting">
- <svg-icon icon-class="draw" />
- </span>
- <span class="icon-button" @click="startGroup">
- <svg-icon icon-class="group" />
- </span>
- <span class="icon-button" @click="dialogVisible = true">
- <svg-icon icon-class="push" />
- </span>
- </div>
- <div class="button-group-right"></div>
- </div>
- </div>
- <!-- 右侧 -->
- <div class="live-container-right">
- <div class="live-teacher-lens">
- <div id="live" @mouseover="liveMenuShow = true" @mouseout="liveMenuShow = false"></div>
- <div :style="{ bottom: liveMenuShow ? '0' : '-40px' }" class="live-wrapper">
- <div class="live-wrapper-right">
- <span :style="{ color: netStatusColor }">{{ netStatus }}</span>
- </div>
- </div>
- <div class="live-operate">
- <div>{{ roomInfo.teacher_name }}</div>
- <div class="live-operate-icon">
- <svg-icon
- :icon-class="hasVideo ? 'camera-on-black' : 'camera-off-black'"
- @click="playOrPauseVideo"
- />
- <svg-icon
- :icon-class="hasAudio ? 'mike-on-black' : 'mike-off-black'"
- @click="playOrPauseAudio"
- />
- </div>
- </div>
- </div>
- <div class="live-container-right-chat">
- <div class="chat-top">
- <span>聊天</span>
- <label @click="chatBans">
- <input v-model="roomData.allow_chat" type="checkbox" class="allow-chat" />
- <span>禁言</span>
- </label>
- </div>
- <div class="chat-window">
- <ul ref="chat" class="chat-window-ul">
- <li v-for="(item, i) in chatList" :key="i">
- <div class="msg-normal">
- <span>{{ item.username }}: </span>
- <span>{{ item.msg }}</span>
- </div>
- </li>
- </ul>
- </div>
- <div class="chat-speak">
- <el-input
- v-model="msg"
- placeholder="输入发言"
- maxlength="400"
- @keydown.enter.native="sendMsg"
- >
- <el-button slot="append" @click="sendMsg">发送</el-button>
- </el-input>
- </div>
- </div>
- </div>
- </div>
- <!-- 学员列表 -->
- <div class="student-list">
- <div class="student-list-title">
- <span>学员列表({{ student_list.length }} / {{ roomInfo.student_count }})</span>
- </div>
- <div class="student-list-container">
- <ul>
- <li v-for="item in student_list" :key="item.room_user_id">
- <div class="li-top">
- <el-avatar icon="el-icon-user" :size="40" :src="item.student_image_url" />
- </div>
- <div class="li-bottom">
- <div class="name">{{ item.student_name }}</div>
- <div class="li-bottom-operate">
- <svg-icon
- v-if="item.connection_mode === 1 && item.connection_status !== 0"
- icon-class="hang-up-black"
- @click="handsDown(item.room_user_id)"
- />
- <svg-icon v-else icon-class="video" @click="invite(item, 1)" />
- <svg-icon
- v-if="item.connection_mode === 2 && item.connection_status !== 0"
- icon-class="hang-up-black"
- @click="handsDown(item.room_user_id)"
- />
- <svg-icon v-else icon-class="voice" @click="invite(item, 2)" />
- </div>
- </div>
- </li>
- </ul>
- </div>
- </div>
- <!-- 推送资料 -->
- <select-material
- :dialog-visible="dialogVisible"
- :task-id="task_id"
- @dialogClose="dialogClose"
- @dialogPush="dialogPush"
- />
- <!-- 教师查看当前完成列表 -->
- <complete-list
- :task-id="task_id"
- :dialog-visible-complete="dialogVisibleComplete"
- @dialogCompleteClose="dialogCompleteClose"
- />
- <select-device
- :dialog-visible-device="dialogVisibleDevice"
- :device="device"
- @dialogDeviceClose="dialogDeviceClose"
- />
- <el-dialog
- title="分组讨论组数"
- top="30vh"
- width="300px"
- class="dialog-group"
- :visible.sync="dialogVisibleGroup"
- :close-on-click-modal="false"
- >
- <el-select v-model="group_count">
- <el-option v-for="i in groupNumList" :key="i" :label="i" :value="i" />
- </el-select>
- <span slot="footer">
- <el-button size="small" @click="closeGroup">取 消</el-button>
- <el-button size="small" type="primary" @click="dialogGroup">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- GetLiveRoomStudentList,
- CloseLiveRoom,
- GetLiveRoomInfo,
- StudentExitLiveRoom,
- StartGroup,
- GetGroupStatus,
- DealStudentConnection,
- GetStudentInfo_Connection
- } from '@/api/live';
- import { app } from '@/store/mutation-types';
- import SelectMaterial from '@/components/live/SelectMaterial.vue';
- import CompleteList from './CompleteList.vue';
- import SelectDevice from '../SelectDevice.vue';
- import * as common from './live';
- export default {
- components: {
- SelectMaterial,
- CompleteList,
- SelectDevice
- },
- data() {
- return {
- task_id: this.$route.query.task_id,
- // 连麦
- connect: false,
- // 连线学员信息
- connectStudent: {},
- // 等待接通
- callLoading: false,
- dialogVisible: false,
- // 学员完成
- dialogVisibleComplete: false,
- // 定时器
- timer: null,
- remoteStreamType: -1,
- rtc: null,
- roomData: {
- desc: '直播间标题',
- name: '姓名',
- user: {
- id: '',
- name: '',
- role: 'talker',
- rommid: ''
- },
- max_users: 1,
- allow_chat: true,
- allow_audio: true,
- allow_speak: true
- },
- roomInfo: {
- room_id: '',
- video_mode: 1,
- task_name: '',
- cs_item_name: '',
- course_name: '',
- teacher_name: '',
- student_count: 0,
- student_connection_info: {}
- },
- loadedNumber: 0,
- speakData: {},
- roomContext: {},
- msg: '',
- chatList: [],
- isDrawSetting: false,
- curColor: '#343434',
- drawColorList: ['#FF4747', '#343434', '#628EFF', '#FFCA0E'],
- drawThicknessList: ['1', '3', '5'],
- // 直播间学员列表
- student_list: [],
- // 直播状态
- liveStat: false,
- liveMenuShow: false,
- // 分组讨论
- groupNumList: [],
- group_count: 1,
- // 网络整体情况
- netStatus: 0,
- dialogVisibleGroup: false,
- dialogVisibleDevice: false,
- isRecreate: false,
- device: {
- video: [],
- audio: []
- },
- // 本地视频流画面、声音
- hasVideo: false,
- hasAudio: false
- };
- },
- computed: {
- // 画板模式
- isDraw() {
- return !this.connect && !this.callLoading;
- },
- netStatusColor() {
- if (this.netStatus >= 1000) {
- return '#f00';
- }
- if (this.netStatus >= 500) {
- return '#d6e91a';
- }
- if (this.netStatus >= 200) {
- return '#6aee4c';
- }
- return '#38d514';
- },
- connectUid() {
- return 'room_user_id' in this.connectStudent ? this.connectStudent.room_user_id : '';
- }
- },
- watch: {
- loadedNumber(newVal) {
- if (newVal === 5) {
- common.createScript(
- 'https://class.csslcloud.net/static/SDK/docSDK/drawSdk_3.0.js'
- ).onload = () => {
- this.initSDK();
- this.$loading().close();
- };
- }
- },
- // 聊天列表滚动
- chatList() {
- common.chatRoll(this, false);
- }
- },
- created() {
- GetGroupStatus({ task_id: this.task_id }).then(({ is_enable_group }) => {
- if (is_enable_group === 'true') {
- this.$router.push({
- path: '/live/teacher/group',
- query: {
- task_id: this.task_id
- }
- });
- } else {
- this.$loading({
- text: '加载直播所需SDK中...',
- background: '#fff'
- });
- common.downloadWebSDK(this);
- this.getLiveRoomStudentList();
- this.getLiveRoomInfo();
- }
- });
- },
- mounted() {
- document.addEventListener(
- 'click',
- e => {
- let target = e.target;
- let isHasClass = false;
- do {
- if (target === null) {
- break;
- }
- if (target.className === 'draw-setting') {
- isHasClass = true;
- }
- target = target.parentElement;
- } while (!isHasClass);
- if (!isHasClass) {
- this.isDrawSetting = false;
- }
- },
- true
- );
- this.getLiveRoomStudentListPolling();
- },
- beforeDestroy() {
- clearInterval(this.timer);
- common.closeVideo('main');
- },
- methods: {
- initSDK() {
- const { live_room_sys_user_id, room_id, session_id } = this.$route.query;
- this.rtc = common.initSDK({
- userid: live_room_sys_user_id,
- roomid: room_id,
- sessionid: session_id
- });
- common.initListener(this); // 注册监听事件
- this.getLiveStat();
- },
- getLiveRoomInfo() {
- GetLiveRoomInfo({ task_id: this.task_id }).then(
- ({
- room_id,
- video_mode,
- task_name,
- cs_item_name,
- course_name,
- teacher_name,
- student_count,
- student_connection_info
- }) => {
- this.roomInfo = {
- room_id,
- video_mode,
- task_name,
- cs_item_name,
- course_name,
- teacher_name,
- student_count,
- student_connection_info
- };
- this.connectStudent = student_connection_info;
- if (student_connection_info.connection_status === 1) {
- this.callLoading = true;
- }
- if (student_connection_info.connection_status === 2) {
- this.connect = true;
- }
- }
- );
- },
- closeLiveRoom() {
- CloseLiveRoom({ task_id: this.task_id }).then(() => {
- this.$router.push('/');
- this.$message.success('关闭直播成功');
- });
- },
- startLive() {
- common.startLive();
- },
- getLiveStat() {
- common.getLiveStat({
- success: data => {
- this.liveStat = data.started;
- },
- fail: str => {
- this.liveStat = false;
- console.log('直播关闭状态或查询直播失败', str);
- }
- });
- },
- // 推送桌面共享
- publishShareStream() {
- common.publishShareStream();
- },
- // 关闭桌面共享
- unPubShareStream() {
- common.unPubShareStream();
- },
- reconnection() {
- common.reconnection();
- },
- // 老师邀请学生上麦
- invite(student, mode) {
- if (this.connect || this.callLoading) {
- this.$message.warning('正在连麦中');
- return;
- }
- this.callLoading = true;
- this.connectStudent = student;
- GetLiveRoomInfo({ task_id: this.task_id })
- .then(({ video_mode }) => {
- let uid = student.room_user_id;
- this.roomInfo.video_mode = mode;
- if (video_mode === mode) {
- this.inviteStudent(uid, student, mode);
- } else {
- common.roomUpdate({
- video_mode: mode,
- roomUpdateSuccess: data => {
- console.log(data, '连麦音视频模式更新请求成功!');
- this.inviteStudent(uid, student, mode);
- },
- roomUpdateFailed: data => {
- this.callLoading = false;
- this.$message.error('连麦音视频模式更新请求失败! 请稍后再试!');
- }
- });
- }
- })
- .catch(() => {
- this.callLoading = false;
- });
- },
- inviteStudent(uid, connectStudent, mode) {
- common.invite({
- uid,
- success: str => {
- console.log('邀请上麦成功', str);
- this.dealStudentConnection(uid, 1, mode);
- common.sendPublishMessage({
- type: 'inviteImage',
- connectStudent
- });
- },
- fail: data => {
- console.log('邀请上麦失败:', data);
- this.callLoading = false;
- this.$message.error(`邀请上麦失败:${data.errorMsg}`);
- }
- });
- },
- dealStudentConnection(room_user_id, deal_mode, connection_mode) {
- DealStudentConnection({
- task_id: this.task_id,
- room_user_id,
- deal_mode,
- connection_mode
- }).then(() => {
- this.getLiveRoomStudentList();
- });
- },
- handsDown(uid) {
- let connectUid = typeof uid === 'string' ? uid : this.connectUid;
- if (connectUid.length === 0) {
- GetStudentInfo_Connection({ task_id: this.task_id }).then(({ room_user_id }) =>
- this.handsDown_Live(room_user_id)
- );
- } else {
- this.handsDown_Live(connectUid);
- }
- },
- // 下麦
- handsDown_Live(uid) {
- common.handsDown({
- uid,
- success: str => {
- if (this.callLoading) {
- common.sendPublishMessage({
- type: 'handsDown-load',
- uid
- });
- }
- this.dealStudentConnection(uid, 0, this.connectStudent.connection_mode);
- this.callLoading = false;
- this.connect = false;
- common.updateMcResult('', 0);
- this.$message.success('下麦成功');
- this.connectStudent = {};
- },
- fail: data => {
- this.callLoading = false;
- this.connect = false;
- console.log('下麦失败', data);
- this.$message.warning(`下麦失败:${data.errorMsg}`);
- }
- });
- },
- // 本地流视频开启、关闭
- playOrPauseVideo() {
- if (this.device.video.length === 0) {
- return this.$message.warning('无视频设备');
- }
- if (this.hasVideo) {
- common.pauseVideo({
- streamName: 'main',
- success: () => {
- this.$message.success('关闭本地流视频画面成功');
- this.hasVideo = false;
- },
- fail: str => {
- this.$message.warning(str);
- }
- });
- } else {
- common.playVideo({
- streamName: 'main',
- success: () => {
- this.$message.success('开启本地流视频画面成功');
- this.hasVideo = true;
- },
- fail: str => {
- this.$message.warning(str);
- }
- });
- }
- },
- // 本地流音频开启、关闭
- playOrPauseAudio() {
- if (this.device.audio.length === 0) {
- return this.$message.warning('无音频设备');
- }
- if (this.hasAudio) {
- common.pauseAudio({
- streamName: 'main',
- success: () => {
- this.$message.success('关闭本地流声音成功');
- this.hasAudio = false;
- },
- fail: str => {
- this.$message.warning(str);
- }
- });
- } else {
- common.playAudio({
- streamName: 'main',
- success: () => {
- this.$message.success('开启本地流声音成功');
- this.hasAudio = true;
- },
- fail: str => {
- this.$message.warning(str);
- }
- });
- }
- },
- // 发消息
- sendMsg() {
- common.sendMsg(this.msg);
- this.msg = '';
- },
- chatBans() {
- common.roomUpdate({
- allow_chat: !this.roomData.allow_chat,
- roomUpdateSuccess(data) {
- console.log(data, '房间模板配置更新请求成功!');
- },
- roomUpdateFailed(data) {
- console.log(data, '房间模板配置更新请求失败! 请稍后再试!');
- }
- });
- },
- // 画笔变更
- drawChange(action, value) {
- if (action === 'color') {
- common.drawChange(action, parseInt(Number(value.replace('#', '0x')), 10));
- this.curColor = value;
- } else {
- common.drawChange(action, value);
- }
- this.isDrawSetting = false;
- },
- // 设置音视频设备
- setDevice(isRecreate) {
- this.isRecreate = isRecreate;
- this.dialogVisibleDevice = true;
- },
- getNetPoint() {
- common.getNetPoint();
- },
- dialogDeviceClose(device) {
- this.$store.commit(`app/${app.SET_DEVICE}`, device);
- this.dialogVisibleDevice = false;
- if (this.isRecreate) {
- common.closeVideoTeacher({
- streamName: 'main',
- success: () => {
- common.createLocalStream(this);
- },
- fail: str => {
- console.log(str);
- }
- });
- } else {
- common.createLocalStream(this);
- }
- },
- showDrawSetting() {
- this.isDrawSetting = !this.isDrawSetting;
- },
- getLiveRoomStudentList() {
- GetLiveRoomStudentList({ task_id: this.task_id }).then(({ student_list }) => {
- this.student_list = student_list;
- });
- },
- getLiveRoomStudentListPolling() {
- this.timer = setInterval(() => {
- this.getLiveRoomStudentList();
- }, 5000);
- },
- studentExitLiveRoom(room_user_id, is_exit_page = true) {
- StudentExitLiveRoom({ task_id: this.task_id, room_user_id, is_exit_page });
- },
- publishStream() {
- common.publishStream('main');
- },
- // 分组讨论
- startGroup() {
- for (let i = 1; i <= this.student_list.length; i++) {
- this.groupNumList.push(i);
- }
- this.dialogVisibleGroup = true;
- },
- // 弹出框方法
- dialogGroup() {
- // 开始分组讨论
- StartGroup({ task_id: this.task_id, group_count: this.group_count }).then(() => {
- this.$message.success('开启分组讨论成功');
- this.$router.push({
- path: '/live/teacher/group',
- query: {
- task_id: this.task_id
- }
- });
- });
- },
- closeGroup() {
- this.dialogVisibleGroup = false;
- this.groupNumList = [];
- this.group_count = 1;
- },
- dialogClose() {
- this.dialogVisible = false;
- },
- dialogPush() {
- this.dialogVisible = false;
- this.dialogVisibleComplete = true;
- },
- dialogCompleteClose() {
- this.dialogVisibleComplete = false;
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- @import '~@/styles/mixin.scss';
- $live-bc: #3d3938;
- .live {
- @include dialog;
- margin-bottom: 24px;
- min-width: 1440px;
- .dialog-group .el-dialog__body {
- height: 65px;
- }
- // 顶部
- &-top {
- background-color: #fff;
- padding: 24px 32px;
- border-top-left-radius: 8px;
- border-top-right-radius: 8px;
- border-bottom: 1px solid #ccc;
- box-shadow: 0 1px 1px #ccc;
- .live-title {
- display: flex;
- justify-content: space-between;
- &-name {
- font-size: 22px;
- }
- .el-button {
- border-radius: 4px;
- padding: 7px 12px;
- }
- }
- }
- // 主容器
- &-container {
- display: flex;
- &-left {
- flex: 1;
- background-color: #fff;
- border-radius: 8px;
- .loading {
- position: relative;
- width: 100%;
- height: 468px;
- color: #fff;
- background-color: #646464;
- display: flex;
- justify-content: center;
- align-items: center;
- &-wrapper {
- text-align: center;
- > .el-avatar {
- width: 96px;
- height: 96px;
- line-height: 96px;
- margin-bottom: 24px;
- > &--icon {
- font-size: 36px;
- }
- }
- .loading-title {
- margin-bottom: 24px;
- }
- }
- }
- .student-parent {
- position: relative;
- width: 100%;
- height: 468px;
- #student {
- width: 100%;
- height: 468px;
- position: relative;
- background-color: $live-bc;
- }
- > .el-button {
- position: absolute;
- bottom: 40px;
- left: calc(50% - 44px);
- }
- .student-audio {
- width: 100%;
- height: 100%;
- background-color: #646464;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- .connect-name {
- color: #fff;
- margin: 24px 0;
- }
- > .el-avatar {
- width: 96px;
- height: 96px;
- line-height: 96px;
- > &--icon {
- font-size: 36px;
- }
- }
- }
- }
- // 画板
- #draw-parent {
- // width: 100%;
- height: 520px;
- position: relative;
- background-color: $live-bc;
- overflow: hidden;
- // 设置屏幕画笔
- .draw-setting {
- position: absolute;
- bottom: 13px;
- left: 22px;
- z-index: 9999;
- background-color: #a0a0a0;
- padding: 6px;
- border-radius: 40px;
- height: 40px;
- line-height: 28px;
- & > span {
- display: inline-block;
- text-align: center;
- margin-right: 10px;
- }
- & > span.brush-shape {
- width: 28px;
- height: 28px;
- border-radius: 50%;
- background-color: #fff;
- cursor: pointer;
- }
- .draw-color {
- position: relative;
- top: 5px;
- height: 18px;
- width: 18px;
- border-radius: 50%;
- cursor: pointer;
- }
- .current::after {
- content: '';
- position: absolute;
- bottom: -7px;
- left: 7px;
- width: 4px;
- height: 4px;
- border-radius: 50%;
- background-color: #292929;
- }
- .draw-thickness {
- height: 18px;
- width: 18px;
- cursor: pointer;
- display: inline-flex;
- flex-direction: column;
- justify-content: center;
- vertical-align: middle;
- align-items: center;
- span {
- border-radius: 50%;
- background-color: #000;
- }
- }
- & > .brush-clear {
- width: 28px;
- height: 28px;
- border-radius: 50%;
- background-color: #666;
- cursor: pointer;
- margin-right: 0;
- }
- & > .eraser {
- @extend .brush-clear;
- margin-right: 12px;
- }
- }
- }
- .button-group {
- display: flex;
- justify-content: space-between;
- height: 48px;
- background-color: #4d4d4d;
- padding: 0 15px;
- border-bottom-left-radius: 5px;
- .svg-icon {
- font-size: 20px;
- }
- &-left {
- .stop-group {
- color: #fff;
- }
- > .icon-button {
- display: inline-block;
- height: 100%;
- padding: 14px 16px;
- cursor: pointer;
- &:active,
- &:hover {
- background-color: #3d3d3d;
- }
- }
- }
- }
- }
- &-right {
- height: 568px;
- width: 485px;
- background-color: #fff;
- .live-teacher-lens {
- display: flex;
- position: relative;
- overflow: hidden;
- #live {
- width: 272px;
- height: 152px;
- background-color: $live-bc;
- }
- .live-wrapper {
- display: flex;
- position: absolute;
- height: 40px;
- width: 272px;
- background-color: #000;
- opacity: 0.7;
- color: #fff;
- line-height: 40px;
- padding: 0 16px;
- transition: all 300ms ease-in 0s;
- > div:first-child {
- flex: 6;
- }
- &-right {
- flex: 4;
- text-align: right;
- .svg-icon {
- cursor: pointer;
- margin-right: 18px;
- }
- }
- }
- .live-operate {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- &-icon {
- display: flex;
- padding-top: 18px;
- > .svg-icon {
- cursor: pointer;
- margin-left: 24px;
- }
- }
- }
- }
- // 聊天窗口
- &-chat {
- height: 417px;
- border: 1px solid #ccc;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .chat-top {
- display: flex;
- justify-content: space-between;
- padding: 15px 15px 10px;
- border-bottom: 1px solid #e6e6e6;
- color: #959595;
- label {
- cursor: pointer;
- }
- .allow-chat {
- margin-right: 12px;
- }
- }
- .chat-window {
- position: relative;
- width: 100%;
- height: 100%;
- overflow: hidden;
- &-ul {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- overflow: auto;
- .msg-normal {
- padding: 7px 16px;
- }
- }
- }
- .chat-speak {
- padding: 16px;
- }
- }
- }
- }
- // 学员列表
- .student-list {
- width: 100%;
- font-size: 14px;
- &-title {
- padding: 24px 16px;
- background-color: #fff;
- }
- &-container {
- padding: 16px 20px;
- background-color: #f2f2f2;
- ul {
- display: flex;
- flex-wrap: wrap;
- li {
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 120px;
- height: 144px;
- background-color: #fff;
- margin: 0 8px 8px 0;
- .li-top {
- flex: 1;
- width: 100%;
- background-color: #000;
- min-height: 72px;
- text-align: center;
- .el-avatar--icon {
- margin-top: 16px;
- }
- }
- .li-bottom {
- flex: 1;
- min-height: 72px;
- padding: 16px 8px;
- &-operate {
- padding: 0 24px;
- .svg-icon {
- font-size: 18px;
- cursor: pointer;
- margin: 8px 4px 0;
- }
- }
- }
- }
- }
- }
- }
- }
- </style>
|