...
|
...
|
@@ -15,7 +15,8 @@ class NewHome extends Page { |
|
|
$userAvatar: $('.user-avatar'),
|
|
|
$codeSet: $('.code-set'),
|
|
|
$resYas: $('.res-c').find('a'),
|
|
|
$trendCode: $('.trend-code')
|
|
|
$trendCode: $('.trend-code'),
|
|
|
$floatTop: $('.float-top')
|
|
|
};
|
|
|
|
|
|
this.init();
|
...
|
...
|
@@ -27,9 +28,20 @@ class NewHome extends Page { |
|
|
this.swiper();
|
|
|
this.showTrend();
|
|
|
this.autoScroll();
|
|
|
this.backToTop();
|
|
|
window.reMarginFooter('.footer-tab');
|
|
|
}
|
|
|
|
|
|
backToTop() {
|
|
|
$(document).scroll(() => {
|
|
|
if (($(document).scrollTop() >= 120)) {
|
|
|
this.selector.$floatTop.addClass('hover');
|
|
|
} else {
|
|
|
this.selector.$floatTop.removeClass('hover');
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
autoScroll() {
|
|
|
new AutoScroll(
|
|
|
{
|
...
|
...
|
@@ -41,7 +53,7 @@ class NewHome extends Page { |
|
|
|
|
|
// 首次进入个人中心,且登陆,且没有设置潮流口令,打开弹框子
|
|
|
showTrend() {
|
|
|
if (yoho.isLogin() && (!this.selector.$trendCode.html()) && !window.cookie('first-trend')) {
|
|
|
if (yoho.isLogin() && (!this.selector.$trendCode.hasClass('trend')) && !window.cookie('first-trend')) {
|
|
|
$('.set-trend-world').removeClass('set-trend-hide');
|
|
|
window.setCookie('first-trend', true, {
|
|
|
path: '/home',
|
...
|
...
|
|