Compare commits

..

No commits in common. "265dc9381dd9cf8b707319b1c8753407984c9746" and "01fc0f64c16586eba5c1bc73d00201696b962209" have entirely different histories.

4 changed files with 6 additions and 34 deletions

View File

@ -295,21 +295,18 @@ const sendVoiceMessage = async (voiceFile, duration) => {
// 发送消息的通用方法(文本、图片、语音) // 发送消息的通用方法(文本、图片、语音)
const sendMessage = async (messageType, data) => { const sendMessage = async (messageType, data) => {
const result = await sendMessageUtil( await sendMessageUtil(
messageType, messageType,
data, data,
props.timChatManager, props.timChatManager,
() => validateBeforeSend(false, false, props.timChatManager), () => validateBeforeSend(false, false, props.timChatManager),
() => { () => {
showMorePanel.value = false; showMorePanel.value = false;
// 发送成功后滚动到底部
emit("messageSent");
}, },
cloudCustomData.value cloudCustomData.value
); );
if (result?.success) {
// 让页面直接将本地消息加入列表,避免依赖全局 IM 回调的注册时机。
emit("messageSent", result.message);
}
}; };
// 发送自定义消息的通用方法 // 发送自定义消息的通用方法

View File

@ -101,7 +101,7 @@
" :userId="openid" :teamId="teamId" :patientId="patientId" :corpId="corpId" :patientInfo="patientInfo" " :userId="openid" :teamId="teamId" :patientId="patientId" :corpId="corpId" :patientInfo="patientInfo"
:orderStatus="orderStatus" :isGenerating="isGenerating" :orderStatus="orderStatus" :isGenerating="isGenerating"
:canBenefitEntry="isBenefitEntryEnabled" :canBenefitEntry="isBenefitEntryEnabled"
@scrollToBottom="() => scrollToBottom(true)" @messageSent="handleMessageSent" @scrollToBottom="() => scrollToBottom(true)" @messageSent="() => scrollToBottom(true)"
@endConsult="handleEndConsult" @openConsult="handleOpenConsult"> @endConsult="handleEndConsult" @openConsult="handleOpenConsult">
<!-- AI助手按钮组插槽 --> <!-- AI助手按钮组插槽 -->
<template #ai-assistant> <template #ai-assistant>
@ -766,29 +766,6 @@ const scrollToBottom = (immediate = false) => {
} }
}; };
// 发送成功后直接写入当前页面列表,避免全局 IM 回调被其他页面覆盖时消息不显示。
const handleMessageSent = (message) => {
if (
!message ||
!message.ID ||
message.conversationID !== chatInfo.value.conversationID
) {
scrollToBottom(true);
return;
}
const existingMessage = messageList.value.find(
(item) => item.ID === message.ID
);
if (!existingMessage) {
messageList.value.push(message);
} else {
existingMessage.status = message.status;
}
nextTick(() => scrollToBottom(true));
};
// 关闭功能栏 // 关闭功能栏
const closeMorePanel = () => { const closeMorePanel = () => {
uni.$emit("closeMorePanel"); uni.$emit("closeMorePanel");

View File

@ -116,7 +116,7 @@ const rule = computed(() => {
title: { name: "职称", disabled: false }, title: { name: "职称", disabled: false },
dept: { name: "科室", disabled: false }, dept: { name: "科室", disabled: false },
} }
if (doctorInfo.value?.verifyStatus === "verified") { if (doctorInfo.value) {
data.job.name = "岗位 (不可修改)"; data.job.name = "岗位 (不可修改)";
data.job.disabled = true; data.job.disabled = true;
} }

View File

@ -513,8 +513,6 @@ export const sendMessage = async (messageType, data, timChatManager, validateBef
console.error('发送消息失败:', result?.error); console.error('发送消息失败:', result?.error);
showMessage('发送失败,请重试'); showMessage('发送失败,请重试');
} }
return result;
}; };
// ==================== 状态检查相关工具方法 ==================== // ==================== 状态检查相关工具方法 ====================