Authored by 姜枫

fix bugs

... ... @@ -17,9 +17,11 @@ const list = {
// 列表页
index: (req, res, next) => {
let q = req.query;
let channel = req.cookies._Channel || 'men';
q.page = parseInt(q.page || 1, 10);
q.order = q.order || 's_n_desc';
q.channel = channel;
let retData = {
module: 'product',
... ... @@ -33,7 +35,7 @@ const list = {
if (result && result.code === 200 && result.data) {
let data = camelCase(result.data);
let nav = [DataHelper.getChannelNav()];
let nav = [DataHelper.getChannelNav(channel)];
if (data.filter) {
data.filter.groupSort = DataHelper.sortConvert(allSort.data.sort);
... ...
... ... @@ -121,12 +121,26 @@ const helpers = {
* 根据频道获取导航栏
* @returns {{link: string, pathTitle: string, name: string}}
*/
getChannelNav() {
return {
link: '#',
pathTitle: '',
name: 'MEN首页'
};
getChannelNav(channel) {
if (channel === 'women') {
return {
link: '/women',
pathTitle: '',
name: 'WOMEN首页'
};
} else if (channel === 'lifestyle') {
return {
link: '/lifestyle',
pathTitle: '',
name: 'LIFESTYLE首页'
};
} else {
return {
link: '/',
pathTitle: '',
name: 'MEN首页'
};
}
},
/**
... ...
... ... @@ -20,8 +20,25 @@ var YohoListPage = {
require('../../common/return-top');
require('../../common/header');
lazyload();
$('.nano').nanoScroller();
YohoListPage.initAccordion();
$('.nano').nanoScroller({disableResize: true});
$('.yoho-ui-accordion', this.rootDoc).each(function() {
var opts = {
collapsible: true,
heightStyle: 'content',
fillSpace: true,
active: 0
};
if ($(this).hasClass('no-active')) {
opts.active = false;
}
$(this).find('h3').each(function(index) {
if ($(this).hasClass('active')) {
opts.active = index;
}
});
$(this).accordion(opts);
});
$('.sex-body .input-radio', this.rootDoc).check({
type: 'radio',
... ... @@ -116,29 +133,8 @@ var YohoListPage = {
YohoListPage.eventBind();
},
initAccordion: function() {
$('.yoho-ui-accordion', this.rootDoc).each(function() {
var opts = {
collapsible: true,
heightStyle: 'content',
active: 0
};
if ($(this).hasClass('no-active')) {
opts.active = false;
}
$(this).find('h3').each(function(index) {
if ($(this).hasClass('active')) {
opts.active = index;
}
});
$(this).accordion(opts);
});
},
eventBind: function() {
$(window).resize(function() {
YohoListPage.initAccordion();
});
$('.mulit-choose', this.rootDoc).click(function() {
YohoListPage.openBrandMulitChoose();
});
... ...