瀏覽代碼

提交代码

wangxiaogang 3 年之前
父節點
當前提交
55f8564f3b

+ 8 - 4
src/web/staticres/common-module/messageCenter/js/detail.js

@@ -21,15 +21,19 @@ var vm = new Vue({
     }
   },
   created() {
-    let wxType = getType()
-    if (!wxType) {
-      checkMsgCount(true, 0)
-    }
     let indx = getQueryString('type')
     let nums = getQueryString('num')
     if (nums != 0) {
       this.setRead(indx)
     }
+    setTimeout(() => {
+      let wxType = getType()
+      if (!wxType) {
+        checkMsgCount(true, 0)
+      } else {
+        backRefresh()
+      }
+    }, 300)
     this.tit = this.imgSrcs[indx - 1].title
     document.title = this.imgSrcs[indx - 1].title
   },

+ 1 - 1
src/web/staticres/js/message.js

@@ -46,7 +46,7 @@ function Message() {
                 needFilter: 1,
                 msgType: '0',
                 isRead: '-1',
-                offset: 0,
+                offset: 1,
                 pageSize: 5
             },
             success: function (r) {

+ 2 - 0
src/web/templates/frontRouter/wx/messageCenter/sess/detail.html

@@ -49,6 +49,8 @@
         </div>
       </div>
     </div>
+    <!-- 底部导航 -->
+    {{include "/weixin/tabbar.html"}}
   </div>
   <!--S-当前页面的资源-->
   <script src='https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js'></script>

+ 1 - 1
src/web/templates/frontRouter/wx/messageCenter/sess/index.html

@@ -60,7 +60,7 @@
       </div>
     </div>
     <!-- 底部导航 -->
-    {{include "/weixin/tabbar.html" "123"}}
+    {{include "/weixin/tabbar.html"}}
   </div>
   <!--S-当前页面的资源-->
   <script src=https://cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>

+ 11 - 7
src/web/templates/weixin/tabbar.html

@@ -17,7 +17,7 @@
   }
 </style>
 
-<div id="tabMesg" v-cloak>
+<div id="tabMesg" v-cloak v-if="tabShow">
   <van-tabbar v-model="tabActive" active-color="#2ABED1" inactive-color="#171826">
     <van-tabbar-item @click="routeHref(index)" v-for="(item, index) in tabList" :key="index" :badge="index === 2 ? getMsgCount : ''">
       <span>{item.label}</span>
@@ -37,11 +37,12 @@
     var isPageHide = false;
     window.addEventListener('pageshow', function () {
         if (isPageHide) {
-            location.reload();
+          location.reload();
         }
     });
     window.addEventListener('pagehide', function () {
         isPageHide = true;
+        vm.tabsCount()
     });
   }
 	var vm = new Vue({
@@ -51,6 +52,7 @@
     return {
 			tabActive: 0,
 			counts: 0,
+      tabShow: true,
       tabList: [
         {
           label: '首页',
@@ -90,10 +92,13 @@
     var uMsg = Number(getQueryString('msg') || this.getURLIndex())
     this.tabActive = uMsg
 		this.tabsCount()
+    const tabShow = location.pathname
+    if (location.pathname == '/weixin/frontPage/messageCenter/sess/detail') {
+      this.tabShow = false
+    } else {
+      this.tabShow = true
+    }
 	},
-  mounted() {
-    backRefresh()
-  },
   computed: {
     getMsgCount: function () {
       return this.counts ? (this.counts > 99 ? '99+' : this.counts) : ''
@@ -124,11 +129,10 @@
       })
     },
 		tabsCount() {
-      console.log('1212')
       const _this = this
       $.ajax({
         type:'GET',
-        url:'/jymessageCenter/getCount',
+        url:'/jymessageCenter/getCount?t=' + Date.now(),
         data: {},
         success:function (res) {
           if (res && res.status == 1 && res.data && res.data.count) {