//执行开始倒计时
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:'加速计启动'
})
0 个回复