index.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>空中传媒</title>
  6. <link rel="icon" type="image/GIF" href="res/favicon.ico"/>
  7. <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1, initial-scale=1, user-scalable=no">
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <style>
  10. body, canvas, div {
  11. -moz-user-select: none;
  12. -webkit-user-select: none;
  13. -ms-user-select: none;
  14. -khtml-user-select: none;
  15. -webkit-tap-highlight-color: rgba(255, 255, 255, 255);
  16. }
  17. #sharebtn{
  18. text-align:center;
  19. position:absolute;
  20. bottom:60px;
  21. left:30%;
  22. width:120px;
  23. margin:auto;
  24. z-index:999;
  25. display:none;
  26. }
  27. </style>
  28. </head>
  29. <body style="padding:0; margin: 0; background: #FFF;">
  30. <canvas id="gameCanvas" width="640" height="960"></canvas>
  31. <div id="sharebtn">
  32. <a href="#" onclick="dp_share();">炫耀一下</a>
  33. </div>
  34. <script src="game.min.js"></script>
  35. <script language=javascript>
  36. var mebtnopenurl = 'http://game.ikongzhong.cn/index.html';
  37. window.shareData = {
  38. "imgUrl": "http://game.ikongzhong.cn/icon/wbk.png",
  39. "timeLineLink": "http://game.ikongzhong.cn/games/wbk/index.html",
  40. "tTitle": "挖鼻孔-空中传媒",
  41. "tContent": "挖鼻孔-空中传媒,请关注空中传媒:mkongzhong"
  42. };
  43. function goHome(){
  44. window.location=mebtnopenurl;
  45. }
  46. function clickMore(){
  47. if((window.location+"").indexOf("f=zf",1)>0){
  48. window.location = "http://game.ikongzhong.cn/";
  49. }
  50. else{
  51. goHome();
  52. }
  53. }
  54. function dp_share(){
  55. document.title ="神手啊,我居然挖中"+myData.score+"个鼻孔,来挑战我的极限吧!";
  56. document.getElementById("share").style.display="";
  57. window.shareData.tTitle = document.title;
  58. }
  59. function dp_Ranking(){
  60. window.location=mebtnopenurl;
  61. }
  62. function showAd(){
  63. }
  64. function hideAd(){
  65. }
  66. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  67. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  68. WeixinJSBridge.invoke('sendAppMessage', {
  69. "img_url": window.shareData.imgUrl,
  70. "link": window.shareData.timeLineLink,
  71. "desc": window.shareData.tContent,
  72. "title": window.shareData.tTitle
  73. }, onShareComplete);
  74. });
  75. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  76. WeixinJSBridge.invoke('shareTimeline', {
  77. "img_url": window.shareData.imgUrl,
  78. "img_width": "640",
  79. "img_height": "640",
  80. "link": window.shareData.timeLineLink,
  81. "desc": window.shareData.tContent,
  82. "title": window.shareData.tTitle
  83. }, onShareComplete);
  84. });
  85. }, false);
  86. </script>
  87. <div id=share style="display: none">
  88. <img width=100% src="http://game.ikongzhong.cn/games/wbk/share.png"
  89. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  90. ontouchstart="document.getElementById('share').style.display='none';" />
  91. </div>
  92. <script type="text/javascript">
  93. var myData = { gameid: "wbk" };
  94. // var domain = ["oixm.cn", "hiemma.cn", "peagame.net"][parseInt(Math.random() * 3)];
  95. window.shareData.timeLineLink = "http://game.ikongzhong.cn";
  96. function dp_submitScore(score){
  97. myData.score = parseInt(score);
  98. myData.scoreName ="挖了"+score+"个鼻孔";
  99. if(score>0){
  100. if (confirm("你挖了"+score+"个鼻孔!敢不敢小伙伴们瞧瞧你的实力?请关注空中传媒:mkongzhong")){
  101. dp_share();
  102. }
  103. }
  104. }
  105. function onShareComplete(res) {
  106. if (localStorage.myuid && myData.score != undefined) {
  107. setTimeout(function(){
  108. // if (confirm("要将成绩提交到空中传媒排行榜吗?")) {
  109. // window.location = "http://wx.9g.com/rank/submit2.jsp?gameid=" + myData.gameid + "&uid=" + localStorage.myuid + "&score=" + myData.score + "&scorename=" + encodeURIComponent(myData.scoreName);
  110. // }
  111. // else {
  112. document.location.href = mebtnopenurl;
  113. // }
  114. }, 500);
  115. }
  116. else {
  117. document.location.href = mebtnopenurl;
  118. }
  119. }
  120. </script>
  121. <div id="ad_container" style="position: absolute;z-index:99;bottom:0px;text-align:center;width:100%;height:50px;overflow:hidden"></div>
  122. </body>
  123. </html>