立即进入
//js部分var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
// 更换input的value决定跳转到哪个下载应用页面
if (!isAndroid) {
document.getElementById('download-app').value = 'https://apps.apple.com/cn/app/id1229469444';
} else {
document.getElementById('download-app').value = 'https://android.myapp.com/myapp/detail.htm?apkName=com.xunmeng.pinduoduo&ADTAG=mobile';
}
var ua = navigator.userAgent.toLowerCase();
var t;
var config = {
scheme_IOS: 'pinduoduo://com.xunmeng.pinduoduo',
scheme_Adr: 'pinduoduo://com.xunmeng.pinduoduo/duo_coupon_landing.html?goods_id=22601078025&pid=8592112_101958852&cpsSign=CC_191014_8592112_101958852_aa2fe711d970ccb958d855ad24c468b6&duoduo_type=2',
download_url: document.getElementById('download-app').value,
timeout: 600
};
function openclient() {
var startTime = Date.now();
var ifr = document.createElement('iframe');
// 创建ifram并指定src
ifr.src = ua.indexOf('os') > 0 ? config.scheme_IOS : config.scheme_Adr;
ifr.style.display = 'none';
document.body.appendChild(ifr);
var t = setTimeout(function () {
var endTime = Date.now();
if (!startTime || endTime - startTime < config.timeout + 200) {
window.location = config.download_url;
} else {
}
}, config.timeout);
window.onblur = function () {
clearTimeout(t);
}
}
window.addEventListener("DOMContentLoaded", function () {
document.getElementById("call-app").addEventListener('click',
openclient, false);
}, false);
本文由(学源码 -- admin)整理发布,转载请注明出处:https://www.xueyuanma.com/article/174.html
本站发布的文章及附件仅限于学习和研究目的;不得将上述内容用于商业或非法用途,否则后果请用户自负。
本站发布的文章及附件若侵犯到您的权益,请邮件联系 admin@xueyuanma.com 说明情况,我们将及时处理!
您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容,请支持正版软件,得到更好的正版服务。