feat:打开聊天会话前标记对话
This commit is contained in:
parent
e20570faa0
commit
5b0a14ae57
|
|
@ -239,6 +239,9 @@ const install = (Vue, vm) => {
|
||||||
// 置顶一个会话
|
// 置顶一个会话
|
||||||
let OverheadOneDialogueApi = (params = {}) =>
|
let OverheadOneDialogueApi = (params = {}) =>
|
||||||
vm.$u.post("api/Dialogue/OverheadOneDialogue", params);
|
vm.$u.post("api/Dialogue/OverheadOneDialogue", params);
|
||||||
|
// 将会话消息标记为已读
|
||||||
|
let ReadMessageApi = (params = {}) =>
|
||||||
|
vm.$u.post("api/Dialogue/ReadMessage", params);
|
||||||
// 删除会话
|
// 删除会话
|
||||||
let DeleteDialogueApi = (params = {}) =>
|
let DeleteDialogueApi = (params = {}) =>
|
||||||
vm.$u.post("api/Dialogue/DeleteDialogue", params);
|
vm.$u.post("api/Dialogue/DeleteDialogue", params);
|
||||||
|
|
@ -309,6 +312,7 @@ const install = (Vue, vm) => {
|
||||||
GetChatHistoryDataApi,
|
GetChatHistoryDataApi,
|
||||||
GetReceiverUserInfoApi,
|
GetReceiverUserInfoApi,
|
||||||
OverheadOneDialogueApi,
|
OverheadOneDialogueApi,
|
||||||
|
ReadMessageApi,
|
||||||
DeleteDialogueApi,
|
DeleteDialogueApi,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -100,18 +100,24 @@ export default {
|
||||||
console.log("切换到标签页:", path, index);
|
console.log("切换到标签页:", path, index);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 打开聊天页面
|
// 打开聊天页面前标记已读
|
||||||
openChat(item) {
|
async openChat(item) {
|
||||||
console.log('打开聊天:', item);
|
console.log("打开聊天:", item);
|
||||||
// uni.navigateTo({
|
|
||||||
// url: `/pages/chat/chat-detail?userId=${item.userId}&name=${item.name}`
|
if (item?.id) {
|
||||||
// });
|
try {
|
||||||
// const id = item.id
|
await this.$u.api.ReadMessageApi({
|
||||||
// const receiverId = item.receiverId
|
dialogueManagementId: item.id,
|
||||||
this.$store.dispatch("selectTeacherChatItem", {
|
});
|
||||||
id: item.id,
|
} catch (err) {
|
||||||
receiverId: item.userId,
|
console.error("[在线咨询] 标记已读失败", err);
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$store.dispatch("selectTeacherChatItem", {
|
||||||
|
id: item.id,
|
||||||
|
receiverId: item.userId,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 加载聊天列表
|
// 加载聊天列表
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue