Authored by 李靖

优化图片

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