no message

This commit is contained in:
wangdongbo 2026-01-30 17:19:49 +08:00
parent d74c06325d
commit a2d2427eb7
4 changed files with 27 additions and 36 deletions

View File

@ -366,10 +366,8 @@ $primary-color: #0877F1;
height: 80rpx; height: 80rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
padding: 0 46rpx; padding: 0 46rpx;
}
.voice-input-btn {
text-align: center; text-align: center;
line-height: 80rpx; line-height: 80rpx;
} }
@ -933,7 +931,16 @@ $primary-color: #0877F1;
.text-input::-moz-placeholder, .text-input::-moz-placeholder,
.text-input:-ms-input-placeholder, .text-input:-ms-input-placeholder,
.text-input::placeholder { .text-input::placeholder {
line-height: 96rpx; line-height: normal;
}
.voice-input-btn::-webkit-input-placeholder,
.voice-input-btn:-moz-placeholder,
.voice-input-btn::-moz-placeholder,
.voice-input-btn:-ms-input-placeholder,
.voice-input-btn::placeholder {
line-height: 80rpx;
text-align: center;
} }
/* 时间分割线 */ /* 时间分割线 */

View File

@ -291,12 +291,6 @@ function handleSystemMessageReceived(message) {
} }
} }
//
function checkConsultPendingStatus() {
//
fetchGroupOrderStatus();
}
// //
function getBubbleClass(message) { function getBubbleClass(message) {
// //
@ -393,27 +387,23 @@ const initTIMCallbacks = async () => {
handleSystemMessageReceived(message); handleSystemMessageReceived(message);
} }
//
checkConsultPendingStatus();
// 使 // 使
nextTick(() => { nextTick(() => {
scrollToBottom(true); scrollToBottom(true);
}); });
// 0 // 0
if (timChatManager.tim && timChatManager.isLoggedIn && chatInfo.value.conversationID) { if (
timChatManager.tim &&
timChatManager.isLoggedIn &&
chatInfo.value.conversationID
) {
timChatManager.tim timChatManager.tim
.setMessageRead({ .setMessageRead({
conversationID: chatInfo.value.conversationID, conversationID: chatInfo.value.conversationID,
}) })
.then(() => { .then(() => {
console.log("✓ 收到新消息后已标记为已读"); console.log("✓ 收到新消息后已标记为已读");
// 0
timChatManager.triggerCallback('onConversationListUpdated', {
conversationID: chatInfo.value.conversationID,
unreadCount: 0
});
}) })
.catch((error) => { .catch((error) => {
console.error("✗ 标记已读失败:", error); console.error("✗ 标记已读失败:", error);
@ -473,9 +463,6 @@ const initTIMCallbacks = async () => {
isCompleted.value = data.isCompleted || false; isCompleted.value = data.isCompleted || false;
isLoadingMore.value = false; isLoadingMore.value = false;
//
checkConsultPendingStatus();
nextTick(() => { nextTick(() => {
if (data.isRefresh) { if (data.isRefresh) {
console.log("后台刷新完成,保持当前滚动位置"); console.log("后台刷新完成,保持当前滚动位置");
@ -570,11 +557,6 @@ const loadMessageList = async () => {
}) })
.then(() => { .then(() => {
console.log("✓ 会话已标记为已读:", chatInfo.value.conversationID); console.log("✓ 会话已标记为已读:", chatInfo.value.conversationID);
//
timChatManager.triggerCallback('onConversationListUpdated', {
conversationID: chatInfo.value.conversationID,
unreadCount: 0
});
}) })
.catch((error) => { .catch((error) => {
console.error("✗ 标记会话已读失败:", error); console.error("✗ 标记会话已读失败:", error);
@ -731,6 +713,9 @@ onShow(() => {
// //
onHide(() => { onHide(() => {
stopIMMonitoring(); stopIMMonitoring();
// ID
timChatManager.currentConversationID = null;
console.log("✓ 页面隐藏已清空当前会话ID");
}); });
// //

View File

@ -46,7 +46,7 @@ export async function mergeConversationWithGroupDetails(conversationList, option
...options // 支持传入额外的查询参数corpId, teamId, keyword等 ...options // 支持传入额外的查询参数corpId, teamId, keyword等
} }
const response = await api('getGroupList', requestData) const response = await api('getGroupList', requestData, false)
// 4. 检查响应 // 4. 检查响应
if (!response || !response.success) { if (!response || !response.success) {

View File

@ -379,7 +379,7 @@ class TimChatManager {
async getUserInfoAndLogin(userID) { async getUserInfoAndLogin(userID) {
try { try {
console.log('getUserInfoAndLogin 开始,传入 userID:', userID) console.log('getUserInfoAndLogin 开始,传入 userID:', userID)
if (userID) { if (userID) {
this.currentUserID = userID this.currentUserID = userID
uni.setStorageSync('userInfo', { userID }) uni.setStorageSync('userInfo', { userID })
@ -388,18 +388,18 @@ class TimChatManager {
console.log('未传入 userID尝试从本地存储获取') console.log('未传入 userID尝试从本地存储获取')
const userInfo = uni.getStorageSync('userInfo') const userInfo = uni.getStorageSync('userInfo')
console.log('本地存储的 userInfo:', userInfo) console.log('本地存储的 userInfo:', userInfo)
if (!userInfo?.userID) { if (!userInfo?.userID) {
throw new Error('未找到用户信息,请先登录') throw new Error('未找到用户信息,请先登录')
} }
this.currentUserID = userInfo.userID this.currentUserID = userInfo.userID
console.log('从本地存储获取到 userID:', this.currentUserID) console.log('从本地存储获取到 userID:', this.currentUserID)
} }
console.log('开始获取 userSig...') console.log('开始获取 userSig...')
this.currentUserSig = await this.getUserSig(this.currentUserID) this.currentUserSig = await this.getUserSig(this.currentUserID)
console.log('userSig 获取成功') console.log('userSig 获取成功')
console.log('开始登录 TIM...') console.log('开始登录 TIM...')
await this.loginTIM() await this.loginTIM()
console.log('TIM 登录成功') console.log('TIM 登录成功')
@ -1488,8 +1488,7 @@ class TimChatManager {
this.markConversationAsRead(conversationID) this.markConversationAsRead(conversationID)
// 首先从本地接口加载聊天记录
console.log(" 开始从本地接口加载聊天记录groupID:", actualGroupID)
await this.loadMessagesFromLocalAPI(actualGroupID, count) await this.loadMessagesFromLocalAPI(actualGroupID, count)
} }
@ -2542,8 +2541,8 @@ class TimChatManager {
return '[自定义消息]' return '[自定义消息]'
} }
const customData = typeof payload.data === 'string' const customData = typeof payload.data === 'string'
? JSON.parse(payload.data) ? JSON.parse(payload.data)
: payload.data : payload.data
const messageType = customData.messageType || customData.type const messageType = customData.messageType || customData.type