Authored by yyq

global deo

... ... @@ -82,10 +82,12 @@ const _handelGlobalSort = (origin, params, originParams) => {
_.forEach(origin, value => {
let equalCategory = _checkSortEqual(value.relation_parameter, originParams);
let category = {
categoryId: value.category_id,
name: value.category_name,
num: value.node_count,
childList: [
{
categoryId: value.category_id,
name: `全部${value.category_name}`,
num: value.node_count,
href: `${searchHandler.handleFilterUrl(params, value.relation_parameter)}`,
... ... @@ -108,6 +110,7 @@ const _handelGlobalSort = (origin, params, originParams) => {
_.forEach(value.sub, subValue => {
let child = {
categoryId: subValue.category_id,
name: subValue.category_name,
num: subValue.node_count,
href: `${searchHandler.handleFilterUrl(params, subValue.relation_parameter)}`,
... ... @@ -197,6 +200,7 @@ const getGlobalProductListData = (params, yoho) => {
// pathNav brand
let pathInfo = {};
let fillCondition = _.get(resData, 'list.filters.checkedConditions.conditions');
if (dps.brand) {
let brandName = _.get(result.brand, 'data.brand_name', '');
... ... @@ -205,6 +209,11 @@ const getGlobalProductListData = (params, yoho) => {
pathInfo.brand = {
name: brandName
};
// 添加品信息for seo
fillCondition = _.concat([{
name: brandName,
itemType: 'brand'
}], fillCondition);
}
}
... ... @@ -216,6 +225,12 @@ const getGlobalProductListData = (params, yoho) => {
}
Object.assign(resData.list, _handelGlobalPathNav(pathInfo, yoho.channel, 'global-list'));
let seo = searchHandler.getListSeo(yoho.channel,
_.get(resData, 'list.leftContent.allSort.list'),
fillCondition);
Object.assign(resData, seo);
}
return resData;
... ...
... ... @@ -515,10 +515,12 @@ exports.handleSortData = (origin, params, originParams, baseUrl) => {
_.forEach(origin, value => {
let equalCategory = `${originParams.category_id}` === `${value.category_id}`;
let category = {
categoryId: value.category_id,
name: value.category_name,
num: value.node_count,
childList: [
{
categoryId: value.category_id,
name: `全部${value.category_name}`,
num: value.node_count,
href: `${baseUrl}${handleFilterUrl(params, {category_id: value.category_id}, {
... ... @@ -539,6 +541,7 @@ exports.handleSortData = (origin, params, originParams, baseUrl) => {
_.forEach(value.sub, subValue => {
let child = {
categoryId: subValue.category_id,
name: subValue.category_name,
num: subValue.node_count,
href: `${baseUrl}${handleFilterUrl(params, {category_id: subValue.category_id}, {
... ... @@ -1425,7 +1428,7 @@ exports.getListSeo = (channel, sorts, checked) => {
if (val.active) {
kd.sort = val && val.name;
_.forEach(val.childList, sub => {
if (sub.childActive && sub.sortId !== val.sortId) {
if (sub.childActive && sub.categoryId !== val.categoryId) {
kd.sort = sub && sub.name;
}
});
... ...