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