bindtouchstart后会授权弹窗怎么处理

发布于 7 年前作者 xiexiulan18339 次浏览最后编辑 7 年前来自 ask

bindtouchstart  开始录音

bindtouchend   结束录音

当第一次点击 bindtouchend时,会弹出授权窗口,但bindtouchstart还在执行,会导致录音出错,用户体验也不好,有什么办法吗?

1 回复
zengguiying
zengguiying1 楼5 年前

我想到了个办法。

onLoad的时候先让他执行wx.startRecord();  授权后再暂停录音

    wx.startRecord();

    setTimeout(function () {

      //结束录音  

      wx.stopRecord()

    }, 1000);

但还没点击确定授权的时候。  setTimeout却执行了。。。