stoneron

Untitled

Dec 7th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 6.16 KB | None | 0 0
  1.  
  2.  
  3. <!DOCTYPE html>
  4.  
  5. <html>
  6. <head>
  7.     <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui" />
  8.     <title></title>
  9.     <script src="/Content/js/jquery-1.10.2.js"></script>
  10.     <script src="/Content/plugins/layer_mobile/layer.js"></script>
  11.     <script>
  12.         function callAPI(method, params) {
  13.             params = params || {};
  14.             if (navigator.userAgent.match(/ipad|ipod|iphone/i)) {
  15.                 if (typeof (window.webkit) === "object") {
  16.                     window.webkit.messageHandlers.myapp.postMessage({
  17.                         'method': method,
  18.                         'params': params
  19.                     });
  20.                 } else {
  21.                     alert("客户端版本不支持");
  22.                 }
  23.             } else {
  24.                 if (typeof (window.myapp) === "object") {
  25.                     // alert(typeof window.myapp[method]);
  26.                     if (params) {
  27.                         window.myapp[method].apply(window.myapp, [JSON.stringify(params)]);
  28.                     } else {
  29.                         window.myapp[method].apply(window.myapp);
  30.                     }
  31.                 } else {
  32.                     alert("客户端版本不支持");
  33.                 }
  34.             }
  35.         }
  36.  
  37.         function isApp() {
  38.             if (navigator.userAgent.match(/ipad|ipod|iphone/i)) {
  39.                 return typeof (window.webkit) === "object";
  40.             } else {
  41.                 return typeof (window.myapp) === "object";
  42.             }
  43.         }
  44.  
  45.         function isIOS() {
  46.             return navigator.userAgent.match(/ipad|ipod|iphone/i);
  47.         }
  48.     </script>
  49.  
  50.     <style>
  51.         body {
  52.             text-align: center;
  53.         }
  54.  
  55.         .hcenter {
  56.             margin-left: auto;
  57.             margin-right: auto;
  58.         }
  59.     </style>
  60. </head>
  61. <body>
  62.         <div class="hcenter" style="margin-top:80pt;display:none;" id="game_tips">
  63.             正在进入游戏...
  64.         </div>
  65.         <div class="hcenter" style="margin-top:80pt;display:none;" id="android_tips">
  66.             <div>
  67.                 <p style="display:inline;" id="lab_tips">正在进入游戏...</p>
  68.                 <a style="display:inline;" href="http://u.txwyf.com/index.html?localIP=160.116.14.39&UserID=5418917&Cer=F73DF57EB96A41568B2AEAB586660EF0&UserLevel=0&LevelKey=dd183a1669ce77c91be54d811a4940fa&CaiPiaoUrl=http%3a%2f%2ftcp.txwyf.com%3a9002&H5Index=http%3a%2f%2fwww.keai6.com&AppUrl=http%3a%2f%2ftcp.txwyf.com%3a9001%2fH5Game%2fH5GameEntry&ServerListDomain=http%3a%2f%2ftcp.txwyf.com%3a170%2chttp%3a%2f%2ftcp.txwyf.com%3a170&SMSUrl=http%3a%2f%2ftcp.txwyf.com%3a9004%2fapi%2fDefault&Emcee_ID=0&r=1981">立即进入游戏</a>
  69.             </div>
  70.             <br /><br />
  71.             <a href="#" onclick="h5RunGame();">从浏览器进入游戏</a>
  72.             <div style="font-size:12px;">如果从APP多次进入游戏失败,推荐从浏览器进入</div>
  73.  
  74.         </div>
  75.         <script>
  76.             var timeHandler = null;
  77.             function tipsCountdown(s, callfun) {
  78.                 $("#lab_tips").html(s + "秒后开始游戏");
  79.                 if (s > 0) {
  80.                     timeHandler = setTimeout(function () {
  81.                         tipsCountdown(s - 1, callfun);
  82.                     }, 1 * 1000);
  83.                 } else {
  84.                     callfun();
  85.                 }
  86.             };
  87.  
  88.             function h5RunGame() {
  89.                 clearTimeout(timeHandler);
  90.                 callAPI('openUrl', { 'url': 'http://www.keai6.com' });
  91.                 callAPI('Close');
  92.             }
  93.             function layerConfirm(msg, callfun) {
  94.                 layer.open({
  95.                     content: msg
  96.                   , btn: ['确定', '取消']
  97.                   , yes: function (index) {
  98.                       callfun(true);
  99.                       layer.close(index);
  100.                   }, no: function (index) {
  101.                       callfun(false);
  102.                       layer.close(index);
  103.                   }
  104.                 });
  105.             };
  106.  
  107.             function runGame() {              
  108.                 if (isApp()) {
  109.                     if (isIOS()) {
  110.                         layerConfirm("由于IOS掉签问题,推荐从浏览器入口进入游戏。<br>点[确定]启动浏览器,点[取消]立即进入游戏", function (result) {
  111.                             if (result == true) {
  112.                                 h5RunGame();
  113.                             }
  114.                         });                        
  115.                     } else {
  116.                         layerConfirm("推荐从浏览器入口进入游戏。<br>点[确定]启动浏览器,点[取消]立即进入游戏", function (result) {
  117.                             if (result == true) {
  118.                                 h5RunGame();
  119.                             } else {
  120.                                 window.location.href = "http://u.txwyf.com/index.html?localIP=160.116.14.39&UserID=5418917&Cer=F73DF57EB96A41568B2AEAB586660EF0&UserLevel=0&LevelKey=dd183a1669ce77c91be54d811a4940fa&CaiPiaoUrl=http%3a%2f%2ftcp.txwyf.com%3a9002&H5Index=http%3a%2f%2fwww.keai6.com&AppUrl=http%3a%2f%2ftcp.txwyf.com%3a9001%2fH5Game%2fH5GameEntry&ServerListDomain=http%3a%2f%2ftcp.txwyf.com%3a170%2chttp%3a%2f%2ftcp.txwyf.com%3a170&SMSUrl=http%3a%2f%2ftcp.txwyf.com%3a9004%2fapi%2fDefault&Emcee_ID=0&r=1981";
  121.                             }
  122.                         });                        
  123.                        
  124.                         return;
  125.                     }
  126.                 }
  127.                 $("#game_tips").show();
  128.                 window.location.href = "http://u.txwyf.com/index.html?localIP=160.116.14.39&UserID=5418917&Cer=F73DF57EB96A41568B2AEAB586660EF0&UserLevel=0&LevelKey=dd183a1669ce77c91be54d811a4940fa&CaiPiaoUrl=http%3a%2f%2ftcp.txwyf.com%3a9002&H5Index=http%3a%2f%2fwww.keai6.com&AppUrl=http%3a%2f%2ftcp.txwyf.com%3a9001%2fH5Game%2fH5GameEntry&ServerListDomain=http%3a%2f%2ftcp.txwyf.com%3a170%2chttp%3a%2f%2ftcp.txwyf.com%3a170&SMSUrl=http%3a%2f%2ftcp.txwyf.com%3a9004%2fapi%2fDefault&Emcee_ID=0&r=1981";
  129.             }
  130.             runGame();
  131.         </script>
  132.  
  133. </body>
  134. </html>
  135.  
Advertisement
Add Comment
Please, Sign In to add comment