瀏覽代碼

feat:消息相关接口添加/jyapi代理

zhangsiya 2 年之前
父節點
當前提交
11a03a1776
共有 2 個文件被更改,包括 29 次插入26 次删除
  1. 8 7
      src/web/staticres/frontRouter/pc/mesgCenter/js/index-pc.js
  2. 21 19
      src/web/staticres/js/pc-message-new.js

+ 8 - 7
src/web/staticres/frontRouter/pc/mesgCenter/js/index-pc.js

@@ -135,12 +135,13 @@ var vm = new Vue({
     // 消息统计
     clickMesg(logid) {
       $.ajax({
-        type: 'GET',
-        url: '/jymessageCenter/clickMessage',
-        data: {
-          msgLogId: logid,
-          platform: '1'
-        },
+        type: 'POST',
+        url: '/jyapi/messageCenter/msgOpenLog',
+        data: JSON.stringify({
+          msgLogId: logid ? Number(logid) : null,
+          platform: 1
+        }),
+        headers: {'Content-Type': 'application/json'},
         success: function () { }
       })
     },
@@ -149,7 +150,7 @@ var vm = new Vue({
         return
       }
       window.__canNextReadMessageStatus = true
-      // this.clickMesg(item.msgLogid)
+      this.clickMesg(item.msgLogId)
       if (item.isRead == 0) {
         this.readed(item.id, item.link)
       } else {

+ 21 - 19
src/web/staticres/js/pc-message-new.js

@@ -56,29 +56,30 @@ var vmMesg = new Vue({
         error:function () {}
       })
     },
-    readed: function(ids, type, url) {
+    readed: function(id, url) {
       var _this = this
       $.ajax({
         type: 'POST',
-        url:'/jymessageCenter/markRead',
-        data: {
-          msgId: ids,
-          msgType: type
-        },
+        url:'/jyapi//messageCenter/markRead',
+        data: JSON.stringify({
+          msgId: id ? Number(id) : null
+        }),
+        dataType: 'json',
+        headers: {'Content-Type': 'application/json'},
         success:function () {
-          if (url) {
-            location.href = url
-          } else {
-            location.href = '/swordfish/frontPage/messageCenter/sess/index'
-          }
+          // if (url) {
+          //   location.href = url
+          // } else {
+          //   location.href = '/swordfish/frontPage/messageCenter/sess/index'
+          // }
         }
       })
     },
     titleGoto: function(item) {
       // 消息统计
-      this.clickMessage(item.msgLogid)
+      this.clickMessage(item.msgLogId)
       if (item.isRead == 0) {
-        this.readed(item.id, item.msg_type, item.link)
+        this.readed(item.id, item.link)
       } else {
         if(item.link) {
           // 跳转链接
@@ -102,14 +103,15 @@ var vmMesg = new Vue({
       return obj[val]
     },
     // 消息统计
-   clickMessage(msgLogid) {
+   clickMessage(msgLogId) {
       $.ajax({
         type:'POST',
-        url:'/jymessageCenter/clickMessage',
-        data: {
-          msgLogId: msgLogid,
-          platform: '1'
-        },
+        url:'/jyapi/messageCenter/msgOpenLog',
+        headers: {'Content-Type': 'application/json'},
+        data: JSON.stringify({
+          msgLogId: msgLogId ? Number(msgLogId) : null,
+          platform: 1
+        }),
         success:function () {}
       })
     }