为什么 接收不到值

发布于 7 年前作者 libai14978 次浏览最后编辑 7 年前来自 ask

首先 我们封装了一个方法

function m(d) {
 
    wx.openBluetoothAdapter({
        success: function (res) {
            console.log('蓝牙开启成功');
            searchBluetooth(d);
        },
        fail: function (res) {
            console.log('蓝牙开启失败');
            wx.closeBluetoothAdapter();
            return {
                status: 'fail',
                errmsg: '开锁失败 请打开蓝牙'
            };
        },
        complete: function (res) {
            wx.onBLECharacteristicValueChange(function (res) {
                console.log("onBLECharacteristicValueChange");
            })
        },
    })
}

console.log(m(d))

但是日志可以打出

为什么打印不出 return的值呢

0 回复
暂无回复