diff --git a/components.d.ts b/components.d.ts index 0dae289..5202040 100644 --- a/components.d.ts +++ b/components.d.ts @@ -30,6 +30,8 @@ declare module 'vue' { LoginMessage: typeof import('./src/components/talk/message/LoginMessage.vue')['default'] Message: typeof import('./src/components/x-message/message/index.vue')['default'] MixedMessage: typeof import('./src/components/talk/message/MixedMessage.vue')['default'] + NButton: typeof import('naive-ui')['NButton'] + NIcon: typeof import('naive-ui')['NIcon'] PageAnimation: typeof import('./src/components/page-animation/index.vue')['default'] RevokeMessage: typeof import('./src/components/talk/message/RevokeMessage.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/src/main.js b/src/main.js index 5a9a805..160aa0a 100644 --- a/src/main.js +++ b/src/main.js @@ -69,6 +69,7 @@ export function createApp() { window.openUniPushMsg = (msg) => { console.log("=====点击通知栏消息") let pushMsg = JSON.parse(decodeURIComponent(msg)) + console.log("=====pushMsg",pushMsg) //由于弹窗前处理了不该弹窗的场景,因此这里弹窗可以一并处理 //也就是都跳转到聊天页面 const talkStore = useTalkStore() diff --git a/src/pages/chatSettings/index.vue b/src/pages/chatSettings/index.vue index fb3b9da..370556f 100644 --- a/src/pages/chatSettings/index.vue +++ b/src/pages/chatSettings/index.vue @@ -504,8 +504,7 @@ const toSearchByConditionPage = (flag) => { condition = 'link' } uni.navigateTo({ - url: - '/pages/search/searchByCondition/index?condition=' + condition + url: '/pages/search/searchByCondition/index?condition=' + condition, }) } } @@ -644,7 +643,8 @@ const toSearchPage = () => { '/pages/search/moreResult/moreResultDetail?talk_type=' + dialogueParams.type + '&receiver_id=' + - dialogueParams.receiver_id, + dialogueParams.receiver_id + + '&hideFirstRecord=1', }) } diff --git a/src/pages/index/components/chatItem.vue b/src/pages/index/components/chatItem.vue index 0558a11..de994cd 100644 --- a/src/pages/index/components/chatItem.vue +++ b/src/pages/index/components/chatItem.vue @@ -1,43 +1,50 @@ diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index b7f90fa..4122846 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -125,6 +125,7 @@ import { ref, watch, computed } from 'vue' import { onShow, onLoad } from '@dcloudio/uni-app' import { useChatList } from '@/store/chatList/index.js' import { useAuth } from '@/store/auth' +import { ServeClearTalkUnreadNum } from '@/api/chat' import { useTalkStore, useUserStore, useDialogueStore } from '@/store' import chatItem from './components/chatItem.vue' import addCircle from '@/static/image/chatList/addCircle.png' @@ -237,21 +238,23 @@ onLoad((options) => { if (items?.value?.length > 0) { items.value.forEach((openSession) => { if (openSession.index_name === options?.openSessionIndexName) { - dialogueStore.setDialogue(openSession) - if (openSession.unread_num > 0) { - ServeClearTalkUnreadNum({ - talk_type: openSession.talk_type, - receiver_id: openSession.receiver_id, - }).then(() => { - talkStore.updateItem({ - index_name: openSession.index_name, - unread_num: 0, + setTimeout(() => { + dialogueStore.setDialogue(openSession) + if (openSession.unread_num > 0) { + ServeClearTalkUnreadNum({ + talk_type: openSession.talk_type, + receiver_id: openSession.receiver_id, + }).then(() => { + talkStore.updateItem({ + index_name: openSession.index_name, + unread_num: 0, + }) }) + } + uni.navigateTo({ + url: `/pages/dialog/index?sessionId=${openSession.id}`, }) - } - uni.navigateTo({ - url: `/pages/dialog/index?sessionId=${openSession.id}`, - }) + }, 500) } }) } diff --git a/src/pages/search/components/searchList.vue b/src/pages/search/components/searchList.vue index 02fc90f..fea0221 100644 --- a/src/pages/search/components/searchList.vue +++ b/src/pages/search/components/searchList.vue @@ -36,7 +36,10 @@ -
+
userStore.uid), //当前用户id + hideFirstRecord: false, //是否隐藏前缀及搜索群/用户主体信息 }) onLoad((options) => { @@ -55,6 +57,10 @@ onLoad((options) => { } console.log(JSON.parse(decodeURIComponent(state.apiParams))) + + if (options.hideFirstRecord) { + state.hideFirstRecord = options.hideFirstRecord === '1' ? true : false + } }) //分页查询时,最后一条id变化 @@ -116,7 +122,7 @@ const clickSearchItem = ( }) } else { uni.navigateTo({ - url: '/pages/dialog/index?msgInfo=' + res, + url: '/pages/dialog/index?msgInfo=' + res + '&keepDialogInfo=1', }) } }