index.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>寻找圣诞老人</title>
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no,target-densitydpi=device-dpi"/>
  8. <meta name="apple-mobile-web-app-capable" content="yes"/>
  9. <meta name="full-screen" content="true"/>
  10. <meta name="screen-orientation" content="portrait"/>
  11. <meta name="x5-fullscreen" content="true"/>
  12. <meta name="360-fullscreen" content="true"/>
  13. <style>
  14. body {
  15. text-align: center;
  16. background: #00b7ee;
  17. padding: 0;
  18. border: 0;
  19. margin: 0;
  20. height: 100%;
  21. }
  22. html {
  23. -ms-touch-action: none; /* Direct all pointer events to JavaScript code. */
  24. }
  25. </style>
  26. </head>
  27. <body onload="load()">
  28. <div style="display:inline-block;width:100%; height:100%;margin: 0 auto; background: #00b7ee; position:relative;"
  29. id="gameDiv">
  30. <canvas id="gameCanvas" width="480" height="800" style="background-color: #00b7ee"></canvas>
  31. </div>
  32. <script>var document_class = "MyTest";</script><!--这部分内容在编译时会被替换,要修改文档类,请到工程目录下的egretProperties.json内编辑。-->
  33. <script src="js/jquery-1.7.2.min.js"></script>
  34. <script src="js/egret_loader.js"></script>
  35. <script src="js/game-min.js"></script>
  36. <script>
  37. egret_h5.startGame();
  38. </script>
  39. <script language=javascript>
  40. function load(){
  41. $.getJSON("http://test.tuling123.com/game2/gameSecond.do",{
  42. name: 'game2' //参数,
  43. },function(json){
  44. });
  45. }
  46. var mebtnopenurl = 'http://test.tuling123.com/game2/';
  47. window.shareData = {
  48. "imgUrl": "http://test.tuling123.com/game2/icon.png",
  49. "timeLineLink": "http://test.tuling123.com/game2/",
  50. "tTitle": "寻找圣诞老人",
  51. "tContent": "寻找圣诞老人"
  52. };
  53. function goHome(){
  54. window.location=mebtnopenurl;
  55. }
  56. function clickMore(){
  57. if((window.location+"").indexOf("zf",1)>0){
  58. window.location = "http://182.92.67.78/game2/";
  59. }
  60. else{
  61. goHome();
  62. }
  63. }
  64. function dp_share(){
  65. document.title =myData.desc;
  66. document.getElementById("share").style.display="";
  67. window.shareData.tTitle = document.title;
  68. }
  69. function dp_Ranking(){
  70. window.location=mebtnopenurl;
  71. }
  72. function showAd(){
  73. }
  74. function hideAd(){
  75. }
  76. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  77. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  78. WeixinJSBridge.invoke('sendAppMessage', {
  79. "img_url": window.shareData.imgUrl,
  80. "link": window.shareData.timeLineLink,
  81. "desc": window.shareData.tContent,
  82. "title": window.shareData.tTitle
  83. }, onShareComplete);
  84. });
  85. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  86. WeixinJSBridge.invoke('shareTimeline', {
  87. "img_url": window.shareData.imgUrl,
  88. "img_width": "640",
  89. "img_height": "640",
  90. "link": window.shareData.timeLineLink,
  91. "desc": window.shareData.tContent,
  92. "title": window.shareData.tTitle
  93. }, onShareComplete);
  94. });
  95. }, false);
  96. </script>
  97. <div id=share style="display: none">
  98. <img width=100% src="share.png"
  99. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  100. ontouchstart="document.getElementById('share').style.display='none';" />
  101. </div>
  102. <div style="display: none;">
  103. <script type="text/javascript">
  104. var myData = { gameid: "jyds" };
  105. // var domain = ["oixm.cn", "hiemma.cn", "peagame.net"][parseInt(Math.random() * 3)];
  106. //window.shareData.timeLineLink = "http://"+ parseInt(Math.random()*100000) +"."+ myData.gameid +"."+domain+"/gamecenter.html?gameid=" + myData.gameid + (localStorage.myuid ? "&uid=" + localStorage.myuid : "");
  107. function dp_submitScore(score,desc){
  108. myData.score = parseInt(score);
  109. myData.desc=desc;
  110. myData.scoreName = score+"关";
  111. if(score>0){
  112. if (confirm("好厉害呀,竟然闯过了"+score+"关,让小伙伴也来试试吧!")){
  113. setTimeout(dp_share,500);
  114. }
  115. }
  116. }
  117. function onShareComplete(res) {
  118. if (localStorage.myuid && myData.score != undefined) {
  119. setTimeout(function(){
  120. if (confirm("要将成绩提交到9G游戏排行榜吗?")) {
  121. //window.location = "http://wx.9g.com/rank/submit2.jsp?gameid=" + myData.gameid + "&uid=" + localStorage.myuid + "&score=" + myData.score + "&scorename=" + encodeURIComponent(myData.scoreName);
  122. }
  123. else {
  124. document.location.href = mebtnopenurl;
  125. }
  126. }, 500);
  127. }
  128. else {
  129. document.location.href = mebtnopenurl;
  130. }
  131. }
  132. </script>
  133. </body>
  134. </html>