小程序 wx.showToast 延时跳转

wx.showToast({
        title: '成功',
        icon: 'success',
        duration: 2000,
        success:function(){
          console.log('haha');
          setTimeout(function () {
            //要延时执行的代码
            wx.switchTab({
              url: '../user/user'
            })
          }, 2000) //延迟时间
        }
      })

 

posted @ 2020-02-25 17:05  lezuw  阅读(561)  评论(0编辑  收藏  举报