- header中返回值字段大小写不一致
iOS平台跟安卓平台返回的header中的字段值大小不一样 iOS平台: [图片] 安卓平台: [图片]
2018-10-12 - 小程序请求服务器返回的数据有延迟
如题,我现在遇到的情况是: 当我通过小程序把手环硬件设备的数据发送到服务器后再重新请求(wx.request GET 方式)数据时短期内还是显示的旧数据,我在线上刷新后台是可以查看到最新数据的,但是小程序向服务器请求返回的数据却还是旧的,然后继续刷新过了好几秒后才会有返回新数据。 然后,现在的疑问是,小程序有数据请求缓存这类的东西么? 你们有遇到这个问题,你们是怎么解决的? 谢谢~
2017-09-19 - iOS 下 BLE 设备获取的data .advertisData为空,安卓正常
如题所示,我在安卓(荣耀9)下可以正常获取到数据,但是在 iOS (iPhone5s,iPhone6,系统10.3.3版本)下则提示错误。 主要对应区域的代码是: [代码]var[代码] [代码]getDevList = setInterval([代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]wx.getBluetoothDevices({[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'bleLength'[代码][代码],that.data.bleLength,res.devices.length);[代码][代码] [代码][代码]if[代码] [代码](that.data.bleList) {[代码][代码] [代码][代码]that.connectBle();[代码][代码] [代码][代码]wx.stopBluetoothDevicesDiscovery({[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]clearInterval(getDevList);[代码][代码] [代码][代码]console.log([代码][代码]'已找到设备'[代码][代码]);[代码][代码] [代码][代码]return[代码] [代码]false[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]if[代码] [代码](that.data.bleLength == res.devices.length) {[代码][代码] [代码][代码]wx.stopBluetoothDevicesDiscovery({[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]clearInterval(getDevList);[代码][代码] [代码][代码]console.log([代码][代码]'clearInterval'[代码][代码]);[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]bleUpdateStatus: [代码][代码]'搜索结束,暂未找到手环...'[代码][代码] [代码][代码]})[代码][代码] [代码][代码]setTimeout([代码][代码]function[代码][代码](){[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]bleUpdateStatus: [代码][代码]''[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},3000)[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]bleLength: res.devices.length[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]var[代码] [代码]resData = res.devices;[代码][代码] [代码][代码]for[代码] [代码]([代码][代码]var[代码] [代码]i [代码][代码]in[代码] [代码]resData) {[代码][代码] [代码][代码]var[代码] [代码]data = resData[i];[代码][代码] [代码][代码]if[代码] [代码](data.name == [代码][代码]'nfWatch'[代码] [代码]|| data.name == [代码][代码]'nfWCH++'[代码][代码]) {[代码][代码] [代码][代码]console.log([代码][代码]'mac'[代码][代码],curMac,data.advertisData,that.buf2hex(data.advertisData));[代码][代码] [代码][代码]// if (curMac == that.buf2hex(data.advertisData).slice(4)) {[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]bleList: data,[代码][代码] [代码][代码]bleUpdateStatus: [代码][代码]'已找到手环,同步中...'[代码][代码] [代码][代码]})[代码][代码] [代码][代码]// }[代码][代码] [代码][代码]// console.log(data.name, data.deviceId, data.advertisServiceUUIDs, data.RSSI, data.advertisData, that.buf2hex(data.advertisData));[代码][代码] [代码][代码]// console.log(data.name, data.deviceId, that.buf2hex(data.advertisData).slice(4));[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]console.log(res);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}, 6000)[代码]
2017-08-24 - BLE 的deviceId是否就是 Mac 地址?
如题,小程序扫描 BLE 出来的deviceId是否就是 Mac 地址?(还有 uuids 也是)。 这个deviceId跟其他 APP 扫描出来的 mac 地址是不一样的。 所以这里有个问题就是,比如我要连接 ibeacon 设备,用小程序自己扫描出来的uuid就一直连接不上。 用其他 APP 扫描出来的 uuid 去连接,则可以。 真心求帮忙解答,谢谢!
2017-08-03