手机浏览器跳转微信,wap跳转微信浏览器打开网页代码
2018-03-24 11:03
1531 查看
首先到www.weixin139.com开通一个生成跳转ticket接口。wap跳转到微信基于微信ticket协议
拿到ticket以后通过js即可进行跳转:<!doctype html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>跳转中</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<style>.button{width:100px;margin:auto;border:1px solid gray;border-radius:4px;background-color:#fff;color:#434343;display:block;padding:15px 0;font-size:15px;line-height:0;text-align:center;}</style>
</head>
<body>
<div style="z-index:9999;position:absolute;display: table;left:0px;top:0px;width:100%;height:100%;">
<div id="loading" style="display: table-cell; vertical-align:middle; text-align:center;font-size:16px;color:#434343;">
加载中...
</div>
<div id="buttons" style="display: none; vertical-align:middle; text-align:center;font-size:14px;color:gray;">
<p>如果跳转失败请重试</p>
<p><a class='button' onclick='window.location.replace(location.href+(location.href.match(/\?/i)?"&":"?")+"_rft"+ (new Date()).valueOf());'>重新打开</a></p>
<p><a class='button' onclick='window.history.back();'>返 回</a></p>
</div>
</div>
<!-- *******
微信跳转联系QQ:192584
网址:www.weixin139.com
******* -->
<script>
var ticket = 'ta181172a79f5b3d568454a5a3192ba74';
if(!/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)){
if(/ baiduboxapp/i.test(navigator.userAgent)){
window.location.replace('bdbox://utils?action=sendIntent&minver=7.4¶ms=%7B%22intent%22%3A%22weixin://dl/business/?ticket='+ticket+'%23wechat_redirect%23Intent%3Bend%22%7D');
}else{
window.location.replace('weixin://dl/business/?ticket='+ticket+'#wechat_redirect');
}
}else{
window.location.replace('weixin://dl/business/?ticket='+ticket+'#wechat_redirect');
}
setTimeout(function(){document.getElementById("loading").style.display="none";document.getElementById("buttons").style.display="table-cell";},3000);
</script>
</body>
</html>
拿到ticket以后通过js即可进行跳转:<!doctype html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>跳转中</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<style>.button{width:100px;margin:auto;border:1px solid gray;border-radius:4px;background-color:#fff;color:#434343;display:block;padding:15px 0;font-size:15px;line-height:0;text-align:center;}</style>
</head>
<body>
<div style="z-index:9999;position:absolute;display: table;left:0px;top:0px;width:100%;height:100%;">
<div id="loading" style="display: table-cell; vertical-align:middle; text-align:center;font-size:16px;color:#434343;">
加载中...
</div>
<div id="buttons" style="display: none; vertical-align:middle; text-align:center;font-size:14px;color:gray;">
<p>如果跳转失败请重试</p>
<p><a class='button' onclick='window.location.replace(location.href+(location.href.match(/\?/i)?"&":"?")+"_rft"+ (new Date()).valueOf());'>重新打开</a></p>
<p><a class='button' onclick='window.history.back();'>返 回</a></p>
</div>
</div>
<!-- *******
微信跳转联系QQ:192584
网址:www.weixin139.com
******* -->
<script>
var ticket = 'ta181172a79f5b3d568454a5a3192ba74';
if(!/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)){
if(/ baiduboxapp/i.test(navigator.userAgent)){
window.location.replace('bdbox://utils?action=sendIntent&minver=7.4¶ms=%7B%22intent%22%3A%22weixin://dl/business/?ticket='+ticket+'%23wechat_redirect%23Intent%3Bend%22%7D');
}else{
window.location.replace('weixin://dl/business/?ticket='+ticket+'#wechat_redirect');
}
}else{
window.location.replace('weixin://dl/business/?ticket='+ticket+'#wechat_redirect');
}
setTimeout(function(){document.getElementById("loading").style.display="none";document.getElementById("buttons").style.display="table-cell";},3000);
</script>
</body>
</html>
相关文章推荐
- 如何在手机浏览器wap网页中点击链接跳转到微信界面
- 在微信网页中,实现微信通过菜单‘在浏览器中打开’跳转到指定的url
- 浏览器网页打开微信app跳转网站只需三步获取ticket接口api
- 【代码】如何在手机等移动平台上浏览器网页中点击链接跳转到QQ聊天界面
- 浏览器网页跳转到微信6.66打开二维码api微信游戏圈免费接口weixin://dl/business/?ticket
- vc使用默认的浏览器打开网页代码
- 判断手机类型,浏览器是否为微信打开
- 手机web开发,网页在微信里打开后的分享功能的实现
- 使浏览器打开后,默认以手机浏览器的方式打开网页
- 微信浏览器打开 点击下载app 无需提示使用浏览器打开--代码分享
- 微信防封系统:手机浏览器或者QQ唤起微信打开指定链接
- 3种方法判断手机浏览器跳转WAP手机网站
- iOS 调用手机浏览器打开网页
- 通过手机浏览器打开APP或者跳转到下载页面.md
- wap跳转微信接口,浏览器跳转微信接口,ticket接口
- 手机浏览器访问wap网页中文显示
- 仿新浪手机浏览器www与wap跳转提示
- 手机浏览器跳转微信指定页面 及 跳转微信公众号一键关注
- 2款JS脚本判断手机浏览器跳转WAP手机网站
- 通过手机浏览器打开APP或者跳转到下载页面.md