mzx16822 6 lat temu
rodzic
commit
12e076c7c7
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4 2
      resources/views/home/user.blade.php

+ 4 - 2
resources/views/home/user.blade.php

@@ -109,6 +109,7 @@ layui.use(['form','jquery'], function(){
                   sum= sum-1;
                   $("#Jvs").html(sum);
                   if(sum<=0){
+                    cur_question++;
                     getQuestion(room_id, cur_question);
                     sum=5;
                   }
@@ -289,7 +290,7 @@ layui.use(['form','jquery'], function(){
         $("#question").html(question);
         $("#Jpage").html(responsedata.info.questions_count)
        // is_end = responsedata.info.question.is_end;
-         clearInterval(ts)
+         
       }else{
         layer.msg(responsedata.msg, {
           time: 1000 //2秒关闭(如果不配置,默认是3秒)
@@ -302,12 +303,13 @@ layui.use(['form','jquery'], function(){
     if($(".cur_answer").length > 0){
       return false;
     }
-    clearInterval(ts)
+    
     var url = '/Home/Game/Answer';
     var answer = $(this).data("id");
     $(this).addClass("cur_answer");
     $.post(url, {answer:answer,cur_question:cur_question,room_id:room_id,client_id:client_id,is_end:is_end,question_id:question_id}, function(responsedata){
       console.log(responsedata);
+      clearInterval(ts)
     });
     cur_question = cur_question + 1;
   });