Commit 97b612b0f61af30adfd0721d1c08fa2a9d8f987a
1 parent
892de59c
脚本错误的修复
Showing
3 changed files
with
12 additions
and
6 deletions
components/diy_pingd_buy/diy_pingd_buy.js
components/diy_seckill/diy_seckill.js
components/diy_shopname/diy_shopname.js
... | ... | @@ -27,15 +27,21 @@ Component({ |
27 | 27 | //--所有商品-- |
28 | 28 | getApp().request.promiseGet("/api/weshop/goods/page/", |
29 | 29 | {data:{ isonsale: 1, store_id: o.stoid,page:1,pageSize:1}}).then(res => { |
30 | - var total=res.data.data.total; | |
31 | - th.setData({total:total}) | |
30 | + | |
31 | + if(res.data.code==0 && res.data.data){ | |
32 | + var total=res.data.data.total; | |
33 | + th.setData({total:total}) | |
34 | + } | |
32 | 35 | }) |
33 | 36 | |
34 | 37 | //--所有新品-- |
35 | 38 | getApp().request.promiseGet("/api/weshop/goods/page/", |
36 | 39 | {data:{is_new:1,isonsale: 1, store_id: o.stoid,page:1,pageSize:1}}).then(res => { |
37 | - var total=res.data.data.total; | |
38 | - th.setData({new_total:total}) | |
40 | + if(res.data.code==0 && res.data.data) | |
41 | + { | |
42 | + var total = res.data.data.total; | |
43 | + th.setData({new_total: total}) | |
44 | + } | |
39 | 45 | }) |
40 | 46 | |
41 | 47 | }, | ... | ... |