小程序调起扫码接口扫描二维码 代码 wx.scanCode({ onlyFromCamera: false, scanType: ['barCode', 'qrCode', 'datamatrix','pdf417'], success: res => { console.log(res); }, fail: res => { // 接口调用失败 }, complete: res => { // 接口调用结束 } })