Authored by zhangxiaoru

guangWeixin

... ... @@ -84,14 +84,6 @@ const packageData = (id, isApp) => {
cache: true
}));
if (isApp) {
promises.push(api.get('', {
method: 'app.resources.getSingleTemplate',
module: 'wechat',
key: 'guang_detail_wechat'
}));
}
// 获取资讯相关的其它资讯
if (typeof article.tag !== 'undefined') {
param = {
... ... @@ -108,10 +100,19 @@ const packageData = (id, isApp) => {
cache: true
}));
}
if (isApp) {
promises.push(api.get('', {
method: 'app.resources.getSingleTemplate',
module: 'wechat',
key: 'guang_detail_wechat'
}));
}
return Promise.all(promises).then(datas => {
let getArticleContent = datas[1].data;
if (datas[3].data) {
if (isApp && datas[4].data) {
let preCount = 0;
let i;
... ... @@ -122,14 +123,14 @@ const packageData = (id, isApp) => {
}
}
getArticleContent.splice(preCount, 0, {weixinPublic: datas[3].data});
getArticleContent.splice(preCount, 0, {weixinPublic: datas[4].data});
}
result.getAuthor = datas[0].data;
result.getArticleContent = getArticleContent;
result.getBrand = datas[2].data;
if (datas.length === 5) {
result.getOtherArticle = datas[4].data;
if (datas.length === 5 && isApp || datas.length === 4 && !isApp) {
result.getOtherArticle = datas[3].data;
}
return result;
});
... ...