Commit f874dd65eec8706f49d1e79cf630fc84a9032b97
1 parent
c0a786d7
组件要推迟获取DOM
Showing
3 changed files
with
17 additions
and
6 deletions
packageA/pages/my_service/i_service.js
@@ -50,8 +50,11 @@ Page({ | @@ -50,8 +50,11 @@ Page({ | ||
50 | */ | 50 | */ |
51 | onShow: function() { | 51 | onShow: function() { |
52 | var th = this; | 52 | var th = this; |
53 | - var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
54 | - my_confirm.open_cancel(0); | 53 | + setTimeout(function (){ |
54 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
55 | + my_confirm.open_cancel(0); | ||
56 | + },1000); | ||
57 | + | ||
55 | }, | 58 | }, |
56 | 59 | ||
57 | onReachBottom: function() { | 60 | onReachBottom: function() { |
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -30,8 +30,13 @@ Page({ | @@ -30,8 +30,13 @@ Page({ | ||
30 | onLoad: function(options) { | 30 | onLoad: function(options) { |
31 | 31 | ||
32 | var th = this; | 32 | var th = this; |
33 | - var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
34 | - my_confirm.open_cancel(0); | 33 | + setTimeout(function (){ |
34 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
35 | + my_confirm.open_cancel(0); | ||
36 | + },1000) | ||
37 | + | ||
38 | + | ||
39 | + | ||
35 | th.setData({ | 40 | th.setData({ |
36 | getStorageID: a.stoid, | 41 | getStorageID: a.stoid, |
37 | getUserID: d.user_id | 42 | getUserID: d.user_id |
pages/user/my_service/i_service.js
@@ -45,8 +45,11 @@ Page({ | @@ -45,8 +45,11 @@ Page({ | ||
45 | */ | 45 | */ |
46 | onShow: function() { | 46 | onShow: function() { |
47 | var th = this; | 47 | var th = this; |
48 | - var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
49 | - my_confirm.open_cancel(0); | 48 | + setTimeout(function (){ |
49 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
50 | + my_confirm.open_cancel(0); | ||
51 | + },1000) | ||
52 | + | ||
50 | }, | 53 | }, |
51 | onReachBottom: function() { | 54 | onReachBottom: function() { |
52 | var th = this; | 55 | var th = this; |