dusenyao 3 lat temu
rodzic
commit
d066ed6fa7

+ 9 - 0
src/icons/svg/mobile-close.svg

@@ -0,0 +1,9 @@
+<svg width="1024" height="1024" xmlns="http://www.w3.org/2000/svg" class="icon">
+<g>
+  <rect fill="none" id="canvas_background" height="402" width="582" y="-1" x="-1"/>
+</g>
+<g>
+  <path stroke-width="0" id="svg_1" d="m537.7536,795.88864c-26.40896,0 -47.89248,21.4784 -47.89248,47.89248s21.48352,47.89248 47.89248,47.89248s47.89248,-21.4784 47.89248,-47.89248s-21.48352,-47.89248 -47.89248,-47.89248zm236.94336,-753.8176l-473.8816,0c-39.86432,0 -72.29952,32.43008 -72.29952,72.29952l0,795.264c0,39.86944 32.43008,72.29952 72.29952,72.29952l473.87136,0c39.86944,0 72.29952,-32.43008 72.29952,-72.29952l0,-795.26912c0.00512,-39.86432 -32.42496,-72.2944 -72.28928,-72.2944zm-473.8816,48.19456l473.87136,0a24.12544,24.12544 0 0 1 24.09984,24.09984l0,595.80928l-522.06592,0l0,-595.80928a24.12544,24.12544 0 0 1 24.09472,-24.09984zm473.8816,843.46368l-473.8816,0a24.12544,24.12544 0 0 1 -24.09984,-24.09984l0,-147.12832l522.07104,0l0,147.12832a24.1152,24.1152 0 0 1 -24.0896,24.09984z" fill="#ffffff"/>
+  <path stroke="#000" id="svg_4" d="m763.135698,531.553734l-148.849631,-144.268793l148.822577,-144.268793l-76.507953,-74.205868l-148.849631,144.268793l-148.849631,-144.268793l-76.507953,74.205868l148.822577,144.268793l-148.849631,144.268793l76.56206,74.179647l148.822577,-144.268793l148.822577,144.268793" fill-opacity="null" stroke-opacity="null" stroke-width="0" fill="#fff"/>
+</g>
+</svg>

+ 1 - 0
src/icons/svg/mobile.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M537.7536 795.88864c-26.40896 0-47.89248 21.4784-47.89248 47.89248s21.48352 47.89248 47.89248 47.89248 47.89248-21.4784 47.89248-47.89248-21.48352-47.89248-47.89248-47.89248zM774.69696 42.07104H300.81536c-39.86432 0-72.29952 32.43008-72.29952 72.29952v795.264c0 39.86944 32.43008 72.29952 72.29952 72.29952h473.87136c39.86944 0 72.29952-32.43008 72.29952-72.29952V114.36544c0.00512-39.86432-32.42496-72.2944-72.28928-72.2944zM300.81536 90.2656h473.87136a24.12544 24.12544 0 0 1 24.09984 24.09984v595.80928H276.72064V114.36544a24.12544 24.12544 0 0 1 24.09472-24.09984z m473.8816 843.46368H300.81536a24.12544 24.12544 0 0 1-24.09984-24.09984v-147.12832h522.07104v147.12832a24.1152 24.1152 0 0 1-24.0896 24.09984z" /></svg>

+ 1 - 3
src/layouts/components/LayoutHeader.vue

@@ -294,9 +294,7 @@ export default {
             projectList.push({
               id: 1,
               name: '教材管理系统',
-              img: 'project8-8',
-              selectImg: 'project8-8-8',
-              text: '帮您快速定制生动、有趣、实用的数字教材。'
+              img: 'project2'
             });
           }
         }

+ 10 - 0
src/views/live/student/index.vue

@@ -22,6 +22,9 @@
             <p class="loading-title">{{ roomInfo.teacher_name }}邀请您连线中</p>
             <div>
               <el-button type="success" icon="el-icon-phone-outline" circle @click="inviteAccept" />
+              <el-button type="danger" circle @click="handsDown">
+                <svg-icon icon-class="hang-up" />
+              </el-button>
             </div>
           </div>
         </div>
@@ -367,6 +370,13 @@ export default {
       common.handsDown({
         uid: this.room_user_id,
         success: str => {
+          if (this.callLoading) {
+            common.sendPublishMessage({
+              type: 'handsDown-load-student',
+              uid: this.room_user_id
+            });
+          }
+
           this.callLoading = false;
           this.dealStudentConnection(this.room_user_id, 0, this.roomInfo.video_mode);
           console.log('下麦成功', str);

+ 2 - 1
src/views/live/student/live.js

@@ -10,7 +10,8 @@ export {
   createScript,
   handsDown,
   chatRoll,
-  updateMcResult
+  updateMcResult,
+  sendPublishMessage
 } from '@/views/live/common';
 
 // 分组讨论

+ 26 - 3
src/views/live/teacher/index.vue

@@ -167,6 +167,10 @@
         <ul>
           <li v-for="item in student_list" :key="item.room_user_id">
             <div class="li-top">
+              <svg-icon
+                v-if="item.is_mobile === 'true'"
+                :icon-class="item.is_exit_page === 'true' ? 'mobile-close' : 'mobile'"
+              />
               <el-avatar icon="el-icon-user" :size="40" :src="item.student_image_url" />
             </div>
             <div class="li-bottom">
@@ -177,13 +181,21 @@
                   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-else
+                  icon-class="video"
+                  @click="invite(item, 1, item.is_mobile === 'true', item.is_exit_page === 'true')"
+                />
                 <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)" />
+                <svg-icon
+                  v-else
+                  icon-class="voice"
+                  @click="invite(item, 2, item.is_mobile === 'true', item.is_exit_page === 'true')"
+                />
               </div>
             </div>
           </li>
@@ -493,7 +505,11 @@ export default {
     },
 
     // 老师邀请学生上麦
-    invite(student, mode) {
+    invite(student, mode, is_mobile, is_exit_page) {
+      if (is_mobile && is_exit_page) {
+        this.$message.warning('手机端学员已离开直播视频界面,不能进行通话');
+        return;
+      }
       if (this.connect || this.callLoading) {
         this.$message.warning('正在连麦中');
         return;
@@ -1171,12 +1187,19 @@ $draw-h: 520px;
           margin: 0 8px 8px 0;
 
           .li-top {
+            position: relative;
             flex: 1;
             width: 100%;
             background-color: #000;
             min-height: 72px;
             text-align: center;
 
+            .svg-icon {
+              position: absolute;
+              top: 10px;
+              right: 10px;
+            }
+
             .el-avatar--icon {
               margin-top: 16px;
             }

+ 4 - 0
src/views/live/teacher/live.js

@@ -330,6 +330,10 @@ export function initListener(vue) {
     // 连接中途下麦
     if (data.type === 'handsDown-load-student' && data.uid === vue.connectUid) {
       vue.callLoading = false;
+      Message({
+        type: 'warning',
+        message: '对方已挂断'
+      });
     }
   });
 }