Browse Source

提交代码

wangxiaogang 3 năm trước cách đây
mục cha
commit
6223a5e9a5

+ 7 - 6
src/jfw/modules/app/src/web/staticres/jyapp/js/message-index.js

@@ -40,16 +40,17 @@ var vm = new Vue({
           msgType: type
         },
         success:function () {
+          try {
+            JyObj.refreshAppointTab('search', 0)
+            JyObj.refreshAppointTab('message', 1)
+          } catch (e) {
+            console.log(e)
+          }
           if (url) {
             location.href = url
           } else {
             _this.getList()
           }
-          try {
-            JyObj.refreshAppointTab('search', 1)
-          } catch (e) {
-            console.log(e)
-          }
         }
       })
     },
@@ -59,7 +60,7 @@ var vm = new Vue({
       let urls = item.url
       if (wxType) {
         if (item.isRead == 0) {
-          this.topRead(item.id, urls.weChatUrl, item.msg_type)
+          this.topRead(item.id, urls.weChatUrl, item.msg_type, wxType)
         } else {
           if (urls.weChatUrl) {
             //链接中如果是www.jianyu360.cn域名,微信中会唤起app,该用window.open

+ 14 - 17
src/web/staticres/js/login.js

@@ -419,25 +419,21 @@ function checkCounts() {
                     url: '/jymessageCenter/lastNewMessage?t=' + Date.now(),
                     success: function (r) {
                         var num = r.count
-                        // var isMsg = window.localStorage.getItem('noMesg')
-                        // if (num !== Number(isMsg)) {
-                            var datas = r.data
-                            // if (!$.isEmptyObject(datas)) {
-                            if (datas = {} || datas == '') {
-                                return
-                            } else {
-                                var notify = new Notification(datas.title,{
-                                    icon: '../images/t3_new.jpg',
-                                    body: datas.content
-                                })
+                        var datas = r.data
+                        if (datas = {} || datas == '') {
+                            return
+                        } else {
+                            var notify = new Notification(datas.title,{
+                                icon: '../images/t3_new.jpg',
+                                body: datas.content
+                            })
 
-                                // 点击时桌面消息时触发
-                                notify.onclick = () => {
-                                    toReaded(r.data.id, r.data.msg_type, r.data.link)
-                                }
+                            // 点击时桌面消息时触发
+                            notify.onclick = () => {
+                                toReaded(r.data.id, r.data.msg_type, r.data.link)
                             }
-                            localStorage.setItem('noMesg', num)
-                        // }
+                        }
+                        localStorage.setItem('noMesg', num)
                     },
                     error: function () {
                         clearInterval(msgTimer)
@@ -550,6 +546,7 @@ var logic = function(data,num){
             checkCounts()
             initIndexMsgList()
         $(".newNotice").css('marginTop', '112px')
+        $('.jy-banner').css('marginTop', '28px')
 		}catch(e){ console.log(e) }
 	}
 }

+ 5 - 1
src/web/staticres/js/pc-message-index.js

@@ -29,7 +29,11 @@ var vmMesg = new Vue({
             });
             _this.lists = res.data
             // _this.lists = []
-            window.localStorage.setItem('noMesg', res.count)
+            if (_this.lists.length == 0) {
+              window.localStorage.setItem('noMesg', 0)
+            } else {
+              window.localStorage.setItem('noMesg', _this.lists.length)
+            }
             // window.localStorage.setItem('noMesg', 0)
           } else {
             window.localStorage.setItem('noMesg', 0)

+ 1 - 1
src/web/templates/pc/index.html

@@ -1093,7 +1093,7 @@ $('.carousel-one').carousel({
 //最新公告信息
 var noMesg = window.localStorage.getItem('noMesg')
 console.log(noMesg, '===============')
-if (noMesg == 0 || noMesg == undefined || noMesg == null || !noMesg) {
+if (noMesg == 0 || noMesg == undefined || noMesg == null) {
   $('.jy-banner').css('marginTop', '56px')
   $(".newNotice").css('marginTop', '192px')
 } else {