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