mzx16822 6 lat temu
rodzic
commit
22bd1649ed
1 zmienionych plików z 16 dodań i 10 usunięć
  1. 16 10
      public/h5/datigame/js/common.js

+ 16 - 10
public/h5/datigame/js/common.js

@@ -167,6 +167,11 @@ common={
           break;
           case "answer":
           if(_this.userInfo.user_id==data.user_id){
+          	if( parseInt($("#py1_score").html())==data.total_score){
+          		$("#question .cur_answer").addClass("cur_error");
+          	}else{
+          		$("#question .cur_answer").addClass("cur_true");
+          	}
           	_this.increment($("#py1_score"),data.total_score);
           }else if(_this.userInfo.playerId==data.user_id){
           	_this.increment($("#py2_score"),data.total_score);
@@ -264,8 +269,17 @@ common={
 		var textCircle   = document.querySelector(".text-circle");
 	    leftContent.setAttribute('style', 'transform: rotate(0deg)');
 	    rightContent.setAttribute('style', 'transform: rotate(0deg)');
+	    var html="<b class=''>"+_this.data.sum+"</b>";
 	    this.data.ts = setInterval(function() {
-	        if (_this.data.sum >= 0) textCircle.innerHTML = _this.data.sum;
+	    	if(_this.data.sum<4){
+	    		 html="<b class='rubberBand animated'>"+_this.data.sum+"</b>";
+	        	setTimeout(function(){
+	        		$(".text-circle b").removeClass("rubberBand");
+	        		$(".text-circle b").removeClass("animated");
+	        	},900)
+	        }
+
+	        if (_this.data.sum >= 0) textCircle.innerHTML = html;
 	        _this.data.sum = _this.data.sum - 1;
 	        $("#Jvs .con").show();
 	        $("#Jvs .tit").html("抢答中");
@@ -278,15 +292,7 @@ common={
 	            }
 	        }
 	        
-	        if(_this.data.sum<3){
-
-	        	$(".text-circle").addClass("rubberBand");
-	        	$(".text-circle").addClass("animated");
-	        	setTimeout(function(){
-	        		$(".text-circle").removeClass("rubberBand");
-	        		$(".text-circle").removeClass("animated");
-	        	},900)
-	        }
+	        
 	        
 	        if (_this.data.sum < -1) {
 	        	if(!_this.data.isAnswer)