perf: 优化消息未读数

This commit is contained in:
kuaifan 2022-03-07 18:07:02 +08:00
parent 2aa687a40b
commit 5afed4b85e
3 changed files with 34 additions and 14 deletions

View File

@ -152,7 +152,9 @@ export default {
}, },
}).then(({data}) => { }).then(({data}) => {
this.read_list = data; this.read_list = data;
this.$refs.percent.updatePopper(); this.$nextTick(() => {
this.$refs.percent.updatePopper();
})
}).catch(() => { }).catch(() => {
this.read_list = []; this.read_list = [];
}); });

View File

@ -90,8 +90,13 @@
</div> </div>
</ScrollerY> </ScrollerY>
<div class="messenger-menu"> <div class="messenger-menu">
<Icon @click="tabActive='dialog'" :class="{active:tabActive==='dialog'}" type="ios-chatbubbles" /> <div class="menu-icon">
<Icon @click="tabActive='contacts'" :class="{active:tabActive==='contacts'}" type="md-person" /> <Icon @click="tabActive='dialog'" :class="{active:tabActive==='dialog'}" type="ios-chatbubbles" />
<Badge class="menu-num" :count="msgUnread('all')"/>
</div>
<div class="menu-icon">
<Icon @click="tabActive='contacts'" :class="{active:tabActive==='contacts'}" type="md-person" />
</div>
</div> </div>
</div> </div>

View File

@ -281,18 +281,31 @@
height: 52px; height: 52px;
flex-shrink: 0; flex-shrink: 0;
border-top: 1px solid #f4f5f5; border-top: 1px solid #f4f5f5;
> i { .menu-icon {
cursor: pointer; height: 100%;
font-size: 24px; display: flex;
margin: 0 24px; align-items: center;
color: #aaaaaa; position: relative;
opacity: 0.9; .menu-num {
&.active { position: absolute;
opacity: 1; top: 4px;
color: $primary-color; left: 50%;
margin-left: 3px;
transform: scale(0.8);
} }
&:hover { > i {
opacity: 1; cursor: pointer;
font-size: 24px;
margin: 0 24px;
color: #aaaaaa;
opacity: 0.9;
&.active {
opacity: 1;
color: $primary-color;
}
&:hover {
opacity: 1;
}
} }
} }
} }