diff --git a/pages/home/message-home.vue b/pages/home/message-home.vue index 654726d..b4cc82e 100644 --- a/pages/home/message-home.vue +++ b/pages/home/message-home.vue @@ -1,696 +1,697 @@ \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue index d920ee8..6faa046 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -5,7 +5,13 @@ 生命全周期健康管理伙伴 - - - - - - - - - - - {{ + + + + + + + + + + + {{ conversation.unreadCount > 99 ? "99+" : conversation.unreadCount }} - - + + - - - - {{ formatPatientName(conversation) }} - - {{ formatPatientInfo(conversation) }} - - - {{ + + + + {{ formatPatientName(conversation) }} + + {{ formatPatientInfo(conversation) }} + + + {{ formatMessageTime(conversation.lastMessageTime) }} - - - {{ + + + {{ conversation.lastMessage || "暂无消息" }} - - - + + + - - - - {{ + + + + 医生信息未获取,请稍后重试 + + + + {{ activeTab === "processing" ? "暂无处理中的会话" : "暂无已结束的会话" }} - + - - - {{ + + + {{ loadingMore ? "加载中..." : "上拉加载更多" }} - - - + + + \ No newline at end of file diff --git a/store/account.js b/store/account.js index eb46acb..a618b95 100644 --- a/store/account.js +++ b/store/account.js @@ -41,6 +41,7 @@ export default defineStore("accountStore", () => { async function loginByCode(phoneCode = '') { try { + const { code } = await uni.login({ appid, provider: "weixin", @@ -61,13 +62,12 @@ export default defineStore("accountStore", () => { } account.value = res.data; openid.value = res.data.openid; - // 持久化账户信息 cache.set(CACHE_KEYS.ACCOUNT, res.data); cache.set(CACHE_KEYS.OPENID, res.data.openid); // 登录成功后初始化腾讯IM - await getDoctorInfo(openid.value); + await getDoctorInfo({ openid: openid.value }); await initIMAfterLogin(); return res.data } @@ -120,13 +120,13 @@ export default defineStore("accountStore", () => { throw new Error('无法获取用户ID'); } } - + const success = await initGlobalTIM(userID); if (!success) { console.error('initGlobalTIM 返回失败'); return false; } - + isIMInitialized.value = true; return true; } catch (error) { diff --git a/utils/send-message-helper.js b/utils/send-message-helper.js index 0c86122..9790add 100644 --- a/utils/send-message-helper.js +++ b/utils/send-message-helper.js @@ -283,7 +283,6 @@ function generateSendLink(survey, answerId, customerId, customerName, sendSurvey const { corpId, userId } = context; const isSystem = survey.createBy === 'system'; let url = ''; - debugger if (isSystem) { // 系统问卷:使用 VITE_SURVEY_URL url = `${env?.MP_SURVEY_URL}?corpId=${corpId}&surveryId=${survey.surveryId}&memberId=${customerId}&sendSurveyId=${sendSurveyId}&userId=${userId}`; diff --git a/utils/tim-chat.js b/utils/tim-chat.js index cd88a20..158e904 100644 --- a/utils/tim-chat.js +++ b/utils/tim-chat.js @@ -1030,6 +1030,11 @@ class TimChatManager { // 获取群聊列表 getGroupList() { return new Promise((resolve, reject) => { + // 检查userId是否存在,不存在则不需要初始化 + if (!this.currentUserID) { + return + } + // 如果 TIM 实例不存在,等待初始化 if (!this.tim) { console.log('TIM实例不存在,等待初始化...')