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:
+251
-23
@@ -191,11 +191,12 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 20rpx;
|
||||
padding: 0 16rpx;
|
||||
padding: 0 8rpx; /* 减小padding让数字有更多空间 */
|
||||
min-width: 0; /* 允许内容收缩 */
|
||||
}
|
||||
|
||||
.almanac-day-num {
|
||||
font-size: 200rpx;
|
||||
font-size: 240rpx; /* 宜忌固定高度后,日历数字可以放大 */
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
@@ -299,14 +300,35 @@
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8rpx;
|
||||
gap: 12rpx 8rpx; /* 行间距12rpx,列间距8rpx */
|
||||
align-content: flex-start;
|
||||
max-height: 88rpx; /* 固定2行高度:item 32rpx*2 + 行距12rpx + padding 12rpx */
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.frame-yiji-items::after {
|
||||
content: '...';
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #FFFDF8;
|
||||
padding-left: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #9E8E7E;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.frame-yiji-item {
|
||||
font-size: 24rpx;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 8rpx;
|
||||
height: 32rpx;
|
||||
line-height: 24rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.frame-yiji-item.yi { background: #FEF2F2; color: #C41E3A; }
|
||||
@@ -330,37 +352,114 @@
|
||||
color: #C41E3A;
|
||||
}
|
||||
|
||||
/* 黄历详情(label 大、value 小、加间隔) */
|
||||
.detail-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
/* 黄历详情(紧凑布局,每行2个) */
|
||||
.detail-grid-compact {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
.detail-item-compact {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24rpx;
|
||||
padding: 16rpx;
|
||||
gap: 12rpx;
|
||||
padding: 12rpx;
|
||||
background: #FFFBF5;
|
||||
border-radius: 12rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
font-size: 28rpx;
|
||||
.detail-item-compact .detail-label {
|
||||
font-size: 24rpx;
|
||||
color: #9E8E7E;
|
||||
min-width: 140rpx;
|
||||
min-width: 70rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
font-size: 28rpx;
|
||||
.detail-item-compact .detail-value {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #1A1A1A;
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* 节日速查 */
|
||||
/* 预留空间占位卡片 */
|
||||
.placeholder-card {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.placeholder-content {
|
||||
text-align: center;
|
||||
padding: 40rpx;
|
||||
color: #C9B8A6;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
/* 节日速查头部 */
|
||||
.fest-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.fest-head .section-title {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.fest-more {
|
||||
font-size: 26rpx;
|
||||
color: #C41E3A;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.fest-empty {
|
||||
text-align: center;
|
||||
padding: 40rpx;
|
||||
color: #C9B8A6;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
/* 今年节日弹窗(字体稍小) */
|
||||
.zoom-fest-year-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1rpx solid #F0E6DA;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.zoom-fest-year-name {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
.zoom-fest-year-date {
|
||||
font-size: 28rpx;
|
||||
color: #9E8E7E;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.zoom-fest-year-type {
|
||||
font-size: 22rpx;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 999rpx;
|
||||
}
|
||||
|
||||
.zoom-fest-year-type.lunar {
|
||||
background: #FEF2F2;
|
||||
color: #C41E3A;
|
||||
}
|
||||
|
||||
.zoom-fest-year-type.solar {
|
||||
background: #F0F9FF;
|
||||
color: #0369A1;
|
||||
}
|
||||
|
||||
/* 节日速查列表 */
|
||||
.fest-quick {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -468,10 +567,10 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 16rpx 4rpx;
|
||||
padding: 8rpx 4rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
min-height: 110rpx;
|
||||
min-height: 80rpx; /* 压缩格子高度,避免数字看起来竖向排列 */
|
||||
}
|
||||
|
||||
.day-cell-inner.today {
|
||||
@@ -488,14 +587,16 @@
|
||||
}
|
||||
|
||||
.day-number {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx; /* 月历数字放大 */
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.day-lunar {
|
||||
font-size: 20rpx;
|
||||
color: #9E8E7E;
|
||||
margin-top: 4rpx;
|
||||
margin-top: 2rpx;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.day-lunar.festival {
|
||||
@@ -663,3 +764,130 @@
|
||||
padding: 4rpx 24rpx;
|
||||
border-radius: 999rpx;
|
||||
}
|
||||
|
||||
/* ===== 历史上的今天 ===== */
|
||||
.otd-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.otd-head .section-title {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.otd-tabs {
|
||||
display: flex;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.otd-tab {
|
||||
font-size: 24rpx;
|
||||
padding: 4rpx 20rpx;
|
||||
border-radius: 999rpx;
|
||||
color: #9E8E7E;
|
||||
background: #F5EFE8;
|
||||
}
|
||||
|
||||
.otd-tab.active {
|
||||
color: #FFFFFF;
|
||||
background: #C41E3A;
|
||||
}
|
||||
|
||||
.otd-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.otd-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.otd-year {
|
||||
flex-shrink: 0;
|
||||
min-width: 104rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
color: #C41E3A;
|
||||
}
|
||||
|
||||
.otd-text {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
color: #5A4E42;
|
||||
line-height: 1.5;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.otd-text.no-year {
|
||||
margin-left: 116rpx;
|
||||
}
|
||||
|
||||
.otd-foot {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 16rpx;
|
||||
padding-top: 16rpx;
|
||||
border-top: 1rpx solid #F0E8DE;
|
||||
}
|
||||
|
||||
.otd-source {
|
||||
font-size: 22rpx;
|
||||
color: #C9B8A6;
|
||||
}
|
||||
|
||||
.otd-more {
|
||||
font-size: 26rpx;
|
||||
color: #C41E3A;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* ===== 历史上的今天放大弹窗 ===== */
|
||||
.zoom-otd-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #C41E3A;
|
||||
margin: 24rpx 0 16rpx;
|
||||
}
|
||||
|
||||
.zoom-otd-title:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.zoom-otd-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 16rpx;
|
||||
padding: 12rpx 0;
|
||||
border-bottom: 1rpx solid #F0E8DE;
|
||||
}
|
||||
|
||||
.zoom-otd-item .otd-year {
|
||||
font-size: 30rpx;
|
||||
min-width: 120rpx;
|
||||
}
|
||||
|
||||
.zoom-otd-item .otd-text {
|
||||
font-size: 32rpx;
|
||||
-webkit-line-clamp: unset;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.zoom-otd-item .otd-text.no-year {
|
||||
margin-left: 136rpx;
|
||||
}
|
||||
|
||||
.zoom-otd-source {
|
||||
margin-top: 24rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #C9B8A6;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user