fix(home): 首页排版细节优化

- 宜忌弹窗字体 44→32rpx、收紧间距,20+ 条可完整显示
- 历史上的今天内页年份加粗、文字稍小,修正层级
- 节日速查外页3条/内页10条,佛历开启时并入排序
- 统一「更多」箭头为 >>
This commit is contained in:
gouki
2026-08-18 00:08:54 +00:00
parent 5a5388234a
commit bff792a974
4 changed files with 66 additions and 16 deletions
+5 -2
View File
@@ -47,6 +47,7 @@ Page({
zoomTitle: '',
zoomType: '',
zoomData: null,
zoomScrollTop: 0,
// 设置
showBuddhist: false,
highlightLunar: true
@@ -97,7 +98,8 @@ Page({
const termTime = dayInfo.solarTerm ? (SOLAR_TERM_TIMES[dayInfo.solarTerm] || '') : '';
const isFirstOrFifteen = this.data.highlightLunar && (dayInfo.lunarDay === 1 || dayInfo.lunarDay === 15);
const nextBuddhist = this.data.showBuddhist ? getNextBuddhistFestival(y, m, d) : null;
const upcoming = getUpcomingFestivals(10, y, m, d);
// 外页只显示最近3条(佛历开启时并入排序);内页弹窗见 openZoom 取10条
const upcoming = getUpcomingFestivals(3, y, m, d, this.data.showBuddhist);
return {
key: fmt(y, m, d),
dayInfo, almanac, legalHoliday, workday, termTime,
@@ -429,7 +431,8 @@ Page({
};
} else if (type === 'fest') {
zoomTitle = '近期节日';
zoomData = { upcoming: dayItem.upcoming };
// 内页显示最近10条(佛历开启时并入排序)
zoomData = { upcoming: getUpcomingFestivals(10, dayInfo.solarYear, dayInfo.solarMonth, dayInfo.solarDay, this.data.showBuddhist) };
} else if (type === 'fest-year') {
zoomTitle = `${dayInfo.solarYear}年节日`;
zoomData = { yearFestivals: getYearFestivals(dayInfo.solarYear) };
+7 -2
View File
@@ -156,7 +156,7 @@
</view>
<view class="otd-foot">
<text class="otd-source">来源:中文维基百科</text>
<text class="otd-more" bindtap="openZoom" data-type="otd" data-date="{{dayItem.key}}">查看完整 </text>
<text class="otd-more" bindtap="openZoom" data-type="otd" data-date="{{dayItem.key}}">查看完整 >></text>
</view>
</view>
<view class="card placeholder-card" wx:elif="{{dayItem.otdLoading}}">
@@ -236,6 +236,7 @@
<text class="zoom-yiji-item ji" wx:for="{{zoomData.avoids}}" wx:key="*this">{{item}}</text>
</view>
</view>
<view class="zoom-end-pad" />
</scroll-view>
<!-- 详情放大 -->
@@ -280,6 +281,7 @@
<text class="zoom-detail-label">彭祖百忌</text>
<text class="zoom-detail-value">{{zoomData.pengZu}}</text>
</view>
<view class="zoom-end-pad" />
</scroll-view>
<!-- 节日放大 -->
@@ -289,15 +291,17 @@
<text class="zoom-fest-date">{{item.solarDate}}</text>
<text class="zoom-fest-left {{item.daysLeft === 0 ? 'is-today' : ''}}">{{item.daysLeft === 0 ? '今天' : '还有' + item.daysLeft + '天'}}</text>
</view>
<view class="zoom-end-pad" />
</scroll-view>
<!-- 今年节日(字体稍小,避免溢出) -->
<scroll-view scroll-y class="zoom-body" wx:if="{{zoomType === 'fest-year' && zoomData}}">
<scroll-view scroll-y class="zoom-body" scroll-top="{{zoomScrollTop}}" wx:if="{{zoomType === 'fest-year' && zoomData}}">
<view class="zoom-fest-year-row" wx:for="{{zoomData.yearFestivals}}" wx:key="name" bindtap="goFestival" data-date="{{item.solarDate}}">
<text class="zoom-fest-year-name">{{item.name}}</text>
<text class="zoom-fest-year-date">{{item.solarMonth}}月{{item.solarDay}}日</text>
<text class="zoom-fest-year-type {{item.type === 'lunar' ? 'lunar' : 'solar'}}">{{item.type === 'lunar' ? '农历' : '公历'}}</text>
</view>
<view class="zoom-end-pad" />
</scroll-view>
<!-- 历史上的今天放大 -->
@@ -330,6 +334,7 @@
</view>
</block>
<view class="zoom-otd-source">数据来源:中文维基百科(CC BY-SA 4.0</view>
<view class="zoom-end-pad" />
</scroll-view>
</view>
</view>
+27 -11
View File
@@ -434,19 +434,23 @@
.zoom-fest-year-name {
font-size: 32rpx;
font-weight: 600;
min-width: 140rpx;
width: 160rpx;
flex-shrink: 0;
}
.zoom-fest-year-date {
font-size: 28rpx;
color: #9E8E7E;
flex: 1;
min-width: 0;
}
.zoom-fest-year-type {
font-size: 22rpx;
padding: 4rpx 16rpx;
border-radius: 999rpx;
flex-shrink: 0;
white-space: nowrap;
}
.zoom-fest-year-type.lunar {
@@ -668,10 +672,18 @@
}
.zoom-body {
width: 100%;
box-sizing: border-box;
padding: 32rpx 28rpx;
max-height: 70vh;
}
/* scroll-view 底部占位:padding-bottom 不计入滚动高度,用真实元素保证最后一项完整显示 */
.zoom-end-pad {
height: 32rpx;
}
/* 宜忌放大 */
.zoom-yiji-block {
margin-bottom: 40rpx;
@@ -695,13 +707,13 @@
.zoom-yiji-items {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
gap: 14rpx;
}
.zoom-yiji-item {
font-size: 44rpx;
padding: 16rpx 32rpx;
border-radius: 16rpx;
font-size: 32rpx;
padding: 12rpx 24rpx;
border-radius: 12rpx;
font-weight: 500;
}
@@ -744,21 +756,24 @@
}
.zoom-fest-name {
font-size: 44rpx;
font-size: 40rpx;
font-weight: 600;
min-width: 200rpx;
flex-shrink: 0;
}
.zoom-fest-date {
font-size: 36rpx;
font-size: 32rpx;
color: #9E8E7E;
flex: 1;
min-width: 0;
}
.zoom-fest-left {
font-size: 36rpx;
font-size: 32rpx;
color: #C41E3A;
font-weight: 500;
flex-shrink: 0;
white-space: nowrap;
}
.zoom-fest-left.is-today {
@@ -874,12 +889,13 @@
}
.zoom-otd-item .otd-year {
font-size: 30rpx;
font-size: 28rpx;
font-weight: 600;
min-width: 120rpx;
}
.zoom-otd-item .otd-text {
font-size: 32rpx;
font-size: 28rpx;
-webkit-line-clamp: unset;
overflow: visible;
}