...
|
...
|
@@ -51,8 +51,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => { |
|
|
src: helpers.image(imgs[0].src, 315, 420)
|
|
|
}, {
|
|
|
src: helpers.image(imgs[1].src, 315, 420)
|
|
|
}
|
|
|
];
|
|
|
}];
|
|
|
contents.push(build);
|
|
|
joinContentFunc(++i, len);
|
|
|
|
...
|
...
|
@@ -80,7 +79,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => { |
|
|
for (let o = 0; o < product.data.product_list.length; o++) {
|
|
|
let goods = product.data.product_list[o];
|
|
|
|
|
|
// 最多显示4个
|
|
|
// 最多显示4个
|
|
|
if (o > 3) {
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -94,7 +93,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => { |
|
|
});
|
|
|
}
|
|
|
|
|
|
// 多个商品
|
|
|
// 多个商品
|
|
|
if (product.data.product_list.length && (product.data.product_list.length > 1)) {
|
|
|
build.relatedReco = reco;
|
|
|
} else if (product.data.product_list.length === 1) { // 单个商品
|
...
|
...
|
@@ -249,13 +248,17 @@ const index = (req, res, next) => { |
|
|
parameter = {},
|
|
|
title = '逛';
|
|
|
|
|
|
// pagecache 前端做
|
|
|
// userAgent = req.get('User-Agent'),
|
|
|
// isWeixin = userAgent.includes('MicroMessenger'); // 标识是否是微信访问
|
|
|
// pagecache 前端做
|
|
|
// userAgent = req.get('User-Agent'),
|
|
|
// isWeixin = userAgent.includes('MicroMessenger'); // 标识是否是微信访问
|
|
|
|
|
|
// 判断参数是否有效, 无效会跳转到错误页面
|
|
|
if (!stringProcess.isNumeric(id)) {
|
|
|
res.json({ code: 400, message: '非法请求', data: '' });
|
|
|
res.json({
|
|
|
code: 400,
|
|
|
message: '非法请求',
|
|
|
data: ''
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
parameter = {
|
...
|
...
|
@@ -297,7 +300,6 @@ const index = (req, res, next) => { |
|
|
// guang双头部的问题 20160601
|
|
|
// 正确的URL
|
|
|
data.guang.author.url = helpers.https(`${detail.getAuthor.url}&openby:yohobuy={"action":"go.h5","params":{"param":{},"share":"","id":${detail.getAuthor.author_id},"type":0,"islogin":"N","url":"${detail.getAuthor.url}"}}`);
|
|
|
|
|
|
// 错误的URL
|
|
|
// data.guang.author.url = helpers.https(`${detail.getAuthor.url}&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"${detail.getAuthor.author_id}"},"share":"","id":${detail.getAuthor.author_id},"type":0,"islogin":"N","url":"${helpers.urlFormat('/author/index', {}, 'guang')}"}}`);
|
|
|
}
|
...
|
...
|
@@ -340,7 +342,6 @@ const index = (req, res, next) => { |
|
|
data.description = detail.getArticle.article_summary;
|
|
|
data.description_more = true;
|
|
|
}
|
|
|
|
|
|
// 标识有微信分享
|
|
|
data.hasWxShare = true;
|
|
|
res.render('info/index', Object.assign({
|
...
|
...
|
@@ -369,7 +370,11 @@ const mini = (req, res, next) => { |
|
|
|
|
|
// 判断参数是否有效, 无效会跳转到错误页面
|
|
|
if (!stringProcess.isNumeric(id)) {
|
|
|
res.json({ code: 400, message: '非法请求', data: '' });
|
|
|
res.json({
|
|
|
code: 400,
|
|
|
message: '非法请求',
|
|
|
data: ''
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -440,7 +445,11 @@ const foryoho = (req, res, next) => { |
|
|
|
|
|
// 判断参数是否有效, 无效会跳转到错误页面
|
|
|
if (!stringProcess.isNumeric(id)) {
|
|
|
res.json({ code: 400, message: '非法请求', data: '' });
|
|
|
res.json({
|
|
|
code: 400,
|
|
|
message: '非法请求',
|
|
|
data: ''
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -492,4 +501,4 @@ module.exports = { |
|
|
index,
|
|
|
mini,
|
|
|
foryoho
|
|
|
}; |
|
|
}; |
|
|
\ No newline at end of file |
...
|
...
|
|