2025-10-15

添加字体
项目描述
聊天记录加载修改
This commit is contained in:
2025-10-15 17:22:54 +08:00
parent f53ec45c51
commit ad2ce26c08
29 changed files with 310 additions and 45 deletions

View File

@@ -563,16 +563,21 @@
userId.value = uni.getStorageSync("user").id
// 获取标题
groupAPI.getById(groupId.value).then(res => {
chatTitle.value = res.data.program.linkman.username + "(" + res.data.program.name + ")"
// chatTitle.value = res.data.program.linkman.username + "(" + res.data.program.name + ")"
chatTitle.value = res.data.program.name
})
loadHistoryData() // 最近10条
setTimeout(()=>{
scrollToBottom()
}, 1000)
// 未读变已读
let data = { groupId: groupId.value, userId: userId.value }
messageAPI.unread(data).then(res => {
if (res.code == 200) {
dataList.value = dataList.value.concat(res.data)
}
})
// let data = { groupId: groupId.value, userId: userId.value }
// messageAPI.unread(data).then(res => {
// if (res.code == 200) {
// dataList.value = dataList.value.concat(res.data)
// }
// })
messageAPI.read({ groupId: groupId.value, userId: userId.value })
}
@@ -584,10 +589,10 @@
const loadFix = ref(true)
// 历史记录
const loadHistoryData = () => {
const loadHistoryData = async () => {
params.value.groupId = groupId.value
messageAPI.list(params.value).then(res => {
console.log(res);
await messageAPI.list(params.value).then(res => {
// console.log(res);
if (res.data.list.length != 0) {
res.data.list.forEach(item => {
dataList.value.unshift(item)
@@ -793,6 +798,7 @@
.img-content {
margin-left: 10rpx;
height: 200rpx;
margin-bottom: 30rpx;
}
}