no message
This commit is contained in:
parent
ce36792303
commit
15df2707b5
@ -201,7 +201,7 @@ export default {
|
|||||||
},
|
},
|
||||||
dialogMsgPush(data) {
|
dialogMsgPush(data) {
|
||||||
if (this.natificationHidden && this.natificationReady) {
|
if (this.natificationHidden && this.natificationReady) {
|
||||||
const {userid, type, msg} = data;
|
const {id, dialog_id, type, msg} = data;
|
||||||
let body = '';
|
let body = '';
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'text':
|
case 'text':
|
||||||
@ -213,20 +213,26 @@ export default {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$store.dispatch("getUserBasic", {
|
this._notificationId = id;
|
||||||
userid: userid,
|
this.notificationClass.replaceOptions({
|
||||||
success: (user) => {
|
icon: $A.serverUrl('images/logo.png'),
|
||||||
this.notificationClass.replaceTitle(user.nickname);
|
body: body,
|
||||||
this.notificationClass.replaceOptions({
|
data: data,
|
||||||
icon: user.userimg,
|
tag: "dialog",
|
||||||
body: body,
|
requireInteraction: true
|
||||||
data: data,
|
|
||||||
tag: "dialog",
|
|
||||||
requireInteraction: true
|
|
||||||
});
|
|
||||||
this.notificationClass.userAgreed();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
let dialog = this.dialogs.find((item) => item.id == dialog_id);
|
||||||
|
if (dialog) {
|
||||||
|
this.notificationClass.replaceTitle(dialog.name);
|
||||||
|
this.notificationClass.userAgreed();
|
||||||
|
} else {
|
||||||
|
this.$store.dispatch("getDialogOne", dialog_id).then(({data}) => {
|
||||||
|
if (this._notificationId === id) {
|
||||||
|
this.notificationClass.replaceTitle(data.name);
|
||||||
|
this.notificationClass.userAgreed();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -323,6 +329,7 @@ export default {
|
|||||||
if (this.notificationClass.support) {
|
if (this.notificationClass.support) {
|
||||||
this.notificationClass.notificationEvent({
|
this.notificationClass.notificationEvent({
|
||||||
onclick: ({target}) => {
|
onclick: ({target}) => {
|
||||||
|
console.log("[Notification] Click", target);
|
||||||
this.notificationClass.close();
|
this.notificationClass.close();
|
||||||
window.focus();
|
window.focus();
|
||||||
//
|
//
|
||||||
|
31
resources/assets/js/store/actions.js
vendored
31
resources/assets/js/store/actions.js
vendored
@ -1093,19 +1093,30 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取会话基础信息
|
* 获取单个会话信息
|
||||||
* @param state
|
* @param state
|
||||||
* @param dispatch
|
* @param dispatch
|
||||||
* @param dialog_id
|
* @param dialog_id
|
||||||
|
* @returns {Promise<unknown>}
|
||||||
*/
|
*/
|
||||||
getDialogOne({state, dispatch}, dialog_id) {
|
getDialogOne({state, dispatch}, dialog_id) {
|
||||||
dispatch("call", {
|
return new Promise(function (resolve, reject) {
|
||||||
url: 'dialog/one',
|
if (state.method.runNum(dialog_id) === 0) {
|
||||||
data: {
|
reject({msg: 'Parameter error'});
|
||||||
dialog_id,
|
return;
|
||||||
},
|
}
|
||||||
}).then(result => {
|
dispatch("call", {
|
||||||
dispatch("saveDialog", result.data);
|
url: 'dialog/one',
|
||||||
|
data: {
|
||||||
|
dialog_id,
|
||||||
|
},
|
||||||
|
}).then(result => {
|
||||||
|
dispatch("saveDialog", result.data);
|
||||||
|
resolve(result);
|
||||||
|
}).catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
reject(e);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1381,8 +1392,6 @@ export default {
|
|||||||
(function (msg) {
|
(function (msg) {
|
||||||
const {mode, data} = msg;
|
const {mode, data} = msg;
|
||||||
const {dialog_id} = data;
|
const {dialog_id} = data;
|
||||||
// 更新消息列表
|
|
||||||
dispatch("saveDialogMsg", data)
|
|
||||||
if (mode === "add" || mode === "chat") {
|
if (mode === "add" || mode === "chat") {
|
||||||
// 新增任务消息数量
|
// 新增任务消息数量
|
||||||
dispatch("increaseTaskMsgNum", dialog_id);
|
dispatch("increaseTaskMsgNum", dialog_id);
|
||||||
@ -1399,6 +1408,8 @@ export default {
|
|||||||
}
|
}
|
||||||
state.dialogMsgPush = data;
|
state.dialogMsgPush = data;
|
||||||
}
|
}
|
||||||
|
// 更新消息列表
|
||||||
|
dispatch("saveDialogMsg", data)
|
||||||
// 更新最后消息
|
// 更新最后消息
|
||||||
dispatch("updateDialogLastMsg", data);
|
dispatch("updateDialogLastMsg", data);
|
||||||
})(msgDetail);
|
})(msgDetail);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user