Authored by 周少峰

Merge branch 'hotfix/image-quality'

@@ -300,8 +300,6 @@ const _getSkuDataByProductBaseInfo = (data) => { @@ -300,8 +300,6 @@ const _getSkuDataByProductBaseInfo = (data) => {
300 let defaultImage = '';// 默认图 300 let defaultImage = '';// 默认图
301 let chooseSkuFlag = false; // 选中状态 301 let chooseSkuFlag = false; // 选中状态
302 302
303 - let fixQuality = imageUrl => imageUrl.replace('/quality/70', '/quality/90');  
304 -  
305 if (data.goodsList) { 303 if (data.goodsList) {
306 skuGoods = _.get(data, 'goodsList', []).reduce((acc, cur, pos)=> { 304 skuGoods = _.get(data, 'goodsList', []).reduce((acc, cur, pos)=> {
307 305
@@ -315,7 +313,7 @@ const _getSkuDataByProductBaseInfo = (data) => { @@ -315,7 +313,7 @@ const _getSkuDataByProductBaseInfo = (data) => {
315 if (cur.goodsImagesList) { 313 if (cur.goodsImagesList) {
316 // 商品列表 314 // 商品列表
317 goodsGroup.productSkc = cur.productSkc; 315 goodsGroup.productSkc = cur.productSkc;
318 - goodsGroup.src = fixQuality(helpers.image(cur.colorImage, 40, 40)); 316 + goodsGroup.src = helpers.image(cur.colorImage, 40, 40);
319 goodsGroup.title = `${_.trim(data.productName)} ${cur.colorName}`; 317 goodsGroup.title = `${_.trim(data.productName)} ${cur.colorName}`;
320 goodsGroup.name = cur.colorName; 318 goodsGroup.name = cur.colorName;
321 goodsGroup.focus = false; 319 goodsGroup.focus = false;
@@ -328,8 +326,8 @@ const _getSkuDataByProductBaseInfo = (data) => { @@ -328,8 +326,8 @@ const _getSkuDataByProductBaseInfo = (data) => {
328 if (good.imageUrl) { 326 if (good.imageUrl) {
329 goodsGroup.thumbs.push({ 327 goodsGroup.thumbs.push({
330 url: '', 328 url: '',
331 - shower: fixQuality(helpers.image(good.imageUrl, 420, 560)),  
332 - img: fixQuality(helpers.image(good.imageUrl, 75, 100)) 329 + shower: helpers.image(good.imageUrl, 420, 560),
  330 + img: helpers.image(good.imageUrl, 75, 100)
333 }); 331 });
334 } 332 }
335 }); 333 });
@@ -341,7 +339,7 @@ const _getSkuDataByProductBaseInfo = (data) => { @@ -341,7 +339,7 @@ const _getSkuDataByProductBaseInfo = (data) => {
341 339
342 // 默认第一张图片 340 // 默认第一张图片
343 if (pos === 0) { 341 if (pos === 0) {
344 - defaultImage = fixQuality(helpers.image(cur.colorImage, 420, 560)); 342 + defaultImage = helpers.image(cur.colorImage, 420, 560);
345 } 343 }
346 344
347 // 商品的尺码列表 345 // 商品的尺码列表
1 'use strict'; 1 'use strict';
2 const _ = require('lodash'); 2 const _ = require('lodash');
  3 +const fp = require('lodash/fp');
3 4
4 const camelCase = global.yoho.camelCase; 5 const camelCase = global.yoho.camelCase;
5 const helpers = global.yoho.helpers; 6 const helpers = global.yoho.helpers;
6 const images = require(`${global.utils}/images`); 7 const images = require(`${global.utils}/images`);
7 8
  9 +// NOTE: 这里修改了图片质量的参数
  10 +helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90'));
  11 +
8 /** 12 /**
9 * 根据性别来决定 默认图片获取字段 如果是 2、3 13 * 根据性别来决定 默认图片获取字段 如果是 2、3
10 * 14 *
@@ -20,7 +24,6 @@ const procProductImg = (product, gender) => { @@ -20,7 +24,6 @@ const procProductImg = (product, gender) => {
20 return product.cover1 || product.cover2 || product.imagesUrl || ''; 24 return product.cover1 || product.cover2 || product.imagesUrl || '';
21 }; 25 };
22 26
23 -  
24 /** 27 /**
25 * 处理列表大图周边小图数据,拼接添加 href 28 * 处理列表大图周边小图数据,拼接添加 href
26 * @param origin goods 原始数据 29 * @param origin goods 原始数据