|
@@ -65,7 +65,6 @@ const _pageArticleContent = (articleContent, isApp, gender) => { |
|
@@ -65,7 +65,6 @@ const _pageArticleContent = (articleContent, isApp, gender) => { |
65
|
skns.push(goods.id);
|
65
|
skns.push(goods.id);
|
66
|
arr[goods.id] = goods.src;
|
66
|
arr[goods.id] = goods.src;
|
67
|
});
|
67
|
});
|
68
|
-
|
|
|
69
|
// 通过SKN获取商品信息
|
68
|
// 通过SKN获取商品信息
|
70
|
productDetailModel.productInfoBySkns(skns).then((product) => {
|
69
|
productDetailModel.productInfoBySkns(skns).then((product) => {
|
71
|
if (product.data.product_list) {
|
70
|
if (product.data.product_list) {
|
|
@@ -146,15 +145,16 @@ const _pageArticleContent = (articleContent, isApp, gender) => { |
|
@@ -146,15 +145,16 @@ const _pageArticleContent = (articleContent, isApp, gender) => { |
146
|
build.moreLink = art.link.data[0].url;
|
145
|
build.moreLink = art.link.data[0].url;
|
147
|
contents.push(build);
|
146
|
contents.push(build);
|
148
|
joinContentFunc(++i, len);
|
147
|
joinContentFunc(++i, len);
|
|
|
148
|
+ } else {
|
|
|
149
|
+ joinContentFunc(++i, len);
|
149
|
}
|
150
|
}
|
150
|
} else {
|
151
|
} else {
|
151
|
resolve(contents);
|
152
|
resolve(contents);
|
152
|
}
|
153
|
}
|
153
|
- };
|
154
|
+ }
|
154
|
joinContentFunc(0, articleContent.length);
|
155
|
joinContentFunc(0, articleContent.length);
|
155
|
});
|
156
|
});
|
156
|
-};
|
|
|
157
|
-
|
157
|
+}
|
158
|
/**
|
158
|
/**
|
159
|
* [处理品牌数据]
|
159
|
* [处理品牌数据]
|
160
|
* @param {[array]} getBrand [品牌原数据]
|
160
|
* @param {[array]} getBrand [品牌原数据]
|
|
@@ -165,8 +165,7 @@ const _relatedBrand = (getBrand) => { |
|
@@ -165,8 +165,7 @@ const _relatedBrand = (getBrand) => { |
165
|
brand.thumb = brand.thumb.replace('http://', '//');
|
165
|
brand.thumb = brand.thumb.replace('http://', '//');
|
166
|
});
|
166
|
});
|
167
|
return relatedBrand;
|
167
|
return relatedBrand;
|
168
|
-};
|
|
|
169
|
-
|
168
|
+}
|
170
|
/**
|
169
|
/**
|
171
|
* [处理标签数据]
|
170
|
* [处理标签数据]
|
172
|
* @param {[array]} tags [标签原数据]
|
171
|
* @param {[array]} tags [标签原数据]
|
|
@@ -183,8 +182,7 @@ const _relatedTag = (tags, isApp) => { |
|
@@ -183,8 +182,7 @@ const _relatedTag = (tags, isApp) => { |
183
|
relatedTag.push(value);
|
182
|
relatedTag.push(value);
|
184
|
});
|
183
|
});
|
185
|
return relatedTag;
|
184
|
return relatedTag;
|
186
|
-};
|
|
|
187
|
-
|
185
|
+}
|
188
|
/**
|
186
|
/**
|
189
|
* [处理相关文章数据]
|
187
|
* [处理相关文章数据]
|
190
|
* @param {[array]} getOtherArticle [相关文章原数据]
|
188
|
* @param {[array]} getOtherArticle [相关文章原数据]
|
|
@@ -202,8 +200,7 @@ const _relatedInfo = (getOtherArticle, isApp) => { |
|
@@ -202,8 +200,7 @@ const _relatedInfo = (getOtherArticle, isApp) => { |
202
|
relatedInfo.push(value);
|
200
|
relatedInfo.push(value);
|
203
|
});
|
201
|
});
|
204
|
return relatedInfo;
|
202
|
return relatedInfo;
|
205
|
-};
|
|
|
206
|
-
|
203
|
+}
|
207
|
/**
|
204
|
/**
|
208
|
* [处理分享内容]
|
205
|
* [处理分享内容]
|
209
|
* @param {[int]} id [资讯id]
|
206
|
* @param {[int]} id [资讯id]
|
|
@@ -222,8 +219,7 @@ const _shareInfo = (id, getArticle) => { |
|
@@ -222,8 +219,7 @@ const _shareInfo = (id, getArticle) => { |
222
|
shareInfo.shareImg = helpers.image(getArticle.cover_image, 640, 320);
|
219
|
shareInfo.shareImg = helpers.image(getArticle.cover_image, 640, 320);
|
223
|
}
|
220
|
}
|
224
|
return shareInfo;
|
221
|
return shareInfo;
|
225
|
-};
|
|
|
226
|
-
|
222
|
+}
|
227
|
/**
|
223
|
/**
|
228
|
* [逛资讯详情页]
|
224
|
* [逛资讯详情页]
|
229
|
*/
|
225
|
*/
|
|
@@ -247,8 +243,7 @@ const index = (req, res, next) => { |
|
@@ -247,8 +243,7 @@ const index = (req, res, next) => { |
247
|
parameter = {
|
243
|
parameter = {
|
248
|
pageHeader: headerModel.setNav({
|
244
|
pageHeader: headerModel.setNav({
|
249
|
navTitle: title
|
245
|
navTitle: title
|
250
|
- }),
|
|
|
251
|
- pageFooter: true
|
246
|
+ })
|
252
|
};
|
247
|
};
|
253
|
}
|
248
|
}
|
254
|
|
249
|
|
|
@@ -284,13 +279,12 @@ const index = (req, res, next) => { |
|
@@ -284,13 +279,12 @@ const index = (req, res, next) => { |
284
|
pageView: detail.getArticle.pageViews,
|
279
|
pageView: detail.getArticle.pageViews,
|
285
|
content: []
|
280
|
content: []
|
286
|
};
|
281
|
};
|
287
|
-
|
282
|
+
|
288
|
|
283
|
|
289
|
if (detail.getArticleContent) {
|
284
|
if (detail.getArticleContent) {
|
290
|
- // 生成内容部分
|
285
|
+ //生成内容部分
|
291
|
return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
|
286
|
return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
|
292
|
guang.detail.content = contents;
|
287
|
guang.detail.content = contents;
|
293
|
-
|
|
|
294
|
// 相关品牌
|
288
|
// 相关品牌
|
295
|
if (detail.getBrand && detail.getBrand.length) {
|
289
|
if (detail.getBrand && detail.getBrand.length) {
|
296
|
guang.relatedBrand = _relatedBrand(detail.getBrand);
|
290
|
guang.relatedBrand = _relatedBrand(detail.getBrand);
|
|
@@ -310,7 +304,7 @@ const index = (req, res, next) => { |
|
@@ -310,7 +304,7 @@ const index = (req, res, next) => { |
310
|
if (detail.getArticle.cover_image) {
|
304
|
if (detail.getArticle.cover_image) {
|
311
|
let shareInfo = _shareInfo(id, detail.getArticle);
|
305
|
let shareInfo = _shareInfo(id, detail.getArticle);
|
312
|
Object.assign(guang, shareInfo);
|
306
|
Object.assign(guang, shareInfo);
|
313
|
- data.title = detail.getArticle.article_title;
|
307
|
+ data.title = detail.getArticle.article_title + ' | Yoho!Buy有货 | 潮流购物逛不停';
|
314
|
data.title_more = true;
|
308
|
data.title_more = true;
|
315
|
data.description = detail.getArticle.article_summary;
|
309
|
data.description = detail.getArticle.article_summary;
|
316
|
data.description_more = true;
|
310
|
data.description_more = true;
|
|
@@ -333,7 +327,6 @@ const index = (req, res, next) => { |
|
@@ -333,7 +327,6 @@ const index = (req, res, next) => { |
333
|
}
|
327
|
}
|
334
|
}).catch(next);
|
328
|
}).catch(next);
|
335
|
};
|
329
|
};
|
336
|
-
|
|
|
337
|
/**
|
330
|
/**
|
338
|
* [逛mini内容页]
|
331
|
* [逛mini内容页]
|
339
|
*/
|
332
|
*/
|
|
@@ -368,13 +361,12 @@ const mini = (req, res, next) => { |
|
@@ -368,13 +361,12 @@ const mini = (req, res, next) => { |
368
|
pageView: detail.getArticle.pageViews,
|
361
|
pageView: detail.getArticle.pageViews,
|
369
|
content: []
|
362
|
content: []
|
370
|
};
|
363
|
};
|
371
|
-
|
364
|
+
|
372
|
|
365
|
|
373
|
if (detail.getArticleContent) {
|
366
|
if (detail.getArticleContent) {
|
374
|
- // 生成内容部分
|
367
|
+ //生成内容部分
|
375
|
return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
|
368
|
return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
|
376
|
guang.detail.content = contents;
|
369
|
guang.detail.content = contents;
|
377
|
-
|
|
|
378
|
// 相关品牌
|
370
|
// 相关品牌
|
379
|
if (detail.getBrand && detail.getBrand.length) {
|
371
|
if (detail.getBrand && detail.getBrand.length) {
|
380
|
guang.relatedBrand = _relatedBrand(detail.getBrand);
|
372
|
guang.relatedBrand = _relatedBrand(detail.getBrand);
|
|
@@ -430,17 +422,16 @@ const foryoho = (req, res, next) => { |
|
@@ -430,17 +422,16 @@ const foryoho = (req, res, next) => { |
430
|
data.brand = detail.getBrand;
|
422
|
data.brand = detail.getBrand;
|
431
|
|
423
|
|
432
|
if (detail.getArticleContent) {
|
424
|
if (detail.getArticleContent) {
|
433
|
- // 生成内容部分
|
425
|
+ //生成内容部分
|
434
|
return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
|
426
|
return _pageArticleContent(detail.getArticleContent, isApp, gender).then((contents) => {
|
435
|
data.content = contents;
|
427
|
data.content = contents;
|
436
|
-
|
|
|
437
|
- // 内容中的相关推荐和悬浮商品移到data层级
|
428
|
+ //内容中的相关推荐和悬浮商品移到data层级
|
438
|
let relatedRecoIndex = data.content.findIndex((cont) => {
|
429
|
let relatedRecoIndex = data.content.findIndex((cont) => {
|
439
|
return typeof cont.relatedReco !== 'undefined';
|
430
|
return typeof cont.relatedReco !== 'undefined';
|
440
|
- });
|
431
|
+ })
|
441
|
let collocationIndex = data.content.findIndex((cont) => {
|
432
|
let collocationIndex = data.content.findIndex((cont) => {
|
442
|
return typeof cont.collocation !== 'undefined';
|
433
|
return typeof cont.collocation !== 'undefined';
|
443
|
- });
|
434
|
+ })
|
444
|
if (relatedRecoIndex > 0) {
|
435
|
if (relatedRecoIndex > 0) {
|
445
|
data.goods = data.content[relatedRecoIndex].relatedReco;
|
436
|
data.goods = data.content[relatedRecoIndex].relatedReco;
|
446
|
data.content.splice(relatedRecoIndex, 1);
|
437
|
data.content.splice(relatedRecoIndex, 1);
|
|
@@ -458,7 +449,7 @@ const foryoho = (req, res, next) => { |
|
@@ -458,7 +449,7 @@ const foryoho = (req, res, next) => { |
458
|
|
449
|
|
459
|
}
|
450
|
}
|
460
|
}).catch(next);
|
451
|
}).catch(next);
|
461
|
-};
|
452
|
+}
|
462
|
|
453
|
|
463
|
module.exports = {
|
454
|
module.exports = {
|
464
|
index,
|
455
|
index,
|