<!--pages/contest/ranking/ranking.wxml-->
<view>
  <image src="../../../imgs/contest/ranking/bg.png" class="bg"></image>
  <image src="../../../imgs/contest/ranking/home.png" class="home" bindtap="goHome"></image>
  <view class="page-title">排行榜</view>
  <view class="content">
    <view class="navList">
      <view class="{{page==1&&'active'}}" bindtap="togglePage" data-index="1">个人排名</view>
      <view class="{{page==2&&'active'}}" bindtap="togglePage" data-index="2">区排名</view>
      <view class="{{page==3&&'active'}}" bindtap="togglePage" data-index="3">学校排名</view>
    </view>
    <view class="ranking-top">
      <view class="second" wx:if="{{second.userId}}">
        <image src="{{second.avatar}}"></image>
        <view class="num">2</view>
        <view class="nickname">{{second.nickname}}</view>
        <view class="fraction">{{second.score}}分</view>
      </view>
      <view class="second" wx:else></view><!-- 占位 -->
      <view class="first" wx:if="{{first.userId}}">
        <image src="{{first.avatar}}"></image>
        <view class="num">1</view>
        <view class="nickname">{{first.nickname}}</view>
        <view class="fraction">{{first.score}}分</view>
      </view>
      <view class="first" wx:else></view><!-- 占位 -->
      <view class="third" wx:if="{{third.userId}}">
        <image src="{{third.avatar}}"></image>
        <view class="num">3</view>
        <view class="nickname">{{third.nickname}}</view>
        <view class="fraction">{{third.score}}分</view>
      </view>
      <view class="third" wx:else></view><!-- 占位 -->
    </view>
    <view class="ranking-list">
      <view class="ranking-item" wx:for="{{dataList}}" wx:key="index">
        <view class="order-num">{{index+4}}</view>
        <image src="{{item.avatar}}"></image>
        <view class="nickname">{{item.nickname}}</view>
        <view class="fraction">{{item.score}}分</view>
      </view>
      <!-- <view class="ranking-item">
        <view class="order-num">4</view>
        <image mode="widthFix" src="../../../imgs/contest/ranking/avatr.png"></image>
        <view class="nickname">乔巴</view>
        <view class="fraction">99分</view>
      </view>
      <view class="ranking-item">
        <view class="order-num">4</view>
        <image mode="widthFix" src="../../../imgs/contest/ranking/avatr.png"></image>
        <view class="nickname">乔巴</view>
        <view class="fraction">99分</view>
      </view>
      <view class="ranking-item">
        <view class="order-num">4</view>
        <image mode="widthFix" src="../../../imgs/contest/ranking/avatr.png"></image>
        <view class="nickname">乔巴</view>
        <view class="fraction">99分</view>
      </view> -->
    </view>
  </view>
</view>
