主题html/public/目录下创建browser.html,如果你使用的是第三方主题可以将这个文件复制到你主题的html/public/目录下即可。官方的代码如下,动手能力强的小伙伴可以自行DIY一下:

  1. <!DOCTYPE html>

  2. <html lang="en">

  3. <head>

  4.     <meta charset="UTF-8">

  5.     <title>使用浏览器打开</title>

  6.     <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">

  7.     <meta content="yes" name="apple-mobile-web-app-capable">

  8.     <meta content="black" name="apple-mobile-web-app-status-bar-style">

  9.     <meta name="format-detection" content="telephone=no">

  10.     <meta content="false" name="twcClient" id="twcClient">

  11.     <meta name="aplus-touch" content="1">

  12.     <style>

  13.         body,html{width:100%;height:100%}

  14.         *{margin:0;padding:0}

  15.         body{background-color:#fff}

  16.         #browser img{

  17.             width:50px;

  18.         }

  19.         #browser{

  20.             margin: 0px 10px;

  21.             text-align:center;

  22.         }

  23.         #contens{

  24.             font-weight: bold;

  25.             margin:-285px 0px 10px;

  26.             text-align:center;

  27.             font-size:20px;

  28.             margin-bottom: 125px;

  29.         }

  30.         .top-bar-guidance{font-size:15px;color:#fff;height:60%;line-height:1.8;padding-left:20px;padding-top:20px;background:url(//gw.alicdn.com/tfs/TB1eSZaNFXXXXb.XXXXXXXXXXXX-750-234.png) center top/contain no-repeat}

  31.         .top-bar-guidance .icon-safari{width:25px;height:25px;vertical-align:middle;margin:0 .2em}

  32.         .app-download-tip{margin:0 auto;width:290px;text-align:center;font-size:15px;color:#2466f4;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAcAQMAAACak0ePAAAABlBMVEUAAAAdYfh+GakkAAAAAXRSTlMAQObYZgAAAA5JREFUCNdjwA8acEkAAAy4AIE4hQq/AAAAAElFTkSuQmCC) left center/auto 15px repeat-x}

  33.         .app-download-tip .guidance-desc{background-color:#fff;padding:0 5px}

  34.         .app-download-btn{display:block;width:214px;height:40px;line-height:40px;margin:18px auto 0 auto;text-align:center;font-size:18px;color:#2466f4;border-radius:20px;border:.5px #2466f4 solid;text-decoration:none}

  35.     </style>

  36. </head>

  37. <body>

  38. <div class="top-bar-guidance">

  39.     <p>点击右上角<img src="//gw.alicdn.com/tfs/TB1xwiUNpXXXXaIXXXXXXXXXXXX-55-55.png" class="icon-safari"> <span id="openm">Safari打开</span></p>

  40.     <p>可以继续浏览本站哦~</p>

  41. </div>

  42. <a style="display: none;" href="" id="vurl" rel="noreferrer"></a>

  43. <div id="browser">

  44.     <p>避免微信和QQ屏蔽本站网址,请理解支持!</p>

  45. </div>

  46. <div class="app-download-tip">

  47.     <span class="guidance-desc">点击右上角或复制网址自行打开</span>

  48. </div>

  49. <link href="{$maccms.path}static/layui/css/modules/layer/default/layer.css" rel="stylesheet" type="text/css" />

  50. <script src="{$maccms.path}static/js/jquery.js"></script>

  51. <script src="{$maccms.path}static/js/jquery.clipboard.js"></script>

  52. <script src="{$maccms.path}static/layui/lay/modules/layer.js"></script>

  53. <a data-clipboard-text="{$maccms.http_url}" class="app-download-btn">点此复制本站网址</a>

  54. <script type="text/javascript">

  55.     new ClipboardJS(".app-download-btn");

  56.     $(".app-download-btn").click(function() {

  57.         layer.tips("复制成功,么么哒"".app-download-btn", {

  58.             tips: [3, "rgb(38,111,250)"],

  59.             time:500

  60.         });})

  61. </script>


  62. <script>

  63.     function openu(u){

  64.         document.getElementById("vurl").href= u;

  65.         document.getElementById("vurl").click();

  66.     }

  67.     var url = window.location.href;

  68.     if(navigator.userAgent.indexOf("QQ/")> -1){

  69.         openu("ucbrowser://"+url);

  70.         openu("mttbrowser://url="+url);

  71.         openu("baiduboxapp://browse?url="+url);

  72.         openu("googlechrome://browse?url="+url);

  73.         openu("mibrowser:"+url);

  74.         openu("taobao://"+url.split("://")[1]);

  75.         openu("alipays://platformapi/startapp?appId=20000067&url="+url);

  76.         $("html").on("click",function(){

  77.             openu("ucbrowser://"+url);

  78.             openu("mttbrowser://url="+url);

  79.             openu("baiduboxapp://browse?url="+url);

  80.             openu("googlechrome://browse?url="+url);

  81.             openu("mibrowser:"+url);

  82.             openu("taobao://"+url.split("://")[1]);

  83.             openu("alipays://platformapi/startapp?appId=20000067&url="+url);

  84.         });

  85.     }else if(navigator.userAgent.indexOf("MicroMessenger") > -1){

  86.         if(navigator.userAgent.indexOf("Android") > -1){

  87.             var iframe = document.createElement("iframe");

  88.             iframe.style.display = "none";

  89.             document.body.appendChild(iframe);

  90.         }else{


  91.         }

  92.     }

  93. </script>

  94. </body>

  95. </html>


然后在application/admin/view/system/config.html 317行添加

QQ截图20191001184753.png


                <div class="layui-form-item">

                    <label class="layui-form-label">防红防封跳转:</label>

                    <div class="layui-input-inline">

                        <input type="radio" name="app[browser_junmp]" value="0" title="关闭" {if condition="$config['app']['browser_junmp'] eq 0"}checked {/if}>

                        <input type="radio" name="app[browser_junmp]" value="1" title="开启" {if condition="$config['app']['browser_junmp'] eq 1"}checked {/if}>

                    </div>

                    <div class="layui-form-mid layui-word-aux">使用微信、QQ访问将直接显示跳转提示页面</div>

                </div>


然后在后台系统,网站参数设置,性能优化选项下设置了功能开关,直接进入后台开启即可。最后记得清除缓存,让功能生效。

QQ截图20191001184912.png

评论(0条)

请登录后评论
下载呢

下载呢 Rank: 16

0

0

0

( 此人很懒并没有留下什么~~ )