1***@qq.com
1***@qq.com
  • 发布:2024-01-03 15:48
  • 更新:2024-01-03 17:46
  • 阅读:208

【报Bug】uni.scanCode() 扫码后无响应,无法扫到条形码,微信小程序。

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10 专业版

HBuilderX类型: 正式

HBuilderX版本号: 3.99

第三方开发者工具版本号: 1.06.2301160

基础库版本号: 3.22

项目创建方式: HBuilderX

示例代码:

uni.scanCode({
scanType: ['barCode'],
success: function (res) {
console.log(res);
uni.hideLoading();
that.brcodeCheck(res.scanType,res.result);
},
fail:function(){
uni.hideLoading();
}
});

操作步骤:

uni.scanCode({
scanType: ['barCode'],
success: function (res) {
console.log(res);
uni.hideLoading();
that.brcodeCheck(res.scanType,res.result);
},
fail:function(){
uni.hideLoading();
}
});

预期结果:

能扫到

实际结果:
                        console.log(res);有值。  

bug描述:

手机扫条形码,无返回响应,无法扫到条形码。一直在扫码。

note7 可以。

2024-01-03 15:48 负责人:无 分享
已邀请:
喜欢技术的前端

喜欢技术的前端 - QQ---445849201

写了个demo .真机调试可以的

<template>  
    <view class="page-body">  
        <button @click="barCode">barCode</button>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  

            };  
        },  
        onLoad() {  

        },  
        methods: {  
            barCode() {  
                uni.scanCode({  
                    scanType: ['barCode'],  
                    success: function(res) {  
                        console.log(res);  

                    },  
                    fail: function(err) {  
                        console.log(err)  
                    }  
                });  
            }  
        }  
    };  
</script>  

<style>  

</style>
  • 1***@qq.com (作者)

    好像是我手机的问题,昨天不能,今天突然又能调用了,应该是没电重启后好用了,抱歉。

    2024-01-04 11:12

要回复问题请先登录注册