no message

This commit is contained in:
wangdongbo 2026-02-12 11:37:29 +08:00
parent f702cb406a
commit 19fbae743e
3 changed files with 5 additions and 25 deletions

View File

@ -15,7 +15,6 @@ $primary-color: #0877F1;
flex-direction: column;
background-color: #f5f5f5;
overflow: hidden;
transition: padding-bottom 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* 患者信息栏样式 - 固定在顶部 */
@ -96,11 +95,10 @@ $primary-color: #0877F1;
top: 100rpx; /* 患者信息栏高度,根据实际调整 */
left: 0;
right: 0;
bottom: 120rpx; /* 输入框高度,根据实际调整 */
bottom: 160rpx; /* 输入框高度,根据实际调整 */
box-sizing: border-box;
overflow-x: hidden;
overflow-y: auto;
transition: bottom 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.chat-content-compressed {
@ -373,8 +371,6 @@ $primary-color: #0877F1;
z-index: 200;
flex-shrink: 0;
transform: translateZ(0); /* 开启硬件加速,提升性能 */
transition: bottom 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
will-change: bottom;
display: flex;
flex-direction: column;
}

View File

@ -1,5 +1,5 @@
<template>
<view class="input-section" :style="{ bottom: props.keyboardHeight + 'px' }">
<view class="input-section">
<!-- AI助手按钮组 -->
<view class="ai-assistant-slot">
<slot name="ai-assistant"></slot>
@ -13,7 +13,7 @@
<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" :hold-keyboard="true"
:auto-height="true" :show-confirm-bar="false" :hold-keyboard="true"
ref="textareaRef"
/>
<input v-else class="voice-input-btn" :class="{ recording: isRecording }" @touchstart="startRecord"
@ -90,7 +90,6 @@ const props = defineProps({
corpId: { type: String, default: "" },
orderStatus: { type: String, default: "" },
isGenerating: { type: Boolean, default: false },
keyboardHeight: { type: Number, default: 0 },
});
// Emits

View File

@ -1,6 +1,5 @@
<template>
<page-meta :page-style="'overflow:' + (keyboardHeight > 0 ? 'hidden' : 'visible')"></page-meta>
<view class="chat-page" :style="{ paddingBottom: keyboardHeight + 'px' }">
<view class="chat-page">
<!-- 患者信息栏 -->
<view class="patient-info-bar" v-if="patientInfo.name">
<view class="patient-info-content">
@ -19,7 +18,7 @@
<!-- 聊天消息区域 -->
<scroll-view
class="chat-content"
:style="{ bottom: (keyboardHeight > 0 ? keyboardHeight + 120 : 120) + 'px' }"
:style="{ bottom: keyboardHeight + 'px' }"
scroll-y="true"
enhanced="true"
bounces="false"
@ -466,18 +465,7 @@ onLoad((options) => {
//
uni.onKeyboardHeightChange((res) => {
console.log("键盘高度变化:", res.height);
const oldHeight = keyboardHeight.value;
keyboardHeight.value = res.height;
// 00
if (oldHeight === 0 && res.height > 0) {
nextTick(() => {
setTimeout(() => {
scrollToBottom(true);
}, 100);
});
}
});
checkLoginAndInitTIM();
@ -1194,9 +1182,6 @@ const handleOpenConsult = async () => {
onUnmounted(() => {
clearMessageCache();
//
uni.offKeyboardHeightChange();
timChatManager.setCallback("onSDKReady", null);
timChatManager.setCallback("onSDKNotReady", null);
timChatManager.setCallback("onMessageReceived", null);