liuyu 4 years ago
parent
commit
0f7a9d1f4f
2 changed files with 19 additions and 1 deletions
  1. 15 1
      src/layout/live/detailInfo.vue
  2. 4 0
      src/store/room.js

+ 15 - 1
src/layout/live/detailInfo.vue

@@ -40,7 +40,7 @@
         <el-col :span="20" class="right">
           <el-col :span="24" class="rightTop">
             <span @click="liveon"><i class="iconfont iconshexiangtou"></i>直播</span>
-            <span @click="livezhuchi"><i class="iconfont iconshexiangtou"></i>主持</span>
+            <span v-show="zjrshow" @click="livezhuchi"><i class="iconfont iconshexiangtou"></i>主持</span>
             <span @click="liveclose"><i class="el-icon-switch-button"></i>关闭直播</span>
             <span @click="shareon"><i class="iconfont iconfenxiang"></i>屏幕</span>
             <span @click="shareclose"><i class="iconfont iconfenxiang"></i>关闭分享</span>
@@ -221,9 +221,23 @@ export default {
       updateshmai: 'updateshmai',
       switchzjr: 'switchzjr',
       switchzb: 'switchzb',
+      switchzp: 'switchzp',
     }),
     ...lookuser(['lookquery', 'lookupdate']),
     ...roomuser({ roomuserfetch: 'fetch' }),
+    async livezp() {
+      const data = {};
+      data.id = this.id;
+      data.uid = this.user.uid;
+      const res = await this.switchzb(data);
+      if (this.$checkRes(res)) {
+        console.log(res.data);
+        this.$message({
+          message: '操作成功',
+          type: 'success',
+        });
+      }
+    },
     async livezhuchi() {
       const data = {};
       data.id = this.id;

+ 4 - 0
src/store/room.js

@@ -77,6 +77,10 @@ const actions = {
     const res = await this.$axios.$post(`${api.roomInfo}/switchzb`, info);
     return res;
   },
+  async switchzp({ commit }, info) {
+    const res = await this.$axios.$post(`${api.roomInfo}/switchzp`, info);
+    return res;
+  },
 };
 
 export default {