Authored by 王水玲

商品列表title 修改

... ... @@ -3,13 +3,6 @@ const _ = require('lodash');
const helpers = global.yoho.helpers;
const logger = global.yoho.logger;
const genderName = {
1: '男生',
2: '女生',
'1,3': '男生',
'2,3': '女生'
};
/**
* 处理接口返回图片链接,兼容非正常链接(如:/2015/10/22/08/023a5aa1cbdac7bdcd1685bfdab118b0c5.jpg)
*
... ... @@ -199,8 +192,17 @@ exports.processProductList = (list, options) => {
isfew ? proInfo.is_few = isfew : delete proInfo.is_few;
}
proInfo.productTitle = _.compact([product.brand_name_en, product.brand_name_cn || product.brand_name,
genderName[product.gender], product.small_sort_name, product.product_name]).join('|');
let genderStr = '';
if (options.from.params.gender === '1,3') {
genderStr = '男士';
} else if (options.from.params.gender === '2,3') {
genderStr = '女士';
} else {
genderStr = '';
}
proInfo.productTitle = `【${genderStr}${product.small_sort ? product.small_sort : ''}${product.product_name}`;
if (options.query && _.isString(proInfo.product_name)) {
try {
... ...
... ... @@ -131,13 +131,6 @@ const procProductImgs = (item, gender) => {
}
};
const genderName = {
1: '男生',
2: '女生',
'1,3': '男生',
'2,3': '女生'
};
/**
* 商品搜索商品数据处理
*/
... ... @@ -339,8 +332,17 @@ exports.processProductList = (list, options) => {
isfew ? product.is_few = isfew : delete product.is_few;
}
product.productTitle = _.compact([product.brand_name_en, product.brand_name_cn || product.brand_name,
genderName[product.gender], product.small_sort_name, product.product_name]).join('|');
let genderStr = '';
if (options.from.params.gender === '1,3') {
genderStr = '男士';
} else if (options.from.params.gender === '2,3') {
genderStr = '女士';
} else {
genderStr = '';
}
product.productTitle = `【${genderStr}${product.small_sort ? product.small_sort : ''}${product.product_name}`;
if (options.query && _.isString(product.product_name)) {
try {
... ...