消息修改
This commit is contained in:
@@ -36,6 +36,7 @@ export default {
|
||||
loading: false,
|
||||
userInfo: {},
|
||||
messageCount: {},
|
||||
timer: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -72,15 +73,17 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
setInterval(() => {
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
}, 10000) // 定时请求
|
||||
},
|
||||
onLoad(options) {},
|
||||
onShow() {
|
||||
this.init()
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
this.timer = setInterval(() => {
|
||||
this.messageCount = uni.getStorageSync(this.$cacheKey.messageCount) || {}
|
||||
}, 3000) // 定时请求
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user