修复已知问题

This commit is contained in:
bobobobo
2026-01-20 21:39:14 +08:00
parent 8f57889ad3
commit 139514b2b9
3 changed files with 68 additions and 9 deletions

View File

@@ -51,7 +51,21 @@
}
continuousDays.value = res.data.continuousDays
indexData.value = res.data.list.map(v => v.signDate)
// indexData.value = res.data.list.map(v => v.signDate)
indexData.value = res.data.list
console.log(indexData.value, '===')
}
/** 判断那一天签到了 */
const isSign = item => {
return indexData.value.some(v => v.signDate === item.signDate)
}
/** 判断签到那一天加多少积分 */
const isAddIntegral = item => {
return indexData.value.find(v => v.signDate === item.signDate)
.pointsAwarded
}
/**
@@ -232,11 +246,11 @@
<view v-for="(item, index) in weekList" :key="index" class="item">
<text class="bottom-name">{{ item.name }}</text>
</view>
<!-- 签到 -->
<!-- 签到 :class="{ active: indexData.includes(item.signDate) }" -->
<view
v-for="(item, index) in dateList"
:key="index"
:class="{ active: indexData.includes(item.signDate) }"
:class="{ active: isSign(item) }"
class="item"
@click="onItem(item)"
>
@@ -246,7 +260,7 @@
mode="heightFix"
class="icon"
></image>
<!-- <text>+10</text> -->
<text v-if="isSign(item)">+{{ isAddIntegral(item) }}</text>
</view>
<text
:style="{ color: item.isToday ? '#00d993' : '#999999' }"