Browse Source

Merge branch 'master' of http://120.78.169.79:3000/zhengxiaoyu/datiGame

郑晓宇 6 years ago
parent
commit
a65c7a10b1
3 changed files with 23 additions and 13 deletions
  1. 3 3
      public/h5/datigame/css/main.css
  2. 1 1
      public/h5/datigame/index.html
  3. 19 9
      public/h5/datigame/js/common.js

+ 3 - 3
public/h5/datigame/css/main.css

@@ -217,7 +217,7 @@ background-color:#009688;
      box-shadow: 0 0.1rem 0rem #00706f;
      box-shadow: 0 0.1rem 0rem #00706f;
   /* background: url(../img/check-true.png) no-repeat center; */background-size:100%;color: #FFF;box-shadow: 0 0.1rem 0rem #7e8cdd;}
   /* background: url(../img/check-true.png) no-repeat center; */background-size:100%;color: #FFF;box-shadow: 0 0.1rem 0rem #7e8cdd;}
 .qs-item .cur_answer.cur_error{/*      background: url(../img/check-error.png) no-repeat center; */background-size:100%;color: #FFF;background: #ff5970;box-shadow: 0 0.1rem 0rem #931325;}
 .qs-item .cur_answer.cur_error{/*      background: url(../img/check-error.png) no-repeat center; */background-size:100%;color: #FFF;background: #ff5970;box-shadow: 0 0.1rem 0rem #931325;}
-.qs-item .cur_answer.cur_true{
+.qs-item li.cur_true{
      background-color:#8BC34A;
      background-color:#8BC34A;
      color: #FFF;
      color: #FFF;
      box-shadow: 0 0.1rem 0rem #4CAF50;
      box-shadow: 0 0.1rem 0rem #4CAF50;
@@ -236,7 +236,7 @@ background-color:#009688;
   -webkit-transform: rotate(-45deg);
   -webkit-transform: rotate(-45deg);
   transform: rotate(-45deg);
   transform: rotate(-45deg);
 }
 }
-.qs-item .cur_answer.cur_true::before{content:"";position:absolute;left: 0.3rem;top: .3rem;width: .35rem;height: .35rem;border: solid .1rem #FFF;border-radius: 50%;}
+.qs-item li.cur_true::before{content:"";position:absolute;left: 0.3rem;top: .3rem;width: .35rem;height: .35rem;border: solid .1rem #FFF;border-radius: 50%;}
 .qs-item .page{text-align: center;color: #fff;font-size: .3rem;clear: both;}
 .qs-item .page{text-align: center;color: #fff;font-size: .3rem;clear: both;}
 .end .qs-item{display: none;}
 .end .qs-item{display: none;}
 .result{width: 6.12rem;height: 9rem;margin: 4.8rem 0.7rem 0;background-color: #FFF;display: none;position: relative;}
 .result{width: 6.12rem;height: 9rem;margin: 4.8rem 0.7rem 0;background-color: #FFF;display: none;position: relative;}
@@ -379,7 +379,7 @@ background-color:#009688;
     top: .5rem;
     top: .5rem;
 }
 }
 .popbg{display: none;position: fixed;left: 0;top: 0;width: 100%;height: 100%;background: rgba(0,0,0,0.5);z-index: 90;}
 .popbg{display: none;position: fixed;left: 0;top: 0;width: 100%;height: 100%;background: rgba(0,0,0,0.5);z-index: 90;}
-.covxlz{ width: 2.86rem;left: 50%; margin-left: -1.43rem; bottom: .5rem; height: 1rem; border-radius: .5rem; background-color: #a7a8c5;line-height: 1rem;text-align: center;color: #222e71 }
+.covxlz{ width: 2.86rem;left: 50%; margin-left: -1.43rem; top: 11rem; height: 1rem; border-radius: .5rem; background-color: #a7a8c5;line-height: 1rem;text-align: center;color: #222e71 }
 .con {
 .con {
   position:relative;
   position:relative;
   display:inline-block;
   display:inline-block;

+ 1 - 1
public/h5/datigame/index.html

@@ -42,7 +42,7 @@
       <div class="cov covtit2"></div>
       <div class="cov covtit2"></div>
     </div>
     </div>
     <div class="g-inner gstart">
     <div class="g-inner gstart">
-       <span class="cov covxlz">星力值:560</span>
+       <span class="cov covxlz">星力值:<em class="sum">0</em></span>
       <div class="loading amt">
       <div class="loading amt">
         <div class="loader">
         <div class="loader">
           <div class="face">
           <div class="face">

+ 19 - 9
public/h5/datigame/js/common.js

@@ -2,8 +2,7 @@ common={
  	data:{
  	data:{
  		baseurl:"http://183.234.61.252:8090/",
  		baseurl:"http://183.234.61.252:8090/",
  		getUserInfo:"Home/User/Info",
  		getUserInfo:"Home/User/Info",
- 		register:"",
- 		WebSocket:"",
+ 		WebSocket:"ws://183.234.61.252:8282",
  		bdSocket:"Home/User/Bind",
  		bdSocket:"Home/User/Bind",
  		Join:"Home/User/Join",
  		Join:"Home/User/Join",
  		Answer:"Home/Game/Answer",
  		Answer:"Home/Game/Answer",
@@ -70,13 +69,11 @@ common={
    //          $("#py1_avatar").html('<img src="' + data.info.user.avatar+ '" class="layui-circle">');
    //          $("#py1_avatar").html('<img src="' + data.info.user.avatar+ '" class="layui-circle">');
    //          $("#py1_username").html(data.info.user.name + '(我)');
    //          $("#py1_username").html(data.info.user.name + '(我)');
    //      }
    //      }
-   this.tips(data.info.user.name+"加入了房间")
+   	this.tips(data.info.user.name+"加入了房间")
         if(data.info.user.user_id!=this.userInfo.user_id){
         if(data.info.user.user_id!=this.userInfo.user_id){
         	 $("#py2_avatar").html('<img src="' + data.info.user.avatar+ '" class="layui-circle">');
         	 $("#py2_avatar").html('<img src="' + data.info.user.avatar+ '" class="layui-circle">');
             $("#py2_username").html(data.info.user.name);
             $("#py2_username").html(data.info.user.name);
-          	
-          
-        }
+     }
  		 
  		 
  	},onSocket:function(e){
  	},onSocket:function(e){
  		var data=JSON.parse(e.data);
  		var data=JSON.parse(e.data);
@@ -119,7 +116,7 @@ common={
  		else this.tips("登录失败");
  		else this.tips("登录失败");
  	},initSocket:function(){
  	},initSocket:function(){
  		var _this=this;
  		var _this=this;
- 		  var ws = new WebSocket("ws://183.234.61.252:8282");
+ 		  var ws = new WebSocket(this.data.WebSocket);
  		 	  ws.onmessage=function(e){
  		 	  ws.onmessage=function(e){
  		 	  	_this.onSocket(e);
  		 	  	_this.onSocket(e);
  		 	  }
  		 	  }
@@ -167,6 +164,19 @@ common={
  		})
  		})
  		
  		
  		
  		
+ 	},increment:function(bdclass,num){
+ 		 var obj=$("."+bdclass);
+ 		 var text=obj.text();
+		obj.prop('Counter',text).animate({
+			Counter: num
+		},{
+				duration: 1500,
+				easing: 'swing',
+				step: function (now){  
+					$(this).text(Math.ceil(now));
+				}
+			});
+	 
  	},daoshu:function(argument) {
  	},daoshu:function(argument) {
  			var _this=this;
  			var _this=this;
 	    clearInterval(this.data.ts);
 	    clearInterval(this.data.ts);
@@ -240,8 +250,8 @@ common={
  		}
  		}
  		this.getUserInfo(function(res){
  		this.getUserInfo(function(res){
  			_this.userInfo=res.info;
  			_this.userInfo=res.info;
- 				$("#py1_username").html(res.info.name);
-   				$("#py1_avatar").html('<img src="' + res.info.avatar + '" class="layui-circle">');
+ 			$("#py1_username").html(res.info.name);
+   			$("#py1_avatar").html('<img src="' + res.info.avatar + '" class="layui-circle">');
  			_this.initSocket();
  			_this.initSocket();
 
 
  		})
  		})