Showing
1 changed file
with
36 additions
and
31 deletions
@@ -107,40 +107,45 @@ const _pageArticleContent = (articleContent, isApp, gender) => { | @@ -107,40 +107,45 @@ const _pageArticleContent = (articleContent, isApp, gender) => { | ||
107 | let callArtGoodGroup = (ii, len2) => { | 107 | let callArtGoodGroup = (ii, len2) => { |
108 | if (ii < len2) { | 108 | if (ii < len2) { |
109 | let goods = art.goodsGroup.data[ii]; | 109 | let goods = art.goodsGroup.data[ii]; |
110 | - let good = { | ||
111 | - thumb: goods.cover ? helpers.image(goods.cover.cover, 235, 314) : '', | ||
112 | - type: goods.cover ? guangProcess.getProductIcon(goods.cover.maxSortId) : '', | ||
113 | - goods: [] | ||
114 | - }; | ||
115 | - let skns = []; | ||
116 | - let arr = []; | ||
117 | - | ||
118 | - goods.list.forEach((mini) => { | ||
119 | - skns.push(mini.id); | ||
120 | - arr[mini.id] = mini.src; | ||
121 | - }); | ||
122 | - | ||
123 | - // 通过SKN获取商品信息 | ||
124 | - productDetailModel.productInfoBySkns(skns).then((product) => { | ||
125 | - if (product && product.data && product.data.product_list) { | ||
126 | - let g = []; | ||
127 | - | ||
128 | - product.data.product_list.forEach(_ => { | ||
129 | - g.push(guangProcess.formatProduct(_, false, true, true, 235, 314, isApp, gender)); | ||
130 | - }); | ||
131 | - g.forEach(p => { | ||
132 | - if (arr[p.id]) { | ||
133 | - p.thumb = helpers.image(arr[p.id], 235, 314); | ||
134 | - good.goods.push(p); | 110 | + if (goods) { |
111 | + let good = { | ||
112 | + thumb: goods.cover ? helpers.image(goods.cover.cover, 235, 314) : '', | ||
113 | + type: goods.cover ? guangProcess.getProductIcon(goods.cover.maxSortId) : '', | ||
114 | + goods: [] | ||
115 | + }; | ||
116 | + let skns = []; | ||
117 | + let arr = []; | ||
118 | + | ||
119 | + goods.list.forEach((mini) => { | ||
120 | + skns.push(mini.id); | ||
121 | + arr[mini.id] = mini.src; | ||
122 | + }); | ||
123 | + | ||
124 | + // 通过SKN获取商品信息 | ||
125 | + productDetailModel.productInfoBySkns(skns).then((product) => { | ||
126 | + if (product && product.data && product.data.product_list) { | ||
127 | + let g = []; | ||
128 | + | ||
129 | + product.data.product_list.forEach(_ => { | ||
130 | + g.push(guangProcess.formatProduct(_, false, true, true, 235, 314, isApp, gender)); | ||
131 | + }); | ||
132 | + g.forEach(p => { | ||
133 | + if (arr[p.id]) { | ||
134 | + p.thumb = helpers.image(arr[p.id], 235, 314); | ||
135 | + good.goods.push(p); | ||
136 | + } | ||
137 | + }); | ||
138 | + if (!build.collocation) { | ||
139 | + build.collocation = []; | ||
135 | } | 140 | } |
136 | - }); | ||
137 | - if (!build.collocation) { | ||
138 | - build.collocation = []; | 141 | + build.collocation.push(good); |
139 | } | 142 | } |
140 | - build.collocation.push(good); | ||
141 | - } | 143 | + callArtGoodGroup(++ii, len2); |
144 | + }); | ||
145 | + } else { | ||
142 | callArtGoodGroup(++ii, len2); | 146 | callArtGoodGroup(++ii, len2); |
143 | - }); | 147 | + } |
148 | + | ||
144 | } else { | 149 | } else { |
145 | contents.push(build); | 150 | contents.push(build); |
146 | joinContentFunc(++i, len); | 151 | joinContentFunc(++i, len); |
-
Please register or login to post a comment