hookehuyr

fix(IndexCheckInPage): 修复进度条显示条件逻辑

当进度计算结果为NaN时隐藏进度条显示
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: 2025-06-09 11:32:31 4 + * @LastEditTime: 2025-06-09 15:50:10
5 * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue 5 * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 @click-subtitle="onClickSubtitle"> 14 @click-subtitle="onClickSubtitle">
15 </van-calendar> 15 </van-calendar>
16 16
17 - <div class="text-wrapper"> 17 + <div v-if="showProgress" class="text-wrapper">
18 <div class="text-header">目标进度</div> 18 <div class="text-header">目标进度</div>
19 <div style="background-color: #FFF; margin-top: 1rem;"> 19 <div style="background-color: #FFF; margin-top: 1rem;">
20 <div class="grade-percentage-main"> 20 <div class="grade-percentage-main">
...@@ -500,13 +500,15 @@ const delCheckin = (post) => { ...@@ -500,13 +500,15 @@ const delCheckin = (post) => {
500 const taskDetail = ref({}); 500 const taskDetail = ref({});
501 const myCheckinDates = ref([]); 501 const myCheckinDates = ref([]);
502 const checkinDataList = ref([]); 502 const checkinDataList = ref([]);
503 +const showProgress = ref(true);
503 504
504 const getTaskDetail = async (month) => { 505 const getTaskDetail = async (month) => {
505 const { code, data } = await getTaskDetailAPI({ i: route.query.id, month }); 506 const { code, data } = await getTaskDetailAPI({ i: route.query.id, month });
506 if (code) { 507 if (code) {
507 console.warn(data); 508 console.warn(data);
508 taskDetail.value = data; 509 taskDetail.value = data;
509 - progress1.value = (data.checkin_number/data.target_number)*100 ; 510 + progress1.value = (data.checkin_number/data.target_number)*100; // 计算进度条百分比
511 + showProgress.value = !isNaN(progress1.value); // 如果是NaN,就不显示进度条
510 teamAvatars.value = data.checkin_avatars; 512 teamAvatars.value = data.checkin_avatars;
511 // 获取当前用户的打卡日期 513 // 获取当前用户的打卡日期
512 myCheckinDates.value = data.my_checkin_dates; 514 myCheckinDates.value = data.my_checkin_dates;
......