Authored by 梁志锋

限购商品详情 跳转APP

... ... @@ -82,20 +82,41 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) {
});
}
limitSaleHammer && limitSaleHammer.on('tap', function(e) {
var loginUrl = $('#loginUrl').val();
$('#limit-sale').on('touchend', function(e) {
var loginUrl = $('#loginUrl').val(),
u = navigator.userAgent,
ifr;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
isIPhone = u.indexOf('iPhone') > -1,
isIPad = u.indexOf('iPad') > -1;
e.stopPropagation();
e.srcEvent.stopPropagation();
if(loginUrl) {
window.location = loginUrl;
} else {
dialog.showDialog({
dialogText: '打开有货APP限定发售频道\n获取限购码',
dialogText: '进入有货APP,获取限购码',
hasFooter: {
rightBtnText: '打开Yoho!Buy有货APP'
}
}, function() {
window.location.href = appUrl;
ifr = document.createElement('iframe');
ifr.src = appUrl;
ifr.style.display = 'none';
document.body.appendChild(ifr);
window.location.href = appUrl;
window.setTimeout(function(){
document.body.removeChild(ifr);
if (isAndroid) {
window.location.href = 'http://yoho-apps.qiniudn.com/YohoBuy_YOHO.apk';
} else if (isIPhone || isIPad) {
window.location.href = 'https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8';
}
},3000)
}, undefined, true);
$('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
... ...