Authored by htoooth

Merge remote-tracking branch 'origin/feature/zookeeper' into feature/zookeeper

... ... @@ -48,7 +48,7 @@
{{/each}}
</div>
</div>
<div class="brands-list" >
<div class="brands-list" data-ishover="{{@root.pc.brands.disBrandNameHover}}">
{{> brand-list}}
</div>
{{/ brands}}
... ...
... ... @@ -82,7 +82,9 @@
{{/ navbars}}
</ul>
<div class="func-area hide">
<ul class="search-suggest"></ul>
{{#unless @root.pc.common.disSearchAssociation}}
<ul class="search-suggest"></ul>
{{/unless}}
<div class="search-2016">
<form action="//search.yohobuy.com" method="get" id="search-form">
<input type="hidden" id="defaultsearch">
... ... @@ -97,16 +99,20 @@
<div class="go-cart">
<a href="//www.yohobuy.com/shopping/cart">
<span class="iconfont ">&#xe600;</span>
<span class="goods-num-tip">0</span>
{{#unless @root.pc.common.removeCartCount}}
<span class="goods-num-tip">0</span>
{{/unless}}
</a>
<div class="mini-cart-wrapper">
<div class="loading-cart">
<h3>加载中,请稍后</h3>
{{#unless @root.pc.common.disCartHover}}
<div class="mini-cart-wrapper">
<div class="loading-cart">
<h3>加载中,请稍后</h3>
</div>
<div class="empty-cart">
<h3>您的购物车暂无商品</h3>
</div>
</div>
<div class="empty-cart">
<h3>您的购物车暂无商品</h3>
</div>
</div>
{{/unless}}
</div>
</div>
</div>
... ...
... ... @@ -175,6 +175,9 @@ function bindTemplete($select, data, tmp) {
// 鼠标悬浮品牌,请求数据,并且展示
function bindHoverEvent() {
if ($list.data('ishover')) {
return;
}
$brand.unbind('mouseenter').unbind('mouseleave').hover(function() {
var $this = $(this);
var key = $this.attr('data-key');
... ...
... ... @@ -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,14 +609,16 @@ $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 {
val = val.replace(new RegExp('\'', 'gm'), ''); // 去掉特殊字符
$(this).val(val);
searchSuggest(val);
if ($searchSug && $searchSug.length) {
val = val.replace(new RegExp('\'', 'gm'), ''); // 去掉特殊字符
searchSuggest(val);
}
}
}).on('blur', '.search-key', function() {
setTimeout(function() {
... ... @@ -616,39 +626,41 @@ $searchForm.on('keyup', '.search-key', function(e) {
}, 200);
});
$goCart.hover(function() {
var data, _html = '';
if ($miniCart && $miniCart.length) {
$goCart.hover(function() {
var data, _html = '';
if ($goCart.hasClass('on-hover')) {
return;
}
data = $goCart.data();
if (data && data.num * 1) {
_html = '<div class="loading-cart"><h3>加载中,请稍后</h3></div>';
loadCartDetail(data.key);
} else {
_html = '<div class="empty-cart"><h3>您的购物车暂无商品</h3></div>';
}
$miniCart.html(_html);
$goCart.addClass('on-hover');
}, function() {
$goCart.removeClass('on-hover');
});
if ($goCart.hasClass('on-hover')) {
return;
}
$goCart.on('click', '.cart-goods-del', function() {
var $dom = $(this),
data = $dom.data(),
callback;
data = $goCart.data();
if (data && data.num * 1) {
_html = '<div class="loading-cart"><h3>加载中,请稍后</h3></div>';
loadCartDetail(data.key);
} else {
_html = '<div class="empty-cart"><h3>您的购物车暂无商品</h3></div>';
}
$miniCart.html(_html);
$goCart.addClass('on-hover');
}, function() {
$goCart.removeClass('on-hover');
});
if (data) {
callback = function() {
$dom.closest('.goods-item').remove();
};
data.key = $goCart.data().key;
delCartGoods(data, callback);
}
});
$goCart.on('click', '.cart-goods-del', function() {
var $dom = $(this),
data = $dom.data(),
callback;
if (data) {
callback = function() {
$dom.closest('.goods-item').remove();
};
data.key = $goCart.data().key;
delCartGoods(data, callback);
}
});
}
$subNav.on({
mouseenter: function() {
... ...