Skip to content

Commit d8838fb

Browse files
committed
fix(SPA): 修复消息错误显示小红点
issue #529
1 parent ae0e8df commit d8838fb

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

resources/spa/src/components/FootGuide.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,9 @@ export default {
7575
state.MESSAGE.NEW_UNREAD_COUNT['news-comment-pinned'] +
7676
state.MESSAGE.NEW_UNREAD_COUNT['post-comment-pinned'] +
7777
state.MESSAGE.NEW_UNREAD_COUNT['post-pinned'] +
78-
state.MESSAGE.NEW_UNREAD_COUNT.system >
79-
0,
78+
state.MESSAGE.NEW_UNREAD_COUNT.system > 0,
8079
profile: state =>
81-
state.MESSAGE.NEW_UNREAD_COUNT.following +
82-
state.MESSAGE.NEW_UNREAD_COUNT.mutual >
83-
0,
80+
state.MESSAGE.NEW_UNREAD_COUNT.following > 0,
8481
}),
8582
...mapGetters(['hasUnreadChat']),
8683
hasMsg () {

resources/spa/src/components/common/badge.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:class="classes"
66
>
77
<slot />
8-
<sup v-show="badge" :class="dotClasses" />
8+
<sup :class="dotClasses" />
99
</span>
1010
<span
1111
v-else
@@ -122,7 +122,7 @@ export default {
122122
position: absolute;
123123
transform: translateX(-50%);
124124
transform-origin: 0 center;
125-
top: -3px; /* no */
125+
top: 2px; /* no */
126126
right: -6px; /* no */
127127
height: 6px; /* no */
128128
width: 6px; /* no */

resources/spa/src/page/message/MessageBase.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<header class="m-box m-head-top m-lim-width m-pos-f m-main m-bb1">
44
<ul class="m-box m-flex-grow1 m-aln-center m-justify-center m-flex-base0 m-head-nav">
55
<RouterLink
6+
class="link-item"
67
tag="li"
78
:to="{name: 'MessageHome'}"
89
replace
@@ -13,6 +14,7 @@
1314
</VBadge>
1415
</RouterLink>
1516
<RouterLink
17+
class="link-item"
1618
tag="li"
1719
:to="{name: 'ChatList'}"
1820
replace
@@ -58,3 +60,19 @@ export default {
5860
},
5961
}
6062
</script>
63+
64+
<style lang="less" scoped>
65+
.p-message-base {
66+
.link-item {
67+
position: relative;
68+
69+
a {
70+
display: flex;
71+
justify-content: center;
72+
align-items: center;
73+
width: 2.3em;
74+
height: 1.5em;
75+
}
76+
}
77+
}
78+
</style>

resources/spa/src/page/message/MessageHome.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,7 @@ export default {
116116
return this.newMsg.liked || 0
117117
},
118118
aCount () {
119-
return (
120-
~~this.newMsg['feed-comment-pinned'] +
121-
~~this.newMsg['news-comment-pinned'] +
122-
~~this.newMsg['post-comment-pinned'] +
123-
~~this.newMsg['post-pinned'] +
124-
~~this.newMsg['group-join-pinned']
125-
)
119+
return 0
126120
},
127121
},
128122
methods: {

0 commit comments

Comments
 (0)