hookehuyr

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

根据李琛要求,将活动历史日期范围的计算从动态获取改为固定到2025年结束
...@@ -221,11 +221,13 @@ onMounted(async () => { ...@@ -221,11 +221,13 @@ onMounted(async () => {
221 })) 221 }))
222 // 遍历日期把列表date字段从小到大排序, 获取到其中日期段 比如 2020-2025 222 // 遍历日期把列表date字段从小到大排序, 获取到其中日期段 比如 2020-2025
223 const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b)) 223 const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b))
224 - if (sortedDates[0] !== sortedDates[sortedDates.length - 1]) { 224 + // if (sortedDates[0] !== sortedDates[sortedDates.length - 1]) {
225 - recordDate.value = sortedDates[0] + '-' + sortedDates[sortedDates.length - 1] || '' 225 + // recordDate.value = sortedDates[0] + '-' + sortedDates[sortedDates.length - 1] || ''
226 - } else { 226 + // } else {
227 - recordDate.value = sortedDates[0] || '' 227 + // recordDate.value = sortedDates[0] || ''
228 - } 228 + // }
229 + // 李琛说就写死到2025年结束
230 + recordDate.value = sortedDates[0] + '-' + '2025'
229 } 231 }
230 } 232 }
231 } 233 }
...@@ -246,11 +248,13 @@ onMounted(async () => { ...@@ -246,11 +248,13 @@ onMounted(async () => {
246 total: item.fee_stu * item.stu_cnt || 0 248 total: item.fee_stu * item.stu_cnt || 0
247 })); 249 }));
248 const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b)) 250 const sortedDates = activities.value.map(item => item.date).sort((a, b) => new Date(a) - new Date(b))
249 - if (sortedDates[0] !== sortedDates[sortedDates.length - 1]) { 251 + // if (sortedDates[0] !== sortedDates[sortedDates.length - 1]) {
250 - recordDate.value = sortedDates[0] + '-' + sortedDates[sortedDates.length - 1] || '' 252 + // recordDate.value = sortedDates[0] + '-' + sortedDates[sortedDates.length - 1] || ''
251 - } else { 253 + // } else {
252 - recordDate.value = sortedDates[0] || '' 254 + // recordDate.value = sortedDates[0] || ''
253 - } 255 + // }
256 + // 李琛说就写死到2025年结束
257 + recordDate.value = sortedDates[0] + '-' + '2025'
254 } 258 }
255 } 259 }
256 } 260 }
......
...@@ -140,7 +140,9 @@ const joinDateFormatted = computed(() => { ...@@ -140,7 +140,9 @@ const joinDateFormatted = computed(() => {
140 140
141 const durationString = computed(() => { 141 const durationString = computed(() => {
142 const start = dayjs(joinDate.value) 142 const start = dayjs(joinDate.value)
143 - const end = lastActivityDate.value ? dayjs(lastActivityDate.value) : dayjs() 143 + // const end = lastActivityDate.value ? dayjs(lastActivityDate.value) : dayjs()
144 + // 写死最后一次活动是2025年12月31日
145 + const end = dayjs('2025-12-31')
144 const years = end.diff(start, 'year') 146 const years = end.diff(start, 'year')
145 const months = end.diff(start, 'month') % 12 147 const months = end.diff(start, 'month') % 12
146 148
......