收藏
回答

Android 10 11 小程序链接WIFI闪退?

API wx. connectWifi

基础库: 2.15.0

微信号:haidong920me 华为手机

打开小程序提示连接wifi,点击链接 ,然后闪退

回答关注问题邀请回答
收藏

1 个回答

  • 😶
    😶
    2021-03-18

    你好,提供下复现的视频或者代码

    2021-03-18
    有用
    回复 1
    • 果冻又是一只猫
      果冻又是一只猫
      2021-03-21
      Connected: function (_this) {
          var _this = this;
          wx.connectWifi({
            SSID: app.globalData.SSID,
            BSSID: app.globalData.BSSID,
            password: app.globalData.PASSWORD,
            success: function (res) {
              if (_this.platform == 'ios') {
                wx.onWifiConnected(function (res) {
                  console.log(res.wifi)
                  if (res.wifi.SSID == app.globalData.SSID) {
                    wx.showToast({
                      title: 'wifi连接成功',
                    })
                  }else{
                    wx.showToast({
                      title: '请重新进入小程序',
                    })
                  }
                })
              } else {
                wx.showToast({
                  title: 'wifi连接成功',
                })
              }


             
            },
            fail: function (res) {
              _this.setData({
                endError: res.errMsg
              });
            }
          })
        },
      2021-03-21
      回复
登录 后发表内容
问题标签