//通过扫码获取商品信息 wx.scanCode({ onlyFromCamera: false, scanType: [‘barCode’], success(res) { console.log(res); } })