소스 검색

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

郑晓宇 6 년 전
부모
커밋
d5cea1f916
33개의 변경된 파일978개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      public/h5/datigame/css/animate.min.css
  2. 463 0
      public/h5/datigame/css/main.css
  3. 23 0
      public/h5/datigame/css/wapzt_base_rem.1.0.css
  4. BIN
      public/h5/datigame/img/again.png
  5. BIN
      public/h5/datigame/img/back-home.png
  6. BIN
      public/h5/datigame/img/bg.png
  7. BIN
      public/h5/datigame/img/bg1.jpg
  8. BIN
      public/h5/datigame/img/bg1.png
  9. BIN
      public/h5/datigame/img/bg2.jpg
  10. BIN
      public/h5/datigame/img/check-error.png
  11. BIN
      public/h5/datigame/img/check-true.png
  12. BIN
      public/h5/datigame/img/check.png
  13. BIN
      public/h5/datigame/img/djs-bg.png
  14. BIN
      public/h5/datigame/img/enter.png
  15. BIN
      public/h5/datigame/img/fail.png
  16. BIN
      public/h5/datigame/img/item.png
  17. BIN
      public/h5/datigame/img/rule.png
  18. BIN
      public/h5/datigame/img/rulebg.png
  19. BIN
      public/h5/datigame/img/start.png
  20. BIN
      public/h5/datigame/img/success.png
  21. BIN
      public/h5/datigame/img/tit1.png
  22. BIN
      public/h5/datigame/img/tit2.png
  23. BIN
      public/h5/datigame/img/user0-face.png
  24. BIN
      public/h5/datigame/img/user0.png
  25. BIN
      public/h5/datigame/img/user1-face.png
  26. BIN
      public/h5/datigame/img/user1.png
  27. 110 0
      public/h5/datigame/index.html
  28. 103 0
      public/h5/datigame/js/base64.js
  29. 219 0
      public/h5/datigame/js/common.js
  30. 45 0
      public/h5/datigame/js/lib-jquery1.10.2.js
  31. 6 0
      public/h5/datigame/js/plugin-preload.js
  32. BIN
      public/h5/datigame/js/~$园&对战游戏_接口规格说明书V1.2.docx
  33. BIN
      public/h5/datigame/js/异次园&对战游戏_接口规格说明书V1.2.docx

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 9 - 0
public/h5/datigame/css/animate.min.css


+ 463 - 0
public/h5/datigame/css/main.css

@@ -0,0 +1,463 @@
+@charset "utf-8";
+body,dl,dd,ul,ol,h1,h2,h3,h4,h5,h6,pre,form,input,textarea,p,hr,thead,tbody,tfoot,th,td{margin:0;padding:0;}
+ul,ol{list-style:none;}
+a{text-decoration:none;}
+html{-ms-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;}
+body{line-height:1.5;}
+body,button,input,select,textarea{font-family:'helvetica neue',tahoma,'hiragino sans gb',stheiti,'wenquanyi micro hei',\5FAE\8F6F\96C5\9ED1,\5B8B\4F53,sans-serif;}
+b,strong{font-weight:bold;}
+i,em{font-style:normal;}
+table{border-collapse:collapse;border-spacing:0;}
+table th,table td{border:1px solid #ddd;padding:5px;}
+table th{font-weight:inherit;border-bottom-width:2px;border-bottom-color:#ccc;}
+img{border:0 none;width:auto\9;max-width:100%;vertical-align:top;}
+button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;vertical-align:baseline;}
+button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}
+button[disabled],input[disabled]{cursor:default;}
+input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}
+input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}
+input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
+@media screen and (-webkit-min-device-pixel-ratio:0){input{line-height:normal!important;}}
+select[size],select[multiple],select[size][multiple]{border:1px solid #AAA;padding:0;}
+article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}
+audio,canvas,video,progress{display:inline-block;}
+a,input,button{outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); -webkit-focus-ring-color: rgba(0, 0, 0, 0);}
+button,input{outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); -webkit-user-modify: read-write-plaintext-only;}
+.loader {
+    width: 4rem;
+    height: 4rem;
+    font-size: 10px;
+    position: relative;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    margin: 2rem auto 0;
+}
+.g-doc{
+        width: 7.5rem;
+        margin: 0 auto;
+        position: relative;
+}
+.loader .face {
+    position: absolute;
+    border-radius: 50%;
+    border-style: solid;
+    animation: animate 3s linear infinite;
+}
+
+.loader .face:nth-child(1) {
+    width: 100%;
+    height: 100%;
+    color: #bbc5ff;
+    /* border-color: currentColor transparent transparent currentColor; */
+    /* border-width: 0.2em 0.2em 0em 0em; */
+    --deg: -45deg;
+    animation-direction: normal;
+}
+
+.loader .face:nth-child(2) {
+    width: 70%;
+    height: 70%;
+    color: #bbc5ff;
+    /* border-color: currentColor currentColor transparent transparent; */
+    /* border-width: 0.2em 0em 0em 0.2em; */
+    --deg: -135deg;
+    animation-direction: reverse;
+}
+
+.loader .face .circle {
+    position: absolute;
+    width: 50%;
+    height: 0.1em;
+    top: 50%;
+    left: 50%;
+    background-color: transparent;
+    transform: rotate(var(--deg));
+    transform-origin: left;
+}
+
+.loader .face .circle::before {
+    position: absolute;
+    top: -0.5em;
+    right: -0.5em;
+    content: '';
+    width: 1em;
+    height: 1em;
+    background-color: currentColor;
+    border-radius: 50%;
+    box-shadow: 0 0 2em,
+                0 0 4em,
+                0 0 6em,
+                0 0 8em,
+                0 0 10em,
+                0 0 0 0.5em rgba(255, 255, 0, 0.1);
+}
+
+@keyframes animate {
+    to {
+        transform: rotate(1turn);
+    }
+}
+body{
+    background: url(../img/bg2.jpg) center top;
+}
+.cov{ position: absolute; }
+.g-inner{margin: 0 auto;width: 7.5rem;overflow: hidden;}
+.cov1{left: 50%;top: 3.3rem;width: 2.4rem;margin-left: -1.2rem;/* border: solid #71a3fd 2px; */border-radius: 50%;}
+.cov2{left: 50%;top: 10.5rem;margin-left: -1.5rem;width: 3rem;font-size: .3rem;text-align: center;}
+.cov1 .userface{width: 2.2rem;height: 2.2rem;margin: 0 auto;}
+.cov3{left: 50%;top: 7rem;width: 2rem;height: 1rem;line-height: 1rem;margin-left: -1rem;text-align: center;font-size: .5rem;color: #FFF;font-weight: bold;border-radius: .2rem;}
+.cov4{right: 50%;top: 8.5rem;width: 2rem;margin-right: -1rem;}
+ .userface{border-radius: 50%;overflow: hidden;background-color: #000;display: block;}
+.cov4 .userface{width: 2.0rem;height: 2.0rem;float: right;opacity: 0;}
+.doing .cov1{left: -.5rem;margin: 0;top: 1rem;background: #32deec;border-radius: 1rem;width: 4.3rem;border: 0;background: url(../img/user0.png);background-size: 4.3rem;height: 1rem;}
+.num{opacity: 0;color: #FFF;FONT-SIZE: 0.6REM;position: absolute;top: 0;text-shadow: 0px 0px 6px #7f8dde;}
+.doing .num{opacity: 1;line-height: .8rem;text-align: center;text-shadow: 2px 2px 0px #820b3e;}
+.doing .cov1 .num{
+    /* color: #FFF; */
+    /* FONT-SIZE: 0.5REM; */
+    left: 2.3rem;
+}
+.doing .cov4 .num{
+    left: .8rem;
+}
+.doing .cov4,.end .cov4{right: 50%;top: 10rem;width: 2rem;margin-left: -1rem;}
+.doing .cov4{right: -.4rem;top: 2rem;width: 4rem;border-radius: 1rem;margin-right: 0rem;height: 1rem;background: url(../img/user1.png);background-size: 4.3rem;}
+.doing .cov1  .userface{width: 1.0rem;height: 1.0rem;left: .8rem;background: url(../img/user0-face.png);background-size: 100%;}
+ 
+.doing .cov2 , .doing .loading{opacity: 0;position: absolute;left: 50%;margin-left: -2.3rem;}
+.doing .cov3{top: 0rem;z-index: 9;}
+.doing  .userface{position: absolute;top: -.5rem;}
+.cov .name{
+    color: #fff;
+    font-style: normal;
+    position: absolute;
+    left: .8rem;
+    font-size: .35rem;
+    top: 1rem;
+    left: .2rem;
+    width: 2rem;
+    text-align: center;
+    text-shadow: 2px 2px 0px #820b3e;
+}
+.cov4 .name{left: 1.7rem;top: -1.2rem;}
+.gstart .name{top: 3.4rem;width: 2rem;left: 50%;margin-left: -1rem;text-align: center;}
+.gstart .cov4  .name{ left: 46%;  }
+.doing.gstart .name{ top:inherit; }
+.doing.gstart .cov4  .name{ left:inherit;  }
+.doing  .qs-item{display:block;width: 5.50rem;}
+.doing  .cov4 .userface{opacity:1;width: 1rem;height: 1rem;left: 2.3rem;background: url(../img/user0-face.png);background-size: 100%;}
+.doing   .userface img{
+    padding: 0.1rem;
+    width: .8rem;
+    border-radius: 50%;
+}
+.qs-item{padding: 3.8rem 1rem 0;display: none;position: absolute;left: 0;top: 0;z-index: 99;}
+.qs-item .tit{color: #FFF;font-size: .4rem;text-align: center;display: block;margin-bottom: .2rem;}
+.qs-item .list{
+    margin: 0 auto;
+    width: 4.4rem;
+}
+.qs-item li{
+    width: 4.46rem;
+    height: .95rem;
+    border-radius: 1.15rem;
+    color: #8400b1;
+    background-color: #FFF;
+    text-align: center;
+    line-height: 1.15rem;
+    margin-bottom: .5rem;
+    overflow: hidden;
+    
+}
+.qs-item li:nth-child(2n){
+    -webkit-animation-name: bounceInLeft;
+    animation-name: bounceInLeft;
+    -webkit-animation-duration: .5s;
+    animation-duration: .5s;
+    -webkit-animation-fill-mode: both;
+    animation-fill-mode: both;
+}
+.qs-item li:nth-child(2n-1){
+    -webkit-animation-name: bounceInRight;
+    animation-name: bounceInRight;
+    -webkit-animation-duration: .5s;
+    animation-duration: .5s;
+    -webkit-animation-fill-mode: both;
+    animation-fill-mode: both;
+}
+.qs-item li.answer {
+    width: 100%;
+    height: 100%;
+    margin: 0;
+    /* background: url(../img/check.png) no-repeat center; */
+    background-color: #FFF;
+    border: 0;
+    background-size: 100%;
+    color: #222e71;
+    font-size: .44rem;
+    float: left;
+    margin-bottom: .3rem;
+    box-shadow: 0 0.1rem 0rem #7e8cdd;
+    position: relative;
+}
+.result .btn.on,.rulebtn.on{
+     box-shadow: 0 0 1rem #FFEB3B;
+    border-radius: .15rem;
+}
+.qs-item li.on{
+     background-color:#8BC34A;
+     color: #FFF;
+     box-shadow: 0 0.1rem 0rem #4CAF50;
+    }
+.qs-item li.cur_answer{
+background-color:#009688;
+     color: #FFF;
+     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;}
+.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{
+     background-color:#8BC34A;
+     color: #FFF;
+     box-shadow: 0 0.1rem 0rem #4CAF50;
+}
+.qs-item .cur_answer.cur_error::before{content:"";position:absolute;left: .5rem;top: .5rem;width: .5rem;height: .1rem;background: #FFF;border-radius: .1rem;-webkit-transform: rotate(-45deg);transform: rotate(-45deg);}
+.qs-item .cur_answer.cur_error::after{
+  content:"";
+  content: "";
+  position: absolute;
+  left: .7rem;
+  top: .3rem;
+  width: .1rem;
+  height: .5rem;
+  background: #FFF;
+  border-radius: .1rem;
+  -webkit-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 .page{text-align: center;color: #fff;font-size: .3rem;clear: both;}
+.end .qs-item{display: none;}
+.result{width: 6.12rem;height: 9rem;margin: 4.8rem 0.7rem 0;background-color: #FFF;display: none;position: relative;}
+.end .result{display: block;background: url(../img/item.png) no-repeat center top;background-size: 100%;}
+.top-icon{width: 2.33rem;height: 3rem;background-size: 100%;display: block;position: absolute;top: -0.86rem;left: 50%;margin-left: -1.165rem;text-align: center;}
+.top-icon.success{background: url(../img/success.png) no-repeat;background-size: 100%;}
+.top-icon.faild{background: url(../img/fail.png)  no-repeat;background-size: 100%;}
+.result .live{color: #FFF;text-align: center;display: block;margin-top: 1.2rem;float: left;width: 100%;margin-bottom: 1rem;/* display: none; */text-indent: -33em;overflow: hidden;}
+.result .btn{
+    display: block;
+    width: 2.46rem;
+    height: 1rem;
+    margin: 0 auto .3rem;
+    text-align: center;
+    clear: both;
+    color: #FFF;
+    line-height: 1.15rem;
+    font-size: .45rem;
+    text-indent: -44em;
+    overflow: hidden;
+}
+.result .btn1{
+    background: url(../img/again.png);
+    background-size: 100%;
+}
+.result .btn2{
+    background: url(../img/back-home.png);
+    background-size: 100%;
+}
+.amt{
+        transition: all .3s;
+        -webkit-transition: all .3s;
+}
+.loading{
+    position: absolute;
+    left: 50%;
+    top: .4rem;
+    width: 4rem;
+    margin-left: -2rem;
+}
+#start_game.layui-btn {
+    display:inline-block;
+    width: 2.66rem;
+    height: 3.12rem;
+    line-height:38px;
+    padding:0 18px;
+    color:#fff;
+    white-space:nowrap;
+    text-align:center;
+    font-size:14px;
+    border:none;
+    border-radius:2px;
+    cursor:pointer;
+    background: url(../img/start.png) no-repeat center;
+    background-size: 100%;
+    text-indent: -33em;
+    overflow: hidden;
+    position: absolute;
+    left: 2.46rem;
+    top: 7.4rem;
+    z-index: 9;
+    -webkit-animation-name: swing;
+    animation-name: swing;
+    -webkit-animation-duration: 2s;
+    animation-duration: 2s;
+    -webkit-animation-fill-mode: both;
+    animation-fill-mode: both;
+    -webkit-animation-iteration-count: infinite;
+    animation-iteration-count: infinite;
+}
+.layui-btn:hover {
+    opacity:.8;
+    filter:alpha(opacity=80);
+    color:#fff
+}
+.layui-btn:active {
+    opacity:1;
+    filter:alpha(opacity=100)
+}
+.layui-btn+.layui-btn {
+    margin-left:10px
+}
+.welcome{background: url(../img/bg1.png) no-repeat center bottom;height: 13.4rem;background-size: 7.5rem;}
+.welcome .covtit1{
+    background: url(../img/tit1.png) no-repeat;
+    background-size: 100%;
+    width: 2.12rem;
+    height: 2.34rem;
+    left: .4rem;
+    top: .4rem;
+    -webkit-animation-name: wobble;
+    animation-name:wobble;
+    -webkit-animation-duration: 3s;
+    animation-duration: 3s;
+    -webkit-animation-fill-mode:both;
+    animation-fill-mode:both;
+    -webkit-animation-iteration-count: infinite;
+    animation-iteration-count:infinite;
+}
+.welcome .covtit2{
+    background: url(../img/tit2.png) no-repeat bottom;
+    background-size: 100%;
+    width: 6.63rem;
+    height: 5.46rem;
+    left: .4rem;
+    top: 2rem;
+    -webkit-animation-name: pulse;
+    animation-name: pulse;
+    -webkit-animation-duration: 2s;
+    animation-duration: 2s;
+    -webkit-animation-fill-mode: both;
+    animation-fill-mode: both;
+    -webkit-animation-iteration-count: infinite;
+    animation-iteration-count: infinite;
+}
+.gstart{display:none}
+.popwind{width:6.05rem;height:6.98rem;position: absolute;left: 0.8rem;top: 2.5rem;background: url(../img/rulebg.png);background-size: 100%;display: none;z-index: 99;}
+.popwind .art{
+    padding: 1.1rem .82rem .4rem;
+    height: 4rem;
+    color: #c0caff;
+    font-size: .32rem;
+}
+.popwind  .close{
+    width: 2.46rem;
+    height: 1rem;
+    display: block;
+    margin: 0 auto;
+    background: url(../img/enter.png);
+    background-size: 100%;
+}
+.welcome .rulebtn{
+    display: block;
+    width: 1.24rem;
+    height: .72rem;
+    background: url(../img/rule.png);
+    background-size: 100%;
+    position: absolute;
+    left: 6rem;
+    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;}
+.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 }
+.con {
+  position:relative;
+  display:inline-block;
+  height: 1.6rem;
+  width: 1.6rem;
+  background: url(../img/djs-bg.png);
+  background-size: 100%;
+  /* padding: .1rem; */
+}
+.doing .covxlz{display:none}
+.end .covxlz{display:block}
+.percent-circle {
+  position:absolute;
+  height:100%;
+  background: #f49136;
+  overflow: hidden;
+}
+
+.percent-circle-right {
+  right:0;
+  width: .8rem;
+  border-radius: 0 .8rem .8rem 0/0 .8rem .8rem 0;
+}
+
+.percent-circle-right .right-content{
+  position: absolute;
+  content: '';
+  width: 100%;
+  height: 100%;
+  transform-origin:left center;
+  transform: rotate(0deg);
+  border-radius: 0 .8rem .8rem 0/0 .8rem .8rem 0;
+  background: #ffffff;
+}
+
+.percent-circle-left {
+  width:.8rem;
+  border-radius: .8rem 0 0 .8rem/.8rem 0 0 .8rem;
+}
+
+.percent-circle-left .left-content {
+  position: absolute;
+  content: '';
+  width: 100%;
+  height: 100%;
+  transform-origin:right center;
+  transform: rotate(0deg);
+  border-radius: .8rem 0 0 .8rem/.8rem 0 0 .8rem;
+  background: #ffffff;
+}
+
+.text-circle {
+  position: absolute;
+  display:flex;
+  align-items: center;
+  justify-content: center;
+  height:80%;
+  width:80%;
+  left:10%;
+  top:10%;
+  border-radius:100%;
+  background: #2b236e;
+  color:#fff;
+}
+ .poptis{
+  display: inline-block;
+  height: 28px;
+  line-height: 28px;
+  border-radius: 9px;
+  background-color: #287AFF;
+  text-align: center;
+  color: #FFF;
+  margin: 0 auto;
+  display: block;
+  position: fixed;
+  left: 50%;
+  
+  top: 42%;
+  padding: 7px 27px;
+  font-size: 16px; 
+  z-index: 9999;
+}

+ 23 - 0
public/h5/datigame/css/wapzt_base_rem.1.0.css

@@ -0,0 +1,23 @@
+@charset "utf-8";
+body,dl,dd,ul,ol,h1,h2,h3,h4,h5,h6,pre,form,input,textarea,p,hr,thead,tbody,tfoot,th,td{margin:0;padding:0;}
+ul,ol{list-style:none;}
+a{text-decoration:none;}
+html{-ms-text-size-adjust:none;-webkit-text-size-adjust:none;text-size-adjust:none;}
+body{line-height:1.5;}
+body,button,input,select,textarea{font-family:'helvetica neue',tahoma,'hiragino sans gb',stheiti,'wenquanyi micro hei',\5FAE\8F6F\96C5\9ED1,\5B8B\4F53,sans-serif;}
+b,strong{font-weight:bold;}
+i,em{font-style:normal;}
+table{border-collapse:collapse;border-spacing:0;}
+table th,table td{border:1px solid #ddd;padding:5px;}
+table th{font-weight:inherit;border-bottom-width:2px;border-bottom-color:#ccc;}
+img{border:0 none;width:auto\9;max-width:100%;vertical-align:top;}
+button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;vertical-align:baseline;}
+button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}
+button[disabled],input[disabled]{cursor:default;}
+input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}
+input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}
+input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
+@media screen and (-webkit-min-device-pixel-ratio:0){input{line-height:normal!important;}}
+select[size],select[multiple],select[size][multiple]{border:1px solid #AAA;padding:0;}
+article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}
+audio,canvas,video,progress{display:inline-block;}

BIN
public/h5/datigame/img/again.png


BIN
public/h5/datigame/img/back-home.png


BIN
public/h5/datigame/img/bg.png


BIN
public/h5/datigame/img/bg1.jpg


BIN
public/h5/datigame/img/bg1.png


BIN
public/h5/datigame/img/bg2.jpg


BIN
public/h5/datigame/img/check-error.png


BIN
public/h5/datigame/img/check-true.png


BIN
public/h5/datigame/img/check.png


BIN
public/h5/datigame/img/djs-bg.png


BIN
public/h5/datigame/img/enter.png


BIN
public/h5/datigame/img/fail.png


BIN
public/h5/datigame/img/item.png


BIN
public/h5/datigame/img/rule.png


BIN
public/h5/datigame/img/rulebg.png


BIN
public/h5/datigame/img/start.png


BIN
public/h5/datigame/img/success.png


BIN
public/h5/datigame/img/tit1.png


BIN
public/h5/datigame/img/tit2.png


BIN
public/h5/datigame/img/user0-face.png


BIN
public/h5/datigame/img/user0.png


BIN
public/h5/datigame/img/user1-face.png


BIN
public/h5/datigame/img/user1.png


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 110 - 0
public/h5/datigame/index.html


+ 103 - 0
public/h5/datigame/js/base64.js

@@ -0,0 +1,103 @@
+function Base64() {
+ 
+    // private property
+    _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+ 
+    // public method for encoding
+    this.encode = function (input) {
+        var output = "";
+        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
+        var i = 0;
+        input = _utf8_encode(input);
+        while (i < input.length) {
+            chr1 = input.charCodeAt(i++);
+            chr2 = input.charCodeAt(i++);
+            chr3 = input.charCodeAt(i++);
+            enc1 = chr1 >> 2;
+            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+            enc4 = chr3 & 63;
+            if (isNaN(chr2)) {
+                enc3 = enc4 = 64;
+            } else if (isNaN(chr3)) {
+                enc4 = 64;
+            }
+            output = output +
+            _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +
+            _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
+        }
+        return output;
+    }
+ 
+    // public method for decoding
+    this.decode = function (input) {
+        var output = "";
+        var chr1, chr2, chr3;
+        var enc1, enc2, enc3, enc4;
+        var i = 0;
+        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+        while (i < input.length) {
+            enc1 = _keyStr.indexOf(input.charAt(i++));
+            enc2 = _keyStr.indexOf(input.charAt(i++));
+            enc3 = _keyStr.indexOf(input.charAt(i++));
+            enc4 = _keyStr.indexOf(input.charAt(i++));
+            chr1 = (enc1 << 2) | (enc2 >> 4);
+            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
+            chr3 = ((enc3 & 3) << 6) | enc4;
+            output = output + String.fromCharCode(chr1);
+            if (enc3 != 64) {
+                output = output + String.fromCharCode(chr2);
+            }
+            if (enc4 != 64) {
+                output = output + String.fromCharCode(chr3);
+            }
+        }
+        output = _utf8_decode(output);
+        return output;
+    }
+ 
+    // private method for UTF-8 encoding
+    _utf8_encode = function (string) {
+        string = string.replace(/\r\n/g,"\n");
+        var utftext = "";
+        for (var n = 0; n < string.length; n++) {
+            var c = string.charCodeAt(n);
+            if (c < 128) {
+                utftext += String.fromCharCode(c);
+            } else if((c > 127) && (c < 2048)) {
+                utftext += String.fromCharCode((c >> 6) | 192);
+                utftext += String.fromCharCode((c & 63) | 128);
+            } else {
+                utftext += String.fromCharCode((c >> 12) | 224);
+                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
+                utftext += String.fromCharCode((c & 63) | 128);
+            }
+ 
+        }
+        return utftext;
+    }
+ 
+    // private method for UTF-8 decoding
+    _utf8_decode = function (utftext) {
+        var string = "";
+        var i = 0;
+        var c = c1 = c2 = 0;
+        while ( i < utftext.length ) {
+            c = utftext.charCodeAt(i);
+            if (c < 128) {
+                string += String.fromCharCode(c);
+                i++;
+            } else if((c > 191) && (c < 224)) {
+                c2 = utftext.charCodeAt(i+1);
+                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
+                i += 2;
+            } else {
+                c2 = utftext.charCodeAt(i+1);
+                c3 = utftext.charCodeAt(i+2);
+                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
+                i += 3;
+            }
+        }
+        return string;
+    }
+}

+ 219 - 0
public/h5/datigame/js/common.js

@@ -0,0 +1,219 @@
+common={
+ 	data:{
+ 		baseurl:"http://183.234.61.252:8090/",
+ 		getUserInfo:"Home/User/Info",
+ 		register:"",
+ 		WebSocket:"",
+ 		bdSocket:"Home/User/Bind",
+ 		Join:"Home/User/Join",
+ 		Answer:"Home/User/Answer",
+ 		Join:"Home/Game/Join",
+ 		uid:"",
+ 	},userInfo:{
+
+ 	},GET: function (name) {
+      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
+      var r = window.location.search.substr(1).match(reg);
+        if (r != null) return unescape(r[2]);
+        return null;
+     },getUserInfo:function(fn){
+     	var _this=this;
+     	   $.ajax({
+             type: "GET",
+             url: this.data.baseurl+this.data.getUserInfo,
+             data: {user_id:this.data.uid , mt:this.data.mt },
+             dataType: "json",
+             success: function(data){
+                   fn&&fn(data); 
+               }
+         });
+ 	},bdSocket:function(fn){
+ 		var _this=this;
+     	   $.ajax({
+             type: "POST",
+             url: this.data.baseurl+this.data.bdSocket,
+             data: {client_id:this.data.client_id    },
+             dataType: "json",
+             success: function(data){
+                   fn&&fn(data); 
+               }
+         });
+ 	},Join:function(fn){
+ 		var _this=this;
+     	   $.ajax({
+             type: "GET",
+             url: this.data.baseurl+this.data.Join,
+             dataType: "json",
+             success: function(data){
+                   fn&&fn(data); 
+
+               }
+         });
+ 	},Answer:function(fn){
+ 		var _this=this;
+     	   $.ajax({
+             type: "GET",
+             url: this.data.baseurl+this.data.Answer,
+             data:{question_id:_this.data.question_id,option_id:_this.data.option_id},
+             dataType: "json",
+             success: function(data){
+                   fn&&fn(data); 
+               }
+         });
+ 	},player_join:function(data){
+ 		// if(responsedata.info.user){
+ 		// 	$("#username").html(responsedata.info.user.name);
+   // 			$("#avatar").html('<img src="' + responsedata.info.user.avatar + '" class="layui-circle">');	
+ 		// }
+
+ 		if(data.info.user){
+            $("#py1_avatar").html('<img src="' + data.info.user.avatar+ '" class="layui-circle">');
+            $("#py1_username").html(data.info.user.name + '(我)');
+        }else if(data.info.players){
+          $("#py2_avatar").html('<img src="' + data.info.players.avatar + '" class="layui-circle">');
+          $("#py2_username").html(data.info.players.name);
+           $(".g-doc .g-inner").removeClass("gstart");
+            $(".g-doc .g-inner").addClass("doing");
+        }
+ 		 
+ 	},onSocket:function(e){
+ 		var data=JSON.parse(e.data);
+ 			var _this=this;
+ 		var type=data.type;
+ 		switch(type){
+ 			case 'init':
+ 			 _this.data.client_id=data.client_id;
+ 			_this.bdSocket(function(res){
+ 				_this.data.isReady=1;
+ 				console.log(res.msg);
+ 			});
+ 			    break;
+          case 'player_join':
+          _this.player_join(data);
+          break;
+          case 'question':
+          _this.loadQuestion(data);
+          break;
+          case 'round_end':
+
+          break;
+          case 'game_end':
+          $(".g-doc .g-inner").addClass("end");
+          $("#Jvs").hide();
+          break;
+          
+
+
+ 		}
+ 	 	//_this.data.question_id
+ 	},startGame:function(){
+ 		if(this.data.isReady=="1")
+ 		this.Join(function(res){
+ 			common.tips(res.msg);
+ 		});
+ 		else this.tips("登录失败");
+ 	},initSocket:function(){
+ 		var _this=this;
+ 		  var ws = new WebSocket("ws://183.234.61.252:8282");
+ 		 	  ws.onmessage=function(e){
+ 		 	  	_this.onSocket(e);
+ 		 	  }
+
+ 	},loadQuestion(responsedata) {
+        console.log(responsedata);
+       _this.data.question_id= responsedata.info.question.question_id;
+        $("#Jqtitle").html(responsedata.info.question.title );
+        var question="";
+        var answers = responsedata.info.options
+        for(var i in answers){
+          question += '<li class="btn-2 item item'+i+' answer layui-btn layui-btn-primary"   data-option_id="'+answers[i].option_id+'">'+answers[i].title+'</li>';
+        }
+        $("#question").html(question);
+        $("#Jpage").html(responsedata.info.questions_count+"/5")
+       // is_end = responsedata.info.question.is_end;
+         daoshu();
+      
+  },listen:function(){
+ 		var _this=this;
+ 		$(".rulebtn").on("touchend",function(){
+ 				$(".popwind,.popbg").fadeIn(200);
+ 		})
+ 		$(".close").on("touchend",function(){
+ 				$(".popwind,.popbg").fadeOut(200);
+ 		})
+ 		$("#start_game").on("touchend",function(){
+ 			 _this.startGame();
+ 		})
+ 		$("#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();
+ 		})
+ 		
+ 	},daoshu:function(argument) {
+	    clearInterval(ts);
+	     sum = 9;
+	     angle = 0;
+	    leftContent.setAttribute('style', 'transform: rotate(0deg)');
+	    rightContent.setAttribute('style', 'transform: rotate(0deg)');
+	    ts = setInterval(function() {
+	        if (sum >= 0) textCircle.innerHTML = sum;
+	        sum = sum - 1;
+	        $("#Jvs .con").show();
+	        $("#Jvs .tit").html("抢答中");
+	        angle += 36;
+	        if (angle <= 360) {
+	            if (angle > 180) {
+	                rightContent.setAttribute('style', 'transform: rotate(' + (angle - 180) + 'deg)')
+	            } else {
+	                leftContent.setAttribute('style', 'transform: rotate(' + angle + 'deg)')
+	            }
+	        }
+	        if (sum < -1) {
+	            answer();
+	            sum = 9;
+	            angle = 0;
+	            leftContent.setAttribute('style', 'transform: rotate(0deg)');
+	            rightContent.setAttribute('style', 'transform: rotate(0deg)')
+	        }
+	    }, 1000)
+}, tips: function (text, time) {
+                //弹窗工具
+                time = time ? time : 1500;
+                var para = document.createElement("p"); //创建新的<p> 元素
+                para.innerHTML = text;
+                para.setAttribute("class", "poptis");
+                document.body.appendChild(para);
+                para.style.marginLeft = -para.offsetWidth / 2+"px";
+                setTimeout(function () {
+                    document.body.removeChild(para);
+                }, time);
+
+    },init:function(){
+ 		var _this=this;
+ 		this.listen();
+ 		var ycy =this.GET("ycy");
+ 		if(ycy){
+ 			var b64 = new Base64();
+	 		ycy=b64.decode(ycy);
+	 		ycy=decodeURIComponent(ycy);
+	 		ycy= JSON.parse(ycy); 
+	 		this.data.uid=ycy.uid;
+	 		this.data.mt=ycy.mt;	
+ 		}
+ 		if( this.GET("user_id")){
+ 			this.data.uid=this.GET("user_id");
+	 		this.data.mt=this.GET("mt");
+ 		}
+ 		this.getUserInfo(function(res){
+ 			_this.userInfo=res.info;
+ 			_this.initSocket();
+
+ 		})
+ 		
+ 		
+ 	}
+ }
+ window.common=common;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 45 - 0
public/h5/datigame/js/lib-jquery1.10.2.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 6 - 0
public/h5/datigame/js/plugin-preload.js


BIN
public/h5/datigame/js/~$园&对战游戏_接口规格说明书V1.2.docx


BIN
public/h5/datigame/js/异次园&对战游戏_接口规格说明书V1.2.docx