Authored by yyq

Merge branch 'release/newSearch' of git.yoho.cn:fe/yohobuy-node into release/newSearch

@@ -181,10 +181,10 @@ exports.processProductList = (list, options) => { @@ -181,10 +181,10 @@ exports.processProductList = (list, options) => {
181 product.tags.is_advance = product.is_advance === 'Y'; // 再到着 181 product.tags.is_advance = product.is_advance === 'Y'; // 再到着
182 182
183 // 打折与即将售完组合显示打折 183 // 打折与即将售完组合显示打折
184 - /*if (product.is_soon_sold_out && product.tags.is_discount) { 184 + /* if (product.is_soon_sold_out && product.tags.is_discount) {
185 product.tags.is_few = false; 185 product.tags.is_few = false;
186 } else*/ 186 } else*/
187 - if(product.tags.is_new) { 187 + if (product.tags.is_new) {
188 product.tags.is_sale = false; 188 product.tags.is_sale = false;
189 } 189 }
190 if (product.tags.is_sale && 190 if (product.tags.is_sale &&
@@ -197,6 +197,12 @@ exports.processProductList = (list, options) => { @@ -197,6 +197,12 @@ exports.processProductList = (list, options) => {
197 } 197 }
198 } 198 }
199 199
  200 + if (options.query && _.isString(product.product_name)) {
  201 + let qreg = new RegExp(options.query, 'ig');
  202 +
  203 + product.product_name = product.product_name.replace(qreg, '<span style="color:#c00;">$&</span>');
  204 + }
  205 +
200 pruductList.push(product); 206 pruductList.push(product);
201 }); 207 });
202 return handleGoodsListData(pruductList); 208 return handleGoodsListData(pruductList);