index.vue 23 KB

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