判断方法:
is_weixin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return true;
} else {
return false;
}
}
应用:
//下载app
down_app() {
if (is_weixin()) {
toast('请点击右上角在浏览器打开')
return false
}
window.location.href = 'http://'
},