|
|
@@ -69,7 +69,7 @@
|
|
|
</router-link>
|
|
|
<div class="setting">
|
|
|
<div style="display:inline-block;" @click="drawer=true">
|
|
|
- <el-badge :value="info.notices.length" v-if="info.notices.length">
|
|
|
+ <el-badge :value="notices.length">
|
|
|
<i class="el-icon-message-solid" style="font-size:22px;"></i>
|
|
|
</el-badge>
|
|
|
</div>
|
|
|
@@ -172,7 +172,8 @@ export default {
|
|
|
menu:[],
|
|
|
now:(new Date()).toLocaleDateString()+" "+(new Date()).toLocaleTimeString(),
|
|
|
isShow:true,
|
|
|
- drawer:false
|
|
|
+ drawer:false,
|
|
|
+ notices:[]
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -197,10 +198,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getData(){
|
|
|
+ let _this = this
|
|
|
this.$api.getAccountInfo().then(res=>{
|
|
|
if(!res.code){
|
|
|
- this.info = res.data.data;
|
|
|
- this.initNav()
|
|
|
+ _this.info = res.data.data;
|
|
|
+ _this.resetSetItem('watchStorage', JSON.stringify(res.data.data.notices));
|
|
|
+ _this.initNav()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -253,6 +256,11 @@ export default {
|
|
|
|
|
|
created(){
|
|
|
this.getData()
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ window.addEventListener('setItem', ()=> {
|
|
|
+ this.notices = JSON.parse(localStorage.getItem('watchStorage'))
|
|
|
+ })
|
|
|
}
|
|
|
};
|
|
|
</script>
|