|
@@ -304,7 +304,7 @@ var textCircle = document.querySelector(".text-circle");
|
|
|
break;
|
|
|
// 当mvc框架调用GatewayClient发消息时直接alert出来
|
|
|
case "question":
|
|
|
- loadQuestion(data);
|
|
|
+ loadQuestion(data.info);
|
|
|
default :
|
|
|
alert(e.data);
|
|
|
}
|
|
@@ -354,7 +354,7 @@ var textCircle = document.querySelector(".text-circle");
|
|
|
|
|
|
//获取题目
|
|
|
function loadQuestion(responsedata) {
|
|
|
- if(responsedata.code == 0){
|
|
|
+
|
|
|
question_id= responsedata.info.question.question_id;
|
|
|
$("#Jqtitle").html(responsedata.info.question.title );
|
|
|
var question="";
|
|
@@ -366,11 +366,7 @@ var textCircle = document.querySelector(".text-circle");
|
|
|
$("#Jpage").html(responsedata.info.questions_count+"/5")
|
|
|
// is_end = responsedata.info.question.is_end;
|
|
|
daoshu();
|
|
|
- }else{
|
|
|
- layer.msg(responsedata.msg, {
|
|
|
- time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
|
|
- });
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
var getQuestion = function getQuestion(room_id, index) {
|
|
|
var url = '/Home/Game/Question';
|
|
@@ -379,7 +375,7 @@ var textCircle = document.querySelector(".text-circle");
|
|
|
},'json').fail(function () {
|
|
|
layer.msg("服务器繁忙");
|
|
|
clearInterval(ts)
|
|
|
- })}
|
|
|
+ })}
|
|
|
var answer=function(answerId) {
|
|
|
|
|
|
answerId= answerId?answerId:$("#question .answer").eq(0).attr("data-id");//默认第一题为答案
|