57 lines
2.5 KiB
Plaintext
57 lines
2.5 KiB
Plaintext
<!--index.wxml-->
|
|
<view class="container">
|
|
<!-- 搜索栏 -->
|
|
<view class="search-bar">
|
|
<input class="search-input" placeholder="搜索姓名" value="{{searchKeyword}}" bindinput="onSearchInput" />
|
|
</view>
|
|
|
|
<!-- 筛选栏 -->
|
|
<view class="filter-bar">
|
|
<text class="filter-label">筛选:</text>
|
|
<scroll-view class="filter-scroll" scroll-x>
|
|
<view class="filter-item {{currentFilter === 'all' ? 'active' : ''}}" bindtap="onFilterTap" data-filter="all">全部</view>
|
|
<view class="filter-item {{currentFilter === 'birthday' ? 'active' : ''}}" bindtap="onFilterTap" data-filter="birthday">生日</view>
|
|
<view class="filter-item {{currentFilter === 'anniversary' ? 'active' : ''}}" bindtap="onFilterTap" data-filter="anniversary">纪念日</view>
|
|
<view class="filter-item {{currentFilter === 'upcoming' ? 'active' : ''}}" bindtap="onFilterTap" data-filter="upcoming">即将到来</view>
|
|
</scroll-view>
|
|
</view>
|
|
|
|
<!-- 人员列表 -->
|
|
<scroll-view class="person-list" scroll-y>
|
|
<view wx:if="{{persons.length === 0}}" class="empty-state">
|
|
<text class="icon">📅</text>
|
|
<text class="text">还没有添加任何人</text>
|
|
<text class="hint">点击右下角 + 添加第一个</text>
|
|
</view>
|
|
|
|
<view wx:for="{{persons}}" wx:key="id" class="person-card" bindtap="onPersonTap" data-id="{{item.id}}">
|
|
<view class="person-header">
|
|
<image class="avatar" src="{{item.avatar || '/images/default-avatar.png'}}" mode="aspectFill" />
|
|
<view class="person-info">
|
|
<text class="person-name">{{item.name}}</text>
|
|
<text wx:if="{{item.nickname}}" class="person-nickname">{{item.nickname}}</text>
|
|
</view>
|
|
<view class="person-count">
|
|
<text wx:if="{{item.anniversaryCount}}" class="count-text">{{item.anniversaryCount}}</text>
|
|
<text class="count-label">个纪念日</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 最近的纪念日 -->
|
|
<view wx:if="{{item.nextAnniversary}}" class="next-anniversary">
|
|
<text class="next-label">📌 </text>
|
|
<text class="next-text">{{item.nextAnniversary.type}}: {{item.nextAnniversary.dateText}}</text>
|
|
<text wx:if="{{item.nextAnniversary.daysUntil}}" class="days-text {{item.nextAnniversary.daysUntil <= 7 ? 'urgent' : ''}}">
|
|
{{item.nextAnniversary.daysUntilText}}
|
|
</text>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
|
|
<!-- 浮动添加按钮 -->
|
|
<view class="fab" bindtap="onAddTap">
|
|
<text>+</text>
|
|
</view>
|
|
</view>
|
|
|