Commit c936d90681e39113a91c121023026f142b8cee08
1 parent
2ff2aeec
组件的修改,避免https://qa-weshop.yolipai.net的空调用
Showing
1 changed file
with
41 additions
and
14 deletions
components/diy_goodsGroup/diy_goodsGroup.js
@@ -120,7 +120,17 @@ Component({ | @@ -120,7 +120,17 @@ Component({ | ||
120 | } else if (prom_type == 6) { | 120 | } else if (prom_type == 6) { |
121 | url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; | 121 | url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; |
122 | } | 122 | } |
123 | - return app.request.promiseGet(url, {}) | 123 | + if(url==""){ |
124 | + th.data.requestData.push(item); | ||
125 | + th.setData({ goods_array: th.data.requestData, }); | ||
126 | + if (th.data.firist_type_curr == th.data.firist_type_data.length) { | ||
127 | + th.setData({ goods_btn: [] }); | ||
128 | + } | ||
129 | + }else{ | ||
130 | + return app.request.promiseGet(url, {}) | ||
131 | + } | ||
132 | + | ||
133 | + | ||
124 | }).then(res => { | 134 | }).then(res => { |
125 | index++; | 135 | index++; |
126 | var prom = res.data.data; | 136 | var prom = res.data.data; |
@@ -185,18 +195,27 @@ Component({ | @@ -185,18 +195,27 @@ Component({ | ||
185 | } else if (prom_type == 6) { | 195 | } else if (prom_type == 6) { |
186 | url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; | 196 | url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; |
187 | } | 197 | } |
188 | - | ||
189 | - app.request.promiseGet(url, {}).then(res => { | ||
190 | - var prom = res.data.data; | ||
191 | - if (prom != null) { | ||
192 | - item.shop_price = res.data.data.price; | ||
193 | - } | 198 | + if(url!="") { |
199 | + app.request.promiseGet(url, {}).then(res => { | ||
200 | + var prom = res.data.data; | ||
201 | + if (prom != null) { | ||
202 | + item.shop_price = res.data.data.price; | ||
203 | + } | ||
204 | + th.data.requestData.push(item); | ||
205 | + th.setData({ | ||
206 | + goods_array: th.data.requestData, | ||
207 | + page: th.data.currentPage - 1, | ||
208 | + }); | ||
209 | + }) | ||
210 | + }else{ | ||
194 | th.data.requestData.push(item); | 211 | th.data.requestData.push(item); |
195 | th.setData({ | 212 | th.setData({ |
196 | goods_array: th.data.requestData, | 213 | goods_array: th.data.requestData, |
197 | page: th.data.currentPage - 1, | 214 | page: th.data.currentPage - 1, |
198 | }); | 215 | }); |
199 | - }) | 216 | + } |
217 | + | ||
218 | + | ||
200 | }) | 219 | }) |
201 | 220 | ||
202 | }) | 221 | }) |
@@ -247,17 +266,25 @@ Component({ | @@ -247,17 +266,25 @@ Component({ | ||
247 | url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; | 266 | url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; |
248 | } | 267 | } |
249 | 268 | ||
250 | - app.request.promiseGet(url, {}).then(res => { | ||
251 | - var prom = res.data.data; | ||
252 | - if (prom != null) { | ||
253 | - item.shop_price = res.data.data.price; | ||
254 | - } | 269 | + if(url!=null){ |
270 | + app.request.promiseGet(url, {}).then(res => { | ||
271 | + var prom = res.data.data; | ||
272 | + if (prom != null) { | ||
273 | + item.shop_price = res.data.data.price; | ||
274 | + } | ||
275 | + th.data.requestData.push(item); | ||
276 | + th.setData({ | ||
277 | + goods_array: th.data.requestData, | ||
278 | + page: th.data.currentPage - 1, | ||
279 | + }); | ||
280 | + }) | ||
281 | + }else{ | ||
255 | th.data.requestData.push(item); | 282 | th.data.requestData.push(item); |
256 | th.setData({ | 283 | th.setData({ |
257 | goods_array: th.data.requestData, | 284 | goods_array: th.data.requestData, |
258 | page: th.data.currentPage - 1, | 285 | page: th.data.currentPage - 1, |
259 | }); | 286 | }); |
260 | - }) | 287 | + } |
261 | }) | 288 | }) |
262 | 289 | ||
263 | }) | 290 | }) |