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