添加方法:
1、添加环境检测判断代码:判断当前环境是微信还是QQ
<?php $conf['qqjump']=1; if(strpos($_SERVER['HTTP_USER_AGENT'], 'QQ/')||strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')!==false && $conf['qqjump']==1){ $siteurl='https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; echo '代码区域'; exit; } ?>
添加方案一:
把以下代码放到判断代码中代码区域位置,一起放到程序的首页也就是index.php文件当中。
<!DOCTYPE html> <html lang="zh_CN"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>在浏览器打开</title> <style type="text/css"> * {margin:0;padding:0;} a {text-decoration:none;} img {max-width:100%;height:auto;} .weixin-tip {display:none;position:fixed;left:0;top:0;bottom:0;background:rgba(0,0,0,0.8);filter:alpha(opacity=80);height:100%;width:100%;z-index:100;} .weixin-tip p {text-align:center;margin-top:10%;padding:0 5%;} </style> </head> <body> <div class="weixin-tip"> <p><img src="//ae01.alicdn.com/kf/Hb05e015ac5c64958bb6bb387972b6d38z.png" alt="在浏览器打开" /></p> </div> <script type="text/javascript"> $(window).on("load",function(){ var winHeight = $(window).height(); function is_weixin() { var ua = navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == "micromessenger") { return true; } else { return false; } } var isWeixin = is_weixin(); if(isWeixin){ $(".weixin-tip").css("height",winHeight); $(".weixin-tip").show(); } }) </script> </body> </html>添加方案二:
把以下代码放到模板全局文件中即可
<html> <head> <meta charset="UTF-8"> <title>请使用浏览器打开</title> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"> <meta content="yes" name="apple-mobile-web-app-capable"> <meta content="black" name="apple-mobile-web-app-status-bar-style"> <meta name="format-detection" content="telephone=no"> <meta content="false" name="twcClient" id="twcClient"> <meta name="aplus-touch" content="1"> <style> body,html {width:100%;height:100%} * {margin:0;padding:0} body {background-color:#fff} #contens {font-weight:bold;margin:-285px 0px 10px;text-align:center;font-size:18px;margin-bottom:125px;} .top-bar-guidance {font-size:15px;color:#fff;height:70%;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} .top-bar-guidance .icon-safari {width:25px;height:25px;vertical-align:middle;margin:0 .2em} </style> </head> <body> <div class="top-bar-guidance"> <p>点击右上角<img src="//gw.alicdn.com/tfs/TB1xwiUNpXXXXaIXXXXXXXXXXXX-55-55.png" class="icon-safari"> <span id="openm">Safari打开</span></p> <p>可以继续浏览本站哦~</p> </div> <div id="contens"> 检测到您正在使用应用内置浏览器<br /> 请切换到手机浏览器浏览-小辉网!<br /> </div> </html>添加方案三:
<html> <head> <meta charset="UTF-8"> <title>请使用浏览器打开</title> <meta http-equiv="refresh" content="0; url="https://c.pc.qq.com/middlem.html?pfurl=你得网址"> </head> <body> </body> </html>