Skip to content

Commit

Permalink
Merge pull request #163 from huangchen1031/main
Browse files Browse the repository at this point in the history
fix(AchievementSidebar): 修复“所有”模块的计数问题
  • Loading branch information
xytoki authored Nov 19, 2024
2 parents 493ed73 + 4fac81b commit dbec520
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
20 changes: 15 additions & 5 deletions src/views/Achievement/AchievementSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@
<small>
<b>
<img :src="img('yuanshi')" alt="原石" />
{{ achievementFinStat[i.id || 0]?.reward || 0 }}/{{ i.totalReward }}
{{
i.key === ALLCAT
? totalFin?.reward || 0
: achievementFinStat[i.id || 0]?.reward || 0
}}/{{ i.totalReward }}
</b>
<span>
{{ achievementFinStat[i.id || 0]?.count || 0 }}/{{ i.achievements.length }} ({{
Math.round(
((achievementFinStat[i.id || 0]?.count || 0) / i.achievements.length) * 100,
{{
i.key === ALLCAT ? totalFin?.count || 0 : achievementFinStat[i.id || 0]?.count || 0
}}/{{ i.achievements.length }} ({{
Math.floor(
((i.key === ALLCAT
? totalFin?.count || 0
: achievementFinStat[i.id || 0]?.count || 0) /
i.achievements.length) *
100,
)
}}%)
</span>
Expand Down Expand Up @@ -55,7 +65,7 @@ import { i18n } from '@/i18n'
import { ref, toRef, defineComponent } from 'vue'
import type { ElScrollbar } from 'element-plus'
export default defineComponent({
props: ['achievementCat', 'achievementFinStat', 'hideFinished'],
props: ['achievementCat', 'achievementFinStat', 'hideFinished', 'totalFin'],
setup() {
const DEFAULTCAT = 'wonders-of-the-world'
const ALLCAT = 'all'
Expand Down
1 change: 1 addition & 0 deletions src/views/Achievement/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
></div>
</div>
<achievement-sidebar
:totalFin="totalFin"
:achievementCat="allAchievementCat"
:achievementFinStat="achievementFinStat"
:hideFinished="hideFinished"
Expand Down

0 comments on commit dbec520

Please sign in to comment.