...
|
...
|
@@ -5381,23 +5381,50 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) { |
|
|
});
|
|
|
}
|
|
|
|
|
|
limitSaleHammer && limitSaleHammer.on('tap', function(e) {
|
|
|
e.srcEvent.stopPropagation();
|
|
|
dialog.showDialog({
|
|
|
dialogText: '打开有货APP限定发售频道\n获取限购码',
|
|
|
hasFooter: {
|
|
|
rightBtnText: '打开Yoho!Buy有货APP'
|
|
|
}
|
|
|
}, function() {
|
|
|
window.location.href = appUrl;
|
|
|
}, undefined, true);
|
|
|
$('#limit-sale').on('touchend', function(e) {
|
|
|
var loginUrl = $('#loginUrl').val(),
|
|
|
u = navigator.userAgent,
|
|
|
ifr;
|
|
|
|
|
|
$('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
|
|
|
e.stopPropagation();
|
|
|
if ($(e.target).hasClass('dialog-wrapper')) {
|
|
|
dialog.hideDialog();
|
|
|
}
|
|
|
});
|
|
|
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
|
|
|
isIPhone = u.indexOf('iPhone') > -1,
|
|
|
isIPad = u.indexOf('iPad') > -1;
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
if(loginUrl) {
|
|
|
window.location = loginUrl;
|
|
|
} else {
|
|
|
dialog.showDialog({
|
|
|
dialogText: '进入有货APP,获取限购码',
|
|
|
hasFooter: {
|
|
|
rightBtnText: '打开Yoho!Buy有货APP'
|
|
|
}
|
|
|
}, function() {
|
|
|
|
|
|
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) {
|
|
|
e.stopPropagation();
|
|
|
if ($(e.target).hasClass('dialog-wrapper')) {
|
|
|
dialog.hideDialog();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
require("js/product/detail/desc");
|
...
|
...
|
@@ -5569,6 +5596,16 @@ var limitProductCode, |
|
|
// 限购商品的skn。只有限购商品时才会设置。
|
|
|
skn;
|
|
|
|
|
|
//禁用数字编辑
|
|
|
function disableNumEdit() {
|
|
|
var $numBtn = $('.chose-panel').find('.num .btn>.iconfont');
|
|
|
|
|
|
//添加disabled样式
|
|
|
$numBtn.hasClass('disabled') ? null : $numBtn.addClass('disabled');
|
|
|
|
|
|
$yohoPage.off('touchstart', '.btn-minus');
|
|
|
$yohoPage.off('touchstart', '.btn-plus');
|
|
|
}
|
|
|
|
|
|
// 初始化购物车面板显示
|
|
|
function init() {
|
...
|
...
|
@@ -5614,6 +5651,7 @@ function setEditModeWithSknId(sknId, isThisGoodSelected) { |
|
|
* @return {undefined}
|
|
|
*/
|
|
|
function setLimitGoodModeWithSknId(code, sknId) {
|
|
|
disableNumEdit();
|
|
|
$('#chose-btn-sure').html('立即购买');
|
|
|
limitProductCode = code;
|
|
|
skn = sknId;
|
...
|
...
|
@@ -5647,16 +5685,6 @@ function checkColorSizeNum() { |
|
|
return true;
|
|
|
}
|
|
|
|
|
|
//禁用数字编辑
|
|
|
function disableNumEdit() {
|
|
|
var $numBtn = $('.chose-panel').find('.num .btn>.iconfont');
|
|
|
|
|
|
//添加disabled样式
|
|
|
$numBtn.hasClass('disabled') ? null : $numBtn.addClass('disabled');
|
|
|
|
|
|
$yohoPage.off('touchstart', '.btn-minus');
|
|
|
$yohoPage.off('touchstart', '.btn-plus');
|
|
|
}
|
|
|
|
|
|
|
|
|
function show(html, cb) {
|
...
|
...
|
@@ -5992,12 +6020,36 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
|
|
|
|
} else if (limitProductCode) {
|
|
|
|
|
|
$(this).css('background-color', '#ccc').removeAttr('id');
|
|
|
|
|
|
// 当前面板选择的是限购商品
|
|
|
url = $('#limitProductPay').val() + '?limitproductcode=' + limitProductCode + '&sku=' +
|
|
|
productSku + '&skn=' + skn + '&buy_number=' + buyNumber;
|
|
|
|
|
|
//打开结算页面,结束函数执行。
|
|
|
window.location.href = url;
|
|
|
removePannel();
|
|
|
loading.showLoadingMask();
|
|
|
|
|
|
// 调用接口判断商品是否可以购买
|
|
|
$.ajax({
|
|
|
url: url
|
|
|
}).then(function(res) {
|
|
|
|
|
|
// 如果有错,则商品不可购买,执行页面刷新,否则跳到结算页面
|
|
|
if (res.error) {
|
|
|
tip.show(res.message);
|
|
|
setTimeout(function() {
|
|
|
location.reload();
|
|
|
}, 2000);
|
|
|
} else {
|
|
|
location.href = url;
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
tip.show('网络异常!');
|
|
|
setTimeout(function() {
|
|
|
location.reload();
|
|
|
}, 2000);
|
|
|
});
|
|
|
|
|
|
return false;
|
|
|
|
|
|
} else {
|
...
|
...
|
|