...
|
...
|
@@ -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,
|
...
|
...
|
@@ -111,16 +114,16 @@ function setTopBanner(data) { |
|
|
} else {
|
|
|
topbanner = '<div class="yoho-notice">' +
|
|
|
'<div class="notice-container center-content">' +
|
|
|
'<h1 class="notice-title">关于系统升级的公告</h1>' +
|
|
|
'<div class="notice-content">' +
|
|
|
'<p class="tips">尊敬的顾客:</p>' +
|
|
|
'<p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p>' +
|
|
|
'<p class="detail">系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:' +
|
|
|
'400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常' +
|
|
|
'使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p>' +
|
|
|
'</div>' +
|
|
|
'<h1 class="notice-title">关于系统升级的公告</h1>' +
|
|
|
'<div class="notice-content">' +
|
|
|
'<p class="tips">尊敬的顾客:</p>' +
|
|
|
'<p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p>' +
|
|
|
'<p class="detail">系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:' +
|
|
|
'400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常' +
|
|
|
'使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p>' +
|
|
|
'</div>' +
|
|
|
'</div>' +
|
|
|
'</div>';
|
|
|
'</div>';
|
|
|
}
|
|
|
$('body').prepend(topbanner);
|
|
|
}
|
...
|
...
|
@@ -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();
|
|
|
|
...
|
...
|
|