|
|
@ -84,12 +84,15 @@ export default { |
|
|
|
clearTimeout(this.timeOutEvent) |
|
|
|
clearInterval(this.btnDurationTimer) |
|
|
|
this.btnDuration = 1 |
|
|
|
if (this.voiceList.localId) { |
|
|
|
wx.stopRecord({ |
|
|
|
fail: function (res) {}, |
|
|
|
success: function (res) { |
|
|
|
// this.localId = res.localId |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 手指按住500ms才算长按 |
|
|
|
this.timeOutEvent = 0 |
|
|
|
this.isRecording = true |
|
|
@ -118,6 +121,7 @@ export default { |
|
|
|
if (timeOutEvent === 0) { |
|
|
|
wx.stopRecord({ |
|
|
|
success: res => { |
|
|
|
console.log(res, 'res') |
|
|
|
this.onRecorded(res.localId) |
|
|
|
} |
|
|
|
}) |
|
|
@ -126,6 +130,7 @@ export default { |
|
|
|
}, |
|
|
|
// 录制结束逻辑处理 |
|
|
|
onRecorded(localId) { |
|
|
|
console.log(localId, 'localId') |
|
|
|
const { recordStartTime } = this |
|
|
|
const endTime = new Date().getTime() |
|
|
|
const arrItem = { |
|
|
|