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
2026-01-22 21:31:39 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
84748224fac258c8598d6fe0ad7ff709eed00769
84748224
1 parent
2ce3140e
fix(打卡页面): 修复打卡按钮显示条件逻辑
添加任务详情准备状态检查,优化完成状态判断逻辑
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
src/views/checkin/IndexCheckInPage.vue
src/views/checkin/IndexCheckInPage.vue
View file @
8474822
<!--
* @Date: 2025-05-29 15:34:17
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-2
1 15:30:0
0
* @LastEditTime: 2026-01-2
2 21:30:2
0
* @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue
* @Description: 文件描述
-->
...
...
@@ -134,7 +134,7 @@
<van-back-top right="5vw" bottom="25vh" offset="600" />
<!-- 底部悬浮打卡按钮 -->
<div v-if="
!taskDetail.is_finish
" class="floating-checkin-button" :class="{ 'is-compact': isCompactButton }">
<div v-if="
is_task_detail_ready && !is_task_finished
" class="floating-checkin-button" :class="{ 'is-compact': isCompactButton }">
<van-button
type="primary"
round
...
...
@@ -177,6 +177,12 @@ useTitle(route.meta.title);
const { y } = useScroll(window)
const isCompactButton = computed(() => y.value > 200)
const is_task_detail_ready = ref(false)
const is_task_finished = computed(() => {
const val = taskDetail.value ? taskDetail.value.is_finish : undefined
return val === 1 || val === '1' || val === true
})
// 动态字段文字
const dynamicFieldText = ref('感恩')
...
...
@@ -606,6 +612,7 @@ const getTaskDetail = async (month) => {
const { code, data } = await getTaskDetailAPI({ i: route.query.id, month, subtask_id: selectedSubtaskId.value });
if (code === 1) {
taskDetail.value = data;
is_task_detail_ready.value = true
progress1.value = ((data.checkin_number/data.target_number)*100).toFixed(1); // 计算进度条百分比
showProgress.value = !isNaN(progress1.value); // 如果是NaN,就不显示进度条
teamAvatars.value = taskDetail.value.checkin_avatars?.length > 8 ? taskDetail.value.checkin_avatars.splice(0, 8) : taskDetail.value.checkin_avatars;
...
...
@@ -666,6 +673,7 @@ const initPage = async (date) => {
finished.value = false;
loading.value = false;
taskDetail.value = {};
is_task_detail_ready.value = false
selectedSubtaskId.value = '';
const current_date = date || route.query.date;
...
...
Please
register
or
login
to post a comment