- 蓝牙模块现在是都搜索不到设备了吗?
//index.js //获取应用实例 const app = getApp() Page({ data: { }, onLoad: function () { wx.openBluetoothAdapter({ success: function (res) { console.info(res); }, fail: function (res) { console.info(res); wx.showModal({ title: '提示', content: '监测到系统未开启蓝牙,请前往设置开启蓝牙模块!', }) } }) wx.onBluetoothAdapterStateChange(function (res) { console.log(`adapterState changed, now is`, res) if (res.available) { wx.showToast({ title: '蓝牙已开启' }); } else { wx.showToast({ title: '蓝牙已关闭' }); } }) wx.startBluetoothDevicesDiscovery({ success: function (res) { console.log(res) } }) setTimeout(function (res) { wx.getBluetoothDevices({ success: function (res) { console.log(res) } }) }, 10000); wx.onBluetoothDeviceFound(function (devices) { console.log('new device list has founded') console.dir(devices); wx.getBluetoothDevices({ success: function (res) { console.log(res) } }) }) }, getBluetoothDevices: function () { let that = this; wx.getBluetoothDevices({ success: function (res4) { console.log(res4); for (let item of res4.devices) { console.log(item.name.trim()) console.log(item.name.trim().length) } } }) }, startsearch:function(){ wx.startBluetoothDevicesDiscovery({ success: function (res) { console.log(res) } }) }, }) 我这样写得到的array永远为0,用了多个真机调试都没用,是不是蓝牙模块有问题?
2017-10-26 - 国外能使用wx.openLocation(OBJECT) API查看位置吗?
国外能使用wx.openLocation(OBJECT) API查看位置吗?
2017-08-24 - 22号更新后1.5库的wx.createSelectorQuery()还是有问题
var scrollTop = 0; var query = wx.createSelectorQuery() query.selectViewport().scrollOffset(); query.exec(function (res) { scrollTop = res[0].scrollTop // 显示区域的竖直滚动位置 that.data.scrollTop = scrollTop; }) 在1.4.3 res有值,1.5还是没有值啊
2017-08-22 - 1.5基础库wx.createSelectorQuery() 没用啦
坑菠萝say
2017-08-19