diff --git a/page_components/bindsztwo.vue b/page_components/bindsztwo.vue index 3970b2f..d885a57 100644 --- a/page_components/bindsztwo.vue +++ b/page_components/bindsztwo.vue @@ -678,7 +678,7 @@ // 将去重后的数组重新赋值给 this.devicesList this.devicesList = uniqueDevicesList let list = [] - filteredDevices.forEach(device => { + uniqueDevicesList.forEach(device => { // 从设备名称中提取 MAC 地址(假设 MAC 地址是设备名称的后6个字符) let macFromName = device.name.substring(device.name.length - 12) this.$u.get(`/app/device/${macFromName}/isBind`).then((res) => { diff --git a/page_components/wifilist/index.vue b/page_components/wifilist/index.vue index 0621648..baaa5db 100644 --- a/page_components/wifilist/index.vue +++ b/page_components/wifilist/index.vue @@ -540,6 +540,20 @@ xBlufi.notifySendCustomData({       customData: "ssid@" + this.ssid + "pass@" + this.password  }) + setTimeout(()=>{ + if(this.textwifi != '连接'){ + uni.showModal({ + title: '温馨提示', + content: '配网失败,请重新操作', + showCancel: false, + success: function(res) { + uni.switchTab({ + url:'/pages/index/index' + }) + } + }) + } + },20000) }, @@ -572,11 +586,26 @@ if (!options.result) this.textwifi = '连接', this.statusflag = false, - uni.hideLoading(), + // uni.hideLoading(), uni.showModal({ title: '温馨提示', content: '配网失败,请选择2.4GWiFi连接并确保密码正确', - showCancel: false //是否显示取消按钮 + showCancel: false ,//是否显示取消按钮 + success:function(res) { + let systemInfo = uni.getSystemInfoSync(); + if (systemInfo.platform == 'android') { + // 当前设备是 Android + uni.navigateBack() + } else if (systemInfo.platform == 'ios') { + // 当前设备是 iOS + uni.navigateBack({ + delta:2 + }) + } + wx.closeBLEConnection({ + deviceId: this.objlist.deviceId, + }) + } }); else { if (options.data.progress == 100) { @@ -589,6 +618,7 @@ content: `连接成功`, showCancel: false, success: function(res) { + uni.hideLoading() let systemInfo = uni.getSystemInfoSync(); if (systemInfo.platform == 'android') { // 当前设备是 Android @@ -625,9 +655,6 @@ console.log('初始化成功'); } else { console.log('初始化失败'); - wx.closeBLEConnection({ - deviceId: this.objlist.deviceId, - }) // uni.showModal({ // title: '温馨提示', // content: `设备初始化失败,请重新连接`,