...
|
...
|
@@ -38,6 +38,8 @@ var logoAngle = 0, |
|
|
|
|
|
var dataLayer = [];
|
|
|
|
|
|
var cartTimer;
|
|
|
|
|
|
// banner和地址的映射
|
|
|
var bannerMap = {
|
|
|
listboys: '4f78b0f418fc42314d8b6e791cfb7fa8',
|
...
|
...
|
@@ -307,6 +309,11 @@ function syncCratInfo(strG) { |
|
|
domain: '.yohobuy.com'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (!$goodsNum || !$goodsNum.length) {
|
|
|
return cartTimer ? clearInterval(cartTimer) : false;
|
|
|
}
|
|
|
|
|
|
if (window.cookie('_g')) {
|
|
|
info = $.parseJSON(window.cookie('_g'));
|
|
|
total = parseInt(info._nac, 10) + parseInt(info._ac, 10);
|
...
|
...
|
@@ -524,7 +531,8 @@ if (isSupportCss3Animation()) { |
|
|
syncPageChannel();
|
|
|
getBannerAndNotice(); // 获取头部banner
|
|
|
formatThirdMenu(); // 格式化三级菜单
|
|
|
setInterval(syncCratInfo, 2000); // 定时同步购物车数量
|
|
|
|
|
|
cartTimer = setInterval(syncCratInfo, 2000); // 定时同步购物车数量
|
|
|
|
|
|
// 获取头部登陆信息
|
|
|
(function() {
|
...
|
...
|
@@ -601,22 +609,25 @@ $searchForm.on('keyup', '.search-key', function(e) { |
|
|
$focus.addClass('action');
|
|
|
$(this).val($focus.find('.searchvalue').text());
|
|
|
} else if (e.which === 13) {
|
|
|
val = val.replace(new RegExp('\'', 'gm'), '');
|
|
|
if (val !== '') {
|
|
|
$(this).val(val);
|
|
|
$searchForm.submit();
|
|
|
}
|
|
|
} else {
|
|
|
if ($searchSug && $searchSug.length) {
|
|
|
val = val.replace(new RegExp('\'', 'gm'), ''); // 去掉特殊字符
|
|
|
|
|
|
$(this).val(val);
|
|
|
searchSuggest(val);
|
|
|
}
|
|
|
}
|
|
|
}).on('blur', '.search-key', function() {
|
|
|
setTimeout(function() {
|
|
|
$searchSug.hide();
|
|
|
}, 200);
|
|
|
});
|
|
|
|
|
|
$goCart.hover(function() {
|
|
|
if ($miniCart && $miniCart.length) {
|
|
|
$goCart.hover(function() {
|
|
|
var data, _html = '';
|
|
|
|
|
|
if ($goCart.hasClass('on-hover')) {
|
...
|
...
|
@@ -632,11 +643,11 @@ $goCart.hover(function() { |
|
|
}
|
|
|
$miniCart.html(_html);
|
|
|
$goCart.addClass('on-hover');
|
|
|
}, function() {
|
|
|
}, function() {
|
|
|
$goCart.removeClass('on-hover');
|
|
|
});
|
|
|
});
|
|
|
|
|
|
$goCart.on('click', '.cart-goods-del', function() {
|
|
|
$goCart.on('click', '.cart-goods-del', function() {
|
|
|
var $dom = $(this),
|
|
|
data = $dom.data(),
|
|
|
callback;
|
...
|
...
|
@@ -648,7 +659,8 @@ $goCart.on('click', '.cart-goods-del', function() { |
|
|
data.key = $goCart.data().key;
|
|
|
delCartGoods(data, callback);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$subNav.on({
|
|
|
mouseenter: function() {
|
...
|
...
|
|