蓝牙倒计时小程序,按了右上角和HOME键后台运行,然后锁屏 调试时可以看到计时是正常的,就是结束的时候指令不下发了,只有再次进入小程序时才会下发。这是什么原因?

展开全部
收起
1回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • JeniferJJJ

    14人对此回答表示赞同

    that.data.setInter=setInterval(function(){time--;minute=parseInt(time/60);second=time%60;that.setData({minute:minute});that.setData({second:second});console.log(time);if(time==0){clearInterval(that.data.setInter)varparam=0x01;that.setData({'send[0]':param});if(that.data.write_id){dataView.setUint8(0,"0x"+send[0])//that.setData({'buffer':send[0]});console.log(send);console.log("endtime");wx.writeBLECharacteristicValue({//这里的deviceId需要在上面的getBluetoothDevices或onBluetoothDeviceFound接口中获取deviceId:that.data.deviceId,//这里的serviceId需要在上面的getBLEDeviceServices接口中获取serviceId:that.data.serviceId,//这里的characteristicId需要在上面的getBLEDeviceCharacteristics接口中获取characteristicId:that.data.write_id,//这里的value是ArrayBuffer类型value:buffer,success:function(res){console.log(send);},fail:function(res){console.log(res)},})}}},1000);

    展开
    14
    0回复
    发布于 6年前

    评论(0)

    收起评论

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部