diff --git a/.DS_Store b/.DS_Store index e68dfc9..1d5b6a3 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/pages/im/components/sent/sentVoice.vue b/pages/im/components/sent/sentVoice.vue index d9ee19f..3e5b4d4 100644 --- a/pages/im/components/sent/sentVoice.vue +++ b/pages/im/components/sent/sentVoice.vue @@ -47,6 +47,7 @@ maxRecordTime: 60, recorderManager: null, mp3AudioSrc: null, + isMoveCancel: false, isBetaPlay: false, // 暂时无用 startOffsetTop: 0 } @@ -69,7 +70,6 @@ this.getAndroidPermission().then(code => { switch (code) { case 1: - this.showConfirm = true this.startOffsetTop = e.target.offsetTop this.showRecordTip = true this.recorderManager.start() @@ -104,6 +104,21 @@ clearInterval(this.interval) // 监听录音结束 this.recorderManager.onStop(res => { + if(this.isMoveCancel) { + this.isMoveCancel = false + return + } + + console.log(this.maxRecordTime - this.recordTime) + + if((this.maxRecordTime - this.recordTime) <= 0){ + uni.showToast({ + title: '说话时间太短', + icon : 'none', + }) + this.showRecordTip = false + return + } this.mp3AudioSrc = res.tempFilePath this.showRecordTip = false this.senVoice() @@ -132,9 +147,10 @@ touchmove(e){ if(this.startOffsetTop - e.changedTouches[0].pageY > 100){ if(this.showRecordTip){ + this.isMoveCancel = true this.showRecordTip = false - clearInterval(this.interval) this.recorderManager.stop() + clearInterval(this.interval) this.recordTime = this.maxRecordTime this.mp3AudioSrc = null return diff --git a/static/.DS_Store b/static/.DS_Store index c3beeb7..0ddb188 100644 Binary files a/static/.DS_Store and b/static/.DS_Store differ