index.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  1. <template>
  2. <div class="live">
  3. <!--顶部-->
  4. <div class="live-top">
  5. <div class="live-title">
  6. <div class="live-title-name">{{ roomInfo.cs_item_name }} {{ roomInfo.task_name }}</div>
  7. <div>
  8. <el-button v-if="!liveStat" @click="startLive">开启直播</el-button>
  9. <el-button v-if="liveStat" icon="el-icon-switch-button" @click="closeLiveRoom">
  10. 结束直播
  11. </el-button>
  12. <el-button v-if="liveStat" @click="reconnection">重连</el-button>
  13. <el-button @click="setDevice(true)">设置设备</el-button>
  14. </div>
  15. </div>
  16. <div class="live-course-name">{{ roomInfo.course_name }}</div>
  17. <div class="live-teacher">
  18. <span class="live-teacher-name">
  19. <svg-icon icon-class="person" />{{ roomInfo.teacher_name }}
  20. </span>
  21. <span><svg-icon icon-class="people" />{{ roomInfo.student_count }}</span>
  22. </div>
  23. </div>
  24. <!-- 主容器 -->
  25. <div class="live-container">
  26. <!-- 左侧 -->
  27. <div class="live-container-left">
  28. <div v-show="callLoading" class="loading">
  29. <div class="loading-wrapper">
  30. <el-avatar icon="el-icon-user" :src="connectStudent.student_image_url" />
  31. <p class="loading-title">
  32. 正在呼叫【{{ connectStudent.student_name }}】,等待对方接通...
  33. </p>
  34. <div>
  35. <el-button type="danger" circle @click="handsDown">
  36. <svg-icon icon-class="hang-up" />
  37. </el-button>
  38. </div>
  39. </div>
  40. </div>
  41. <div v-show="connect" class="student-parent">
  42. <div v-show="roomInfo.video_mode === 1 || remoteStreamType === 1" id="student"></div>
  43. <template v-if="remoteStreamType !== 1">
  44. <template v-if="roomInfo.video_mode === 1">
  45. <el-button type="danger" @click="handsDown">
  46. <svg-icon icon-class="hang-up" /> 挂断
  47. </el-button>
  48. </template>
  49. <template v-else>
  50. <div class="student-audio">
  51. <el-avatar icon="el-icon-user" :src="connectStudent.student_image_url" />
  52. <span class="connect-name">{{ connectStudent.student_name }}</span>
  53. <el-button type="danger" circle @click="handsDown">
  54. <svg-icon icon-class="hang-up" />
  55. </el-button>
  56. </div>
  57. </template>
  58. </template>
  59. </div>
  60. <div v-show="isDraw" id="draw-parent">
  61. <div v-show="isDrawSetting" class="draw-setting">
  62. <span class="brush-shape">
  63. <svg-icon icon-class="brush-shape" />
  64. </span>
  65. <span
  66. v-for="item in drawColorList"
  67. :key="item"
  68. :class="['draw-color', item === '#FF4747' ? 'current' : '']"
  69. :style="{ 'background-color': item }"
  70. ></span>
  71. <span v-for="item in drawThicknessList" :key="item" class="draw-thickness">
  72. <span :style="{ width: item * 2 + 'px', height: item * 2 + 'px' }"></span>
  73. </span>
  74. <span class="brush-clear">
  75. <svg-icon icon-class="clear" />
  76. </span>
  77. </div>
  78. </div>
  79. <div class="button-group">
  80. <div class="button-group-left">
  81. <span class="icon-button" @click="publishShareStream">
  82. <svg-icon icon-class="share" />
  83. </span>
  84. <span class="icon-button" @click="showDrawSetting">
  85. <svg-icon icon-class="draw" />
  86. </span>
  87. <span class="icon-button" @click="startGroup">
  88. <svg-icon icon-class="group" />
  89. </span>
  90. <span class="icon-button" @click="dialogVisible = true">
  91. <svg-icon icon-class="push" />
  92. </span>
  93. </div>
  94. <div class="button-group-right"></div>
  95. </div>
  96. <div class="live-container-left-chat">
  97. <div class="chat-top">
  98. <span>聊天</span>
  99. <label @click="chatBans">
  100. <input v-model="roomData.allow_chat" type="checkbox" class="allow-chat" />
  101. <span>禁言</span>
  102. </label>
  103. </div>
  104. <div class="chat-window">
  105. <ul ref="chat" class="chat-window-ul">
  106. <li v-for="(item, i) in chatList" :key="i">
  107. <div class="msg-normal">
  108. <span>{{ item.username }}: </span>
  109. <span>{{ item.msg }}</span>
  110. </div>
  111. </li>
  112. </ul>
  113. </div>
  114. <div class="chat-speak">
  115. <el-input
  116. v-model="msg"
  117. placeholder="输入发言"
  118. maxlength="400"
  119. @keydown.enter.native="sendMsg"
  120. >
  121. <el-button slot="append" @click="sendMsg">发送</el-button>
  122. </el-input>
  123. </div>
  124. </div>
  125. </div>
  126. <!-- 右侧 -->
  127. <div class="live-container-right">
  128. <div
  129. class="live-teacher-lens"
  130. @mouseover="liveMenuShow = true"
  131. @mouseout="liveMenuShow = false"
  132. >
  133. <div id="live"></div>
  134. <div :style="{ bottom: liveMenuShow ? '0' : '-40px' }" class="live-wrapper">
  135. <div>
  136. {{ roomInfo.teacher_name }}
  137. </div>
  138. <div>
  139. <span :style="{ color: netStatusColor }">{{ netStatus }}</span>
  140. </div>
  141. </div>
  142. </div>
  143. <div class="student-list">
  144. <div class="student-list-title">学生列表</div>
  145. <ul>
  146. <li v-for="item in student_list" :key="item.room_user_id">
  147. <div class="student-list-left">
  148. <el-avatar icon="el-icon-user" size="small" :src="item.student_image_url" />
  149. <span class="name">{{ item.student_name }}</span>
  150. </div>
  151. <div class="student-list-right">
  152. <svg-icon
  153. v-if="item.connection_mode === 1 && item.connection_status !== 0"
  154. icon-class="hang-up"
  155. @click="handsDown(item.room_user_id)"
  156. />
  157. <svg-icon v-else icon-class="video" @click="invite(item, 1)" />
  158. <svg-icon
  159. v-if="item.connection_mode === 2 && item.connection_status !== 0"
  160. icon-class="hang-up"
  161. @click="handsDown(item.room_user_id)"
  162. />
  163. <svg-icon v-else icon-class="voice" @click="invite(item, 2)" />
  164. </div>
  165. </li>
  166. </ul>
  167. </div>
  168. </div>
  169. </div>
  170. <!-- 推送资料 -->
  171. <select-material
  172. :dialog-visible="dialogVisible"
  173. :task-id="task_id"
  174. @dialogClose="dialogClose"
  175. @dialogPush="dialogPush"
  176. />
  177. <!-- 教师查看当前完成列表 -->
  178. <complete-list
  179. :task-id="task_id"
  180. :dialog-visible-complete="dialogVisibleComplete"
  181. @dialogCompleteClose="dialogCompleteClose"
  182. />
  183. <select-device
  184. :dialog-visible-device="dialogVisibleDevice"
  185. :device="device"
  186. @dialogDeviceClose="dialogDeviceClose"
  187. />
  188. <el-dialog
  189. title="分组讨论组数"
  190. top="30vh"
  191. width="300px"
  192. class="dialog-group"
  193. :visible.sync="dialogVisibleGroup"
  194. :close-on-click-modal="false"
  195. >
  196. <el-select v-model="group_count">
  197. <el-option v-for="i in groupNumList" :key="i" :label="i" :value="i" />
  198. </el-select>
  199. <span slot="footer">
  200. <el-button size="small" @click="closeGroup">取 消</el-button>
  201. <el-button size="small" type="primary" @click="dialogGroup">确 定</el-button>
  202. </span>
  203. </el-dialog>
  204. </div>
  205. </template>
  206. <script>
  207. import {
  208. GetLiveRoomStudentList,
  209. CloseLiveRoom,
  210. GetLiveRoomInfo,
  211. StudentExitLiveRoom,
  212. StartGroup,
  213. GetGroupStatus,
  214. DealStudentConnection,
  215. GetStudentInfo_Connection
  216. } from '@/api/live';
  217. import { app } from '@/store/mutation-types';
  218. import SelectMaterial from '@/components/live/SelectMaterial.vue';
  219. import CompleteList from './CompleteList.vue';
  220. import SelectDevice from '../SelectDevice.vue';
  221. import * as common from './live';
  222. export default {
  223. components: {
  224. SelectMaterial,
  225. CompleteList,
  226. SelectDevice
  227. },
  228. data() {
  229. return {
  230. task_id: this.$route.query.task_id,
  231. // 连麦
  232. connect: false,
  233. // 连线学员信息
  234. connectStudent: {},
  235. // 等待接通
  236. callLoading: false,
  237. dialogVisible: false,
  238. // 学员完成
  239. dialogVisibleComplete: false,
  240. // 定时器
  241. timer: null,
  242. remoteStreamType: -1,
  243. rtc: null,
  244. roomData: {
  245. desc: '直播间标题',
  246. name: '姓名',
  247. user: {
  248. id: '',
  249. name: '',
  250. role: 'talker',
  251. rommid: ''
  252. },
  253. max_users: 1,
  254. allow_chat: true,
  255. allow_audio: true,
  256. allow_speak: true
  257. },
  258. roomInfo: {
  259. room_id: '',
  260. video_mode: 1,
  261. task_name: '',
  262. cs_item_name: '',
  263. course_name: '',
  264. teacher_name: '',
  265. student_count: 0,
  266. student_connection_info: {}
  267. },
  268. loadedNumber: 0,
  269. speakData: {},
  270. roomContext: {},
  271. msg: '',
  272. chatList: [],
  273. isDrawSetting: false,
  274. drawColorList: ['#FF4747', '#343434', '#628EFF', '#FFCA0E'],
  275. drawThicknessList: ['1', '3', '5'],
  276. // 直播间学员列表
  277. student_list: [],
  278. // 直播状态
  279. liveStat: false,
  280. liveMenuShow: false,
  281. // 分组讨论
  282. groupNumList: [],
  283. group_count: 1,
  284. // 网络整体情况
  285. netStatus: 0,
  286. dialogVisibleGroup: false,
  287. dialogVisibleDevice: false,
  288. isRecreate: false,
  289. device: {
  290. video: [],
  291. audio: []
  292. }
  293. };
  294. },
  295. computed: {
  296. // 画板模式
  297. isDraw() {
  298. return !this.connect && !this.callLoading;
  299. },
  300. netStatusColor() {
  301. if (this.netStatus >= 1000) {
  302. return '#f00';
  303. }
  304. if (this.netStatus >= 500) {
  305. return '#d6e91a';
  306. }
  307. if (this.netStatus >= 200) {
  308. return '#6aee4c';
  309. }
  310. return '#38d514';
  311. },
  312. connectUid() {
  313. return 'room_user_id' in this.connectStudent ? this.connectStudent.room_user_id : '';
  314. }
  315. },
  316. watch: {
  317. loadedNumber(newVal) {
  318. if (newVal === 5) {
  319. common.createScript(
  320. 'https://class.csslcloud.net/static/SDK/docSDK/drawSdk_3.0.js'
  321. ).onload = () => {
  322. this.initSDK();
  323. this.$loading().close();
  324. };
  325. }
  326. },
  327. // 聊天列表滚动
  328. chatList() {
  329. common.chatRoll(this);
  330. }
  331. },
  332. created() {
  333. GetGroupStatus({ task_id: this.task_id }).then(({ is_enable_group }) => {
  334. if (is_enable_group === 'true') {
  335. this.$router.push({
  336. path: '/live/teacher/group',
  337. query: {
  338. task_id: this.task_id
  339. }
  340. });
  341. } else {
  342. this.$loading({
  343. text: '加载直播所需SDK中...',
  344. background: '#fff'
  345. });
  346. common.downloadWebSDK(this);
  347. this.getLiveRoomStudentList();
  348. this.getLiveRoomInfo();
  349. }
  350. });
  351. },
  352. mounted() {
  353. document.addEventListener(
  354. 'click',
  355. e => {
  356. let target = e.target;
  357. let isHasClass = false;
  358. do {
  359. if (target === null) {
  360. break;
  361. }
  362. if (target.className === 'draw-setting') {
  363. isHasClass = true;
  364. }
  365. target = target.parentElement;
  366. } while (!isHasClass);
  367. if (!isHasClass) {
  368. this.isDrawSetting = false;
  369. }
  370. },
  371. true
  372. );
  373. this.getLiveRoomStudentListPolling();
  374. },
  375. beforeDestroy() {
  376. clearInterval(this.timer);
  377. common.closeVideo('main');
  378. },
  379. methods: {
  380. initSDK() {
  381. const { live_room_sys_user_id, room_id, session_id } = this.$route.query;
  382. this.rtc = common.initSDK({
  383. userid: live_room_sys_user_id,
  384. roomid: room_id,
  385. sessionid: session_id
  386. });
  387. common.initListener(this); // 注册监听事件
  388. this.getLiveStat();
  389. },
  390. getLiveRoomInfo() {
  391. GetLiveRoomInfo({ task_id: this.task_id }).then(
  392. ({
  393. room_id,
  394. video_mode,
  395. task_name,
  396. cs_item_name,
  397. course_name,
  398. teacher_name,
  399. student_count,
  400. student_connection_info
  401. }) => {
  402. this.roomInfo = {
  403. room_id,
  404. video_mode,
  405. task_name,
  406. cs_item_name,
  407. course_name,
  408. teacher_name,
  409. student_count,
  410. student_connection_info
  411. };
  412. this.connectStudent = student_connection_info;
  413. if (student_connection_info.connection_status === 1) {
  414. this.callLoading = true;
  415. }
  416. if (student_connection_info.connection_status === 2) {
  417. this.connect = true;
  418. }
  419. }
  420. );
  421. },
  422. closeLiveRoom() {
  423. CloseLiveRoom({ task_id: this.task_id }).then(() => {
  424. this.$router.push('/');
  425. this.$message.success('关闭直播成功');
  426. });
  427. },
  428. startLive() {
  429. common.startLive();
  430. },
  431. getLiveStat() {
  432. common.getLiveStat({
  433. success: data => {
  434. this.liveStat = data.started;
  435. },
  436. fail: str => {
  437. this.liveStat = false;
  438. console.log('直播关闭状态或查询直播失败', str);
  439. }
  440. });
  441. },
  442. // 推送桌面共享
  443. publishShareStream() {
  444. common.publishShareStream();
  445. },
  446. // 关闭桌面共享
  447. unPubShareStream() {
  448. common.unPubShareStream();
  449. },
  450. reconnection() {
  451. common.reconnection();
  452. },
  453. // 老师邀请学生上麦
  454. invite(student, mode) {
  455. if (this.connect || this.callLoading) {
  456. this.$message.warning('正在连麦中');
  457. return;
  458. }
  459. this.callLoading = true;
  460. this.connectStudent = student;
  461. GetLiveRoomInfo({ task_id: this.task_id })
  462. .then(({ video_mode }) => {
  463. let uid = student.room_user_id;
  464. this.roomInfo.video_mode = mode;
  465. if (video_mode === mode) {
  466. this.inviteStudent(uid, student, mode);
  467. } else {
  468. common.roomUpdate({
  469. video_mode: mode,
  470. roomUpdateSuccess: data => {
  471. console.log(data, '连麦音视频模式更新请求成功!');
  472. this.inviteStudent(uid, student, mode);
  473. },
  474. roomUpdateFailed: data => {
  475. this.callLoading = false;
  476. this.$message.error('连麦音视频模式更新请求失败! 请稍后再试!');
  477. }
  478. });
  479. }
  480. })
  481. .catch(() => {
  482. this.callLoading = false;
  483. });
  484. },
  485. inviteStudent(uid, connectStudent, mode) {
  486. common.invite({
  487. uid,
  488. success: str => {
  489. console.log('邀请上麦成功', str);
  490. this.dealStudentConnection(uid, 1, mode);
  491. common.sendPublishMessage({
  492. type: 'inviteImage',
  493. connectStudent
  494. });
  495. },
  496. fail: data => {
  497. console.log('邀请上麦失败:', data);
  498. this.callLoading = false;
  499. this.$message.error(`邀请上麦失败:${data.errorMsg}`);
  500. }
  501. });
  502. },
  503. dealStudentConnection(room_user_id, deal_mode, connection_mode) {
  504. DealStudentConnection({
  505. task_id: this.task_id,
  506. room_user_id,
  507. deal_mode,
  508. connection_mode
  509. }).then(() => {
  510. this.getLiveRoomStudentList();
  511. });
  512. },
  513. handsDown(uid) {
  514. let connectUid = typeof uid === 'string' ? uid : this.connectUid;
  515. if (connectUid.length === 0) {
  516. GetStudentInfo_Connection({ task_id: this.task_id }).then(({ room_user_id }) =>
  517. this.handsDown_Live(room_user_id)
  518. );
  519. } else {
  520. this.handsDown_Live(connectUid);
  521. }
  522. },
  523. // 下麦
  524. handsDown_Live(uid) {
  525. common.handsDown({
  526. uid,
  527. success: str => {
  528. if (this.callLoading) {
  529. common.sendPublishMessage({
  530. type: 'handsDown-load',
  531. uid
  532. });
  533. }
  534. this.dealStudentConnection(uid, 0, this.connectStudent.connection_mode);
  535. this.callLoading = false;
  536. this.connect = false;
  537. common.updateMcResult('', 0);
  538. this.$message.success('下麦成功');
  539. this.connectStudent = {};
  540. },
  541. fail: data => {
  542. this.callLoading = false;
  543. this.connect = false;
  544. console.log('下麦失败', data);
  545. this.$message.warning(`下麦失败:${data.errorMsg}`);
  546. }
  547. });
  548. },
  549. // 发消息
  550. sendMsg() {
  551. common.sendMsg(this.msg);
  552. this.msg = '';
  553. },
  554. chatBans() {
  555. common.roomUpdate({
  556. allow_chat: !this.roomData.allow_chat,
  557. roomUpdateSuccess: function (data) {
  558. console.log(data, '房间模板配置更新请求成功!');
  559. },
  560. roomUpdateFailed: function (data) {
  561. console.log(data, '房间模板配置更新请求失败! 请稍后再试!');
  562. }
  563. });
  564. },
  565. // 画笔变更
  566. drawChange(action, value) {
  567. common.drawChange(action, value);
  568. },
  569. // 设置音视频设备
  570. setDevice(isRecreate) {
  571. this.isRecreate = isRecreate;
  572. this.dialogVisibleDevice = true;
  573. },
  574. getNetPoint() {
  575. common.getNetPoint();
  576. },
  577. dialogDeviceClose(device) {
  578. this.$store.commit(`app/${app.SET_DEVICE}`, device);
  579. this.dialogVisibleDevice = false;
  580. if (this.isRecreate) {
  581. common.closeVideoTeacher({
  582. streamName: 'main',
  583. success: () => {
  584. common.createLocalStream();
  585. },
  586. fail: str => {
  587. console.log(str);
  588. }
  589. });
  590. } else {
  591. common.createLocalStream();
  592. }
  593. },
  594. showDrawSetting() {
  595. this.isDrawSetting = !this.isDrawSetting;
  596. },
  597. getLiveRoomStudentList() {
  598. GetLiveRoomStudentList({ task_id: this.task_id }).then(({ student_list }) => {
  599. this.student_list = student_list;
  600. });
  601. },
  602. getLiveRoomStudentListPolling() {
  603. this.timer = setInterval(() => {
  604. this.getLiveRoomStudentList();
  605. }, 5000);
  606. },
  607. studentExitLiveRoom(room_user_id) {
  608. StudentExitLiveRoom({ task_id: this.task_id, room_user_id });
  609. },
  610. publishStream() {
  611. common.publishStream('main');
  612. },
  613. // 分组讨论
  614. startGroup() {
  615. for (let i = 1; i <= this.student_list.length; i++) {
  616. this.groupNumList.push(i);
  617. }
  618. this.dialogVisibleGroup = true;
  619. },
  620. // 弹出框方法
  621. dialogGroup() {
  622. // 开始分组讨论
  623. StartGroup({ task_id: this.task_id, group_count: this.group_count }).then(() => {
  624. this.$message.success('开启分组讨论成功');
  625. this.$router.push({
  626. path: '/live/teacher/group',
  627. query: {
  628. task_id: this.task_id
  629. }
  630. });
  631. });
  632. },
  633. closeGroup() {
  634. this.dialogVisibleGroup = false;
  635. this.groupNumList = [];
  636. this.group_count = 1;
  637. },
  638. dialogClose() {
  639. this.dialogVisible = false;
  640. },
  641. dialogPush() {
  642. this.dialogVisible = false;
  643. this.dialogVisibleComplete = true;
  644. },
  645. dialogCompleteClose() {
  646. this.dialogVisibleComplete = false;
  647. }
  648. }
  649. };
  650. </script>
  651. <style lang="scss">
  652. @import '~@/styles/mixin.scss';
  653. $live-bc: #3d3938;
  654. .live {
  655. @include container;
  656. @include dialog;
  657. .dialog-group .el-dialog__body {
  658. height: 65px;
  659. }
  660. // 顶部
  661. &-top {
  662. background-color: #fff;
  663. padding: 24px 32px;
  664. border-top-left-radius: 8px;
  665. border-top-right-radius: 8px;
  666. .live-title {
  667. display: flex;
  668. justify-content: space-between;
  669. &-name {
  670. font-size: 22px;
  671. }
  672. .el-button {
  673. border-radius: 4px;
  674. padding: 7px 12px;
  675. }
  676. }
  677. .live-course-name {
  678. font-size: 14px;
  679. color: #737373;
  680. line-height: 30px;
  681. }
  682. .live-teacher {
  683. margin-top: 12px;
  684. .svg-icon {
  685. margin-right: 8px;
  686. }
  687. &-name {
  688. margin-right: 60px;
  689. }
  690. }
  691. }
  692. // 主容器
  693. &-container {
  694. display: flex;
  695. justify-content: left;
  696. &-left {
  697. width: 832px;
  698. background-color: #fff;
  699. border-radius: 8px;
  700. .loading {
  701. position: relative;
  702. width: 100%;
  703. height: 468px;
  704. color: #fff;
  705. background-color: #646464;
  706. display: flex;
  707. justify-content: center;
  708. align-items: center;
  709. &-wrapper {
  710. text-align: center;
  711. > .el-avatar {
  712. width: 96px;
  713. height: 96px;
  714. line-height: 96px;
  715. margin-bottom: 24px;
  716. > &--icon {
  717. font-size: 36px;
  718. }
  719. }
  720. .loading-title {
  721. margin-bottom: 24px;
  722. }
  723. }
  724. }
  725. .student-parent {
  726. position: relative;
  727. width: 100%;
  728. height: 468px;
  729. #student {
  730. width: 100%;
  731. height: 468px;
  732. position: relative;
  733. background-color: $live-bc;
  734. }
  735. > .el-button {
  736. position: absolute;
  737. bottom: 40px;
  738. left: calc(50% - 44px);
  739. }
  740. .student-audio {
  741. width: 100%;
  742. height: 100%;
  743. background-color: #646464;
  744. display: flex;
  745. flex-direction: column;
  746. justify-content: center;
  747. align-items: center;
  748. .connect-name {
  749. color: #fff;
  750. margin: 24px 0;
  751. }
  752. > .el-avatar {
  753. width: 96px;
  754. height: 96px;
  755. line-height: 96px;
  756. > &--icon {
  757. font-size: 36px;
  758. }
  759. }
  760. }
  761. }
  762. #draw-parent {
  763. width: 100%;
  764. height: 468px;
  765. position: relative;
  766. background-color: $live-bc;
  767. overflow: hidden;
  768. // 设置屏幕画笔
  769. .draw-setting {
  770. position: absolute;
  771. bottom: 13px;
  772. left: 22px;
  773. z-index: 9999;
  774. background-color: #a0a0a0;
  775. padding: 6px;
  776. border-radius: 40px;
  777. height: 40px;
  778. width: 275px;
  779. line-height: 28px;
  780. & > span {
  781. display: inline-block;
  782. text-align: center;
  783. margin-right: 10px;
  784. }
  785. & > span.brush-shape {
  786. width: 28px;
  787. height: 28px;
  788. border-radius: 50%;
  789. background-color: #fff;
  790. cursor: pointer;
  791. }
  792. .draw-color {
  793. position: relative;
  794. top: 5px;
  795. height: 18px;
  796. width: 18px;
  797. border-radius: 50%;
  798. cursor: pointer;
  799. }
  800. .current::after {
  801. content: '';
  802. position: absolute;
  803. bottom: -7px;
  804. left: 7px;
  805. width: 4px;
  806. height: 4px;
  807. border-radius: 50%;
  808. background-color: #292929;
  809. }
  810. .draw-thickness {
  811. height: 18px;
  812. width: 18px;
  813. cursor: pointer;
  814. display: inline-flex;
  815. flex-direction: column;
  816. justify-content: center;
  817. vertical-align: middle;
  818. align-items: center;
  819. span {
  820. border-radius: 50%;
  821. background-color: #000;
  822. }
  823. }
  824. & > .brush-clear {
  825. width: 28px;
  826. height: 28px;
  827. border-radius: 50%;
  828. background-color: #666;
  829. cursor: pointer;
  830. margin-right: 0;
  831. }
  832. }
  833. }
  834. .button-group {
  835. display: flex;
  836. justify-content: space-between;
  837. height: 48px;
  838. background-color: #4d4d4d;
  839. padding: 0 15px;
  840. border-bottom-left-radius: 5px;
  841. .svg-icon {
  842. font-size: 20px;
  843. }
  844. &-left {
  845. .stop-group {
  846. color: #fff;
  847. }
  848. > .icon-button {
  849. display: inline-block;
  850. height: 100%;
  851. padding: 14px 16px;
  852. cursor: pointer;
  853. &:active,
  854. &:hover {
  855. background-color: #3d3d3d;
  856. }
  857. }
  858. }
  859. }
  860. // 聊天窗口
  861. &-chat {
  862. height: 278px;
  863. border: 1px solid #ccc;
  864. border-bottom-left-radius: 8px;
  865. display: flex;
  866. flex-direction: column;
  867. justify-content: space-between;
  868. .chat-top {
  869. display: flex;
  870. justify-content: space-between;
  871. padding: 15px 15px 10px;
  872. border-bottom: 1px solid #e6e6e6;
  873. color: #959595;
  874. label {
  875. cursor: pointer;
  876. }
  877. .allow-chat {
  878. margin-right: 12px;
  879. }
  880. }
  881. .chat-window {
  882. position: relative;
  883. width: 100%;
  884. height: 100%;
  885. overflow: hidden;
  886. &-ul {
  887. position: absolute;
  888. top: 0;
  889. left: 0;
  890. width: 100%;
  891. height: 100%;
  892. overflow: auto;
  893. .msg-normal {
  894. padding: 7px 16px;
  895. }
  896. }
  897. }
  898. .chat-speak {
  899. padding: 16px;
  900. }
  901. }
  902. }
  903. &-right {
  904. height: 794px;
  905. padding: 8px;
  906. background-color: #2c2c2c;
  907. border-end-end-radius: 8px;
  908. .live-teacher-lens {
  909. position: relative;
  910. overflow: hidden;
  911. #live {
  912. width: 352px;
  913. height: 198px;
  914. background-color: $live-bc;
  915. }
  916. .live-wrapper {
  917. display: flex;
  918. position: absolute;
  919. height: 40px;
  920. width: 100%;
  921. background-color: #000;
  922. opacity: 0.7;
  923. color: #fff;
  924. line-height: 40px;
  925. padding: 0 16px;
  926. transition: all 300ms ease-in 0s;
  927. > div:first-child {
  928. flex: 6;
  929. }
  930. > div:last-child {
  931. flex: 4;
  932. text-align: right;
  933. }
  934. }
  935. }
  936. // 学员列表
  937. .student-list {
  938. width: 100%;
  939. padding: 24px 16px;
  940. margin-top: 2px;
  941. height: calc(100% - 200px);
  942. background-color: #2c2c2c;
  943. font-size: 14px;
  944. color: #fff;
  945. &-title {
  946. margin-bottom: 16px;
  947. }
  948. ul {
  949. height: calc(100% - 18px);
  950. overflow: auto;
  951. }
  952. li {
  953. display: flex;
  954. margin-bottom: 16px;
  955. .student-list-left {
  956. flex: 8;
  957. .name {
  958. vertical-align: super;
  959. margin-left: 8px;
  960. }
  961. }
  962. .student-list-right {
  963. flex: 2;
  964. .svg-icon {
  965. font-size: 18px;
  966. cursor: pointer;
  967. margin-top: 7px;
  968. margin-right: 8px;
  969. }
  970. }
  971. }
  972. }
  973. }
  974. }
  975. }
  976. </style>