...
|
...
|
@@ -16,14 +16,21 @@ var $cartContent = $('.cart-content'), |
|
|
cartType = $('#cartType').val(),
|
|
|
hasShowCartPresellTip = false;
|
|
|
|
|
|
var $cartContentShow = $cartContent.not('.hide');
|
|
|
|
|
|
var navHammer,
|
|
|
advanceBuyHammer,
|
|
|
freebieHammer;
|
|
|
freebieHammer,
|
|
|
switchChose = false;
|
|
|
|
|
|
require('../product/recommend-for-you');
|
|
|
|
|
|
var hasChecked = $('.cart-content:not(.hide) .icon-cb-checked').length > 0 ? true : false; //是否有选中商品
|
|
|
function hasChecked() {
|
|
|
return $cartContentShow.find('.icon-cb-checked').length > 0 ? true : false;
|
|
|
}
|
|
|
|
|
|
function shouldSelectGift() {
|
|
|
var $freebie = $('.freebie');
|
|
|
var $freebie = $cartContentShow.find('.freebie');
|
|
|
|
|
|
if ($freebie.length <= 0) {
|
|
|
return false;
|
...
|
...
|
@@ -58,7 +65,7 @@ function showChooseGifDialog() { |
|
|
rightBtnText: '去选择'
|
|
|
}
|
|
|
}, function() {
|
|
|
window.location.href = $('.freebie').find('a').attr('href');
|
|
|
window.location.href = $cartContentShow.find('.freebie > a').attr('href');
|
|
|
}, function() {
|
|
|
window.location.href = '/cart/index/orderEnsure?cartType=' + cartType;
|
|
|
});
|
...
|
...
|
@@ -93,9 +100,11 @@ if ($('.cart-nav').length > 0) { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (switchChose === false) {
|
|
|
$('.shopping-cart-good .name').each(function() {
|
|
|
this.mlellipsis(2);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (cartType === 'ordinary') {
|
|
|
cartType = 'advance';
|
...
|
...
|
@@ -111,7 +120,7 @@ if ($('.cart-nav').length > 0) { |
|
|
//切换普通商品和预售商品购物车显示
|
|
|
$cartContent.toggleClass('hide');
|
|
|
|
|
|
hasChecked = $('.cart-content:not(.hide) .icon-cb-checked').length > 0 ? true : false;
|
|
|
$cartContentShow = $cartContent.not('.hide');
|
|
|
|
|
|
//trigger lazyload
|
|
|
$(window).trigger('scroll');
|
...
|
...
|
@@ -150,7 +159,7 @@ $('.btn-balance').on('touchend', function() { |
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if (hasChecked) {
|
|
|
if (hasChecked()) {
|
|
|
window.location.href = '/cart/index/orderEnsure?cartType=' + cartType;
|
|
|
} else {
|
|
|
tip.show('请先勾选商品');
|
...
|
...
|
@@ -161,10 +170,6 @@ $('.chose').on('touchend', function() { |
|
|
chosePanel.show();
|
|
|
});
|
|
|
|
|
|
if ($('.shopping-cart-good').length <= 0) {
|
|
|
require('../product/recommend-for-you');
|
|
|
}
|
|
|
|
|
|
function notAllowScroll() {
|
|
|
var docH = $(document).height(),
|
|
|
winH = $(window).height();
|
...
|
...
|
|