Showing
1 changed file
with
10 additions
and
2 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-05-29 15:34:17 | 2 | * @Date: 2025-05-29 15:34:17 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2026-01-21 15:30:00 | 4 | + * @LastEditTime: 2026-01-22 21:30:20 |
| 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue | 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -134,7 +134,7 @@ | ... | @@ -134,7 +134,7 @@ |
| 134 | <van-back-top right="5vw" bottom="25vh" offset="600" /> | 134 | <van-back-top right="5vw" bottom="25vh" offset="600" /> |
| 135 | 135 | ||
| 136 | <!-- 底部悬浮打卡按钮 --> | 136 | <!-- 底部悬浮打卡按钮 --> |
| 137 | - <div v-if="!taskDetail.is_finish" class="floating-checkin-button" :class="{ 'is-compact': isCompactButton }"> | 137 | + <div v-if="is_task_detail_ready && !is_task_finished" class="floating-checkin-button" :class="{ 'is-compact': isCompactButton }"> |
| 138 | <van-button | 138 | <van-button |
| 139 | type="primary" | 139 | type="primary" |
| 140 | round | 140 | round |
| ... | @@ -177,6 +177,12 @@ useTitle(route.meta.title); | ... | @@ -177,6 +177,12 @@ useTitle(route.meta.title); |
| 177 | const { y } = useScroll(window) | 177 | const { y } = useScroll(window) |
| 178 | const isCompactButton = computed(() => y.value > 200) | 178 | const isCompactButton = computed(() => y.value > 200) |
| 179 | 179 | ||
| 180 | +const is_task_detail_ready = ref(false) | ||
| 181 | +const is_task_finished = computed(() => { | ||
| 182 | + const val = taskDetail.value ? taskDetail.value.is_finish : undefined | ||
| 183 | + return val === 1 || val === '1' || val === true | ||
| 184 | +}) | ||
| 185 | + | ||
| 180 | // 动态字段文字 | 186 | // 动态字段文字 |
| 181 | const dynamicFieldText = ref('感恩') | 187 | const dynamicFieldText = ref('感恩') |
| 182 | 188 | ||
| ... | @@ -606,6 +612,7 @@ const getTaskDetail = async (month) => { | ... | @@ -606,6 +612,7 @@ const getTaskDetail = async (month) => { |
| 606 | const { code, data } = await getTaskDetailAPI({ i: route.query.id, month, subtask_id: selectedSubtaskId.value }); | 612 | const { code, data } = await getTaskDetailAPI({ i: route.query.id, month, subtask_id: selectedSubtaskId.value }); |
| 607 | if (code === 1) { | 613 | if (code === 1) { |
| 608 | taskDetail.value = data; | 614 | taskDetail.value = data; |
| 615 | + is_task_detail_ready.value = true | ||
| 609 | progress1.value = ((data.checkin_number/data.target_number)*100).toFixed(1); // 计算进度条百分比 | 616 | progress1.value = ((data.checkin_number/data.target_number)*100).toFixed(1); // 计算进度条百分比 |
| 610 | showProgress.value = !isNaN(progress1.value); // 如果是NaN,就不显示进度条 | 617 | showProgress.value = !isNaN(progress1.value); // 如果是NaN,就不显示进度条 |
| 611 | teamAvatars.value = taskDetail.value.checkin_avatars?.length > 8 ? taskDetail.value.checkin_avatars.splice(0, 8) : taskDetail.value.checkin_avatars; | 618 | 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) => { | ... | @@ -666,6 +673,7 @@ const initPage = async (date) => { |
| 666 | finished.value = false; | 673 | finished.value = false; |
| 667 | loading.value = false; | 674 | loading.value = false; |
| 668 | taskDetail.value = {}; | 675 | taskDetail.value = {}; |
| 676 | + is_task_detail_ready.value = false | ||
| 669 | selectedSubtaskId.value = ''; | 677 | selectedSubtaskId.value = ''; |
| 670 | 678 | ||
| 671 | const current_date = date || route.query.date; | 679 | const current_date = date || route.query.date; | ... | ... |
-
Please register or login to post a comment