no message

This commit is contained in:
kuaifan 2021-06-24 22:09:03 +08:00
parent 6356c99543
commit ce36792303
3 changed files with 18 additions and 6 deletions

View File

@ -220,6 +220,8 @@ export default {
this.notificationClass.replaceOptions({ this.notificationClass.replaceOptions({
icon: user.userimg, icon: user.userimg,
body: body, body: body,
data: data,
tag: "dialog",
requireInteraction: true requireInteraction: true
}); });
this.notificationClass.userAgreed(); this.notificationClass.userAgreed();
@ -320,11 +322,21 @@ export default {
this.notificationClass = new notificationKoro(this.$L("打开通知成功")); this.notificationClass = new notificationKoro(this.$L("打开通知成功"));
if (this.notificationClass.support) { if (this.notificationClass.support) {
this.notificationClass.notificationEvent({ this.notificationClass.notificationEvent({
onclick: () => { onclick: ({target}) => {
window.focus();
this.notificationClass.close(); this.notificationClass.close();
this.goForward({path: '/manage/messenger'}); window.focus();
this.$store.dispatch("openDialogUserid", this.dialogMsgPush.userid); //
const {tag, data} = target;
if (tag == 'dialog') {
if (!$A.isJson(data)) {
return;
}
this.goForward({path: '/manage/messenger'});
if (data.dialog_id) {
this.$store.state.method.setStorage("messenger::dialogId", data.dialog_id)
this.$store.state.dialogOpenId = data.dialog_id;
}
}
}, },
}); });
this.notificationPermission(); this.notificationPermission();

View File

@ -147,7 +147,6 @@ export default {
} }
}, },
dialogOpenId(id) { dialogOpenId(id) {
this.$store.state.method.setStorage("messenger::dialogId", id)
this.dialogId = id; this.dialogId = id;
} }
}, },

View File

@ -1128,6 +1128,7 @@ export default {
}, },
}).then(result => { }).then(result => {
dispatch("saveDialog", result.data); dispatch("saveDialog", result.data);
state.method.setStorage("messenger::dialogId", result.data.id);
state.dialogOpenId = result.data.id; state.dialogOpenId = result.data.id;
resolve(result); resolve(result);
}).catch(e => { }).catch(e => {
@ -1381,7 +1382,6 @@ export default {
const {mode, data} = msg; const {mode, data} = msg;
const {dialog_id} = data; const {dialog_id} = data;
// 更新消息列表 // 更新消息列表
state.dialogMsgPush = data;
dispatch("saveDialogMsg", data) dispatch("saveDialogMsg", data)
if (mode === "add" || mode === "chat") { if (mode === "add" || mode === "chat") {
// 新增任务消息数量 // 新增任务消息数量
@ -1397,6 +1397,7 @@ export default {
// 移动到首位 // 移动到首位
dispatch("moveDialogTop", dialog_id); dispatch("moveDialogTop", dialog_id);
} }
state.dialogMsgPush = data;
} }
// 更新最后消息 // 更新最后消息
dispatch("updateDialogLastMsg", data); dispatch("updateDialogLastMsg", data);