Authored by ccbikai(👎🏻🍜)

Merge branch 'release/guang'

@@ -72,7 +72,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => { @@ -72,7 +72,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
72 72
73 // 通过SKN获取商品信息 73 // 通过SKN获取商品信息
74 productDetailModel.productInfoBySkns(skns).then((product) => { 74 productDetailModel.productInfoBySkns(skns).then((product) => {
75 - if (product.data.product_list) { 75 + if (product.data && product.data.product_list) {
76 let d = []; 76 let d = [];
77 77
78 for (let o = 0; o < product.data.product_list.length; o++) { 78 for (let o = 0; o < product.data.product_list.length; o++) {
@@ -84,14 +84,6 @@ const packageData = (id, isApp) => { @@ -84,14 +84,6 @@ const packageData = (id, isApp) => {
84 cache: true 84 cache: true
85 })); 85 }));
86 86
87 - if (isApp) {  
88 - promises.push(api.get('', {  
89 - method: 'app.resources.getSingleTemplate',  
90 - module: 'wechat',  
91 - key: 'guang_detail_wechat'  
92 - }));  
93 - }  
94 -  
95 // 获取资讯相关的其它资讯 87 // 获取资讯相关的其它资讯
96 if (typeof article.tag !== 'undefined') { 88 if (typeof article.tag !== 'undefined') {
97 param = { 89 param = {
@@ -108,10 +100,19 @@ const packageData = (id, isApp) => { @@ -108,10 +100,19 @@ const packageData = (id, isApp) => {
108 cache: true 100 cache: true
109 })); 101 }));
110 } 102 }
  103 +
  104 + if (isApp) {
  105 + promises.push(api.get('', {
  106 + method: 'app.resources.getSingleTemplate',
  107 + module: 'wechat',
  108 + key: 'guang_detail_wechat'
  109 + }));
  110 + }
  111 +
111 return Promise.all(promises).then(datas => { 112 return Promise.all(promises).then(datas => {
112 let getArticleContent = datas[1].data; 113 let getArticleContent = datas[1].data;
113 114
114 - if (datas[3].data) { 115 + if (isApp && datas[4].data) {
115 116
116 let preCount = 0; 117 let preCount = 0;
117 let i; 118 let i;
@@ -122,14 +123,14 @@ const packageData = (id, isApp) => { @@ -122,14 +123,14 @@ const packageData = (id, isApp) => {
122 } 123 }
123 } 124 }
124 125
125 - getArticleContent.splice(preCount, 0, {weixinPublic: datas[3].data}); 126 + getArticleContent.splice(preCount, 0, {weixinPublic: datas[4].data});
126 } 127 }
127 128
128 result.getAuthor = datas[0].data; 129 result.getAuthor = datas[0].data;
129 result.getArticleContent = getArticleContent; 130 result.getArticleContent = getArticleContent;
130 result.getBrand = datas[2].data; 131 result.getBrand = datas[2].data;
131 - if (datas.length === 5) {  
132 - result.getOtherArticle = datas[4].data; 132 + if (datas.length === 5 && isApp || datas.length === 4 && !isApp) {
  133 + result.getOtherArticle = datas[3].data;
133 } 134 }
134 return result; 135 return result;
135 }); 136 });