Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-12-03 10:23:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
47c409b879730b83ab6a38aae3084726957ecc6a
47c409b8
1 parent
bdfea03e
feat(ProfilePage): 添加打卡次数格式化功能
添加 formatCheckInCount 方法,将超过99的打卡次数显示为'99+'
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
src/views/profile/ProfilePage.vue
src/views/profile/ProfilePage.vue
View file @
47c409b
...
...
@@ -39,19 +39,19 @@
<div class="flex justify-around">
<div class="flex flex-col items-center min-w-[4rem]">
<div class="font-bold text-gray-800 px-2 leading-normal text-center w-full" style="font-size: 1.5rem;">
{{
checkIns?.total_days || 0
}}
{{
formatCheckInCount(checkIns?.total_days)
}}
</div>
<div class="text-xs text-gray-500 mt-1">累计打卡</div>
</div>
<div class="flex flex-col items-center min-w-[4rem]">
<div class="font-bold text-green-600 px-2 leading-normal text-center w-full" style="font-size: 1.5rem;">
{{
checkIns?.consecutive_days || 0
}}
{{
formatCheckInCount(checkIns?.consecutive_days)
}}
</div>
<div class="text-xs text-gray-500 mt-1">连续打卡</div>
</div>
<div class="flex flex-col items-center min-w-[4rem]">
<div class="font-bold text-blue-600 px-2 leading-normal text-center w-full" style="font-size: 1.5rem;">
{{
checkIns?.longest_consecutive_days || 0
}}
{{
formatCheckInCount(checkIns?.longest_consecutive_days)
}}
</div>
<div class="text-xs text-gray-500 mt-1">最长连续</div>
</div>
...
...
@@ -148,6 +148,11 @@ const profile = ref({});
const checkIns = ref({});
const isTeacher = ref(false);
const formatCheckInCount = (count) => {
const num = Number(count) || 0;
return num > 99 ? '99+' : num;
};
onMounted(async () => {
const { code, data } = await getUserInfoAPI();
if (code) {
...
...
Please
register
or
login
to post a comment