Kaynağa Gözat

提交代码

wangxiaogang 3 yıl önce
ebeveyn
işleme
19f5a77473

+ 7 - 3
src/web/staticres/js/login.js

@@ -395,10 +395,10 @@ function checkCounts() {
     Notification.requestPermission(function(status) {
         console.info(status, '----------')
         if(status === 'granted'){
-            // clearInterval(timer)
+            clearInterval(timer)
             timer = setInterval(function () {
                 $.ajax({
-                    type: 'GET',
+                    type: 'POST',
                     url: '/jymessageCenter/latestNews?t=' + Date.now(),
                     success: function (r) {
                         var num = r.count
@@ -529,8 +529,10 @@ var logic = function(data,num){
 			infoListCss();
 			commonMouseEvent();
             message.init()
+            initIndexMsgList()
             checkCounts()
-		}catch(e){}
+		}catch(e){ console.log(e) }
+        $(".newNotice").css('marginTop', '112px')
 	}
 }
 
@@ -841,6 +843,7 @@ var haslogin = function(num,kyorpn,url){
 				infoListCss();
 				commonMouseEvent();
                 message.init()
+                initIndexMsgList()
                 checkCounts()
 			}catch(e){}
 		}
@@ -852,6 +855,7 @@ var haslogin = function(num,kyorpn,url){
 			if (nosess!=null && (!loginflag)){
 			    openLoginDig();
 			}
+            window.localStorage.setItem('noMesg', 0)
 		}
 		getNewShareId(num,true);
 	})

+ 20 - 7
src/web/staticres/js/pc-message-index.js

@@ -1,23 +1,24 @@
-var temp = '<div :class="{noActive: lists.length == 0}"><div class="list-msg" v-if="lists.length"><div class="l-msg"><div class="words" v-for="item in lists" :key="item.id"><i v-show="item.isRead == 0"></i><h3 :class="{isActive: item.isRead == 1}">@@item.msg_type@@</h3><span @click="titleGoto(item)">@@item.title@@</span><p>@@item.createtime@@</p></div></div><img @click="gotoUrl" class="r-msg" src="/images/pc/msg-arrow.png"></div></div>'
+var temp = '<div class="list-msg" v-if="lists.length"><div class="l-msg"><div class="words" v-for="item in lists" :key="item.id"><i v-show="item.isRead == 0"></i><h3 :class="{isActive: item.isRead == 1}">@@item.msg_type@@</h3><span @click="titleGoto(item)">@@item.title@@</span><p>@@item.createtime@@</p></div></div><img @click="gotoUrl" class="r-msg" src="/images/pc/msg-arrow.png"></div>'
 
-var vm = new Vue({
-  el: '#vue-message-index-pc',
+var vmMesg = new Vue({
+  // el: '#vue-message-index-pc',
   delimiters: ['@@', '@@'],
   template: temp,
   data: function () {
     return {
+      el: '#vue-message-index-pc',
       lists: []
     }
   },
-  created() {
+  mounted: function () {
     this.getList()
   },
   methods: {
     getList() {
       var _this = this
       $.ajax({
-        type:'POST',
-        url:'/jymessageCenter/latestNews',
+        type: 'POST',
+        url: '/jymessageCenter/latestNews?t=' + Date.now(),
         success:function (res) {
           if (res.data) {
             res.data.forEach(v => {
@@ -78,4 +79,16 @@ var vm = new Vue({
       return obj[val]
     }
   }
-})
+})
+
+function initIndexMsgList () {
+  try {
+    var el = vmMesg._data.el
+    var $el = $(el)
+    if ($el.length > 0) {
+      vmMesg.$mount(el)
+    }
+  } catch (error) {
+    console.log(error)
+  }
+}

+ 0 - 1
src/web/staticres/pccss/index.css

@@ -1213,7 +1213,6 @@ body{
   width: 6px;
   height: 6px;
   background: #FF3A20;
-  border: 1px solid #FFFFFF;
   border-radius: 50%;
   margin-right: 9px;
 }

+ 1 - 1
src/web/staticres/public-pc/js/header-nav.js

@@ -94,7 +94,7 @@ function trySelectNav (name) {
 })();
 function docScroll(e){
   var $href = window.location.href;
-  var opa = $(document).scrollTop() / 150
+  var opa = $(document).scrollTop() / 120
   var curTheme =$("#public-nav").attr('data-theme')
   if(opa >= 1){
     setNavTheme('light')

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

@@ -1092,9 +1092,12 @@ $('.carousel-one').carousel({
 })
 //最新公告信息
 var noMesg = window.localStorage.getItem('noMesg')
-if (noMesg == 0 || noMesg == undefined) {
+console.info(noMesg, 'pppppppppppppppp')
+if (noMesg == 0 || noMesg == undefined || !noMesg) {
   $(".newNotice").css('marginTop', '192px')
+  $('#vue-message-index-pc').css('marginTop', '56px')
 } else {
+  $('#vue-message-index-pc').css('marginTop', '28px')
   $(".newNotice").css('marginTop', '112px')
 }