@@ -1329,6 +1329,13 @@ if (strpos($_SERVER['HTTP_USER_AGENT'], "Triden")) {
},
mounted() {
let that = this;
+ // 重写notify,设置默认偏移
+ const notifyFunc = this.$notify;
+ that.$notify = function (obj) {
+ notifyFunc(
+ Object.assign({offset: 70}, obj)
+ )
+ }
document.addEventListener('paste', that.getClipboardFiles);
that.emojiList = [];
for(let i=1;i<=30;i++){
@@ -2266,11 +2273,13 @@ if (strpos($_SERVER['HTTP_USER_AGENT'], "Triden")) {
});
}
if (!isNotificated) {
+ console.log("@", obj)
that.$notify({
title: that.urldecode(obj.user.user_name) + "@了你:",
- message: that.urldecode(obj.content),
+ message: that.urldecode(obj.content) + `[查看]`,
duration: 0,
- offset: 70,
+ dangerouslyUseHTMLString: true
+ // offset: 70,
});
}
}
@@ -2281,7 +2290,8 @@ if (strpos($_SERVER['HTTP_USER_AGENT'], "Triden")) {
that.$notify({
title: that.urldecode(obj.user.user_name) + "说:",
message: that.urldecode(obj.content),
- duration: 5000
+ duration: 5000,
+ // offset: 70,
});
}
}
diff --git a/js/scroll-helper.js b/js/scroll-helper.js
index 0777799f8f40edcee888ec2081941e1ac978c8d4..36ff60c5d43d50f4af74f46c1013e8b538fc22ca 100755
--- a/js/scroll-helper.js
+++ b/js/scroll-helper.js
@@ -23,6 +23,27 @@ const scrollFuncs = {
} else {
vue.showScrollToBottomBtn = false;
}
+ },
+
+ /**
+ * 滚动到指定消息
+ * @param {*} msgid
+ */
+ scrollToChat: function (msgid) {
+ const chatRoom = document.querySelector('#chat_room_history');
+ const chat = document.querySelector(`#msgid_${msgid}`);
+ chatRoom.scrollTop = chat.offsetTop - 100;
+ chat.style.backgroundColor = 'rgba(251, 114, 153,0.1)';
+ chat.style.transition = 'all 600ms';
+ setTimeout(() => {
+ chat.style.transition = 'all 2000ms';
+ chat.style.backgroundColor = 'transparent';
+ setTimeout(() => {
+ chat.style.transition = 'unset';
+ }, 2000);
+ }, 3000);
}
+
+
}
\ No newline at end of file