Authored by hongweigao

Merge branch 'master' into feature/studentsTwo

@@ -86,7 +86,7 @@ exports.suggest4Old = (req, res, next) => { @@ -86,7 +86,7 @@ exports.suggest4Old = (req, res, next) => {
86 86
87 exports.serachFilterBrands = (req, res, next) => { 87 exports.serachFilterBrands = (req, res, next) => {
88 search.getBrands4Filter(Object.assign({}, req.query, { 88 search.getBrands4Filter(Object.assign({}, req.query, {
89 - keyword: req.query.query 89 + keyword: req.query.query || ''
90 })).then(result => { 90 })).then(result => {
91 let dest = { 91 let dest = {
92 code: 200, 92 code: 200,
@@ -108,6 +108,11 @@ exports.getBrands4Filter = (params) => { @@ -108,6 +108,11 @@ exports.getBrands4Filter = (params) => {
108 nparams.price = nmp.join(','); 108 nparams.price = nmp.join(',');
109 } 109 }
110 110
  111 + // 生成路径包含callback 导致多次调用多个 callback问题
  112 + if (params && params.callback) {
  113 + delete params.callback;
  114 + }
  115 +
111 return searchApi.getBrands4Filter(Object.assign({}, params, nparams)).then(result => { 116 return searchApi.getBrands4Filter(Object.assign({}, params, nparams)).then(result => {
112 117
113 let dest = []; 118 let dest = [];
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 </p> 78 </p>
79 <div class="hideList hide"> 79 <div class="hideList hide">
80 {{#goods_list}} 80 {{#goods_list}}
81 - <li data-src="{{image images_url 280 374}}" data-url="{{../url}}"></li> 81 + <li data-src="{{image images_url 280 374}}" data-url="{{../url}}" data-status="{{status}}"></li>
82 {{/goods_list}} 82 {{/goods_list}}
83 </div> 83 </div>
84 </div> 84 </div>
1 { 1 {
2 "name": "yohobuy-node", 2 "name": "yohobuy-node",
3 - "version": "5.0.1", 3 + "version": "5.0.2",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
@@ -104,7 +104,10 @@ exports.init = function(num) { @@ -104,7 +104,10 @@ exports.init = function(num) {
104 event.target.find('.hideList > li').each(function() { 104 event.target.find('.hideList > li').each(function() {
105 pic = $(this).data(); 105 pic = $(this).data();
106 pic.coverImg = pic.src; 106 pic.coverImg = pic.src;
107 - pics.push(pic); 107 +
  108 + if (+pic.status) { // 过滤下架商品
  109 + pics.push(pic);
  110 + }
108 }); 111 });
109 112
110 colorList = createColorList(pics, _from); 113 colorList = createColorList(pics, _from);
@@ -4,7 +4,8 @@ const fp = require('lodash/fp'); @@ -4,7 +4,8 @@ const fp = require('lodash/fp');
4 4
5 const camelCase = global.yoho.camelCase; 5 const camelCase = global.yoho.camelCase;
6 const helpers = global.yoho.helpers; 6 const helpers = global.yoho.helpers;
7 -const images = require(`${global.utils}/images`); 7 +
  8 +// const images = require(`${global.utils}/images`);
8 9
9 // NOTE: 这里修改了图片质量的参数 10 // NOTE: 这里修改了图片质量的参数
10 helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90')); 11 helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90'));
@@ -393,7 +394,7 @@ exports.processProduct = (productData, options) => { @@ -393,7 +394,7 @@ exports.processProduct = (productData, options) => {
393 394
394 result.id = productData.product_skn; 395 result.id = productData.product_skn;
395 result.product_id = productData.product_id; 396 result.product_id = productData.product_id;
396 - result.thumb = images.getImageUrl(productData.default_images, options.width, options.height); 397 + result.thumb = helpers.image(productData.default_images, options.width, options.height);
397 result.name = productData.product_name; 398 result.name = productData.product_name;
398 result.price = !productData.market_price ? false : productData.market_price; 399 result.price = !productData.market_price ? false : productData.market_price;
399 result.salePrice = productData.sales_price; 400 result.salePrice = productData.sales_price;