From 63cd416b4cd316623136d8d012aea346abbd7556 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Wed, 15 Jan 2025 14:34:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0iws=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=B6=88=E6=81=AF=E5=88=97=E8=A1=A8=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=95=B0=E6=8D=AE=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/manifest.json | 2 +- src/pages/message/index.vue | 19 +++++++++++++++---- src/services/message/index.js | 10 ++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/manifest.json b/src/manifest.json index 75bc553..1c5a678 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -74,7 +74,7 @@ "vueVersion": "3", "h5": { "router": { - "base": "/h5portal/", + "base": "/iws/h5portal/", "mode": "history" }, "title": "安徽机具租赁商城" diff --git a/src/pages/message/index.vue b/src/pages/message/index.vue index 895c811..dd69ea5 100644 --- a/src/pages/message/index.vue +++ b/src/pages/message/index.vue @@ -64,13 +64,18 @@ import { computed, ref, reactive } from 'vue' import { onHide, onLoad, onShow, onUnload } from '@dcloudio/uni-app' import { useMemberStore } from '@/stores/index.js' -import { getMessageListAPI, isReadMessageAllAPI } from '@/services/message/index.js' +import { + getMessageListAPI, + isReadMessageAllAPI, + getMessageListAllAPI, +} from '@/services/message/index.js' const memberStore = useMemberStore() const userName = ref('') const userAccount = ref('') const userCompanyId = ref('') const messageInterval = ref(null) const messageList = ref([]) +const messageListAll = ref([]) onLoad(() => { userName.value = memberStore.userInfo.nickName @@ -86,7 +91,9 @@ onHide(() => { }) onShow(() => { - getMessageListData() + Promise.all([getMessageListAllData()]).then(() => { + getMessageListData() + }) messageInterval.value = setInterval(() => { getMessageListData() }, 3000) @@ -116,12 +123,16 @@ const onClearNoRead = async () => { } }) const res = await isReadMessageAllAPI(isReadParams) - console.log(res, '已读结果') + // console.log(res, '已读结果') } const getMessageListData = async () => { const { data: res } = await getMessageListAPI() - messageList.value = res + messageList.value = [...new Set([...messageListAll.value, ...res])] +} +const getMessageListAllData = async () => { + const { data: res } = await getMessageListAllAPI() + messageListAll.value = res } const onJumpToMessagePages = (item) => { const { toCompany, toUser, toCompanyName, fromCompany, fromCompanyName, fromUser } = item diff --git a/src/services/message/index.js b/src/services/message/index.js index 3d6b36e..1563338 100644 --- a/src/services/message/index.js +++ b/src/services/message/index.js @@ -30,6 +30,16 @@ export const getMessageListAPI = (data) => { data, }) } +/** + * 消息 消息列表 历史列表所有 + */ +export const getMessageListAllAPI = (data) => { + return http({ + method: 'GET', + url: '/material-mall/bm_message/listFromDB', + data, + }) +} /** * 消息 消息已读 */