Commit 1dbfc0aa963b88503c6d51d5e13667c5892c3980
1 parent
f93e22b7
公众号组件推迟显示
Showing
1 changed file
with
2 additions
and
5 deletions
pages/index/index/index.js
| @@ -453,18 +453,15 @@ Page({ | @@ -453,18 +453,15 @@ Page({ | ||
| 453 | } | 453 | } |
| 454 | }, 1500) | 454 | }, 1500) |
| 455 | 455 | ||
| 456 | - | ||
| 457 | setTimeout(function () { | 456 | setTimeout(function () { |
| 458 | const query = wx.createSelectorQuery(); | 457 | const query = wx.createSelectorQuery(); |
| 459 | query.select('#off_top').boundingClientRect(); | 458 | query.select('#off_top').boundingClientRect(); |
| 460 | query.exec((res) => { | 459 | query.exec((res) => { |
| 461 | - if(res && res[0].height>0){ | 460 | + if(res && res[0] && res[0].height>0){ |
| 462 | th.setData({is_ok_h5:1}); | 461 | th.setData({is_ok_h5:1}); |
| 463 | } | 462 | } |
| 464 | }) | 463 | }) |
| 465 | - },2000); | ||
| 466 | - | ||
| 467 | - | 464 | + },3600); |
| 468 | 465 | ||
| 469 | }, | 466 | }, |
| 470 | //当隐藏的时候就关闭计时器 | 467 | //当隐藏的时候就关闭计时器 |