feat(home): 修复swiper动画、宜忌布局、月历显示、节日速查
1. 修复swiper箭头点击动画丢失问题 - 改用固定7天窗口,滑动到边缘时整体滚动数据 - 保持dayIndex连续,确保swiper平滑动画 2. 修复宜忌两行显示压在一起 - 设置item固定高度32rpx和行距12rpx - 超出2行显示...省略号 3. 修复月历数字竖向排列问题 - 修正wxml嵌套结构,让42个格子正确排成6行7列 - 压缩格子高度,放大数字字体 4. 节日速查功能优化 - 默认显示3条,右侧添加更多
This commit is contained in:
@@ -1260,6 +1260,30 @@ function getUpcomingFestivals(count = 6, baseYear, baseMonth, baseDay) {
|
||||
return list.slice(0, count);
|
||||
}
|
||||
|
||||
/** 获取今年所有节日(农历+公历) */
|
||||
function getYearFestivals(year) {
|
||||
const list = [];
|
||||
for (const fest of FESTIVAL_QUICK_SEARCH) {
|
||||
const solar = getFestivalSolarDate(year, fest);
|
||||
if (solar) {
|
||||
list.push({
|
||||
name: fest.name,
|
||||
type: fest.type,
|
||||
solarDate: `${solar.year}-${String(solar.month).padStart(2, '0')}-${String(solar.day).padStart(2, '0')}`,
|
||||
solarYear: solar.year,
|
||||
solarMonth: solar.month,
|
||||
solarDay: solar.day
|
||||
});
|
||||
}
|
||||
}
|
||||
// 按日期排序
|
||||
list.sort((a, b) => {
|
||||
if (a.solarMonth !== b.solarMonth) return a.solarMonth - b.solarMonth;
|
||||
return a.solarDay - b.solarDay;
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/** 获取下一个佛教节日及倒计时(基准日可选,默认今天) */
|
||||
function getNextBuddhistFestival(baseYear, baseMonth, baseDay) {
|
||||
const now = new Date();
|
||||
@@ -1428,6 +1452,7 @@ module.exports = {
|
||||
getWeekDay,
|
||||
getFestivalSolarDate,
|
||||
getUpcomingFestivals,
|
||||
getYearFestivals,
|
||||
getNextBuddhistFestival,
|
||||
daysBetween,
|
||||
analyzeShensha,
|
||||
|
||||
Reference in New Issue
Block a user