收藏
回答

wx.connectWifi(Object object)连WIFI,弹窗不可以隐藏或取消吗?

使用API wx.connectWifi(Object object) 连WIFI时,弹窗一直显示 微信连WIFI··· 无法取消,导致用户无法进行后续操作。

Connected: function() {
    console.log("Connected");
    var that=this;
    var connect_timer;
    that.timers = 0;
    connect_timer = setInterval(function(){
      that.timers++;
      wx.connectWifi({
        SSID"ATBM_AP",
        password"12345678",
        successfunction(res{


          wx.hideLoading();


          wx.showToast({
            title'wifi连接成功',
          })
          clearInterval(connect_timer);
          that.ap_touch_send();
        },
        failfunction(res{
          if(that.timers == 20)
          {
            wx.showToast({
              title'wifi连接失败',
            })
            clearInterval(connect_timer);
          }
        
        }
      })
    },2000)
  },
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签