Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fe: 如果有未完成的签到,显示有未读消息的提示。 #2034

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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