Skip to content

Commit

Permalink
fix(SPA): 修复消息错误显示小红点
Browse files Browse the repository at this point in the history
issue #529

(cherry picked from commit d8838fb)
  • Loading branch information
mutoe committed Mar 1, 2019
1 parent 6a55d80 commit 4dc0550
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
7 changes: 2 additions & 5 deletions resources/spa/src/components/FootGuide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,9 @@ export default {
state.MESSAGE.NEW_UNREAD_COUNT['news-comment-pinned'] +
state.MESSAGE.NEW_UNREAD_COUNT['post-comment-pinned'] +
state.MESSAGE.NEW_UNREAD_COUNT['post-pinned'] +
state.MESSAGE.NEW_UNREAD_COUNT.system >
0,
state.MESSAGE.NEW_UNREAD_COUNT.system > 0,
profile: state =>
state.MESSAGE.NEW_UNREAD_COUNT.following +
state.MESSAGE.NEW_UNREAD_COUNT.mutual >
0,
state.MESSAGE.NEW_UNREAD_COUNT.following > 0,
}),
...mapGetters(['hasUnreadChat']),
hasMsg () {
Expand Down
4 changes: 2 additions & 2 deletions resources/spa/src/components/common/badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:class="classes"
>
<slot />
<sup v-show="badge" :class="dotClasses" />
<sup :class="dotClasses" />
</span>
<span
v-else
Expand Down Expand Up @@ -122,7 +122,7 @@ export default {
position: absolute;
transform: translateX(-50%);
transform-origin: 0 center;
top: -3px; /* no */
top: 2px; /* no */
right: -6px; /* no */
height: 6px; /* no */
width: 6px; /* no */
Expand Down
18 changes: 18 additions & 0 deletions resources/spa/src/page/message/MessageBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<header class="m-box m-head-top m-lim-width m-pos-f m-main m-bb1">
<ul class="m-box m-flex-grow1 m-aln-center m-justify-center m-flex-base0 m-head-nav">
<RouterLink
class="link-item"
tag="li"
:to="{name: 'MessageHome'}"
replace
Expand All @@ -13,6 +14,7 @@
</VBadge>
</RouterLink>
<RouterLink
class="link-item"
tag="li"
:to="{name: 'ChatList'}"
replace
Expand Down Expand Up @@ -58,3 +60,19 @@ export default {
},
}
</script>

<style lang="less" scoped>
.p-message-base {
.link-item {
position: relative;
a {
display: flex;
justify-content: center;
align-items: center;
width: 2.3em;
height: 1.5em;
}
}
}
</style>
8 changes: 1 addition & 7 deletions resources/spa/src/page/message/MessageHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,7 @@ export default {
return this.newMsg.liked || 0
},
aCount () {
return (
~~this.newMsg['feed-comment-pinned'] +
~~this.newMsg['news-comment-pinned'] +
~~this.newMsg['post-comment-pinned'] +
~~this.newMsg['post-pinned'] +
~~this.newMsg['group-join-pinned']
)
return 0
},
},
methods: {
Expand Down

0 comments on commit 4dc0550

Please sign in to comment.