使用微信打開網址時,無法在微信內打開常用下載軟件,手機APP等。網上流傳的各種微信打開下載鏈接,微信一更新基本失效。大家常用的方法是,彈出一個遮罩提示用戶在新的瀏覽器窗口打開,再也不用管微信如何的更新。
直接判斷微信的ua,如果是在微信內置瀏覽器中打開,彈出一個遮罩提示用戶在瀏覽器中打開下載,並且不加關閉的按鈕。這樣子用戶就只能在瀏覽器中打開,並且可以直接下載應用了。
css代碼
<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>
HTML 代碼
<div class="weixin-tip">
<p>
<img src="live_weixin.png" alt="微信打開"/>
</p>
</div>
JS代碼
<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>
有個herl工具,是可以在微信中自動打開手機瀏覽器下載APP。
1、herl工具網址:http://www.fishtool.cn/
2、填寫下載的apk的地址,或者下載頁鏈接
3、點擊一鍵生成,會自動生成二維碼和一個鏈接地址(兩個是同一個地址,根據你的需要選擇)
4、生成的二維碼或者鏈接,用微信掃一掃或者用微信打開連接,就可以測試了效果了
如果大家有更好的解決方案或者工具,歡迎推薦分享!