mzx16822 6 years ago
parent
commit
5e1a115ae8
1 changed files with 5 additions and 2 deletions
  1. 5 2
      public/h5/datigame/js/common.js

+ 5 - 2
public/h5/datigame/js/common.js

@@ -71,11 +71,14 @@ common={
    //          $("#py1_username").html(data.info.user.name + '(我)');
    //      }
    	this.tips(data.info.user.name+"加入了房间")
-        if(data.info.user.user_id!=this.userInfo.user_id){
+   	for (var i = 0; i < data.info.players.length; i++) {
+   		 if(data.info.players[i].user_id!=this.userInfo.user_id){
         	 $("#py2_avatar").html('<img src="' + data.info.user.avatar+ '" class="layui-circle">');
             $("#py2_username").html(data.info.user.name);
             _this.userInfo.playerId=data.info.user.user_id;
-     }
+     	}
+   	}
+        
  		 
  	},round_end:function(data){
  		var _this=this;