no message
This commit is contained in:
parent
f702cb406a
commit
19fbae743e
@ -15,7 +15,6 @@ $primary-color: #0877F1;
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
overflow: hidden;
|
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; /* 患者信息栏高度,根据实际调整 */
|
top: 100rpx; /* 患者信息栏高度,根据实际调整 */
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 120rpx; /* 输入框高度,根据实际调整 */
|
bottom: 160rpx; /* 输入框高度,根据实际调整 */
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
transition: bottom 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-content-compressed {
|
.chat-content-compressed {
|
||||||
@ -373,8 +371,6 @@ $primary-color: #0877F1;
|
|||||||
z-index: 200;
|
z-index: 200;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
transform: translateZ(0); /* 开启硬件加速,提升性能 */
|
transform: translateZ(0); /* 开启硬件加速,提升性能 */
|
||||||
transition: bottom 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
||||||
will-change: bottom;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="input-section" :style="{ bottom: props.keyboardHeight + 'px' }">
|
<view class="input-section">
|
||||||
<!-- AI助手按钮组 -->
|
<!-- AI助手按钮组 -->
|
||||||
<view class="ai-assistant-slot">
|
<view class="ai-assistant-slot">
|
||||||
<slot name="ai-assistant"></slot>
|
<slot name="ai-assistant"></slot>
|
||||||
@ -13,7 +13,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" :hold-keyboard="true"
|
:auto-height="true" :show-confirm-bar="false" :hold-keyboard="true"
|
||||||
ref="textareaRef"
|
ref="textareaRef"
|
||||||
/>
|
/>
|
||||||
<input v-else class="voice-input-btn" :class="{ recording: isRecording }" @touchstart="startRecord"
|
<input v-else class="voice-input-btn" :class="{ recording: isRecording }" @touchstart="startRecord"
|
||||||
@ -90,7 +90,6 @@ const props = defineProps({
|
|||||||
corpId: { type: String, default: "" },
|
corpId: { type: String, default: "" },
|
||||||
orderStatus: { type: String, default: "" },
|
orderStatus: { type: String, default: "" },
|
||||||
isGenerating: { type: Boolean, default: false },
|
isGenerating: { type: Boolean, default: false },
|
||||||
keyboardHeight: { type: Number, default: 0 },
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Emits
|
// Emits
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<page-meta :page-style="'overflow:' + (keyboardHeight > 0 ? 'hidden' : 'visible')"></page-meta>
|
<view class="chat-page">
|
||||||
<view class="chat-page" :style="{ paddingBottom: keyboardHeight + 'px' }">
|
|
||||||
<!-- 患者信息栏 -->
|
<!-- 患者信息栏 -->
|
||||||
<view class="patient-info-bar" v-if="patientInfo.name">
|
<view class="patient-info-bar" v-if="patientInfo.name">
|
||||||
<view class="patient-info-content">
|
<view class="patient-info-content">
|
||||||
@ -19,7 +18,7 @@
|
|||||||
<!-- 聊天消息区域 -->
|
<!-- 聊天消息区域 -->
|
||||||
<scroll-view
|
<scroll-view
|
||||||
class="chat-content"
|
class="chat-content"
|
||||||
:style="{ bottom: (keyboardHeight > 0 ? keyboardHeight + 120 : 120) + 'px' }"
|
:style="{ bottom: keyboardHeight + 'px' }"
|
||||||
scroll-y="true"
|
scroll-y="true"
|
||||||
enhanced="true"
|
enhanced="true"
|
||||||
bounces="false"
|
bounces="false"
|
||||||
@ -466,18 +465,7 @@ onLoad((options) => {
|
|||||||
|
|
||||||
// 监听键盘高度变化
|
// 监听键盘高度变化
|
||||||
uni.onKeyboardHeightChange((res) => {
|
uni.onKeyboardHeightChange((res) => {
|
||||||
console.log("键盘高度变化:", res.height);
|
|
||||||
const oldHeight = keyboardHeight.value;
|
|
||||||
keyboardHeight.value = res.height;
|
keyboardHeight.value = res.height;
|
||||||
|
|
||||||
// 键盘弹出时(从0变为非0),自动滚动到底部
|
|
||||||
if (oldHeight === 0 && res.height > 0) {
|
|
||||||
nextTick(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
scrollToBottom(true);
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
checkLoginAndInitTIM();
|
checkLoginAndInitTIM();
|
||||||
@ -1194,9 +1182,6 @@ const handleOpenConsult = async () => {
|
|||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearMessageCache();
|
clearMessageCache();
|
||||||
|
|
||||||
// 移除键盘监听
|
|
||||||
uni.offKeyboardHeightChange();
|
|
||||||
|
|
||||||
timChatManager.setCallback("onSDKReady", null);
|
timChatManager.setCallback("onSDKReady", null);
|
||||||
timChatManager.setCallback("onSDKNotReady", null);
|
timChatManager.setCallback("onSDKNotReady", null);
|
||||||
timChatManager.setCallback("onMessageReceived", null);
|
timChatManager.setCallback("onMessageReceived", null);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user