Commit d9df84d6d60771d5b59ad5b9afa3f2bc819a1d30
1 parent
312af5a3
自定义组件,商品分组的功能的实现
Showing
1 changed file
with
6 additions
and
3 deletions
components/diy_goodsGroup/diy_goodsGroup.js
... | ... | @@ -185,7 +185,8 @@ Component({ |
185 | 185 | |
186 | 186 | }).then(res => { |
187 | 187 | index++; |
188 | - var prom = res.data.data; | |
188 | + var prom =null | |
189 | + if (res && res.data) res.data.data; | |
189 | 190 | var now=ut.gettimestamp(); |
190 | 191 | if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time<now) { |
191 | 192 | item.prom_price = res.data.data.price; |
... | ... | @@ -256,7 +257,8 @@ Component({ |
256 | 257 | } |
257 | 258 | if(url!="") { |
258 | 259 | await app.request.promiseGet(url, {}).then(res => { |
259 | - var prom = res.data.data; | |
260 | + var prom = null | |
261 | + if (res && res.data) prom=res.data.data; | |
260 | 262 | if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time<now) { |
261 | 263 | item.prom_price = res.data.data.price; |
262 | 264 | } |
... | ... | @@ -329,7 +331,8 @@ Component({ |
329 | 331 | |
330 | 332 | if(url!=null){ |
331 | 333 | await app.request.promiseGet(url, {}).then(res => { |
332 | - var prom = res.data.data; | |
334 | + var prom =null; | |
335 | + if(res && res.data) res.data.data; | |
333 | 336 | if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time<now) { |
334 | 337 | item.prom_price = res.data.data.price; |
335 | 338 | } | ... | ... |