ソースを参照

Merge branch 'feature/v4socket' of http://192.168.0.115:3000/bill/mini-shop into feature/v4socket

tangning 3 年 前
コミット
0f2aa139d7
1 ファイル変更20 行追加22 行削除
  1. 20 22
      socket.js

+ 20 - 22
socket.js

@@ -5,7 +5,7 @@ var user = require('./services/user.js');
 const api = require('/config/api.js');
 const util = require('/utils/util.js');
 const UNLOGIN = 'NO_LOGIN'
-const btoa = require('./utils/btoa')
+const btoa = require('./utils/btoa');
 
 const manyCount = 50
 
@@ -323,15 +323,15 @@ export default {
       userInfo.nickname = "口"
     }
     // this.role !== 'leader'
-    let roomType
-    if ((!this.data.canShow && !this.data.join) || (this.data.join && !this.options.join)) {
-      // roomType = '1v1'
-      if (this.options.roomId) {
-        this.role = 'leader'
-      }
-      console.log('**************')
-      console.log(this.options)
-    }
+    // let roomType
+    // if ((!this.data.canShow && !this.data.join) || (this.data.join && !this.options.join)) {
+    //   // roomType = '1v1'
+    //   if (this.options.roomId) {
+    //     this.role = 'leader'
+    //   }
+    //   console.log('**************')
+    //   console.log(this.options)
+    // }
 
     let isAllowMic // 真正MIC权, 房主与 授权一个 要在房间isAllowMic开启
 
@@ -864,26 +864,24 @@ export default {
     }
   },
 
-  closeMic(data) {
+  closeMic() {
 
-    getApp().globalData.voiceProps.noMute = false
+    getApp().globalData.voiceProps.noMute = true
     this.socketSendMessage('changeVoiceStatus', {
       status: 0,
-      user: data.user
     })
     getApp().setVoiceProps({
-      noMute: false
+      noMute: true
     })
   },
   
-  openMic(data) {
-    getApp().globalData.voiceProps.noMute = true
-    // this.socketSendMessage('changeVoiceStatus', {
-    //   status: 2,
-    //   user: data.user
-    // })
+  openMic() {
+    getApp().globalData.voiceProps.noMute = false
+    this.socketSendMessage('changeVoiceStatus', {
+      status: 2,
+    })
     getApp().setVoiceProps({
-      noMute: true
+      noMute: false
     })
   },
   callPhone() {
@@ -931,7 +929,7 @@ export default {
     console.log('on onUnload')
     // this.socketSendMessage('stopCall', {})
     // this.stopCall()
-    this.socketStop()
+    this.socketStop && this.socketStop()
     getApp().globalData.pusher = ''
   },