Skip to content

Commit

Permalink
fe: 如果有未完成的签到,显示有未读消息的提示。
Browse files Browse the repository at this point in the history
  • Loading branch information
wjcjttl committed Oct 19, 2024
1 parent 12abe26 commit 173137e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions resource/schemas/NexusPHP/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
"messageCount": {
"selector": ["td[style*='background: red'] a[href*='messages.php']", "div[style*='background: red'] a[href*='messages.php']"],
"filters": ["query.text().match(/(\\d+)/)", "(query && query.length>=2)?parseInt(query[1]):0"]
},
"pendingCheckins": {
"selector": ["a[class*='faqlink']"],
"filters": ["query.text().match(/(签到得)/)", "(query && query.length>=1)?1:0"]
}
}
},
Expand Down
6 changes: 3 additions & 3 deletions src/options/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@
<v-badge color="red messageCount" overlap>
<template v-slot:badge v-if="
!props.item.disableMessageCount &&
props.item.user.messageCount > 0
(props.item.user.messageCount > 0 || props.item.user.pendingCheckins > 0)
" :title="$t('home.newMessage')">
{{
props.item.user.messageCount > 10
(props.item.user.messageCount > 10 || props.item.user.messageCount == 0)
? ""
: props.item.user.messageCount
}}
Expand Down Expand Up @@ -655,7 +655,7 @@ export default Vue.extend({
},
allUnReadMsgSites() {
// @ts-ignore
return this.allSitesSorted.filter((site: Site) => !site.disableMessageCount && ((site.user?.messageCount || 0) > 0))
return this.allSitesSorted.filter((site: Site) => !site.disableMessageCount && ((site.user?.messageCount || 0) > 0 || (site.user?.pendingCheckins || 0) > 0))
},
allTaggedSites() {
// @ts-ignore
Expand Down
3 changes: 2 additions & 1 deletion src/options/views/UserDataTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ export default Vue.extend({
res = res.concat(allUnTaggedSites)
}
if (tags.includes(ETagType.unReadMsg)) {
let allUnReadMsgSites = sites.filter((site: Site) => (site.user?.messageCount || 0) > 0)
// 有未读消息或签到消息
let allUnReadMsgSites = sites.filter((site: Site) => (site.user?.messageCount || 0) > 0 || (site.user?.pendingCheckins || 0) > 0)
res = res.concat(allUnReadMsgSites)
}
if (tags.includes(ETagType.statusError)) {
Expand Down

0 comments on commit 173137e

Please sign in to comment.