|
@@ -29,7 +29,7 @@
|
|
<p>1.随机匹配对手<br />
|
|
<p>1.随机匹配对手<br />
|
|
2.在50秒内完成5道题目<br />
|
|
2.在50秒内完成5道题目<br />
|
|
3.10秒内完成答题,答对加分,答错不扣分<br />
|
|
3.10秒内完成答题,答对加分,答错不扣分<br />
|
|
- 4.每题满分100分,慢一秒答题扣10分<br />
|
|
|
|
|
|
+ 4.每题满分300分,慢一秒答题扣10分<br />
|
|
5.最终得分高为胜者,获得奖励</p>
|
|
5.最终得分高为胜者,获得奖励</p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
@@ -61,7 +61,8 @@
|
|
<input type="hidden" id="user_id" name="user_id">
|
|
<input type="hidden" id="user_id" name="user_id">
|
|
<input type="hidden" id="duishou" name="duishou">
|
|
<input type="hidden" id="duishou" name="duishou">
|
|
</div>
|
|
</div>
|
|
- <div class="cov cov3 amt" id="Jvs">匹配中
|
|
|
|
|
|
+ <div class="cov cov3 amt" id="Jvs">
|
|
|
|
+ <span class="tit">匹配中</span>
|
|
<div class="con" style="display: none;">
|
|
<div class="con" style="display: none;">
|
|
<div class="percent-circle percent-circle-left">
|
|
<div class="percent-circle percent-circle-left">
|
|
<div class="left-content "></div>
|
|
<div class="left-content "></div>
|
|
@@ -108,7 +109,7 @@ layui.use(['form','jquery'], function(){
|
|
var is_end = 0;
|
|
var is_end = 0;
|
|
var question_id=0;
|
|
var question_id=0;
|
|
var ts;
|
|
var ts;
|
|
- var sum=5;
|
|
|
|
|
|
+ var sum=9;
|
|
var angle = 0 ;
|
|
var angle = 0 ;
|
|
$.ajaxSetup({
|
|
$.ajaxSetup({
|
|
headers: {
|
|
headers: {
|
|
@@ -157,6 +158,7 @@ function daoshu(argument) {
|
|
if (sum >= 0) textCircle.innerHTML = sum;
|
|
if (sum >= 0) textCircle.innerHTML = sum;
|
|
sum = sum - 1;
|
|
sum = sum - 1;
|
|
$("#Jvs .con").show();
|
|
$("#Jvs .con").show();
|
|
|
|
+ $("#Jvs .tit").html("抢答中");
|
|
angle += 36;
|
|
angle += 36;
|
|
if (angle <= 360) {
|
|
if (angle <= 360) {
|
|
if (angle > 180) {
|
|
if (angle > 180) {
|
|
@@ -228,10 +230,11 @@ function daoshu(argument) {
|
|
break;
|
|
break;
|
|
case 'answer':
|
|
case 'answer':
|
|
console.log(data);
|
|
console.log(data);
|
|
|
|
+
|
|
if(data.user_id == $("#user_id").val()){
|
|
if(data.user_id == $("#user_id").val()){
|
|
var score = parseInt($("#py1_score").html());
|
|
var score = parseInt($("#py1_score").html());
|
|
if(data.is_true == 1){
|
|
if(data.is_true == 1){
|
|
- $("#py1_score").html(score+300);
|
|
|
|
|
|
+ $("#py1_score").html(score+300*(sum/10));
|
|
$(".cur_answer").addClass("cur_true");
|
|
$(".cur_answer").addClass("cur_true");
|
|
}else{
|
|
}else{
|
|
$(".cur_answer").addClass("cur_error");
|
|
$(".cur_answer").addClass("cur_error");
|
|
@@ -239,14 +242,16 @@ function daoshu(argument) {
|
|
}else{
|
|
}else{
|
|
if(data.is_true == 1){
|
|
if(data.is_true == 1){
|
|
var score = parseInt($("#py2_score").html());
|
|
var score = parseInt($("#py2_score").html());
|
|
- $("#py2_score").html(score+300);
|
|
|
|
|
|
+ $("#py2_score").html(score+300*(sum/10));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var py1_score = parseInt($("#py1_score").html());
|
|
var py1_score = parseInt($("#py1_score").html());
|
|
var py2_score = parseInt($("#py2_score").html());
|
|
var py2_score = parseInt($("#py2_score").html());
|
|
if(data.is_end == 1){
|
|
if(data.is_end == 1){
|
|
//结算
|
|
//结算
|
|
- clearInterval(ts)
|
|
|
|
|
|
+ clearInterval(ts)
|
|
|
|
+ setTimeout(function (argument) {
|
|
|
|
+
|
|
$(".g-doc .g-inner").addClass("end");
|
|
$(".g-doc .g-inner").addClass("end");
|
|
$("#Jvs").hide();
|
|
$("#Jvs").hide();
|
|
|
|
|
|
@@ -277,6 +282,8 @@ function daoshu(argument) {
|
|
cur_question = 1;
|
|
cur_question = 1;
|
|
room_id = 0;
|
|
room_id = 0;
|
|
|
|
|
|
|
|
+ },1000)
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
return false;
|
|
return false;
|
|
@@ -295,7 +302,10 @@ function daoshu(argument) {
|
|
break;
|
|
break;
|
|
// 当mvc框架调用GatewayClient发消息时直接alert出来
|
|
// 当mvc框架调用GatewayClient发消息时直接alert出来
|
|
case "question":
|
|
case "question":
|
|
- loadQuestion(data);
|
|
|
|
|
|
+ setTimeout(function(argument) {
|
|
|
|
+ loadQuestion(data);
|
|
|
|
+ },1000);
|
|
|
|
+
|
|
default :
|
|
default :
|
|
// alert(e.data);
|
|
// alert(e.data);
|
|
}
|
|
}
|
|
@@ -369,7 +379,7 @@ function daoshu(argument) {
|
|
})}
|
|
})}
|
|
var answer=function(answerId) {
|
|
var answer=function(answerId) {
|
|
|
|
|
|
- answerId= answerId?answerId:$("#question .answer").eq(0).attr("data-id");//默认第一题为答案
|
|
|
|
|
|
+ answerId= answerId?answerId:0;//默认第一题为答案
|
|
var url = '/Home/Game/Answer';
|
|
var url = '/Home/Game/Answer';
|
|
|
|
|
|
$.post(url, {option_id:answerId,cur_question:cur_question,client_id:client_id,is_end:is_end,question_id:question_id}, function(responsedata){
|
|
$.post(url, {option_id:answerId,cur_question:cur_question,client_id:client_id,is_end:is_end,question_id:question_id}, function(responsedata){
|