fix(home): 修复箭头无限循环+日期框竖长型+宜忌放大框+月历横向
Publish Mini Program Dev Version / publish (push) Successful in 3m10s
Publish Mini Program Dev Version / publish (push) Successful in 3m10s
1. 箭头放到大框里面,点击不触发swiper无限循环 2. 日期框改为竖长型(min-height 800rpx) 3. 宜忌放到大框里面,包含日期/农历/干支/节日/星期/宜忌 4. 月历确认横向滑动(vertical=false)
This commit is contained in:
+55
-56
@@ -24,71 +24,74 @@
|
||||
<scroll-view class="day-scroll" scroll-y>
|
||||
<view class="container">
|
||||
|
||||
<!-- 大日历卡片 -->
|
||||
<view class="almanac-card {{dayItem.legalHoliday ? 'is-holiday' : (dayItem.workday ? 'is-workday' : 'is-weekend')}}" bindtap="openZoom" data-type="detail" data-date="{{dayItem.key}}">
|
||||
<!-- 顶部:公历 -->
|
||||
<!-- 大日历卡片(竖长型,包含日期/农历/干支/宜忌) -->
|
||||
<view class="almanac-card {{dayItem.legalHoliday ? 'is-holiday' : (dayItem.workday ? 'is-workday' : 'is-weekend')}}">
|
||||
<!-- 顶部:公历年月 + 标签 -->
|
||||
<view class="almanac-head">
|
||||
<view class="almanac-head-left">
|
||||
<text class="almanac-year">{{dayItem.dayInfo.solarYear}}年{{dayItem.dayInfo.solarMonth}}月</text>
|
||||
</view>
|
||||
<text class="almanac-year">{{dayItem.dayInfo.solarYear}}年{{dayItem.dayInfo.solarMonth}}月</text>
|
||||
<view class="head-tags">
|
||||
<text class="today-tag" wx:if="{{dayItem.dayInfo.isToday}}">今日</text>
|
||||
<text class="lunar-tag" wx:if="{{dayItem.isFirstOrFifteen}}">{{dayItem.dayInfo.lunarDay === 1 ? '初一' : '十五'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 大日期(老黄历方框,包含农历和干支) -->
|
||||
<view class="almanac-day-row" catchtap="noop">
|
||||
<view class="day-frame {{dayItem.legalHoliday ? 'frame-holiday' : (dayItem.workday ? 'frame-workday' : 'frame-weekend')}}">
|
||||
<view class="day-frame-inner">
|
||||
<view class="almanac-day-num font-chinese {{dayItem.legalHoliday ? 'num-holiday' : (dayItem.workday ? 'num-workday' : 'num-weekend')}}">{{dayItem.dayInfo.solarDay}}</view>
|
||||
<view class="day-frame-lunar">
|
||||
<text class="day-frame-lunar-main font-chinese">{{dayItem.dayInfo.lunarMonthName}}{{dayItem.dayInfo.lunarDayName}}</text>
|
||||
<text class="day-frame-lunar-sub">{{dayItem.dayInfo.lunarYearGanzhi}}年 {{dayItem.dayInfo.lunarMonthGanzhi}}月 {{dayItem.dayInfo.lunarDayGanzhi}}日</text>
|
||||
<!-- 大日期方框(竖长型,包含所有信息) -->
|
||||
<view class="day-frame {{dayItem.legalHoliday ? 'frame-holiday' : (dayItem.workday ? 'frame-workday' : 'frame-weekend')}}">
|
||||
<!-- 左箭头(在大框里面) -->
|
||||
<view class="day-arrow-inner left" catchtap="prevDay">‹</view>
|
||||
|
||||
<!-- 中间内容 -->
|
||||
<view class="day-frame-content">
|
||||
<!-- 大日期 -->
|
||||
<view class="almanac-day-num font-chinese {{dayItem.legalHoliday ? 'num-holiday' : (dayItem.workday ? 'num-workday' : 'num-weekend')}}">{{dayItem.dayInfo.solarDay}}</view>
|
||||
|
||||
<!-- 农历 -->
|
||||
<view class="day-frame-lunar">
|
||||
<text class="day-frame-lunar-main font-chinese">{{dayItem.dayInfo.lunarMonthName}}{{dayItem.dayInfo.lunarDayName}}</text>
|
||||
<text class="day-frame-lunar-sub">{{dayItem.dayInfo.lunarYearGanzhi}}年 {{dayItem.dayInfo.lunarMonthGanzhi}}月 {{dayItem.dayInfo.lunarDayGanzhi}}日</text>
|
||||
</view>
|
||||
|
||||
<!-- 节日/节气 -->
|
||||
<view class="day-frame-fest" wx:if="{{dayItem.legalHoliday || dayItem.dayInfo.lunarFestival || dayItem.dayInfo.solarFestival || dayItem.dayInfo.solarTerm}}">
|
||||
<text class="frame-badge frame-badge-holiday" wx:if="{{dayItem.legalHoliday}}">{{dayItem.legalHoliday}}</text>
|
||||
<text class="frame-badge frame-badge-festival" wx:if="{{dayItem.dayInfo.lunarFestival && !dayItem.legalHoliday}}">{{dayItem.dayInfo.lunarFestival}}</text>
|
||||
<text class="frame-badge frame-badge-festival" wx:if="{{dayItem.dayInfo.solarFestival && !dayItem.legalHoliday}}">{{dayItem.dayInfo.solarFestival}}</text>
|
||||
<text class="frame-badge frame-badge-term" wx:if="{{dayItem.dayInfo.solarTerm}}">{{dayItem.dayInfo.solarTerm}}{{dayItem.termTime ? ' ' + dayItem.termTime : ''}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 星期 + 工作日 -->
|
||||
<view class="day-frame-week">
|
||||
星期{{dayItem.dayInfo.weekDay}} · {{dayItem.legalHoliday ? dayItem.legalHoliday + ' · 放假' : (dayItem.workday ? '工作日 · 上班' : '周末 · 休息')}}
|
||||
</view>
|
||||
|
||||
<!-- 宜忌(在大框里面) -->
|
||||
<view class="day-frame-yiji">
|
||||
<view class="frame-yiji-row">
|
||||
<view class="frame-yiji-title yi">宜</view>
|
||||
<view class="frame-yiji-items">
|
||||
<text class="frame-yiji-item yi" wx:for="{{dayItem.almanac.recommends}}" wx:key="*this">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="frame-yiji-row">
|
||||
<view class="frame-yiji-title ji">忌</view>
|
||||
<view class="frame-yiji-items">
|
||||
<text class="frame-yiji-item ji" wx:for="{{dayItem.almanac.avoids}}" wx:key="*this">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 右箭头(在大框里面) -->
|
||||
<view class="day-arrow-inner right" catchtap="nextDay">›</view>
|
||||
</view>
|
||||
|
||||
<!-- 节日/节气(固定高度,空着也占位) -->
|
||||
<view class="almanac-fest">
|
||||
<text class="badge badge-holiday" wx:if="{{dayItem.legalHoliday}}">{{dayItem.legalHoliday}}</text>
|
||||
<text class="badge badge-festival" wx:if="{{dayItem.dayInfo.lunarFestival && !dayItem.legalHoliday}}">{{dayItem.dayInfo.lunarFestival}}</text>
|
||||
<text class="badge badge-festival" wx:if="{{dayItem.dayInfo.solarFestival && !dayItem.legalHoliday}}">{{dayItem.dayInfo.solarFestival}}</text>
|
||||
<text class="badge badge-term" wx:if="{{dayItem.dayInfo.solarTerm}}">{{dayItem.dayInfo.solarTerm}}{{dayItem.termTime ? ' ' + dayItem.termTime : ''}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 佛历提醒(固定高度,空着也占位) -->
|
||||
<view class="buddhist-tip">
|
||||
<text class="buddhist-text" wx:if="{{dayItem.showBuddhist && dayItem.nextBuddhist}}" catchtap="noop">🪷 距 {{dayItem.nextBuddhist.name}} 还有 {{dayItem.nextBuddhist.daysLeft}} 天({{dayItem.nextBuddhist.solarDate}})</text>
|
||||
</view>
|
||||
|
||||
<!-- 星期 + 工作日/节假日提示 -->
|
||||
<view class="day-type-tip {{dayItem.legalHoliday ? 'tip-holiday' : (dayItem.workday ? 'tip-workday' : 'tip-weekend')}}">
|
||||
星期{{dayItem.dayInfo.weekDay}} · {{dayItem.legalHoliday ? dayItem.legalHoliday + ' · 放假' : (dayItem.workday ? '工作日 · 上班' : '周末 · 休息')}}
|
||||
<!-- 佛历提醒 -->
|
||||
<view class="buddhist-tip" wx:if="{{dayItem.showBuddhist && dayItem.nextBuddhist}}">
|
||||
<text class="buddhist-text">🪷 距 {{dayItem.nextBuddhist.name}} 还有 {{dayItem.nextBuddhist.daysLeft}} 天({{dayItem.nextBuddhist.solarDate}})</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 宜忌(点击放大) -->
|
||||
<view class="card yiji-card" bindtap="openZoom" data-type="yiji" data-date="{{dayItem.key}}">
|
||||
<view class="yiji-row">
|
||||
<view class="yiji-col">
|
||||
<view class="yiji-title yi">宜</view>
|
||||
<view class="yiji-items">
|
||||
<text class="yiji-item yi" wx:for="{{dayItem.almanac.recommends}}" wx:key="*this">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="yiji-divider"></view>
|
||||
<view class="yiji-col">
|
||||
<view class="yiji-title ji">忌</view>
|
||||
<view class="yiji-items">
|
||||
<text class="yiji-item ji" wx:for="{{dayItem.almanac.avoids}}" wx:key="*this">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 黄历详情(点击放大) -->
|
||||
<!-- 黄历详情 -->
|
||||
<view class="card" bindtap="openZoom" data-type="detail" data-date="{{dayItem.key}}">
|
||||
<view class="detail-grid">
|
||||
<view class="detail-item">
|
||||
@@ -136,17 +139,13 @@
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<!-- 左右箭头(固定在 swiper 最左最右) -->
|
||||
<view class="day-arrow-fixed left" bindtap="prevDay">‹</view>
|
||||
<view class="day-arrow-fixed right" bindtap="nextDay">›</view>
|
||||
</view>
|
||||
|
||||
<!-- 月历视图:swiper 上下/左右滚动换月 -->
|
||||
<!-- 月历视图:swiper 左右滑动换月 -->
|
||||
<view class="page-body month-body" wx:if="{{viewMode === 'month'}}" style="padding-top: {{statusBarHeight + navBarHeight}}px;">
|
||||
<view class="month-header">
|
||||
<text class="month-title font-chinese">{{currentYear}}年{{currentMonth}}月</text>
|
||||
<text class="month-hint">上下或左右滑动换月</text>
|
||||
<text class="month-hint">左右滑动换月</text>
|
||||
</view>
|
||||
<view class="grid grid-cols-7 week-head">
|
||||
<view class="text-center week-cell" wx:for="{{weekHeaders}}" wx:key="*this">{{item}}</view>
|
||||
|
||||
Reference in New Issue
Block a user