diff --git a/resources/assets/js/components/Mobile/Notification.vue b/resources/assets/js/components/Mobile/Notification.vue
index 1498291cf..e1f7e682a 100644
--- a/resources/assets/js/components/Mobile/Notification.vue
+++ b/resources/assets/js/components/Mobile/Notification.vue
@@ -6,7 +6,7 @@
@click.stop="onClick"
@touchstart="onTouchstart"
@touchmove="onTouchmove">
-
+
{{desc}}
@@ -18,6 +18,7 @@ export default {
data() {
return {
userid: 0,
+ title: '',
desc: '',
duration: 6000,
callback: null,
@@ -40,6 +41,7 @@ export default {
return;
}
this.userid = config.userid || 0;
+ this.title = config.title || "";
this.desc = config.desc || "";
this.duration = typeof config.duration === "number" ? config.duration : 6000;
this.callback = typeof config.callback === "function" ? config.callback : null;
diff --git a/resources/assets/js/components/UserAvatar.vue b/resources/assets/js/components/UserAvatar.vue
index a93dbce43..c34139fb3 100755
--- a/resources/assets/js/components/UserAvatar.vue
+++ b/resources/assets/js/components/UserAvatar.vue
@@ -27,7 +27,7 @@
- {{user.nickname}}
+ {{nameText || user.nickname}}
@@ -56,6 +56,10 @@
type: Boolean,
default: false
},
+ nameText: {
+ type: String,
+ default: null // showName = true 时有效,留空就显示会员昵称
+ },
tooltipDisabled: {
type: Boolean,
default: false
diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue
index 773ad7c41..b27fc42d3 100644
--- a/resources/assets/js/pages/manage.vue
+++ b/resources/assets/js/pages/manage.vue
@@ -485,6 +485,7 @@ export default {
...mapState([
'userInfo',
'userIsAdmin',
+ 'cacheUserBasic',
'cacheTasks',
'cacheDialogs',
'cacheProjects',
@@ -933,7 +934,7 @@ export default {
return; // 窗口激活且最后打开的会话是通知的会话时不通知
}
//
- const {id, dialog_id, type, msg, userid} = data;
+ const {id, dialog_id, dialog_type, type, msg, userid} = data;
if (userid == this.userId) {
return; // 自己的消息不通知
}
@@ -949,11 +950,37 @@ export default {
return;
}
this.__notificationId = id;
- const notificationFunc = (title) => {
+ const notificationFuncA = (title) => {
+ if (dialog_type === 'group') {
+ let tempUser = this.cacheUserBasic.find(item => item.userid == userid);
+ if (tempUser) {
+ notificationFuncB(`${title} (${tempUser.nickname})`)
+ } else {
+ this.$store.dispatch("call", {
+ url: 'users/basic',
+ data: {
+ userid: [userid]
+ },
+ checkRole: false
+ }).then(({data}) => {
+ tempUser = data.find(item => item.userid == userid);
+ if (tempUser) {
+ notificationFuncB(`${title} (${tempUser.nickname})`)
+ }
+ }).catch(_ => {
+ notificationFuncB(title)
+ });
+ }
+ } else {
+ notificationFuncB(title)
+ }
+ }
+ const notificationFuncB = (title) => {
if (this.__notificationId === id) {
if (this.$isEEUiApp) {
this.$refs.mobileNotification.open({
userid: userid,
+ title,
desc: body,
callback: () => {
this.goForward({name: 'manage-messenger'});
@@ -975,11 +1002,9 @@ export default {
}
const dialog = this.cacheDialogs.find((item) => item.id == dialog_id);
if (dialog) {
- notificationFunc(dialog.name)
+ notificationFuncA(dialog.name)
} else {
- this.$store.dispatch("getDialogOne", dialog_id).then(({data}) => {
- notificationFunc(data.name)
- }).catch(() => {})
+ this.$store.dispatch("getDialogOne", dialog_id).then(({data}) => notificationFuncA(data.name)).catch(() => {})
}
},