Files
wxserver/pages/calendar/calendar.wxml
T
2025-10-26 19:29:30 +08:00

53 lines
2.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--calendar.wxml-->
<view class="container">
<!-- 日历头部 -->
<view class="calendar-header">
<view class="month-navigation">
<text class="nav-btn" bindtap="onPrevMonth"></text>
<text class="month-title">{{currentYear}}年{{currentMonth}}月</text>
<text class="nav-btn" bindtap="onNextMonth"></text>
</view>
<button class="today-btn" bindtap="onGoToday">今天</button>
</view>
<!-- 星期标题 -->
<view class="week-header">
<view wx:for="{{['日', '一', '二', '三', '四', '五', '六']}}" wx:key="*this" class="week-title">{{item}}</view>
</view>
<!-- 日历内容 -->
<scroll-view class="calendar-content" scroll-y>
<view class="calendar-grid">
<view wx:for="{{calendarDays}}" wx:key="index" class="calendar-cell {{item.isToday ? 'today' : ''}} {{item.isOtherMonth ? 'other-month' : ''}}">
<text class="date-num">{{item.day}}</text>
<view class="events">
<view wx:for="{{item.events}}" wx:key="id" wx:for-item="event" class="event-dot" style="background-color: {{event.color}};"></view>
</view>
<view wx:if="{{item.hasMore}}" class="more-text">+{{item.moreCount}}</view>
</view>
</view>
<!-- 列表视图 -->
<view class="events-list">
<view class="section-title">本月纪念日</view>
<view wx:if="{{monthEvents.length === 0}}" class="empty-state">
<text class="icon">📅</text>
<text class="text">本月没有纪念日</text>
</view>
<view wx:for="{{monthEvents}}" wx:key="id" class="event-card" bindtap="onEventTap" data-id="{{item.id}}">
<view class="event-header">
<text class="event-icon">{{item.typeIcon}}</text>
<text class="event-title">{{item.personName}} - {{item.typeName}}</text>
<text class="event-date">{{item.dateText}}</text>
</view>
<view class="event-info">
<text wx:if="{{item.isLunar}}" class="lunar-badge">农历</text>
<text wx:if="{{item.daysUntil === 0}}" class="status urgent">今天</text>
<text wx:elif="{{item.daysUntil === 1}}" class="status warning">明天</text>
</view>
</view>
</view>
</scroll-view>
</view>