...
|
...
|
@@ -9,6 +9,7 @@ const newDetailModel = require('../models/new-detail'); |
|
|
const listModel = require('../models/list');
|
|
|
const headerModel = require('../../../doraemon/models/header'); // 头部model
|
|
|
const qs = require('querystring');
|
|
|
const moment = require('moment');
|
|
|
const tdk = require('../../../utils/getTDK');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
|
...
|
...
|
@@ -57,11 +58,14 @@ const newDetail = { |
|
|
let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.productDetail","params":' +
|
|
|
JSON.stringify(appParams) +
|
|
|
'}';
|
|
|
|
|
|
let mipPics = _.map(_.get(result, 'bannerTop.list', []), item => {
|
|
|
return item.img.replace(/\?(.*)/g, "?imageView2/{mode}/w/{width}/h/{height}");
|
|
|
});
|
|
|
|
|
|
|
|
|
if (mipPics.length <= 0) {
|
|
|
mipPics.push(_.get(result, 'bannerTop.img', '').replace(/\?(.*)/g, "?imageView2/{mode}/w/{width}/h/{height}"));
|
|
|
}
|
|
|
|
|
|
let title = `【${result.brandName}${result.sortName}】${result.goodsName}|YOHO!BUY 有货`;
|
|
|
let description = result.goodsName + ' 有货网仅售' + result.goodsPrice.currentPrice + '元,购买' +
|
|
|
result.brandName + result.sortName + ',了解' + result.brandName + result.sortName + '商品信息就上有货网!';
|
...
|
...
|
@@ -83,10 +87,10 @@ const newDetail = { |
|
|
isMarsApp: req.yoho.isMarsApp, // 判断mars
|
|
|
showAnaJson: {
|
|
|
miptitle: title,
|
|
|
mipPublishTime: '',// mip日期必填
|
|
|
mipPublishTime: moment.unix(result.shelveTime).format('YYYY-MM-DDTHH:mm:ss'),// mip日期必填
|
|
|
mipPics: mipPics.slice(0, 5),
|
|
|
mipDes: description,
|
|
|
mipUrl: `http://m.yohobuy.com/product/${result.productSkn}.html`
|
|
|
mipUrl: `${req.protocol}://m.yohobuy.com/product/${result.productSkn}.html`
|
|
|
}
|
|
|
});
|
|
|
}).catch(next);
|
...
|
...
|
|