dusenyao преди 3 години
родител
ревизия
63697c9acf
променени са 5 файла, в които са добавени 74 реда и са изтрити 25 реда
  1. 15 0
      src/api/live.js
  2. 15 3
      src/views/live/student/group.vue
  3. 5 5
      src/views/live/student/index.vue
  4. 34 12
      src/views/live/teacher/group.vue
  5. 5 5
      src/views/live/teacher/index.vue

+ 15 - 0
src/api/live.js

@@ -314,3 +314,18 @@ export function GetStudentInfo_Connection(data) {
     data
   });
 }
+
+/**
+ * 向所有小组发送群组消息
+ * @param {Object} data
+ */
+export function SendGroupMessage(data) {
+  let params = getRequestParams('live_room-live_room_dispatch-SendGroupMessage');
+
+  return request({
+    method: 'post',
+    url: process.env.VUE_APP_LearnWebSI,
+    params,
+    data
+  });
+}

+ 15 - 3
src/views/live/student/group.vue

@@ -374,7 +374,7 @@ export default {
     GetGroupStatus() {
       this.timer = setInterval(() => {
         GetGroupStatus({ task_id: this.task_id })
-          .then(({ is_enable_group }) => {
+          .then(({ is_enable_group, is_has_group_message, group_message_text }) => {
             if (is_enable_group === 'false') {
               clearInterval(this.timer);
               CreateEnterLiveRoomSession({
@@ -392,6 +392,12 @@ export default {
                 });
               });
             }
+
+            if (is_has_group_message === 'true') {
+              this.$alert(group_message_text, '群消息', {
+                confirmButtonText: '关闭'
+              });
+            }
           })
           .catch(() => {
             clearInterval(this.timer);
@@ -494,10 +500,10 @@ $live-bc: #3d3938;
         height: 468px;
         position: relative;
         background-color: $live-bc;
-        overflow: hidden;
+        overflow: auto;
 
         .group-box {
-          width: 256px;
+          width: 255px;
           height: 144px;
           margin: 8px;
 
@@ -642,6 +648,7 @@ $live-bc: #3d3938;
     }
 
     &-right {
+      height: 794px;
       padding: 8px;
       background-color: #2c2c2c;
       border-end-end-radius: 8px;
@@ -692,6 +699,11 @@ $live-bc: #3d3938;
           margin-bottom: 16px;
         }
 
+        ul {
+          height: calc(100% - 20px);
+          overflow-x: auto;
+        }
+
         li {
           display: flex;
           margin-bottom: 16px;

+ 5 - 5
src/views/live/student/index.vue

@@ -506,6 +506,7 @@ export default {
 <style lang="scss" scoped>
 @import '~@/styles/mixin.scss';
 $live-bc: #3d3938;
+$draw-h: 520px;
 
 .live {
   @include dialog;
@@ -553,7 +554,7 @@ $live-bc: #3d3938;
       .loading {
         position: relative;
         width: 100%;
-        height: 468px;
+        height: $draw-h;
         color: #fff;
         background-color: #646464;
         display: flex;
@@ -583,11 +584,11 @@ $live-bc: #3d3938;
       .student-parent {
         position: relative;
         width: 100%;
-        height: 468px;
+        height: $draw-h;
 
         #student {
           width: 100%;
-          height: 468px;
+          height: $draw-h;
           position: relative;
           background-color: $live-bc;
         }
@@ -626,8 +627,7 @@ $live-bc: #3d3938;
 
       // 画板
       #draw-parent {
-        // width: 100%;
-        height: 520px;
+        height: $draw-h;
         position: relative;
         background-color: $live-bc;
         overflow: hidden;

+ 34 - 12
src/views/live/teacher/group.vue

@@ -59,10 +59,7 @@
         <div class="live-container-left-chat">
           <div class="chat-top">
             <span>聊天</span>
-            <!-- <label @click="chatBans">
-              <input v-model="roomData.allow_chat" type="checkbox" class="allow-chat" />
-              <span>禁言</span>
-            </label> -->
+            <el-button size="small" @click="sendAllMsg">给所有小组发送群消息</el-button>
           </div>
           <div class="chat-window">
             <ul ref="chat" class="chat-window-ul">
@@ -141,7 +138,8 @@ import {
   JoinGroup_Teacher,
   ExitCurGroup_Teacher,
   GetMyGroupInfo_Teacher,
-  GetGroupStatus
+  GetGroupStatus,
+  SendGroupMessage
 } from '@/api/live';
 import * as common from './group';
 
@@ -289,6 +287,18 @@ export default {
       this.msg = '';
     },
 
+    // 给所有小组发送消息
+    sendAllMsg() {
+      this.$prompt(' ', '给所有小组发送群消息', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消'
+      }).then(({ value }) => {
+        SendGroupMessage({ task_id: this.task_id, group_message_text: value }).then(() => {
+          this.$message.success('发送成功');
+        });
+      });
+    },
+
     chatBans() {
       common.roomUpdate({
         allow_chat: !this.roomData.allow_chat,
@@ -431,24 +441,29 @@ $live-bc: #3d3938;
         display: flex;
         flex-wrap: wrap;
         background-color: #4d4d4d;
-        overflow: hidden;
-        padding: 10px 24px;
+        overflow: auto;
+        padding: 10px 0 10px 24px;
 
         &-list {
           background-color: #646464;
           position: relative;
           padding: 24px;
-          width: 253px;
+          width: 255px;
           height: 144px;
-          margin-right: 8px;
+          margin: 0 8px 8px 0;
           cursor: pointer;
 
           &-avatar {
             display: flex;
+            height: 92px;
             flex-wrap: wrap;
-            justify-content: space-around;
             align-items: center;
-            margin-top: 24px;
+            margin-top: 12px;
+            overflow: auto;
+
+            .el-avatar {
+              margin: 0 7px 6px 0;
+            }
           }
 
           .group-serial {
@@ -474,7 +489,7 @@ $live-bc: #3d3938;
         height: 468px;
         position: relative;
         background-color: $live-bc;
-        overflow: hidden;
+        overflow: auto;
 
         .group-box {
           width: 256px;
@@ -565,6 +580,7 @@ $live-bc: #3d3938;
 
         .chat-top {
           display: flex;
+          align-items: center;
           justify-content: space-between;
           padding: 15px 15px 10px;
           border-bottom: 1px solid #e6e6e6;
@@ -607,6 +623,7 @@ $live-bc: #3d3938;
 
     &-right {
       padding: 8px;
+      height: 794px;
       background-color: #2c2c2c;
       border-end-end-radius: 8px;
 
@@ -647,6 +664,11 @@ $live-bc: #3d3938;
           margin-bottom: 16px;
         }
 
+        ul {
+          height: calc(100% - 20px);
+          overflow-x: auto;
+        }
+
         li {
           display: flex;
           margin-bottom: 16px;

+ 5 - 5
src/views/live/teacher/index.vue

@@ -786,6 +786,7 @@ export default {
 <style lang="scss" scoped>
 @import '~@/styles/mixin.scss';
 $live-bc: #3d3938;
+$draw-h: 520px;
 
 .live {
   @include dialog;
@@ -833,7 +834,7 @@ $live-bc: #3d3938;
       .loading {
         position: relative;
         width: 100%;
-        height: 468px;
+        height: $draw-h;
         color: #fff;
         background-color: #646464;
         display: flex;
@@ -863,11 +864,11 @@ $live-bc: #3d3938;
       .student-parent {
         position: relative;
         width: 100%;
-        height: 468px;
+        height: $draw-h;
 
         #student {
           width: 100%;
-          height: 468px;
+          height: $draw-h;
           position: relative;
           background-color: $live-bc;
         }
@@ -906,8 +907,7 @@ $live-bc: #3d3938;
 
       // 画板
       #draw-parent {
-        // width: 100%;
-        height: 520px;
+        height: $draw-h;
         position: relative;
         background-color: $live-bc;
         overflow: hidden;