Authored by 毕凯

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -12,12 +12,13 @@ var chosePanel = require('./chose-panel'),
dialog = require('../me/dialog'),
tip = require('../plugin/tip');
var $cartContent = $('.cart-content');
var $cartContent = $('.cart-content'),
cartType = $('#cartType').val(),
hasShowCartPresellTip = false;
var navHammer,
advanceBuyHammer,
freebieHammer,
cartType = $('#cartType').val();
freebieHammer;
var hasChecked = $('.cart-content:not(.hide) .icon-cb-checked').length > 0 ? true : false; //是否有选中商品
... ... @@ -67,6 +68,11 @@ require('./good');
lazyLoad($('img.lazy'));
if (typeof window.cookie === 'function' && 'y' === window.cookie('_hasShowCartPresellTip')) {
$('#presell-tip').addClass('hide');
hasShowCartPresellTip = true;
}
if ('advance' === cartType) {
$cartContent.toggleClass('hide');
$('presell-cart-nav').addClass('active');
... ... @@ -102,9 +108,12 @@ if ($('.cart-nav').length > 0) {
$(window).trigger('scroll');
});
setTimeout(function() {
$('#presell-tip').addClass('hide');
}, 3000);
if(!hasShowCartPresellTip) {
setTimeout(function() {
$('#presell-tip').addClass('hide');
window.setCookie('_hasShowCartPresellTip', 'y');
}, 3000);
}
}
if ($('.advance-buy').length > 0) {
... ... @@ -121,14 +130,6 @@ if ($('.freebie').length > 0) {
});
}
//$('.advance-buy').on('touchend', function() {
// window.location.href = '/cart/index/advanceBuy?cartType=' + cartType;
//});
//
//$('.freebie').on('touchend', function() {
// window.location.href = '/cart/index/gift?cartType=' + cartType;
//});
$('.btn-balance').on('touchend', function() {
if (shouldSelectGift()) {
showChooseGifDialog();
... ...
... ... @@ -42,6 +42,11 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
var goodsList = [],
goodInfo = {};
if (!$this.hasClass('icon-cb-checked') && $this.siblings('.info').find('.low-stocks').length > 0) {
tip.show('库存不足,无法购买');
return false;
}
goodInfo.goods_type = $('#cartType').val();
goodInfo.selected = $this.hasClass('icon-cb-checked') ? 'N' : 'Y';
goodInfo.product_sku = id;
... ...