From f874dd65eec8706f49d1e79cf630fc84a9032b97 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 12 May 2021 14:55:45 +0800 Subject: [PATCH] 组件要推迟获取DOM --- packageA/pages/my_service/i_service.js | 7 +++++-- pages/giftpack/buygiftpack/giftpackbuy.js | 9 +++++++-- pages/user/my_service/i_service.js | 7 +++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/packageA/pages/my_service/i_service.js b/packageA/pages/my_service/i_service.js index e820f39..d3dfbd8 100644 --- a/packageA/pages/my_service/i_service.js +++ b/packageA/pages/my_service/i_service.js @@ -50,8 +50,11 @@ Page({ */ onShow: function() { var th = this; - var my_confirm = th.selectComponent("#my_confirm"); //组件的id - my_confirm.open_cancel(0); + setTimeout(function (){ + var my_confirm = th.selectComponent("#my_confirm"); //组件的id + my_confirm.open_cancel(0); + },1000); + }, onReachBottom: function() { diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index adcd413..a699bee 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -30,8 +30,13 @@ Page({ onLoad: function(options) { var th = this; - var my_confirm = th.selectComponent("#my_confirm"); //组件的id - my_confirm.open_cancel(0); + setTimeout(function (){ + var my_confirm = th.selectComponent("#my_confirm"); //组件的id + my_confirm.open_cancel(0); + },1000) + + + th.setData({ getStorageID: a.stoid, getUserID: d.user_id diff --git a/pages/user/my_service/i_service.js b/pages/user/my_service/i_service.js index 54d868b..243edd5 100644 --- a/pages/user/my_service/i_service.js +++ b/pages/user/my_service/i_service.js @@ -45,8 +45,11 @@ Page({ */ onShow: function() { var th = this; - var my_confirm = th.selectComponent("#my_confirm"); //组件的id - my_confirm.open_cancel(0); + setTimeout(function (){ + var my_confirm = th.selectComponent("#my_confirm"); //组件的id + my_confirm.open_cancel(0); + },1000) + }, onReachBottom: function() { var th = this; -- libgit2 0.21.4