47 lines
1.5 KiB
Plaintext
47 lines
1.5 KiB
Plaintext
<!-- components/calendar/index.wxml -->
|
|
<view class="calendar">
|
|
<!-- 年份切换器 -->
|
|
<view class="year">
|
|
<t-icon class="btn" name="chevron-left" size="40rpx" catchtap="prevYear" />
|
|
<text class="text">{{currentYear}} 年</text>
|
|
<t-icon class="btn" name="chevron-right" size="40rpx" catchtap="nextYear" />
|
|
</view>
|
|
|
|
<!-- 星期标题 -->
|
|
<view class="weekdays">
|
|
<view class="weekday">日</view>
|
|
<view class="weekday">一</view>
|
|
<view class="weekday">二</view>
|
|
<view class="weekday">三</view>
|
|
<view class="weekday">四</view>
|
|
<view class="weekday">五</view>
|
|
<view class="weekday">六</view>
|
|
</view>
|
|
|
|
<!-- 月份列表 -->
|
|
<scroll-view class="months" scroll-y enhanced show-scrollbar="{{false}}" scroll-into-view="{{scrollIntoView}}" scroll-with-animation>
|
|
<block wx:for="{{months}}" wx:key="month">
|
|
<view class="month" id="month-{{item.month}}">
|
|
<!-- 月份标题 -->
|
|
<view class="title">{{item.month}} 月</view>
|
|
<!-- 日期网格 -->
|
|
<view class="days">
|
|
<block wx:for="{{item.days}}" wx:key="date" wx:for-item="day">
|
|
<view
|
|
class="day {{day.isCurrentMonth ? '' : 'other-month'}} {{day.hasJournal ? 'has-journal' : ''}} {{day.isToday ? 'today' : ''}}"
|
|
catchtap="onDayTap"
|
|
data-date="{{day.date}}"
|
|
data-year="{{day.year}}"
|
|
data-month="{{day.month}}"
|
|
data-day="{{day.day}}"
|
|
>
|
|
<view class="number">{{day.day}}</view>
|
|
<view wx:if="{{day.hasJournal}}" class="dot"></view>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</scroll-view>
|
|
</view>
|