Files

37 lines
1.5 KiB
Plaintext

<!-- 通知中心页 U25 -->
<view class="page">
<view class="header">
<text class="title">通知</text>
<text class="unread-badge" wx:if="{{unreadCount > 0}}" bindtap="onMarkAllRead">
{{unreadCount}}条未读 · 全部已读
</text>
<text wx:else class="unread-badge empty">暂无未读</text>
</view>
<scroll-view scroll-y class="list" bindscrolltolower="onReachBottom" refresher-enabled bindrefresherrefresh="onPullDownRefresh">
<view wx:for="{{notifications}}" wx:key="notificationId" class="notif-item {{item.read ? 'read' : 'unread'}}"
bindtap="onMarkRead" data-id="{{item.notificationId}}">
<view class="notif-dot" wx:if="{{!item.read}}"></view>
<view class="notif-content">
<view class="notif-header">
<text class="notif-title">{{item.title}}</text>
<text class="notif-time">{{formatTime(item.createdAt)}}</text>
</view>
<text class="notif-body">{{item.content}}</text>
<view class="notif-type-tag {{item.type}}">
{{getTypeText(item.type)}}
</view>
</view>
</view>
<view wx:if="{{!loading && notifications.length === 0}}" class="empty">
<image class="empty-img" src="/assets/images/empty-notification.png" mode="aspectFit" />
<text class="empty-text">暂无通知</text>
</view>
<view wx:if="{{loading && notifications.length === 0}}" class="loading">
<text>加载中...</text>
</view>
</scroll-view>
</view>