mzx16822 6 jaren geleden
bovenliggende
commit
20c60dfb14
1 gewijzigde bestanden met toevoegingen van 7 en 3 verwijderingen
  1. 7 3
      public/h5/datigame/js/common.js

+ 7 - 3
public/h5/datigame/js/common.js

@@ -125,6 +125,7 @@ common={
 
  	},loadQuestion(responsedata) {
         console.log(responsedata);
+        _this.data.isAnswer=false;
         var _this=this;
        _this.data.question_id= responsedata.info.question.question_id;
         $("#Jqtitle").html(responsedata.info.question.title );
@@ -154,9 +155,11 @@ common={
  		$("#question .item").on("touchend",function(){
  			var l = $("#question .item.cur_answer").length;
  			if(l>0)return;
- 			_this.data.option_id=this.attr("data-option_id");
  			this.addClass("cur_answer");
- 			_this.Answer();
+ 			_this.data.option_id=this.attr("data-option_id");
+ 			_this.Answer(function(){
+ 				_this.data.isAnswer=true;
+ 			});
  		})
  		
  	},daoshu:function(argument) {
@@ -183,7 +186,8 @@ common={
 	            }
 	        }
 	        if (_this.data.sum < -1) {
-	            answer();
+	        	if(!_this.data.isAnswer)
+	           	_this.Answer();
 	            _this.data.sum = 9;
 	            _this.data.angle = 0;
 	            leftContent.setAttribute('style', 'transform: rotate(0deg)');