button:function(e){ wx.startRecord({ success: function (res) { voice = res.tempFilePath }, fail: function (res) { //录音失败 } }) }, stop:function(e){ // setTimeout(function () { //结束录音 wx.stopRecord() // }, 10000) }, bofang:function(e){ console.log(voice) wx.playVoice({ filePath: voice }) }