Commit f874dd65eec8706f49d1e79cf630fc84a9032b97

Authored by yvan.ni
1 parent c0a786d7

组件要推迟获取DOM

packageA/pages/my_service/i_service.js
... ... @@ -50,8 +50,11 @@ Page({
50 50 */
51 51 onShow: function() {
52 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 60 onReachBottom: function() {
... ...
pages/giftpack/buygiftpack/giftpackbuy.js
... ... @@ -30,8 +30,13 @@ Page({
30 30 onLoad: function(options) {
31 31  
32 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 40 th.setData({
36 41 getStorageID: a.stoid,
37 42 getUserID: d.user_id
... ...
pages/user/my_service/i_service.js
... ... @@ -45,8 +45,11 @@ Page({
45 45 */
46 46 onShow: function() {
47 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 54 onReachBottom: function() {
52 55 var th = this;
... ...