Răsfoiți Sursa

提交代码

wangxiaogang 3 ani în urmă
părinte
comite
2493e82899

+ 19 - 0
src/web/staticres/common-module/messageCenter/js/detail.js

@@ -26,6 +26,11 @@ var vm = new Vue({
       checkMsgCount(true, 0)
     }
     let indx = getQueryString('type')
+    let nums = getQueryString('num')
+    console.log(indx,nums)
+    if (nums != 0) {
+      this.setRead(indx)
+    }
     this.tit = this.imgSrcs[indx - 1].title
     document.title = this.imgSrcs[indx - 1].title
     this.msgData()
@@ -38,6 +43,20 @@ var vm = new Vue({
     el.scrollTop = el.scrollHeight
   },
   methods: {
+    // 点击分类修改分类下的消息为已读
+    setRead(val) {
+      const _this = this
+      $.ajax({
+        type:'POST',
+        url:'/jymessageCenter/setReadStatus',
+        data: {
+          msgType: val
+        },
+        success:function (res) {
+          console.log(res)
+        }
+      })
+    },
     // 消息详情
     msgData() {
       const _this = this

+ 8 - 25
src/web/staticres/common-module/messageCenter/js/index.js

@@ -22,10 +22,6 @@ var vm = new Vue({
     
   },
   mounted () {
-    // let appType = androidOrIOS()
-    // if (appType == 'ios') {
-      // utils.iosBackRefresh()
-    // }
     iosBackRefresh()
     keepQuest()
   },
@@ -64,20 +60,6 @@ var vm = new Vue({
         }
       })
     },
-    // 点击分类修改分类下的消息为已读
-    setRead(val) {
-      const _this = this
-      $.ajax({
-        type:'POST',
-        url:'/jymessageCenter/setReadStatus',
-        data: {
-          msgType: val
-        },
-        success:function (res) {
-          console.log(res)
-        }
-      })
-    },
     // 点击置顶消息为已读
     topRead(ids) {
       const _this = this
@@ -100,10 +82,12 @@ var vm = new Vue({
       let appType = androidOrIOS()
       if (wxType) {
         if (url.weChatUrl) {
-          location.href = url.weChatUrl
           if (!num) {
             this.topRead(ids)
           }
+          setTimeout(() => {
+            location.href = url.weChatUrl
+          }, 300)
         } else {
           return
         }
@@ -119,10 +103,12 @@ var vm = new Vue({
           }
         } else {
           if (url.iosUrl) {
-            location.href = url.iosUrl
             if (!num) {
               this.topRead(ids)
             }
+            setTimeout(() => {
+              location.href = url.iosUrl
+            }, 300)
           } else {
             return
           }
@@ -136,13 +122,10 @@ var vm = new Vue({
     // 列表消息跳转详情页
     msgDetailed(type, num) {
       let wxType = getType()
-      if (num) {
-        this.setRead(type)
-      }
       if (wxType) {
-          location.href = '/weixin/frontPage/messageCenter/sess/detail?type=' + type
+          location.href = '/weixin/frontPage/messageCenter/sess/detail?type=' + type + '&num=' + num
       } else {
-          location.href = '/jyapp/frontPage/messageCenter/sess/detail?type=' + type
+          location.href = '/jyapp/frontPage/messageCenter/sess/detail?type=' + type + '&num=' + num
       }
     }
   }