فهرست منبع

销售直播代码

yuhongqi 2 روز پیش
والد
کامیت
6f3ad61615
1فایلهای تغییر یافته به همراه11 افزوده شده و 10 حذف شده
  1. 11 10
      src/views/live/liveConsole/index.vue

+ 11 - 10
src/views/live/liveConsole/index.vue

@@ -73,10 +73,10 @@
     <el-col class="live-console-col" :span="11">
       <div style="background: #000; border-radius: 5px; overflow: hidden; margin: 10px 5px;">
         <div style="border-radius: 5px; overflow: hidden;">
-          <video 
-            controls 
-            autoplay 
-            :src="this.liveVideo.videoUrl" 
+          <video
+            controls
+            autoplay
+            :src="this.liveVideo.videoUrl"
             width="100%"
             style="display: block; background: #000;"
           ></video>
@@ -151,7 +151,7 @@
           <!-- 消息输入区域 -->
           <div style="padding: 10px; border-top: 1px solid #ebeef5; background-color: #fff; min-height: 120px;">
             <el-input
-              type="textarea" 
+              type="textarea"
               v-model="newMsg"
               placeholder="请输入消息..."
               :rows="8"
@@ -208,8 +208,8 @@ export default {
     }
   },
   created() {
-    this.getLiveVideo()
-    this.getList()
+    // this.getLiveVideo()
+    // this.getList()
     this.connectWebSocket()
   },
   computed: {
@@ -315,7 +315,7 @@ export default {
             let totalPage = (total % this.msgParams.pageSize == 0) ? Math.floor(total / this.msgParams.pageSize) : Math.floor(total / this.msgParams.pageSize + 1);
             rows.forEach(row => {
               if (!this.msgList.some(m => m.msgId === row.msgId)) {
-                
+
                 let user = this.userList.find(u => u.userId === row.userId)
                 if (user) {
                   row.msgStatus = user.msgStatus
@@ -370,7 +370,7 @@ export default {
               msg.msgStatus = u.msgStatus;
             }
           });
-          
+
           this.userList.forEach(user => {
             if (user.userId === u.userId) {
               user.msgStatus = u.msgStatus;
@@ -385,6 +385,7 @@ export default {
       })
     },
     connectWebSocket() {
+      console.log(this.liveWsUrl)
       let socket = new LiveWS(this.liveWsUrl, this.liveId, this.userId);
       socket.onmessage = (event) => this.handleWsMessage(event)
       this.socket = socket
@@ -494,4 +495,4 @@ export default {
     box-shadow: none !important;
   }
 
-</style>
+</style>