...
|
...
|
@@ -10,11 +10,13 @@ var $ = require('jquery'), |
|
|
|
|
|
var chosePanel = require('./chose-panel'),
|
|
|
dialog = require('../me/dialog'),
|
|
|
loading = require('../plugin/loading'),
|
|
|
tip = require('../plugin/tip');
|
|
|
|
|
|
var $cartContent = $('.cart-content'),
|
|
|
cartType = $('#cartType').val(),
|
|
|
$cartNav = $('.cart-nav'),
|
|
|
$cartPage = $('.shopping-cart-page'),
|
|
|
hasShowCartPresellTip = false;
|
|
|
|
|
|
var navHammer,
|
...
|
...
|
@@ -22,19 +24,30 @@ var navHammer, |
|
|
freebieHammer,
|
|
|
switchChose = false;
|
|
|
|
|
|
var isRefreshByDelete = window.cookie('_yoho-cart-refreshByDelete') === 'true' ? true : false;
|
|
|
|
|
|
|
|
|
loading.showLoadingMask();
|
|
|
|
|
|
function needLoadRecommandForYou() {
|
|
|
return window.isCookiesEnabled() ?
|
|
|
$('.cart-goods').length <= 0 && window.cookie('_yoho-cart-refreshByDelete') !== 'true' :
|
|
|
$('.cart-goods').length <= 0 && !isRefreshByDelete :
|
|
|
$('.cart-goods').length <= 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
if (needLoadRecommandForYou()) {
|
|
|
require('../product/recommend-for-you');
|
|
|
} else {
|
|
|
if (isRefreshByDelete) {
|
|
|
$('body').css('background-color', '#f0f0f0');
|
|
|
}
|
|
|
require('./good');
|
|
|
}
|
|
|
|
|
|
$cartPage.css('display', 'block');
|
|
|
loading.hideLoadingMask();
|
|
|
|
|
|
window.setCookie('_yoho-cart-refreshByDelete', false);
|
|
|
|
|
|
ellipsis.init();
|
...
|
...
|
|