From 9f7a3d4970bb55d8c0ae69d04e3190ef40a1bad7 Mon Sep 17 00:00:00 2001
From: xsx <825657193@qq.com>
Date: Wed, 3 Apr 2024 16:01:21 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E6=A1=A3=E8=B7=AF=E5=BE=84?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
im-ui/src/view/Login.vue | 2 +-
.../components/chat-record/chat-record.vue | 21 ++++++++++++++++---
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/im-ui/src/view/Login.vue b/im-ui/src/view/Login.vue
index f3d8b2f..c64b6d4 100644
--- a/im-ui/src/view/Login.vue
+++ b/im-ui/src/view/Login.vue
@@ -20,7 +20,7 @@
web端音视频功能优化:支持语音呼叫、会话中加入通话状态消息
uniapp端支持音视频通话,并与web端打通
uniapp端音视频源码通话源码暂未开源,需付费获取:
- uniapp端音视频通源码购买说明
+ uniapp端音视频通源码购买说明
diff --git a/im-uniapp/components/chat-record/chat-record.vue b/im-uniapp/components/chat-record/chat-record.vue
index 623333a..77de146 100644
--- a/im-uniapp/components/chat-record/chat-record.vue
+++ b/im-uniapp/components/chat-record/chat-record.vue
@@ -1,7 +1,10 @@
- {{recording?'正在录音':'长按 说话'}}
+ {{recording?'正在录音':'长按 说话'}}
@@ -13,7 +16,7 @@
{{recordTip}}
-
+
@@ -40,7 +43,19 @@
const moveY = e.touches[0].clientY;
this.moveToCancel = moveY < this.recordBarTop-40;
},
+ onCancel(){
+ if(this.recording){
+ this.moveToCancel = true;
+ this.onEndRecord();
+ }
+ },
onStartRecord() {
+ /* 用户第一次使用语音会唤醒录音权限请求,此时会导致@touchend失效,
+ 一直处于录音状态,这里允许用户再次点击发送语音并结束录音 */
+ if(this.recording){
+ this.onEndRecord();
+ return;
+ }
console.log("开始录音")
this.moveToCancel = false;
this.initRecordBar();