1. 节日速查显示最近10条(之前只显示3条) 2. 修复右侧'还有XX天'溢出问题 - fest-left 添加 flex-shrink: 0 和 min-width - 确保文字不会溢出屏幕
This commit is contained in:
@@ -97,7 +97,7 @@ 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(5, y, m, d);
|
||||
const upcoming = getUpcomingFestivals(10, y, m, d);
|
||||
return {
|
||||
key: fmt(y, m, d),
|
||||
dayInfo, almanac, legalHoliday, workday, termTime,
|
||||
|
||||
@@ -123,14 +123,14 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 节日速查(默认显示3条,点击查看更多) -->
|
||||
<!-- 节日速查(显示最近10条,点击查看更多) -->
|
||||
<view class="card">
|
||||
<view class="fest-head">
|
||||
<text class="section-title">节日速查</text>
|
||||
<text class="fest-more" bindtap="openZoom" data-type="fest-year" data-date="{{dayItem.key}}">更多 >></text>
|
||||
</view>
|
||||
<view class="fest-quick" wx:if="{{dayItem.upcoming.length > 0}}">
|
||||
<view class="fest-quick-item" wx:for="{{dayItem.upcoming.slice(0, 3)}}" wx:key="name" catchtap="goFestival" data-date="{{item.solarDate}}">
|
||||
<view class="fest-quick" wx:if="{{dayItem.upcoming && dayItem.upcoming.length > 0}}">
|
||||
<view class="fest-quick-item" wx:for="{{dayItem.upcoming}}" wx:key="name" catchtap="goFestival" data-date="{{item.solarDate}}">
|
||||
<text class="fest-name">{{item.name}}</text>
|
||||
<text class="fest-date">{{item.solarMonth}}月{{item.solarDay}}日</text>
|
||||
<text class="fest-left {{item.daysLeft === 0 ? 'is-today' : ''}}">{{item.daysLeft === 0 ? '今天' : item.daysLeft + '天后'}}</text>
|
||||
|
||||
@@ -491,6 +491,9 @@
|
||||
font-size: 24rpx;
|
||||
color: #C41E3A;
|
||||
font-weight: 500;
|
||||
flex-shrink: 0;
|
||||
min-width: 100rpx;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.fest-left.is-today {
|
||||
|
||||
Reference in New Issue
Block a user