mzx16822 лет назад: 6
Родитель
Сommit
a169965f92
1 измененных файлов с 7 добавлено и 4 удалено
  1. 7 4
      public/h5/datigame/js/common.js

+ 7 - 4
public/h5/datigame/js/common.js

@@ -46,6 +46,7 @@ common={
              dataType: "json",
              success: function(data){
                    fn&&fn(data); 
+
                }
          });
  	},Answer:function(fn){
@@ -59,16 +60,16 @@ common={
                    fn&&fn(data); 
                }
          });
- 	},player_join:function(responsedata){
+ 	},player_join:function(data){
  		// if(responsedata.info.user){
  		// 	$("#username").html(responsedata.info.user.name);
    // 			$("#avatar").html('<img src="' + responsedata.info.user.avatar + '" class="layui-circle">');	
  		// }
 
- 		if(responsedata.info.user){
+ 		if(data.info.user){
             $("#py1_avatar").html('<img src="' + data.info.user.avatar+ '" class="layui-circle">');
             $("#py1_username").html(data.info.user.name + '(我)');
-        }else if(responsedata.info.players){
+        }else if(data.info.players){
           $("#py2_avatar").html('<img src="' + data.info.players.avatar + '" class="layui-circle">');
           $("#py2_username").html(data.info.players.name);
         }
@@ -105,7 +106,9 @@ common={
  	 	//_this.data.question_id
  	},startGame:function(){
  		if(this.data.isReady=="1")
- 		this.Join();
+ 		this.Join(function(res){
+ 			common.tips(res.msg);
+ 		});
  		else this.tips("登录失败");
  	},initSocket:function(){
  		var _this=this;