hookehuyr

fix(recall): 修改活动历史日期范围计算为固定到2025年

根据李琛要求,将活动历史日期范围的计算从动态获取改为固定到2025年结束
......@@ -221,11 +221,13 @@ onMounted(async () => {
}))
// 遍历日期把列表date字段从小到大排序, 获取到其中日期段 比如 2020-2025
const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b))
if (sortedDates[0] !== sortedDates[sortedDates.length - 1]) {
recordDate.value = sortedDates[0] + '-' + sortedDates[sortedDates.length - 1] || ''
} else {
recordDate.value = sortedDates[0] || ''
}
// if (sortedDates[0] !== sortedDates[sortedDates.length - 1]) {
// recordDate.value = sortedDates[0] + '-' + sortedDates[sortedDates.length - 1] || ''
// } else {
// recordDate.value = sortedDates[0] || ''
// }
// 李琛说就写死到2025年结束
recordDate.value = sortedDates[0] + '-' + '2025'
}
}
}
......@@ -246,11 +248,13 @@ onMounted(async () => {
total: item.fee_stu * item.stu_cnt || 0
}));
const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b))
if (sortedDates[0] !== sortedDates[sortedDates.length - 1]) {
recordDate.value = sortedDates[0] + '-' + sortedDates[sortedDates.length - 1] || ''
} else {
recordDate.value = sortedDates[0] || ''
}
// if (sortedDates[0] !== sortedDates[sortedDates.length - 1]) {
// recordDate.value = sortedDates[0] + '-' + sortedDates[sortedDates.length - 1] || ''
// } else {
// recordDate.value = sortedDates[0] || ''
// }
// 李琛说就写死到2025年结束
recordDate.value = sortedDates[0] + '-' + '2025'
}
}
}
......
......@@ -140,7 +140,9 @@ const joinDateFormatted = computed(() => {
const durationString = computed(() => {
const start = dayjs(joinDate.value)
const end = lastActivityDate.value ? dayjs(lastActivityDate.value) : dayjs()
// const end = lastActivityDate.value ? dayjs(lastActivityDate.value) : dayjs()
// 写死最后一次活动是2025年12月31日
const end = dayjs('2025-12-31')
const years = end.diff(start, 'year')
const months = end.diff(start, 'month') % 12
......