...
|
...
|
@@ -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;
|
|
|
}
|
|
|
|
...
|
...
|
|