Browse Source

直播沟通和直播人数

unknown 4 years ago
parent
commit
f56fb78bf3
2 changed files with 15 additions and 11 deletions
  1. 1 1
      pagesGood/liveDetail.vue
  2. 14 10
      pagesGood/trtc-room/trtc-room.vue

+ 1 - 1
pagesGood/liveDetail.vue

@@ -466,7 +466,7 @@
 						  that.first_gx=false;
 						  that.setNum();
 					  }
-				  },1000)
+				  },5000)
 				  
 				})
 				this.trtcComponent.on(TRTC_EVENT.IM_MESSAGE_RECEIVED, event => {

+ 14 - 10
pagesGood/trtc-room/trtc-room.vue

@@ -2409,16 +2409,7 @@ export default {
 		  }
 		  console.log(TAG_NAME, '_loginIM', params)
 		  var that=this;
-		  setTimeout(function(){
-			  that.sendGroupCustomMessage({
-			    roomID: Number(that.config.roomID), // 房间 ID
-			    payload: {
-			  	data: 'genxin',
-			  	description: 'genxin',
-			  	extension: 'genxin'
-			    }
-			  })
-		  },2000)
+		  
 		  return this.tim.login({
 			userID: params.userID,
 			userSig: params.userSig,
@@ -2528,6 +2519,7 @@ export default {
 		  if (!this.tim) {
 			return
 		  }
+		  var that=this;
 		  console.log(TAG_NAME, '_joinGroup', params)
 		  const promise = this.tim.joinGroup({ groupID: params.roomID + '', type: IM_GROUP_TYPE })
 		  promise.then((imResponse) => {
@@ -2540,6 +2532,18 @@ export default {
 				// wx.showToast({
 				//   title: '进群成功',
 				// })
+				var data={"test":"test"}
+				that._emitter.emit(EVENT.IM_READY, data)
+				setTimeout(function(){
+					  that.sendGroupCustomMessage({
+						roomID: Number(that.config.roomID), // 房间 ID
+						payload: {
+						data: 'genxin',
+						description: 'genxin',
+						extension: 'genxin'
+						}
+					  })
+				},2000)
 				console.log(TAG_NAME, '_joinGroup success', imResponse)
 				break
 			  default: