perf: 优化消息窗口

This commit is contained in:
kuaifan 2025-03-30 08:56:22 +08:00
parent 82230d70a5
commit a57740e14e
6 changed files with 22 additions and 32 deletions

View File

@ -227,7 +227,6 @@ export default {
case 'contact': case 'contact':
this.$store.dispatch("openDialogUserid", item.id).then(_ => { this.$store.dispatch("openDialogUserid", item.id).then(_ => {
this.onHide() this.onHide()
this.goForward({name: 'manage-messenger', params: {dialogAction: 'dialog'}})
}).catch(({msg}) => { }).catch(({msg}) => {
$A.modalError(msg || this.$L('打开会话失败')) $A.modalError(msg || this.$L('打开会话失败'))
}); });

View File

@ -182,9 +182,7 @@ export default {
}, },
openDialog() { openDialog() {
this.$store.dispatch("openDialogUserid", this.userid).then(_ => { this.$store.dispatch("openDialogUserid", this.userid).catch(({msg}) => {
this.goForward({name: 'manage-messenger'})
}).catch(({msg}) => {
$A.modalError(msg) $A.modalError(msg)
}); });
}, },

View File

@ -636,28 +636,26 @@ export default {
}) })
if (dialogId) { if (dialogId) {
this.$store.dispatch("openDialog", dialogId) this.$store.dispatch("openDialog", dialogId)
this.aibotShow = false; this.aibotShow = false
} else { return
this.aibotDialogSearchLoad = type;
this.$store.dispatch("call", {
url: 'users/search/ai',
data: {type},
}).then(({data}) => {
this.$store.dispatch("openDialogUserid", data.userid).then(_ => {
if (this.windowOrientation == 'landscape') {
this.goForward({ name: 'manage-messenger' })
}
this.aibotShow = false;
}).catch(({ msg }) => {
$A.modalError(msg)
}).finally(_ => {
this.aibotDialogSearchLoad = '';
});
}).catch(({msg}) => {
this.aibotDialogSearchLoad = '';
$A.messageError(msg || '机器人暂未开启');
});
} }
//
this.aibotDialogSearchLoad = type;
this.$store.dispatch("call", {
url: 'users/search/ai',
data: {type},
}).then(({data}) => {
this.$store.dispatch("openDialogUserid", data.userid).then(_ => {
this.aibotShow = false;
}).catch(({ msg }) => {
$A.modalError(msg)
}).finally(_ => {
this.aibotDialogSearchLoad = '';
});
}).catch(({msg}) => {
this.aibotDialogSearchLoad = '';
$A.messageError(msg || '机器人暂未开启');
});
}, },
// //
onMeeting(name) { onMeeting(name) {

View File

@ -522,7 +522,6 @@ export default {
} else if (this.$parent.$options.name === "Modal") { } else if (this.$parent.$options.name === "Modal") {
this.$parent.close() this.$parent.close()
} }
this.goForward({name: 'manage-messenger'})
}).catch(({msg}) => { }).catch(({msg}) => {
$A.modalError(msg) $A.modalError(msg)
}); });

View File

@ -219,9 +219,7 @@ export default {
onOpenDialog(userid) { onOpenDialog(userid) {
if (this.dialogData.type == 'group' || ![this.dialogData.dialog_user?.userid, this.userId].includes(userid)) { if (this.dialogData.type == 'group' || ![this.dialogData.dialog_user?.userid, this.userId].includes(userid)) {
this.$store.dispatch("openDialogUserid", userid).then(_ => { this.$store.dispatch("openDialogUserid", userid).catch(({msg}) => {
this.goForward({name: 'manage-messenger'})
}).catch(({msg}) => {
$A.modalError(msg) $A.modalError(msg)
}); });
} }

View File

@ -505,9 +505,7 @@ export default {
}, },
openDialog(userid) { openDialog(userid) {
this.$store.dispatch("openDialogUserid", userid).then(_ => { this.$store.dispatch("openDialogUserid", userid).catch(({msg}) => {
this.goForward({name: 'manage-messenger'})
}).catch(({msg}) => {
$A.modalError(msg) $A.modalError(msg)
}); });
}, },