Showing
2 changed files
with
22 additions
and
18 deletions
@@ -3,13 +3,6 @@ const _ = require('lodash'); | @@ -3,13 +3,6 @@ const _ = require('lodash'); | ||
3 | const helpers = global.yoho.helpers; | 3 | const helpers = global.yoho.helpers; |
4 | const logger = global.yoho.logger; | 4 | const logger = global.yoho.logger; |
5 | 5 | ||
6 | -const genderName = { | ||
7 | - 1: '男生', | ||
8 | - 2: '女生', | ||
9 | - '1,3': '男生', | ||
10 | - '2,3': '女生' | ||
11 | -}; | ||
12 | - | ||
13 | /** | 6 | /** |
14 | * 处理接口返回图片链接,兼容非正常链接(如:/2015/10/22/08/023a5aa1cbdac7bdcd1685bfdab118b0c5.jpg) | 7 | * 处理接口返回图片链接,兼容非正常链接(如:/2015/10/22/08/023a5aa1cbdac7bdcd1685bfdab118b0c5.jpg) |
15 | * | 8 | * |
@@ -199,8 +192,17 @@ exports.processProductList = (list, options) => { | @@ -199,8 +192,17 @@ exports.processProductList = (list, options) => { | ||
199 | isfew ? proInfo.is_few = isfew : delete proInfo.is_few; | 192 | isfew ? proInfo.is_few = isfew : delete proInfo.is_few; |
200 | } | 193 | } |
201 | 194 | ||
202 | - proInfo.productTitle = _.compact([product.brand_name_en, product.brand_name_cn || product.brand_name, | ||
203 | - genderName[product.gender], product.small_sort_name, product.product_name]).join('|'); | 195 | + let genderStr = ''; |
196 | + | ||
197 | + if (options.from.params.gender === '1,3') { | ||
198 | + genderStr = '男士'; | ||
199 | + } else if (options.from.params.gender === '2,3') { | ||
200 | + genderStr = '女士'; | ||
201 | + } else { | ||
202 | + genderStr = ''; | ||
203 | + } | ||
204 | + | ||
205 | + proInfo.productTitle = `【${genderStr}${product.small_sort ? product.small_sort : ''}】${product.product_name}`; | ||
204 | 206 | ||
205 | if (options.query && _.isString(proInfo.product_name)) { | 207 | if (options.query && _.isString(proInfo.product_name)) { |
206 | try { | 208 | try { |
@@ -131,13 +131,6 @@ const procProductImgs = (item, gender) => { | @@ -131,13 +131,6 @@ const procProductImgs = (item, gender) => { | ||
131 | } | 131 | } |
132 | }; | 132 | }; |
133 | 133 | ||
134 | -const genderName = { | ||
135 | - 1: '男生', | ||
136 | - 2: '女生', | ||
137 | - '1,3': '男生', | ||
138 | - '2,3': '女生' | ||
139 | -}; | ||
140 | - | ||
141 | /** | 134 | /** |
142 | * 商品搜索商品数据处理 | 135 | * 商品搜索商品数据处理 |
143 | */ | 136 | */ |
@@ -339,8 +332,17 @@ exports.processProductList = (list, options) => { | @@ -339,8 +332,17 @@ exports.processProductList = (list, options) => { | ||
339 | isfew ? product.is_few = isfew : delete product.is_few; | 332 | isfew ? product.is_few = isfew : delete product.is_few; |
340 | } | 333 | } |
341 | 334 | ||
342 | - product.productTitle = _.compact([product.brand_name_en, product.brand_name_cn || product.brand_name, | ||
343 | - genderName[product.gender], product.small_sort_name, product.product_name]).join('|'); | 335 | + let genderStr = ''; |
336 | + | ||
337 | + if (options.from.params.gender === '1,3') { | ||
338 | + genderStr = '男士'; | ||
339 | + } else if (options.from.params.gender === '2,3') { | ||
340 | + genderStr = '女士'; | ||
341 | + } else { | ||
342 | + genderStr = ''; | ||
343 | + } | ||
344 | + | ||
345 | + product.productTitle = `【${genderStr}${product.small_sort ? product.small_sort : ''}】${product.product_name}`; | ||
344 | 346 | ||
345 | if (options.query && _.isString(product.product_name)) { | 347 | if (options.query && _.isString(product.product_name)) { |
346 | try { | 348 | try { |
-
Please register or login to post a comment