Authored by 周少峰

Merge branch 'hotfix/image-quality'

... ... @@ -300,8 +300,6 @@ const _getSkuDataByProductBaseInfo = (data) => {
let defaultImage = '';// 默认图
let chooseSkuFlag = false; // 选中状态
let fixQuality = imageUrl => imageUrl.replace('/quality/70', '/quality/90');
if (data.goodsList) {
skuGoods = _.get(data, 'goodsList', []).reduce((acc, cur, pos)=> {
... ... @@ -315,7 +313,7 @@ const _getSkuDataByProductBaseInfo = (data) => {
if (cur.goodsImagesList) {
// 商品列表
goodsGroup.productSkc = cur.productSkc;
goodsGroup.src = fixQuality(helpers.image(cur.colorImage, 40, 40));
goodsGroup.src = helpers.image(cur.colorImage, 40, 40);
goodsGroup.title = `${_.trim(data.productName)} ${cur.colorName}`;
goodsGroup.name = cur.colorName;
goodsGroup.focus = false;
... ... @@ -328,8 +326,8 @@ const _getSkuDataByProductBaseInfo = (data) => {
if (good.imageUrl) {
goodsGroup.thumbs.push({
url: '',
shower: fixQuality(helpers.image(good.imageUrl, 420, 560)),
img: fixQuality(helpers.image(good.imageUrl, 75, 100))
shower: helpers.image(good.imageUrl, 420, 560),
img: helpers.image(good.imageUrl, 75, 100)
});
}
});
... ... @@ -341,7 +339,7 @@ const _getSkuDataByProductBaseInfo = (data) => {
// 默认第一张图片
if (pos === 0) {
defaultImage = fixQuality(helpers.image(cur.colorImage, 420, 560));
defaultImage = helpers.image(cur.colorImage, 420, 560);
}
// 商品的尺码列表
... ...
'use strict';
const _ = require('lodash');
const fp = require('lodash/fp');
const camelCase = global.yoho.camelCase;
const helpers = global.yoho.helpers;
const images = require(`${global.utils}/images`);
// NOTE: 这里修改了图片质量的参数
helpers.image = _.flow(helpers.image, fp.replace(/\/quality\/\d*$/, '/quality/90'));
/**
* 根据性别来决定 默认图片获取字段 如果是 2、3
*
... ... @@ -20,7 +24,6 @@ const procProductImg = (product, gender) => {
return product.cover1 || product.cover2 || product.imagesUrl || '';
};
/**
* 处理列表大图周边小图数据,拼接添加 href
* @param origin goods 原始数据
... ...