Merge branch 'release/guang'
Showing
1 changed file
with
6 additions
and
3 deletions
@@ -72,7 +72,8 @@ const _pageArticleContent = (articleContent, isApp, gender) => { | @@ -72,7 +72,8 @@ 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.data.product_list) { | 75 | + if (product && product.data) { |
76 | + if (product.data.product_list) { | ||
76 | let d = []; | 77 | let d = []; |
77 | 78 | ||
78 | for (let o = 0; o < product.data.product_list.length; o++) { | 79 | for (let o = 0; o < product.data.product_list.length; o++) { |
@@ -93,11 +94,13 @@ const _pageArticleContent = (articleContent, isApp, gender) => { | @@ -93,11 +94,13 @@ const _pageArticleContent = (articleContent, isApp, gender) => { | ||
93 | } | 94 | } |
94 | 95 | ||
95 | // 多个商品 | 96 | // 多个商品 |
96 | - if (product.data.product_list.length > 1) { | 97 | + if (product.data.product_list.length && (product.data.product_list.length > 1)) { |
97 | build.relatedReco = reco; | 98 | build.relatedReco = reco; |
98 | } else if (product.data.product_list.length === 1) { // 单个商品 | 99 | } else if (product.data.product_list.length === 1) { // 单个商品 |
99 | build.relatedReco = reco[0]; | 100 | build.relatedReco = reco[0]; |
100 | } | 101 | } |
102 | + } | ||
103 | + | ||
101 | contents.push(build); | 104 | contents.push(build); |
102 | joinContentFunc(++i, len); | 105 | joinContentFunc(++i, len); |
103 | }); | 106 | }); |
@@ -120,7 +123,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => { | @@ -120,7 +123,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => { | ||
120 | 123 | ||
121 | // 通过SKN获取商品信息 | 124 | // 通过SKN获取商品信息 |
122 | productDetailModel.productInfoBySkns(skns).then((product) => { | 125 | productDetailModel.productInfoBySkns(skns).then((product) => { |
123 | - if (product.data.product_list) { | 126 | + if (product && product.data && product.data.product_list) { |
124 | let g = []; | 127 | let g = []; |
125 | 128 | ||
126 | product.data.product_list.forEach(_ => { | 129 | product.data.product_list.forEach(_ => { |
-
Please register or login to post a comment