|
@@ -1,5 +1,5 @@
|
|
|
// 点击置顶消息为已读
|
|
|
-function topRead(ids, type) {
|
|
|
+function topRead(ids, type, url) {
|
|
|
$.ajax({
|
|
|
type:'POST',
|
|
|
url:'/jymessageCenter/markRead',
|
|
@@ -7,20 +7,36 @@ function topRead(ids, type) {
|
|
|
msgId: ids,
|
|
|
msgType: type
|
|
|
},
|
|
|
- success:function (res) {
|
|
|
+ success:function () {
|
|
|
message.checkMessage()
|
|
|
message.checkOpened()
|
|
|
+ if (url) {
|
|
|
+ window.location.href = url
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
+}
|
|
|
+// 消息统计
|
|
|
+function clickMesge(msgLogid) {
|
|
|
+ $.ajax({
|
|
|
+ type:'POST',
|
|
|
+ url:'/jymessageCenter/clickMessage',
|
|
|
+ data: {
|
|
|
+ msgLogId: msgLogid,
|
|
|
+ platform: '1'
|
|
|
+ },
|
|
|
+ success:function () {}
|
|
|
+ })
|
|
|
+}
|
|
|
// 消息悬浮窗列表跳转详情页
|
|
|
-function linked (ids, url, num, type) {
|
|
|
- console.info(ids, url, num, type)
|
|
|
- if (url) {
|
|
|
- window.location.href = url
|
|
|
- }
|
|
|
+function linked (ids, url, num, type, msgLogid) {
|
|
|
+ this.clickMesge(msgLogid)
|
|
|
if (num == 0) {
|
|
|
- topRead(ids, type)
|
|
|
+ topRead(ids, type, url)
|
|
|
+ } else {
|
|
|
+ if (url) {
|
|
|
+ window.location.href = url
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
function Message() {
|
|
@@ -124,17 +140,17 @@ function Message() {
|
|
|
var temp = ''
|
|
|
if (lasts) {
|
|
|
if (lasts.isRead == 0) {
|
|
|
- temp += '<div id="firsted" class="m-li" onclick="linked(\''+lasts.id+'\',\''+lasts.link+'\',\''+lasts.isRead+'\',\''+lasts.msg_type+'\')"><div class="lis-cont"><img src="/images/pc/'+imgArrs[lasts.msg_type]+'@2x.png"><i class="dots"></i><div class="r-lis"><div class="title"><span>'+lasts.title+'</span><span>'+dateMatter(lasts.createtime)+'</span></div><p>'+lasts.content+'</p></div></div></div>'
|
|
|
+ temp += '<div id="firsted" class="m-li" onclick="linked(\''+lasts.id+'\',\''+lasts.link+'\',\''+lasts.isRead+'\',\''+lasts.msg_type+'\',\''+lasts.msgLogId+'\')"><div class="lis-cont"><img src="/images/pc/'+imgArrs[lasts.msg_type]+'@2x.png"><i class="dots"></i><div class="r-lis"><div class="title"><span>'+lasts.title+'</span><span>'+dateMatter(lasts.createtime)+'</span></div><p>'+lasts.content+'</p></div></div></div>'
|
|
|
} else {
|
|
|
- temp += '<div id="firsted" class="m-li" onclick="linked(\''+lasts.id+'\',\''+lasts.link+'\',\''+lasts.isRead+'\',\''+lasts.msg_type+'\')"><div class="lis-cont"><img src="/images/pc/'+imgArrs[lasts.msg_type]+'@2x.png"><div class="r-lis"><div class="title"><span>'+lasts.title+'</span><span>'+dateMatter(lasts.createtime)+'</span></div><p>'+lasts.content+'</p></div></div></div>'
|
|
|
+ temp += '<div id="firsted" class="m-li" onclick="linked(\''+lasts.id+'\',\''+lasts.link+'\',\''+lasts.isRead+'\',\''+lasts.msg_type+'\',\''+lasts.msgLogId+'\')"><div class="lis-cont"><img src="/images/pc/'+imgArrs[lasts.msg_type]+'@2x.png"><div class="r-lis"><div class="title"><span>'+lasts.title+'</span><span>'+dateMatter(lasts.createtime)+'</span></div><p>'+lasts.content+'</p></div></div></div>'
|
|
|
}
|
|
|
}
|
|
|
if (lists) {
|
|
|
for (var i = 0; i < lists.length; i++) {
|
|
|
if (lists[i].isRead == 0) {
|
|
|
- temp += '<div class="m-li" onclick="linked(\''+lists[i].id+'\',\''+lists[i].link+'\',\''+lists[i].isRead+'\',\''+lists[i].msg_type+'\')"><div class="lis-cont"><img src="/images/pc/'+imgArrs[lists[i].msg_type]+'@2x.png"><i class="dots"></i><div class="r-lis"><div class="title"><span>'+lists[i].title+'</span><span>'+dateMatter(lists[i].createtime)+'</span></div><p>'+lists[i].content+'</p></div></div></div>'
|
|
|
+ temp += '<div class="m-li" onclick="linked(\''+lists[i].id+'\',\''+lists[i].link+'\',\''+lists[i].isRead+'\',\''+lists[i].msg_type+'\',\''+lists[i].msgLogId+'\')"><div class="lis-cont"><img src="/images/pc/'+imgArrs[lists[i].msg_type]+'@2x.png"><i class="dots"></i><div class="r-lis"><div class="title"><span>'+lists[i].title+'</span><span>'+dateMatter(lists[i].createtime)+'</span></div><p>'+lists[i].content+'</p></div></div></div>'
|
|
|
} else {
|
|
|
- temp += '<div class="m-li" onclick="linked(\''+lists[i].id+'\',\''+lists[i].link+'\',\''+lists[i].isRead+'\',\''+lists[i].msg_type+'\')"><div class="lis-cont"><img src="/images/pc/'+imgArrs[lists[i].msg_type]+'@2x.png"><div class="r-lis"><div class="title"><span>'+lists[i].title+'</span><span>'+dateMatter(lists[i].createtime)+'</span></div><p>'+lists[i].content+'</p></div></div></div>'
|
|
|
+ temp += '<div class="m-li" onclick="linked(\''+lists[i].id+'\',\''+lists[i].link+'\',\''+lists[i].isRead+'\',\''+lists[i].msg_type+'\',\''+lists[i].msgLogId+'\')"><div class="lis-cont"><img src="/images/pc/'+imgArrs[lists[i].msg_type]+'@2x.png"><div class="r-lis"><div class="title"><span>'+lists[i].title+'</span><span>'+dateMatter(lists[i].createtime)+'</span></div><p>'+lists[i].content+'</p></div></div></div>'
|
|
|
}
|
|
|
}
|
|
|
}
|