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