jinx 3 anos atrás
pai
commit
3a998ead1b
1 arquivos alterados com 21 adições e 17 exclusões
  1. 21 17
      socket.js

+ 21 - 17
socket.js

@@ -80,7 +80,7 @@ export default {
 
     this.data.reload = false
     this.data.showCommodity = false
-    // options.url = options.url+'&vlog';
+    options.url = options.url + '&vlog';
     if (!this.data.webviewUrl) {
       console.log(base)
       this.setData({
@@ -509,22 +509,26 @@ export default {
     this.setData({
       surplus: this.data.peopleCount - data.roomsPerson.length
     })
-    if (!this.isAuthorizeRecord) {
-      const voiceStatus = Number(await this.authorizeRecord())
-      this.isAuthorizeRecord = true
-
-      // getApp().setVoiceProps({
-      //   noMute: !voiceStatus
-      // })
-
-      // console.log(getApp().globalData.voiceProps.noMute)
-      // this.socketSendMessage('changeVoiceStatus', {
-      //   status: getApp().globalData.voiceProps.noMute ? 0 : 2
-      // })
-      // this.data.socketOptions.voiceStatus = 1
-      // this.socketSendMessage('changeVoiceStatus', {status: noMute ? 0 : 2})
+    //限制只有主持人才可以开麦
+    if (this.role == 'leader') {
+      if (!this.isAuthorizeRecord) {
+        const voiceStatus = Number(await this.authorizeRecord())
+        this.isAuthorizeRecord = true
+
+        // getApp().setVoiceProps({
+        //   noMute: !voiceStatus
+        // })
+
+        // console.log(getApp().globalData.voiceProps.noMute)
+        // this.socketSendMessage('changeVoiceStatus', {
+        //   status: getApp().globalData.voiceProps.noMute ? 0 : 2
+        // })
+        // this.data.socketOptions.voiceStatus = 1
+        // this.socketSendMessage('changeVoiceStatus', {status: noMute ? 0 : 2})
+      }
     }
 
+
     const socketOptions = this.data.socketOptions
     getApp().globalData.roomId = socketOptions.roomId
     const user = data.roomsPerson.find(user => user.userId == socketOptions.userId)
@@ -598,7 +602,7 @@ export default {
 
       this.setData({
         // peopleCount: this.data.many ? manyCount : 5
-        peopleCount: this.data.many ? manyCount : 2
+        peopleCount: manyCount
       })
 
       let base = this.base
@@ -1116,7 +1120,7 @@ export default {
 
         this.setData({
           // peopleCount: this.data.many ? manyCount : 5,
-          peopleCount: this.data.many ? manyCount : 2,
+          peopleCount: manyCount
         })
 
         if (!res.data.brand.canShow) {