Authored by 李靖

优化图片

... ... @@ -7,9 +7,9 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model
exports.list = (req, res, next) => {
let responseData = {
pageHeader: headerModel.setNav({
navTitle: '商品列表',
navTitle: '商品素材列表页',
}),
title: '商品列表',
title: '商品素材列表页',
module: '3party',
page: 'material',
width750: true,
... ...
... ... @@ -35,10 +35,20 @@ class materialModel extends global.yoho.BaseModel {
let build = [];
_.forEach(result.data.product_list, (val) => {
let url = `//m.yohobuy.com/product/${val.productSkn}.html`;
let imgUrl = val.picImgUrl;
if (imgUrl.split('?')[0]) {
imgUrl = imgUrl.split('?')[0] + '?imageView2/0/w/323/h/431';
}
if (params.isApp) {
url = `http:${url}?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${val.productSkn}"}}`; // eslint-disable-line
}
build.push({
product_name: val.productName,
default_images: val.picImgUrl,
url: `//m.yohobuy.com/product/${val.productSkn}.html`
default_images: imgUrl,
url: url
});
});
resu.goods = build;
... ...