|
|
@@ -108,31 +108,31 @@ const rewardList = computed(() => {
|
|
|
];
|
|
|
});
|
|
|
|
|
|
-// 判断某天是否已签到(基于累计天数在8天循环内的位置)
|
|
|
+// 判断某天是否已签到(基于连续签到天数在8天循环内的位置)
|
|
|
const isSignedDay = (day: number) => {
|
|
|
- const totalDays = signInfo.value?.totalDays || 0;
|
|
|
- const cycleDay = totalDays % 8 || (totalDays > 0 ? 8 : 0);
|
|
|
+ const continuousDays = signInfo.value?.continuousDays || 0;
|
|
|
+ const cycleDay = continuousDays % 8 || (continuousDays > 0 ? 8 : 0);
|
|
|
return day <= cycleDay;
|
|
|
};
|
|
|
|
|
|
// 判断是否是今天要签到的天数
|
|
|
const isTodayDay = (day: number) => {
|
|
|
if (signInfo.value?.todaySigned) return false;
|
|
|
- const totalDays = signInfo.value?.totalDays || 0;
|
|
|
- const nextDay = (totalDays % 8) + 1;
|
|
|
+ const continuousDays = signInfo.value?.continuousDays || 0;
|
|
|
+ const nextDay = (continuousDays % 8) + 1;
|
|
|
return day === nextDay;
|
|
|
};
|
|
|
|
|
|
// 获取今日奖励
|
|
|
const getTodayReward = () => {
|
|
|
- const totalDays = signInfo.value?.totalDays || 0;
|
|
|
+ const continuousDays = signInfo.value?.continuousDays || 0;
|
|
|
if (signInfo.value?.todaySigned) {
|
|
|
// 已签到,显示今天的奖励
|
|
|
- const currentDayIndex = ((totalDays - 1) % 8);
|
|
|
+ const currentDayIndex = ((continuousDays - 1) % 8);
|
|
|
return rewardList.value[currentDayIndex]?.reward || 0.10;
|
|
|
}
|
|
|
// 未签到,显示下一天的奖励
|
|
|
- const nextDayIndex = totalDays % 8;
|
|
|
+ const nextDayIndex = continuousDays % 8;
|
|
|
return rewardList.value[nextDayIndex]?.reward || 0.10;
|
|
|
};
|
|
|
|