no message
This commit is contained in:
parent
0ecef71467
commit
f64a5864ef
@ -8,7 +8,8 @@
|
||||
<view class="input-area">
|
||||
<textarea v-if="!showVoiceInput" class="text-input" v-model="inputText" placeholder="我来说两句..."
|
||||
@confirm="sendTextMessage" @focus="handleInputFocus" @input="handleInput"
|
||||
:auto-height="true" :show-confirm-bar="false" :adjust-position="false"
|
||||
:auto-height="true" :show-confirm-bar="false" :adjust-position="false" :hold-keyboard="true"
|
||||
ref="textareaRef"
|
||||
/>
|
||||
<input v-else class="voice-input-btn" :class="{ recording: isRecording }" @touchstart="startRecord"
|
||||
@touchmove="onRecordTouchMove" @touchend="stopRecord" @touchcancel="cancelRecord" :placeholder="isRecording ? '松开发送' : '按住说话'" disabled>
|
||||
@ -101,6 +102,7 @@ const showVoiceInput = ref(false);
|
||||
const showMorePanel = ref(false);
|
||||
const isRecording = ref(false);
|
||||
const recordingText = ref("录音中...");
|
||||
const textareaRef = ref(null);
|
||||
const cloudCustomData = computed(() => {
|
||||
const arr = [
|
||||
props.chatRoomBusiness.businessType,
|
||||
@ -168,8 +170,19 @@ const initRecorderManager = () => {
|
||||
const sendTextMessage = async () => {
|
||||
if (!inputText.value.trim()) return;
|
||||
|
||||
await sendMessage("text", inputText.value);
|
||||
const textToSend = inputText.value;
|
||||
inputText.value = "";
|
||||
|
||||
await sendMessage("text", textToSend);
|
||||
|
||||
// 发送后保持焦点,不收起键盘
|
||||
nextTick(() => {
|
||||
// 通过设置 focus 属性来保持键盘显示
|
||||
// 注意:在某些情况下可能需要延迟执行
|
||||
setTimeout(() => {
|
||||
// 这里不需要手动聚焦,因为 hold-keyboard 会保持键盘
|
||||
}, 50);
|
||||
});
|
||||
};
|
||||
|
||||
// 从常用语发送文本消息
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user