Authored by 毕凯

Merge branch 'gray' of git.yoho.cn:fe/yohobuywap-node into gray

... ... @@ -62,7 +62,7 @@ const newDetail = {
pageHeader: headerData,
result: result,
page: 'new-detail',
title: `${result.brandName}${result.sortName}${result.goodsName}|YOHO!BUY 有货`,
title: `${result.brandName}|${result.sortName}|${result.goodsName}|YOHO!BUY 有货`,
keywords: result.brandName + result.sortName + ',' + result.brandName + '官网专卖店,' +
result.brandName + '官方授权店,' + result.brandName + '正品,' + result.brandName + '打折,' +
result.brandName + '折扣店,' +
... ...
... ... @@ -35,7 +35,7 @@ const shop = {
if (shopId) {
let shopInfoApi = (yield req.ctx(shopModel).getShopInfo(shopId)) || {};
return res.redirect(301, `//m.yohobuy.com/shop/${_.get(shopInfoApi, 'data.shop_domain')}-${shopId}.html`); // eslint-disable-line
return res.redirect(301, `//m.yohobuy.com/shop/${_.get(shopInfoApi, 'data.shop_domain', 'id')}-${shopId}.html`); // eslint-disable-line
}
if (domain) {
... ... @@ -44,14 +44,14 @@ const shop = {
if (domainInfo.shopId && domainInfo.type === '2') {
return res.redirect(301, `//m.yohobuy.com/shop/${domain}-${_.get(domainInfo, 'shopId')}.html`);
} else {
return res.redirect(301, helpers.urlFormat('/index/brand', {
return res.redirect(301, helpers.urlFormat('/product/index/brand', {
brand_id: _.get(domainInfo, 'id')
}));
}
}
if (brandId) {
return res.redirect(301, helpers.urlFormat('/index/brand', { brand_id: brandId }));
return res.redirect(301, helpers.urlFormat('/product/index/brand', { brand_id: brandId }));
}
})().catch(next);
},
... ...
... ... @@ -148,9 +148,7 @@ class DetailProcess {
};
if (value.shop_id) {
shopInfo.url = helpers.urlFormat('/product/shop', {
shop_id: value.shop_id
});
shopInfo.url = `/shop/${value.brand_domain}-${value.shop_id}.html`;
} else {
shopInfo.url = helpers.urlFormat('', null, value.brand_domain);
}
... ...
... ... @@ -4,7 +4,8 @@ const _ = require('lodash');
const helpers = global.yoho.helpers;
const GENDER = {
1: '男',
2: '女'
2: '女',
3: '男|女'
};
/**
... ... @@ -232,7 +233,9 @@ exports.processProductList = (list, options) => {
product.similar = true;
}
product.seoTitle = `${product.brand_name}|${product.gender ? GENDER[product.gender] + '|': ''}${product.small_sort_name}|${product.product_name}|YOHO!BUY有货`; // eslint-disable-line
let seoGender = product.gender ? GENDER[product.gender] + '|' : '';
product.seoTitle = `${product.brand_name}|${seoGender}${product.small_sort_name}|${product.product_name}|YOHO!BUY有货`; // eslint-disable-line
pruductList.push(product);
});
... ...