58 lines
2.1 KiB
Plaintext
58 lines
2.1 KiB
Plaintext
<view class="container page-enter" style="{{themeStyle}}">
|
|
<!-- Period tabs -->
|
|
<view class="period-tabs">
|
|
<view
|
|
wx:for="{{periods}}"
|
|
wx:key="key"
|
|
class="period-tab {{activePeriod === item.key ? 'active' : ''}}"
|
|
data-period="{{item.key}}"
|
|
bindtap="switchPeriod"
|
|
>{{item.label}}</view>
|
|
</view>
|
|
|
|
<!-- Loading -->
|
|
<view class="status-wrap" wx:if="{{loading}}">
|
|
<text class="status-text">加载中...</text>
|
|
</view>
|
|
|
|
<!-- Empty -->
|
|
<view class="status-wrap" wx:elif="{{empty}}">
|
|
<image class="empty-icon" src="{{icons.peopleFill}}" mode="aspectFit"></image>
|
|
<text class="empty-text">暂无排行数据</text>
|
|
<text class="empty-sub">快去训练吧!</text>
|
|
</view>
|
|
|
|
<!-- Rank list -->
|
|
<view class="rank-list" wx:else>
|
|
<view
|
|
wx:for="{{rankedList}}"
|
|
wx:key="openid"
|
|
class="rank-item {{item.openid === myEntry.openid ? 'is-me' : ''}}"
|
|
>
|
|
<view class="rank-num {{item.rank === 1 ? 'gold' : item.rank === 2 ? 'silver' : item.rank === 3 ? 'bronze' : ''}}">
|
|
<text wx:if="{{item.rank === 1}}">🥇</text>
|
|
<text wx:elif="{{item.rank === 2}}">🥈</text>
|
|
<text wx:elif="{{item.rank === 3}}">🥉</text>
|
|
<text wx:else>{{item.rank}}</text>
|
|
</view>
|
|
<image class="rank-avatar" src="{{icons.peopleFill}}" mode="aspectFit"></image>
|
|
<view class="rank-info">
|
|
<text class="rank-name">{{item.name}}</text>
|
|
<text class="rank-sessions">{{item.sessions}}次</text>
|
|
</view>
|
|
<text class="rank-dur">{{item.durationText}}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- My entry pinned at bottom (if not already in list) -->
|
|
<view class="my-bar" wx:if="{{myEntry && myEntry.rank > rankedList.length}}">
|
|
<view class="rank-num">{{myEntry.rank}}</view>
|
|
<image class="rank-avatar" src="{{icons.peopleFill}}" mode="aspectFit"></image>
|
|
<view class="rank-info">
|
|
<text class="rank-name">我 ({{myEntry.name}})</text>
|
|
<text class="rank-sessions">{{myEntry.sessions}}次</text>
|
|
</view>
|
|
<text class="rank-dur">{{myEntry.durationText}}</text>
|
|
</view>
|
|
</view>
|