...
|
...
|
@@ -15,11 +15,14 @@ var $head = $('.head-wrapper'), |
|
|
$logotrans = $head.find('.main-logo'),
|
|
|
$searchSug = $head.find('.search-suggest'),
|
|
|
$goCart = $head.find('.go-cart'),
|
|
|
$myYohoBox = $('#myYohoBox'),
|
|
|
$goodsNum = $goCart.find('.goods-num-tip'),
|
|
|
$miniCart = $head.find('.mini-cart-wrapper');
|
|
|
|
|
|
var $subNav = $('.sub-nav-list .contain-third');
|
|
|
|
|
|
var fetchUserInfoEvent = $.Callbacks('once'); // eslint-disable-line
|
|
|
|
|
|
var thirdLineNum = 9,
|
|
|
delayer,
|
|
|
centerFn,
|
...
|
...
|
@@ -260,7 +263,7 @@ function syncLoginInfo() { |
|
|
method: 'open.passport.get'
|
|
|
};
|
|
|
|
|
|
$.getJSON('//www.yohobuy.com/common/passport/?callback=?', param, function(jsonData) {
|
|
|
return $.getJSON('//www.yohobuy.com/common/passport/?callback=?', param, function(jsonData) {
|
|
|
if (jsonData && jsonData.data && jsonData.data.result !== -1) {
|
|
|
updateLoginInfo(jsonData.data);
|
|
|
} else {
|
...
|
...
|
@@ -491,10 +494,44 @@ if (isSupportCss3Animation()) { |
|
|
window.setTimeout(fadeAnimate, 3000);
|
|
|
}
|
|
|
getBannerAndNotice(); // 获取头部banner
|
|
|
syncLoginInfo(); // 同步登陆信息
|
|
|
formatThirdMenu(); // 格式化三级菜单
|
|
|
setInterval(syncCratInfo, 2000); // 定时同步购物车数量
|
|
|
|
|
|
// 获取头部登陆信息
|
|
|
(function() {
|
|
|
var uid = getUid(), //eslint-disable-line
|
|
|
profileName = getProfileName(); // eslint-disable-line
|
|
|
|
|
|
var info = {
|
|
|
usercenter: '//www.yohobuy.com/home?t=' + new Date().getTime(),
|
|
|
nickname: profileName,
|
|
|
signout: '//www.yohobuy.com/logout.html'
|
|
|
};
|
|
|
|
|
|
if (uid === 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$loginBox.html(loginFn(info));
|
|
|
$loginBox.show();
|
|
|
}());
|
|
|
|
|
|
fetchUserInfoEvent.add(syncLoginInfo);
|
|
|
|
|
|
$myYohoBox.hover(function() {
|
|
|
var uid = getUid(); // eslint-disable-line
|
|
|
|
|
|
$myYohoBox.addClass('myyoho-hover');
|
|
|
|
|
|
if (uid === 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
fetchUserInfoEvent.fire();
|
|
|
}, function() {
|
|
|
$myYohoBox.removeClass('myyoho-hover');
|
|
|
});
|
|
|
|
|
|
$yohoGroup.hover(function() {
|
|
|
var data = $(this).data();
|
|
|
|
...
|
...
|
|