no message

This commit is contained in:
wangdongbo 2026-02-11 17:11:20 +08:00
parent 110b6754f9
commit abe38ad86f
2 changed files with 9 additions and 5 deletions

View File

@ -8,7 +8,7 @@
<view class="input-area"> <view class="input-area">
<textarea v-if="!showVoiceInput" class="text-input" v-model="inputText" placeholder="我来说两句..." <textarea v-if="!showVoiceInput" class="text-input" v-model="inputText" placeholder="我来说两句..."
@confirm="sendTextMessage" @focus="handleInputFocus" @input="handleInput" @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" />
<input v-else class="voice-input-btn" :class="{ recording: isRecording }" @touchstart="startRecord" <input v-else class="voice-input-btn" :class="{ recording: isRecording }" @touchstart="startRecord"
@touchmove="onRecordTouchMove" @touchend="stopRecord" @touchcancel="cancelRecord" :placeholder="isRecording ? '松开发送' : '按住说话'" disabled> @touchmove="onRecordTouchMove" @touchend="stopRecord" @touchcancel="cancelRecord" :placeholder="isRecording ? '松开发送' : '按住说话'" disabled>
</input> </input>
@ -151,11 +151,15 @@ const initRecorderManager = () => {
const sendTextMessage = async () => { const sendTextMessage = async () => {
if (!inputText.value.trim()) return; if (!inputText.value.trim()) return;
await sendMessage("text", inputText.value); const textToSend = inputText.value;
inputText.value = ""; inputText.value = "";
// await sendMessage("text", textToSend);
uni.hideKeyboard();
//
nextTick(() => {
// hold-keyboard
});
}; };

View File

@ -23,7 +23,7 @@
<!-- 聊天消息区域 --> <!-- 聊天消息区域 -->
<scroll-view <scroll-view
class="chat-content" class="chat-content"
:style="{ bottom: (keyboardHeight > 0 ? keyboardHeight + 120 : 120) + 'px' }" :style="{ bottom: (keyboardHeight > 0 ? keyboardHeight + 60 : 60) + 'px' }"
scroll-y="true" scroll-y="true"
enhanced="true" enhanced="true"
bounces="false" bounces="false"