9***@qq.com
9***@qq.com
  • 发布:2024-05-13 10:24
  • 更新:2024-05-13 10:24
  • 阅读:186

【报Bug】uni.startAccelerometer ({interval:‘game’})设置频率是没有效果的

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Win10

HBuilderX类型: 正式

HBuilderX版本号: 4.16

手机系统: Android

手机系统版本号: Android 13

手机厂商: 华为

手机机型: p40pro

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

//执行开始倒计时
handleTimeout(){
this.timestampshow=true;
//开始测试
testcounttimer = setInterval(()=>{
this.testcount--;
if(this.testcount<=0){
uni.showToast({
title:'加速计结束'
})
this.cancelTestMethod();

                    console.log(this.testarr);  
                }  
            },1000);  
        },  
        //开始测试  
        startTestProject(){  

            this.handleTimeout();  
            //开始监听加速度数据  
            let obj = {  
                interval:'20',  
                success:()=>{  
                    console.log('调用加速计成功');  
                },fail:()=> {  
                    console.log('调用加速计失败')  
                },  
                complete() {  
                    console.log('调用加速计完成')  
                }  
            }  
            uni.startAccelerometer({interval:20});  
                    //监听加速度数据事件的监听函数  
            uni.onAccelerometerChange(this.getAllDataMethod);     

            uni.showToast({  
                title:'加速计启动'  
            })

预期结果:

预期15秒执行 50*15 = 750次

实际结果:

实际执行75次

bug描述:

频率修改没有效果,一直维持200ms ,不会改变

2024-05-13 10:24 负责人:无 分享
已邀请:

要回复问题请先登录注册