Showing
2 changed files
with
13 additions
and
0 deletions
utils/product-name-process.js
0 → 100644
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | require('../app'); | 2 | require('../app'); |
3 | const _ = require('lodash'); | 3 | const _ = require('lodash'); |
4 | const helpers = global.yoho.helpers; | 4 | const helpers = global.yoho.helpers; |
5 | +const productNameProcess = require('./product-name-process'); | ||
5 | 6 | ||
6 | /** | 7 | /** |
7 | * 根据性别来决定 默认图片获取字段 如果是 2、3 | 8 | * 根据性别来决定 默认图片获取字段 如果是 2、3 |
@@ -128,6 +129,11 @@ exports.processProductList = (list, options) => { | @@ -128,6 +129,11 @@ exports.processProductList = (list, options) => { | ||
128 | } | 129 | } |
129 | 130 | ||
130 | product.is_soon_sold_out = product.is_soon_sold_out === 'Y'; | 131 | product.is_soon_sold_out = product.is_soon_sold_out === 'Y'; |
132 | + | ||
133 | + if (product.cn_alphabet) { | ||
134 | + product.cn_alphabet = productNameProcess(product.cn_alphabet); | ||
135 | + } | ||
136 | + | ||
131 | product.url = helpers.urlFormat(`/product/pro_${product.product_id}_${product.goods_list[0].goods_id}/${product.cn_alphabet}.html`); // eslint-disable-line | 137 | product.url = helpers.urlFormat(`/product/pro_${product.product_id}_${product.goods_list[0].goods_id}/${product.cn_alphabet}.html`); // eslint-disable-line |
132 | 138 | ||
133 | // APP访问需要加附加的参数 | 139 | // APP访问需要加附加的参数 |
-
Please register or login to post a comment