mzx16822 hace 6 años
padre
commit
5e1a115ae8
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  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;