Authored by yyq

process cnAlphabet

@@ -105,6 +105,10 @@ const procProductImgs = (item, gender) => { @@ -105,6 +105,10 @@ const procProductImgs = (item, gender) => {
105 } 105 }
106 }; 106 };
107 107
  108 +const procCnAlphabetName = (nameStr) => {
  109 + return nameStr.match(/\w/ig).join('');
  110 +};
  111 +
108 /** 112 /**
109 * 商品搜索商品数据处理 113 * 商品搜索商品数据处理
110 */ 114 */
@@ -191,6 +195,8 @@ exports.processProductList = (list, options) => { @@ -191,6 +195,8 @@ exports.processProductList = (list, options) => {
191 thumb: product.default_images 195 thumb: product.default_images
192 }); 196 });
193 197
  198 + product.cn_alphabet = procCnAlphabetName(product.cn_alphabet);
  199 +
194 product.is_few = product.is_soon_sold_out === 'Y'; 200 product.is_few = product.is_soon_sold_out === 'Y';
195 product.url = helpers.urlFormat(`/product/pro_${product.product_id}_${_.get(product, 'goods_list[0].goods_id', 0)}/${product.cn_alphabet}.html`, '', 'item'); // eslint-disable-line 201 product.url = helpers.urlFormat(`/product/pro_${product.product_id}_${_.get(product, 'goods_list[0].goods_id', 0)}/${product.cn_alphabet}.html`, '', 'item'); // eslint-disable-line
196 202