Authored by 郝肖肖

逛滚动翻页加载数据,foreach优化

... ... @@ -31,7 +31,6 @@ const getAuthor = (id) => {
});
};
/**
* 逛分类
*/
... ... @@ -108,27 +107,21 @@ const getPageData = (gender, sortId, uid, udid, page, tag, authorId, isApp, show
// 广告列表
if (isTab && adList) {
let build = [];
adList.forEach(ad => {
build.push({
result.swiper = adList.map(function(ad) {
return {
url: guangProcess.getFilterUrl(ad.url),
img: helpers.image(ad.src, 830, 327)
});
};
});
result.swiper = build;
}
/* 构建资讯文章内容 */
let build = [];
let artList = article.data.list.artList;
artList.forEach(art => {
build.push(guangProcess.formatArticle(art, true, isApp, showAuthor, uid));
// build.push(guangProcess.formatArticle(art, true, isApp, true, uid));
result.infos = artList.map(function(art) {
return guangProcess.formatArticle(art, true, isApp, showAuthor, uid);
});
result.infos = build;
return result;
});
};
... ...