Authored by 陈峰

Merge branch 'gray' into 'master'

Gray



See merge request !345
@@ -43,10 +43,10 @@ @@ -43,10 +43,10 @@
43 {{/ is_solded}} 43 {{/ is_solded}}
44 </div> 44 </div>
45 <div class="good-detail-text {{#for_stu}} stu-good-detail {{/for_stu}}"> 45 <div class="good-detail-text {{#for_stu}} stu-good-detail {{/for_stu}}">
46 - <a href="{{url}}" target="_blank"{{#if noFollow}} rel="nofollow"{{/if}}>{{{product_name}}}</a> 46 + <a href="{{url}}" target="_blank" title="{{#if productTitle}}{{productTitle}}{{^}}{{product_name}}{{/if}}" {{#if noFollow}} rel="nofollow"{{/if}}>{{{product_name}}}111</a>
47 <p class="brand"> 47 <p class="brand">
48 {{#if brand_name}} 48 {{#if brand_name}}
49 - <a href="{{brandUrl}}"{{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{brand_name}}</a> 49 + <a href="{{brandUrl}}" title="{{#if productTitle}}{{productTitle}}{{^}}{{product_name}}{{/if}}" {{#if @root.pageNoFollow}} rel="nofollow"{{/if}}>{{brand_name}}</a>
50 {{/if}} 50 {{/if}}
51 </p> 51 </p>
52 <p class="price {{#if vip}}vip-center{{/if}}"> 52 <p class="price {{#if vip}}vip-center{{/if}}">
@@ -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 (_.get(options, 'from.params.gender') === '1,3') {
  198 + genderStr = '男士';
  199 + } else if (_.get(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 (_.get(options, 'from.params.gender') === '1,3') {
  338 + genderStr = '男士';
  339 + } else if (_.get(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 {