var ua = navigator.userAgent.toLowerCase();var isWeixin = ua.indexOf('micromessenger') != -1;if (!isWeixin) {
alert(“不是微信打开”);
}