Authored by hf

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

... ... @@ -5,7 +5,6 @@
*/
var $ = require('jquery'),
lazyLoad = require('yoho.lazyload'),
Hammer = require('yoho.hammer');
var chosePanel = require('./chose-panel'),
... ... @@ -40,9 +39,15 @@ function shouldSelectGift() {
}
function shouldLowStocks() {
var $lowStocks = $('.low-stocks'),
var $lowStocks,
result = false;
if ('ordinary' === cartType) {
$lowStocks = $('.common .low-stocks');
} else if ('advance' === cartType) {
$lowStocks = $('.presell .low-stocks');
}
if ($lowStocks.length <= 0) {
return result;
}
... ... @@ -73,7 +78,7 @@ function showChooseGifDialog() {
require('./good');
lazyLoad($('img.lazy'));
//lazyLoad($('img.lazy'));
if (typeof window.cookie === 'function' && 'y' === window.cookie('_hasShowCartPresellTip')) {
$('#presell-tip').removeClass('show').addClass('hide');
... ... @@ -151,7 +156,7 @@ if ($('.freebie').length > 0) {
$('.btn-balance').on('touchend', function() {
if (shouldLowStocks()) {
tip.show('库存不足无法结算');
tip.show('所选商品中含有库存不足的商品');
return false;
}
... ...
... ... @@ -192,13 +192,22 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
//全选按钮点击事件
$selectAllBtn.on('touchend', function() {
var isSelect = $(this).hasClass('icon-cb-checked');
var cartType = $('#cartType').val(),
isSelect = $(this).hasClass('icon-cb-checked');
if (!isSelect && $('.low-stocks').length > 0) {
if ('ordinary' === cartType) {
if (!isSelect && $('.common .low-stocks').length > 0) {
tip.show('所选商品中含有库存不足的商品');
return false;
}
bottomCheckBoxHandeler(isSelect, $('#cartType').val(), didUpdateAllGoodsCheckStatus);
} else if ('advance' === cartType) {
if (!isSelect && $('.presell .low-stocks').length > 0) {
tip.show('所选商品中含有库存不足的商品');
return false;
}
}
bottomCheckBoxHandeler(isSelect, cartType, didUpdateAllGoodsCheckStatus);
});
$('.down').on('touchend', function() {
... ...