Authored by 毕凯

Merge branch 'hotfix/cnAlpha' into 'master'

process-product-name



See merge request !45
/**
* Created by yoho on 2016/12/19.
*/
module.exports = function (nameStr) {
return nameStr.match(/\w/ig).join('');
};
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@
require('../app');
const _ = require('lodash');
const helpers = global.yoho.helpers;
const productNameProcess = require('./product-name-process');
/**
* 根据性别来决定 默认图片获取字段 如果是 2、3
... ... @@ -128,6 +129,11 @@ exports.processProductList = (list, options) => {
}
product.is_soon_sold_out = product.is_soon_sold_out === 'Y';
if (product.cn_alphabet) {
product.cn_alphabet = productNameProcess(product.cn_alphabet);
}
product.url = helpers.urlFormat(`/product/pro_${product.product_id}_${product.goods_list[0].goods_id}/${product.cn_alphabet}.html`); // eslint-disable-line
// APP访问需要加附加的参数
... ...