Authored by biao

update for set cookie for channel

... ... @@ -6,7 +6,8 @@ exports.index = (req, res) => {
model.getContent(channelType).then(result => {
res.display('index', Object.assign({
module: 'channel',
page: 'home'
page: 'home',
dataPage: channelType,
}, result));
});
};
... ...
<div class="home-page blk-page">
<div class="home-page blk-page" data-page="{{dataPage}}">
<div class="top-slider-container">
{{# content}}
{{#if slider}}
... ...
... ... @@ -6,6 +6,8 @@
var lazyLoad = require('yoho-jquery-lazyload');
var homePage = $('.home-page').data('page');
require('../common/header');
require('../common/return-top');
require('../plugins/slider');
... ... @@ -24,3 +26,12 @@ $('.card').mouseenter(function() {
$('.active').removeClass('active');
$this.addClass('active');
});
if ($.inArray(homePage, ['men', 'women', 'lifestyle']) > -1) {
window.setCookie('_Channel', homePage, {
domain: '.yohoblk.com',
path: '/',
expires: 365
});
}
... ...