瀏覽代碼

Merge branch 'dev/v4.8.49_zsy' of qmx/jy into feature/v4.8.49

zhangsiya 2 年之前
父節點
當前提交
41a61fe88c
共有 1 個文件被更改,包括 14 次插入7 次删除
  1. 14 7
      src/web/staticres/frontRouter/pc/mesgCenter/js/index-pc.js

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

@@ -23,12 +23,15 @@ var vm = new Vue({
     }
   },
   created() {
-    this.activeName = '-1'
-    this.getList()
+    this.init()
     // this.kfContacts()
     // this.kfData()
   },
   methods: {
+    init () {
+      this.activeName = '-1'
+      this.getList()
+    },
     // 获取所有栏目列表数据(包括未读数量)
     getList (msgType) {
       var _this = this
@@ -50,9 +53,6 @@ var vm = new Vue({
         dataType: 'json',
         headers: {'Content-Type': 'application/json'},
         success:function (res) {
-          setTimeout(() => {
-            _this.loading = false
-          }, 300)
            if(res.code === 0) {
              _this.counts = res.column || []
              for(var item of _this.counts) {
@@ -65,7 +65,12 @@ var vm = new Vue({
              if(type === -1 ) _this.unread = res.unread
            }
         },
-        error:function () {}
+        error:function () {},
+        complete: function ()  {
+          setTimeout(() => {
+            _this.loading = false
+          }, 100)
+        }
       })
     },
     // 私信显示、隐藏
@@ -124,9 +129,11 @@ var vm = new Vue({
           if(message){
             message.getMessageList()
           }
-          _this.getList(_this.activeName)
           if (url) {
+            _this.init()
             location.href = url
+          } else {
+            _this.getList(_this.activeName)
           }
         }
       })