flat: 消息

This commit is contained in:
史典卓
2025-05-15 14:17:51 +08:00
parent 5333254c58
commit a93907018c
40 changed files with 875 additions and 56 deletions

View File

@@ -110,8 +110,14 @@ const pageState = reactive({
});
onLoad(() => {
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0');
const day = String(today.getDate()).padStart(2, '0');
const currentDate = `${year}-${month}-${day}`;
const result = getNextDates({
startDate: '2025-04-21',
startDate: currentDate,
});
weekList.value = result;
getFair('refresh');
@@ -123,9 +129,17 @@ function toSelectDate() {
date: currentDay.value.fullDate,
},
onBack: (res) => {
console.log(res);
const result = getNextDates({
startDate: res.date,
});
const formattedDate = res.date.slice(5); // MM-DD
const dateFull = {
date: res.date.slice(5),
day: '周' + res.week,
fullDate: res.date,
};
currentDay.value = dateFull;
weekList.value = result;
getFair('refresh');
},
@@ -151,7 +165,7 @@ const handleScrollToLower = () => {
function getFair(type = 'add') {
if (type === 'refresh') {
pageState.page = 0;
pageState.page = 1;
pageState.maxPage = 1;
}
if (type === 'add' && pageState.page < pageState.maxPage) {
@@ -262,7 +276,6 @@ function getNextDates({ startDate = '', count = 6 }) {
date: formattedDate,
fullDate,
day: '周' + dayOfWeek,
isToday: i === 0,
});
}