|
@@ -41,7 +41,7 @@
|
|
|
</div>
|
|
|
<div class="cov cov2 amt">
|
|
|
<button id="start_game" class="layui-btn layui-btn-normal" style="margin-top: 20px;">匹配对手</button>
|
|
|
- <input type="hidden" id="uid" name="uid">
|
|
|
+ <input type="hidden" id="user_id" name="user_id">
|
|
|
<input type="hidden" id="duishou" name="duishou">
|
|
|
</div>
|
|
|
<div class="cov cov3 amt">vs</div>
|
|
@@ -96,7 +96,7 @@ layui.use(['form','jquery'], function(){
|
|
|
console.log(responsedata)
|
|
|
$("#username").html(responsedata.info.username);
|
|
|
$("#avatar").html('<img src="' + responsedata.info.avatar + '" class="layui-circle">');
|
|
|
- $("#uid").val(responsedata.info.uid);
|
|
|
+ $("#user_id").val(responsedata.info.user_id);
|
|
|
},'json');
|
|
|
|
|
|
//绑定通信
|
|
@@ -127,18 +127,18 @@ layui.use(['form','jquery'], function(){
|
|
|
$(".g-doc .g-inner").removeClass("gstart");
|
|
|
$(".g-doc .g-inner").addClass("doing");
|
|
|
//设置player值
|
|
|
- if(data.info.players[0]['uid'] == $("#uid").val()){
|
|
|
+ if(data.info.players[0]['user_id'] == $("#user_id").val()){
|
|
|
$("#py1_avatar").html('<img src="' + data.info.players[0]['avatar'] + '" class="layui-circle">');
|
|
|
$("#py1_username").html(data.info.players[0]['username'] + '(我)');
|
|
|
$("#py2_avatar").html('<img src="' + data.info.players[1]['avatar'] + '" class="layui-circle">');
|
|
|
$("#py2_username").html(data.info.players[1]['username']);
|
|
|
- $("#duishou").val(data.info.players[1]['uid']);
|
|
|
+ $("#duishou").val(data.info.players[1]['user_id']);
|
|
|
}else{
|
|
|
$("#py1_avatar").html('<img src="' + data.info.players[1]['avatar'] + '" class="layui-circle">');
|
|
|
$("#py1_username").html(data.info.players[1]['username']+'(我)');
|
|
|
$("#py2_avatar").html('<img src="' + data.info.players[0]['avatar'] + '" class="layui-circle">');
|
|
|
$("#py2_username").html(data.info.players[0]['username']);
|
|
|
- $("#duishou").val(data.info.players[0]['uid']);
|
|
|
+ $("#duishou").val(data.info.players[0]['user_id']);
|
|
|
}
|
|
|
|
|
|
if(data.info.room_id){
|
|
@@ -148,7 +148,7 @@ layui.use(['form','jquery'], function(){
|
|
|
break;
|
|
|
case 'answer':
|
|
|
console.log(data);
|
|
|
- if(data.user_id == $("#uid").val()){
|
|
|
+ if(data.user_id == $("#user_id").val()){
|
|
|
var score = parseInt($("#py1_score").html());
|
|
|
if(data.is_true == 1){
|
|
|
$("#py1_score").html(score+1);
|