no message
This commit is contained in:
parent
1c3aca8700
commit
840d26197f
@ -3,7 +3,7 @@ MP_IMAGE_URL=https://patient.youcan365.com
|
|||||||
MP_CACHE_PREFIX=development
|
MP_CACHE_PREFIX=development
|
||||||
MP_WX_APP_ID=wx1d8337a40c11d66c
|
MP_WX_APP_ID=wx1d8337a40c11d66c
|
||||||
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
||||||
MP_TIM_SDK_APP_ID=1600123876
|
MP_TIM_SDK_APP_ID=1600126296
|
||||||
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
||||||
MP_INVITE_PATIENT_QRCODE=https://patient.youcan365.com/invite-patient
|
MP_INVITE_PATIENT_QRCODE=https://patient.youcan365.com/invite-patient
|
||||||
MP_PATIENT_PAGE_BASE_URL= 'https://www.youcan365.com/patientDeploy/#/'
|
MP_PATIENT_PAGE_BASE_URL= 'https://www.youcan365.com/patientDeploy/#/'
|
||||||
|
|||||||
@ -3,7 +3,7 @@ MP_IMAGE_URL=https://patient.youcan365.com
|
|||||||
MP_CACHE_PREFIX=development
|
MP_CACHE_PREFIX=development
|
||||||
MP_WX_APP_ID=wx1d8337a40c11d66c
|
MP_WX_APP_ID=wx1d8337a40c11d66c
|
||||||
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
||||||
MP_TIM_SDK_APP_ID=1600123876
|
MP_TIM_SDK_APP_ID=1600126296
|
||||||
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
||||||
MP_INVITE_PATIENT_QRCODE=https://patient.youcan365.com/invite-patient
|
MP_INVITE_PATIENT_QRCODE=https://patient.youcan365.com/invite-patient
|
||||||
MP_PATIENT_PAGE_BASE_URL= 'https://www.youcan365.com/patientDeploy/#/'
|
MP_PATIENT_PAGE_BASE_URL= 'https://www.youcan365.com/patientDeploy/#/'
|
||||||
|
|||||||
16
App.vue
16
App.vue
@ -1,14 +1,18 @@
|
|||||||
<script>
|
<script>
|
||||||
import useAccountStore from "@/store/account.js";
|
import useAccountStore from "@/store/account.js";
|
||||||
import { globalTimChatManager } from "@/utils/tim-chat.js";
|
import {
|
||||||
|
globalTimChatManager
|
||||||
|
} from "@/utils/tim-chat.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
// 需在 pinia 安装后再获取 store,避免 getActivePinia 报错
|
const {
|
||||||
const { account, login, initIMAfterLogin, getDoctorInfo } =
|
account,
|
||||||
useAccountStore();
|
login,
|
||||||
|
initIMAfterLogin,
|
||||||
|
getDoctorInfo
|
||||||
|
} = useAccountStore();
|
||||||
|
|
||||||
// 如果已有缓存的账户信息,尝试初始化 IM,否则重新登录
|
|
||||||
if (account && account.openid) {
|
if (account && account.openid) {
|
||||||
console.log("App Launch: 已有登录信息,初始化 IM");
|
console.log("App Launch: 已有登录信息,初始化 IM");
|
||||||
initIMAfterLogin().catch((err) => {
|
initIMAfterLogin().catch((err) => {
|
||||||
@ -84,6 +88,7 @@ uni-button[type="primary"]:not([disabled]):active {
|
|||||||
.relative {
|
.relative {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.absolute {
|
.absolute {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
@ -212,6 +217,7 @@ uni-button[type="primary"]:not([disabled]):active {
|
|||||||
.pt-5 {
|
.pt-5 {
|
||||||
padding-top: 10rpx;
|
padding-top: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pt-15 {
|
.pt-15 {
|
||||||
padding-top: 30rpx;
|
padding-top: 30rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -368,22 +368,6 @@ const loadConversationList = async () => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("加载会话列表失败:", error);
|
console.error("加载会话列表失败:", error);
|
||||||
|
|
||||||
// 如果是超时或连接错误,提示用户重试
|
|
||||||
if (
|
|
||||||
error.message &&
|
|
||||||
(error.message.includes("超时") || error.message.includes("连接"))
|
|
||||||
) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "网络连接不稳定,请重试",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: error.message || "加载失败,请重试",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -245,11 +245,16 @@ async function tryConsumePendingFollowUpSend() {
|
|||||||
const currentGroupId = normalizeGroupId(groupId.value || "");
|
const currentGroupId = normalizeGroupId(groupId.value || "");
|
||||||
|
|
||||||
// 必须匹配当前会话,才允许发送
|
// 必须匹配当前会话,才允许发送
|
||||||
if (!payloadConversationID || payloadConversationID !== currentConversationID) return;
|
if (!payloadConversationID || payloadConversationID !== currentConversationID)
|
||||||
if (payloadGroupId && currentGroupId && payloadGroupId !== currentGroupId) return;
|
return;
|
||||||
|
if (payloadGroupId && currentGroupId && payloadGroupId !== currentGroupId)
|
||||||
|
return;
|
||||||
|
|
||||||
const messages = Array.isArray(payload.messages) ? payload.messages : [];
|
const messages = Array.isArray(payload.messages) ? payload.messages : [];
|
||||||
const context = payload.context && typeof payload.context === "object" ? payload.context : {};
|
const context =
|
||||||
|
payload.context && typeof payload.context === "object"
|
||||||
|
? payload.context
|
||||||
|
: {};
|
||||||
if (!messages.length) {
|
if (!messages.length) {
|
||||||
uni.removeStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
|
uni.removeStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
|
||||||
return;
|
return;
|
||||||
@ -438,7 +443,9 @@ onLoad((options) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const rawGroupId = decodeQueryValue(options.groupID || "");
|
const rawGroupId = decodeQueryValue(options.groupID || "");
|
||||||
groupId.value = rawGroupId.startsWith("GROUP") ? rawGroupId.replace(/^GROUP/, "") : rawGroupId;
|
groupId.value = rawGroupId.startsWith("GROUP")
|
||||||
|
? rawGroupId.replace(/^GROUP/, "")
|
||||||
|
: rawGroupId;
|
||||||
messageList.value = [];
|
messageList.value = [];
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
if (options.conversationID) {
|
if (options.conversationID) {
|
||||||
@ -872,13 +879,17 @@ onShow(() => {
|
|||||||
checkLoginAndInitTIM();
|
checkLoginAndInitTIM();
|
||||||
} else if (timChatManager.tim && !timChatManager.isLoggedIn) {
|
} else if (timChatManager.tim && !timChatManager.isLoggedIn) {
|
||||||
timChatManager.ensureIMConnection();
|
timChatManager.ensureIMConnection();
|
||||||
} else if (timChatManager.tim && timChatManager.isLoggedIn && chatInfo.value.conversationID) {
|
} else if (
|
||||||
|
timChatManager.tim &&
|
||||||
|
timChatManager.isLoggedIn &&
|
||||||
|
chatInfo.value.conversationID
|
||||||
|
) {
|
||||||
// 页面从后台返回时,重新加载消息列表
|
// 页面从后台返回时,重新加载消息列表
|
||||||
console.log("页面从后台返回,重新加载消息列表");
|
console.log("页面从后台返回,重新加载消息列表");
|
||||||
messageList.value = [];
|
messageList.value = [];
|
||||||
isCompleted.value = false;
|
isCompleted.value = false;
|
||||||
lastFirstMessageId.value = "";
|
lastFirstMessageId.value = "";
|
||||||
loadMessageList();
|
// loadMessageList();
|
||||||
}
|
}
|
||||||
|
|
||||||
startIMMonitoring(30000);
|
startIMMonitoring(30000);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user