uni.scanCode({
onlyFromCamera: true,
success: function (res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
}
});
- 发布:2023-02-28 14:21
- 更新:2023-02-28 14:23
- 阅读:340
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: windows7旗舰版
HBuilderX类型: 正式
HBuilderX版本号: 3.6.18
手机系统: iOS
手机系统版本号: iOS 15
手机厂商: 苹果
手机机型: iphone7
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
操作步骤:
预期结果:
能正常打开相机扫描二维码
能正常打开相机扫描二维码
实际结果:
Failed to execute the callback function:[ERROR] : [JS Framework] Failed to execute the callback function:TypeError: this.$refs.barcode.cancel is not a function. (In 'this.$refs.barcode.cancel()', 'this.$refs.barcode.cancel' is undefined) __ERROR
Failed to execute the callback function:[ERROR] : [JS Framework] Failed to execute the callback function:TypeError: this.$refs.barcode.cancel is not a function. (In 'this.$refs.barcode.cancel()', 'this.$refs.barcode.cancel' is undefined) __ERROR
bug描述:
uni.scanCode({
onlyFromCamera: true,
success: function (res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
}
});
FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866
App模块配置->扫码,勾选没有,然后重新打包生效
浅水321 (作者)
可以了。谢谢
2023-02-28 14:29