...
|
...
|
@@ -29,6 +29,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => { |
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
let joinContentFunc = (i, len) => {
|
|
|
|
|
|
if (i < len) {
|
|
|
let build = {};
|
|
|
let art = articleContent[i];
|
...
|
...
|
@@ -160,6 +161,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => { |
|
|
resolve(contents);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
joinContentFunc(0, articleContent.length);
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -170,6 +172,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => { |
|
|
*/
|
|
|
const _relatedBrand = (getBrand) => {
|
|
|
let relatedBrand = getBrand;
|
|
|
|
|
|
relatedBrand.forEach(brand => {
|
|
|
brand.thumb = brand.thumb.replace('http://', '//');
|
|
|
});
|
...
|
...
|
@@ -183,6 +186,7 @@ const _relatedBrand = (getBrand) => { |
|
|
*/
|
|
|
const _relatedTag = (tags, isApp) => {
|
|
|
let relatedTag = [];
|
|
|
|
|
|
tags.forEach(value => {
|
|
|
if (!isApp) {
|
|
|
value.url = helpers.urlFormat('/tags/index', {
|
...
|
...
|
@@ -201,6 +205,7 @@ const _relatedTag = (tags, isApp) => { |
|
|
*/
|
|
|
const _relatedInfo = (getOtherArticle, isApp) => {
|
|
|
let relatedInfo = [];
|
|
|
|
|
|
getOtherArticle.forEach(value => {
|
|
|
if (!isApp) {
|
|
|
value.url = helpers.urlFormat('/info/index', {
|
...
|
...
|
@@ -220,6 +225,7 @@ const _relatedInfo = (getOtherArticle, isApp) => { |
|
|
*/
|
|
|
const _shareInfo = (id, getArticle) => {
|
|
|
let shareInfo = {};
|
|
|
|
|
|
shareInfo.shareLink = helpers.urlFormat('/info/index', {
|
|
|
id: id
|
|
|
}, 'guang');
|
...
|
...
|
@@ -317,6 +323,7 @@ const index = (req, res, next) => { |
|
|
// 分享参数
|
|
|
if (detail.getArticle.cover_image) {
|
|
|
let shareInfo = _shareInfo(id, detail.getArticle);
|
|
|
|
|
|
Object.assign(guang, shareInfo);
|
|
|
data.title = detail.getArticle.article_title + ' | Yoho!Buy有货 | 潮流购物逛不停';
|
|
|
data.title_more = true;
|
...
|
...
|
@@ -391,6 +398,7 @@ const mini = (req, res, next) => { |
|
|
// 分享参数
|
|
|
if (detail.getArticle.cover_image) {
|
|
|
let shareInfo = _shareInfo(id, detail.getArticle);
|
|
|
|
|
|
Object.assign(guang, shareInfo);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -446,9 +454,11 @@ const foryoho = (req, res, next) => { |
|
|
let relatedRecoIndex = data.content.findIndex((cont) => {
|
|
|
return typeof cont.relatedReco !== 'undefined';
|
|
|
});
|
|
|
|
|
|
let collocationIndex = data.content.findIndex((cont) => {
|
|
|
return typeof cont.collocation !== 'undefined';
|
|
|
});
|
|
|
|
|
|
if (relatedRecoIndex > 0) {
|
|
|
data.goods = data.content[relatedRecoIndex].relatedReco;
|
|
|
data.content.splice(relatedRecoIndex, 1);
|
...
|
...
|
|