增加iws配置以及消息列表历史数据增加

This commit is contained in:
BianLzhaoMin 2025-01-15 14:34:47 +08:00
parent bf2ad92e64
commit 63cd416b4c
3 changed files with 26 additions and 5 deletions

View File

@ -74,7 +74,7 @@
"vueVersion": "3",
"h5": {
"router": {
"base": "/h5portal/",
"base": "/iws/h5portal/",
"mode": "history"
},
"title": "安徽机具租赁商城"

View File

@ -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

View File

@ -30,6 +30,16 @@ export const getMessageListAPI = (data) => {
data,
})
}
/**
* 消息 消息列表 历史列表所有
*/
export const getMessageListAllAPI = (data) => {
return http({
method: 'GET',
url: '/material-mall/bm_message/listFromDB',
data,
})
}
/**
* 消息 消息已读
*/