فهرست منبع

Merge branch '02/23reviewBUG' into 11/24SAAS

lex 3 سال پیش
والد
کامیت
def561dbf0

+ 41 - 21
src/views/liveClassManager/index.vue

@@ -102,10 +102,17 @@
               </div>
             </template>
           </el-table-column>
-              <el-table-column align="center" prop="popularize" label="观看权限">
+          <el-table-column align="center" prop="popularize" label="直播设备">
             <template slot-scope="scope">
               <div>
-                {{ scope.row.popularizeType=='ALL'? "全员" : "部分" }}
+                {{ scope.row.os == "pc" ? "电脑" : "手机" }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="popularize" label="观看权限">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.popularizeType == "ALL" ? "全员" : "部分" }}
               </div>
             </template>
           </el-table-column>
@@ -146,17 +153,19 @@
           <el-table-column align="center" prop="studentId" label="操作">
             <template slot-scope="scope">
               <div>
-                <el-dropdown trigger="click" placement="bottom">
+                <el-dropdown trigger="click" placement="bottom" :hide-on-click="false" >
                   <span class="el-dropdown-link">
                     操作<i class="el-icon-arrow-down el-icon--right"></i>
                   </span>
-                  <el-dropdown-menu slot="dropdown">
+                  <el-dropdown-menu slot="dropdown" style="width:100px">
                     <el-dropdown-item
+                    style="width:100px"
                       v-if="permission('/liveStudentList')&&scope.row.popularizeType!=='ALL'"
+                        @click.native="lookStudentDetail(scope.row)"
                     >
                       <el-button
                         type="text"
-                        @click="lookStudentDetail(scope.row)"
+
                         >观看学员</el-button
                       >
                     </el-dropdown-item>
@@ -165,10 +174,11 @@
                         permission('imLiveBroadcastRoom/opsPopularize') &&
                         scope.row.liveState != 2
                       "
+                           @click.native="popularizeRoom(scope.row)"
                     >
                       <el-button
                         type="text"
-                        @click="popularizeRoom(scope.row)"
+
                         >{{
                           scope.row.popularize == 1 ? "取消推广" : "首页推广"
                         }}</el-button
@@ -180,42 +190,44 @@
                         permission('imLiveBroadcastRoom/roomDestroy') &&
                         scope.row.liveState == 1
                       "
+                       @click.native="closeRoom(scope.row)"
                     >
-                      <el-button type="text" @click="closeRoom(scope.row)"
+                      <el-button type="text"
                         >关闭直播</el-button
                       >
                     </el-dropdown-item>
 
-                    <el-dropdown-item v-if="scope.row.liveState == 2">
-                      <el-button type="text" @click="gotoDetail(scope.row)"
+                    <el-dropdown-item v-if="scope.row.liveState == 2"  @click.native="gotoDetail(scope.row)">
+                      <el-button type="text"
                         >直播详情</el-button
                       >
                     </el-dropdown-item>
                     <auth auths="/liveBlackList">
-                      <el-dropdown-item>
-                        <el-button type="text" @click="gotoBuylist(scope.row)"
+                      <el-dropdown-item  @click.native="gotoBuylist(scope.row)">
+                        <el-button type="text"
                           >订单详情</el-button
                         >
                       </el-dropdown-item>
                     </auth>
-                    <el-dropdown-item v-if="permission('liveGoodsMapper/page')">
-                      <el-button type="text" @click="setShop(scope.row)"
+                    <el-dropdown-item v-if="permission('liveGoodsMapper/page')&&ishowCart(scope.row)"  @click.native="setShop(scope.row)">
+                      <el-button type="text"
                         >商品设置</el-button
                       >
                     </el-dropdown-item>
                     <auth
                       auths="imLiveBroadcastRoom/queryLiveRoomGoodsOrderList"
                     >
-                      <el-dropdown-item>
-                        <el-button type="text" @click="gotoBlacklist(scope.row)"
+                      <el-dropdown-item  @click.native="gotoBlacklist(scope.row)">
+                        <el-button type="text"
                           >黑名单</el-button
                         >
                       </el-dropdown-item>
                     </auth>
                     <el-dropdown-item
                       v-if="permission('imLiveBroadcastRoom/shareGroup')"
+                       @click.native="shareLive(scope.row)"
                     >
-                      <el-button type="text" @click="shareLive(scope.row)"
+                      <el-button type="text"
                         >分享</el-button
                       >
                     </el-dropdown-item>
@@ -226,7 +238,7 @@
                         scope.row.liveState == 0
                       "
                     >
-                      <el-button type="text" @click="resetLive(scope.row)"
+                      <el-button type="text"  @click.native="resetLive(scope.row)"
                         >修改</el-button
                       >
                     </el-dropdown-item>
@@ -236,7 +248,7 @@
                       v-if="scope.row.liveState == 0"
                     >
                       <el-dropdown-item>
-                        <el-button type="text" @click="deteleLive(scope.row)"
+                        <el-button type="text"  @click.native="deteleLive(scope.row)"
                           >删除</el-button
                         >
                       </el-dropdown-item>
@@ -440,9 +452,9 @@ export default {
     resetLive(row) {
       let params = {
         path: "/business/createLiveClass",
-        query: { ...row },
+       query: { id:row.id,roomUid:row.roomUid}
       };
-      //   query: { id:row.id,roomUid:row.roomUid},
+      //  ,
       this.$router.push(params, (route) => {
         route.meta.title = "修改直播课";
       });
@@ -527,9 +539,17 @@ export default {
     lookStudentDetail(row) {
       this.$router.push({
         path: "/business/liveStudentList",
-        query: { roomUid: row.roomUid,name:row.roomTitle },
+        query: { roomUid: row.roomUid, name: row.roomTitle },
       });
     },
+    ishowCart(row){
+      let json = JSON.parse(row.roomConfig)
+      if(json.whether_view_shop_cart == 0) {
+         return true
+      }else{
+        return false
+      }
+    }
   },
 };
 </script>

+ 31 - 15
src/views/liveClassManager/liveClassDetail.vue

@@ -125,8 +125,7 @@
           @click="opneVideo(item)"
         >
           <video width="110px" :src="item.url"></video>
-          <i class="el-icon-video-play linkIcon"></i
-          >
+          <i class="el-icon-video-play linkIcon"></i>
           <p :underline="false" type="text" class="lineTitle">
             {{ item.endTime | dateForMinFormat }}
           </p>
@@ -146,14 +145,26 @@
       v-if="videoVisible"
     >
       <!-- activeUrl -->
-      <video
-        style="width: 640px"
-        :src="activeVideo.url"
-        ref="dialogVideo"
-        controls="controls"
-      >
-        您的浏览器不支持视频播放
-      </video>
+      <div class="activeVideoWrap">
+        <video
+          v-if="activeVideo.os == 'mobile'"
+          style="width: 320px"
+          :src="activeVideo.url"
+          ref="dialogVideo"
+          controls="controls"
+        >
+          您的浏览器不支持视频播放
+        </video>
+        <video
+          v-else
+          style="width: 640px"
+          :src="activeVideo.url"
+          ref="dialogVideo"
+          controls="controls"
+        >
+          您的浏览器不支持视频播放
+        </video>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -308,19 +319,20 @@ export default {
   flex-direction: row;
   align-items: center;
   flex-wrap: wrap;
-  justify-content: space-around;
+
 
   .linkItem {
     display: flex;
     flex-direction: column;
     align-items: center;
+    margin-right: 5px;
     cursor: pointer;
     position: relative;
     &:hover {
       color: var(--color-primary);
-      .lineTitle{
-         color: var(--color-primary);
-         font-weight: bold;
+      .lineTitle {
+        color: var(--color-primary);
+        font-weight: bold;
       }
     }
     .linkIcon {
@@ -328,7 +340,6 @@ export default {
       position: absolute;
       top: 30px;
       color: #fff;
-
     }
   }
   .lineTitle {
@@ -342,4 +353,9 @@ export default {
     border-radius: 4px;
   }
 }
+.activeVideoWrap {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
 </style>

+ 11 - 2
src/views/liveClassManager/modals/shareDetail.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
     <el-form :model="form" ref="form" class="form">
-      <el-form-item label="分享对象">
-        <el-radio-group v-model="form.shareTarget" @change="changeShareTarget">
+      <el-form-item label="分享对象" v-if="row.os !== 'mobile'">
+        <el-radio-group v-model="form.shareTarget" @change="changeShareTarget" >
           <el-radio v-model="form.shareTarget" label="1">主讲人</el-radio>
           <el-radio v-model="form.shareTarget" label="2">学员</el-radio>
         </el-radio-group>
@@ -82,6 +82,15 @@ export default {
       ? domain + `/live/?roomUid=${this.row.roomUid}`
       : "https://test.dayaedu.com" + `/live/?roomUid=${this.row.roomUid}`;
       // this.copyText()
+
+      // 判断一下
+
+      if(this.row.os == 'mobile'){
+          console.log('设置学员观看')
+          this.form.shareTarget='2'
+      }else {
+         this.form.shareTarget='1'
+      }
   },
   methods: {
     copyText(e) {

+ 103 - 36
src/views/liveClassManager/newLiveClass.vue

@@ -158,6 +158,26 @@
           </el-form-item>
         </el-row>
         <el-alert
+          title="直播设备配置"
+          type="info"
+          :closable="false"
+          style="margin-bottom: 20px"
+        ></el-alert>
+        <el-row class="row">
+          <el-form-item
+            class="mline"
+            label="直播设备"
+            prop="os"
+            label-width="120px"
+            :rules="[{ required: true, message: '请选择推广类型' }]"
+          >
+            <el-radio-group v-model="form.os" >
+              <el-radio label="pc">电脑</el-radio>
+              <el-radio label="mobile">手机</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-row>
+        <el-alert
           title="观看权限配置"
           type="info"
           :closable="false"
@@ -313,7 +333,7 @@
             </el-radio-group>
           </el-form-item>
         </el-row>
-        <!-- <el-row class="row">
+        <el-row class="row">
           <el-form-item
             prop="roomConfig.whether_view_shop_cart"
             label-width="120px"
@@ -326,7 +346,7 @@
               <el-radio :label="1">否</el-radio>
             </el-radio-group>
           </el-form-item>
-        </el-row> -->
+        </el-row>
       </el-form>
       <el-row class="row">
         <el-button type="primary" @click="preLook">预览</el-button>
@@ -349,7 +369,7 @@
 import preview from "./modals/preview.vue";
 import axios from "axios";
 import { getToken, getTenantId } from "@/utils/auth";
-import { createLiveBroadcast, resetLiveBroadcastRoomList } from "./api";
+import { createLiveBroadcast, resetLiveBroadcastRoomList ,getRoomInfo} from "./api";
 import { queryByOrganId } from "@/api/systemManage";
 import { getTeamList } from "@/api/teamServer";
 export default {
@@ -368,6 +388,7 @@ export default {
         liveRemark: "",
         preTemplate: null,
         popularizeType: "ALL",
+        os:'pc',
         roomConfig: {
           whether_like: 0,
           whether_chat: 0,
@@ -388,47 +409,93 @@ export default {
   mounted() {
     this.$store.dispatch("setBranchs");
     if (this.$route.query.id) {
-      this.name = "修改直播间";
+      // this.name = "修改直播间";
+      this.getDetail()
       // console.log()
-      this.form = {
-        ...this.$route.query,
-        organIds: [],
-        schoolIds: [],
-        teamIds: [],
-      };
-      this.form.roomConfig = JSON.parse(this.$route.query.roomConfig);
+      // this.form = {
+      //   ...this.$route.query,
+      //   organIds: [],
+      //   schoolIds: [],
+      //   teamIds: [],
+      // };
+      // this.form.roomConfig = JSON.parse(this.$route.query.roomConfig);
 
-      if (this.$route.query.popularizeOrgIds) {
-        this.form.organIds = this.$route.query.popularizeOrgIds
-          .split(",")
-          .map((item) => {
-            return item * 1;
-          });
-      }
-      this.changeSection(this.form.organIds);
-      if (this.$route.query.popularizeSchoolIds) {
-        this.form.schoolIds = this.$route.query.popularizeSchoolIds
-          .split(",")
-          .map((item) => {
-            return item * 1;
-          });
-      }
+      // if (this.$route.query.popularizeOrgIds) {
+      //   this.form.organIds = this.$route.query.popularizeOrgIds
+      //     .split(",")
+      //     .map((item) => {
+      //       return item * 1;
+      //     });
+      // }
+      // this.changeSection(this.form.organIds);
+      // if (this.$route.query.popularizeSchoolIds) {
+      //   this.form.schoolIds = this.$route.query.popularizeSchoolIds
+      //     .split(",")
+      //     .map((item) => {
+      //       return item * 1;
+      //     });
+      // }
 
-      if (this.$route.query.popularizeTeamIds) {
-        let arr = this.$route.query.popularizeTeamIds.split(",");
-        this.$set(this.form, "teamIds", arr);
-        console.log(this.form.teamIds);
-      }
+      // if (this.$route.query.popularizeTeamIds) {
+      //   let arr = this.$route.query.popularizeTeamIds.split(",");
+      //   this.$set(this.form, "teamIds", arr);
+      //   console.log(this.form.teamIds);
+      // }
 
-      // this.form.popularizeType = "SCHOOL";
+      // // this.form.popularizeType = "SCHOOL";
 
-      this.remoteMethod(this.$route.query.speakerName);
+      // this.remoteMethod(this.$route.query.speakerName);
 
-      this.checkList.push(this.form.preTemplate * 1);
-      this.isinit = false;
+      // this.checkList.push(this.form.preTemplate * 1);
+      // this.isinit = false;
     }
   },
   methods: {
+        async getDetail() {
+      try {
+        const res = await getRoomInfo({ roomUid: this.$route.query.roomUid });
+        this.name = "修改直播间";
+        // console.log()
+        this.form = {
+          ...res.data,
+          organIds: [],
+          schoolIds: [],
+          teamIds: [],
+          catIds: [],
+          studentIds: [],
+        };
+        this.form.roomConfig = JSON.parse(res.data.roomConfig);
+        if (res.data.popularizeOrgIds) {
+          this.form.organIds = res.data.popularizeOrgIds
+            .split(",")
+            .map((item) => {
+              return item * 1;
+            });
+        }
+
+        if (res.data.popularizeSchoolIds) {
+          this.form.schoolIds = res.data.popularizeSchoolIds
+            .split(",")
+            .map((item) => {
+              return item * 1;
+            });
+        }
+
+        if (res.data.popularizeTeamIds) {
+          let arr = res.data.popularizeTeamIds.split(",");
+          this.$set(this.form, "teamIds", arr);
+        }
+
+        // this.form.popularizeType = "SCHOOL";
+        this.changeSection(this.form.organIds);
+        this.remoteMethod(res.data.speakerName);
+
+        this.checkList.push(this.form.preTemplate * 1);
+        this.isinit = false;
+      } catch (e) {
+        console.log(e);
+      }
+    },
     onCancel() {
       this.$store.dispatch("delVisitedViews", this.$route);
       this.$router.push("/liveClassManager");
@@ -524,7 +591,7 @@ export default {
       this.form.popularizeOrgIds = this.form.organIds.join(",");
       this.form.popularizeSchoolIds = this.form.schoolIds.join(",");
       this.form.popularizeTeamIds = this.form.teamIds.join(",");
-      this.$refs.form.validate(async(flag) => {
+      this.$refs.form.validate(async (flag) => {
         if (!flag) return;
         if (this.$route.query.id) {
           // 修改