isIOSOpenApp(data,url) {
window.location.href = "xxx"; //要跳转的app的地址,客户端配置好的短链
// 页面隐藏,那么代表已经调起了app,就清除下载的定时器
const visibilitychange = function() {
const tag = document.hidden || document.webkitHidden;
tag && clearTimeout(this.timer);
};
document.addEventListener("visibilitychange", visibilitychange,false);
document.addEventListener("webkitvisibilitychange", visibilitychange,false);
this.timer = setTimeout(()=>{
window.location.href = data[url];
},3000);
},
使用:
this.isIOSOpenApp(this.jumpUrl,this.routeQuery.location);