<wxs module="filters" src="../../utils/toFixed.wxs" />
<view class="top_bg">
      <image mode="widthFix" src="../../xiao/titlebg@2x.png"></image>
      <view class="top_title">顽主杯屠龙榜</view>
</view>
<view class="tab">
  <view bindtap="tab"   data-id='win' class="{{cur=='win'?'act':''}}">今日盈利榜</view>
  <view bindtap="tab"   data-id='loss' class="{{cur=='loss'?'act':''}}">今日亏损榜</view>
  <view bindtap="tab"   data-id='total_win' class="{{cur=='total_win'?'act':''}}">总盈利榜</view>
  <view bindtap="tab"   data-id='total_loss' class="{{cur=='total_loss'?'act':''}}">总亏损榜</view>
</view>
<scroll-view scroll-y="{{true}}" bindscrolltolower='next'>
  <navigator wx:for="{{list}}" class="list" url="../homepage/homepage?id={{item.match_id}}&record_id={{item.id}}&user_id={{item.user_id}}">
    <image wx:if="{{index<3}}" class="number" mode="widthFix" src="../../xiao/{{index+1}}.png"></image>
    <text wx:else class="number">{{index+1}}</text>
    <text class="usn">{{item.username}}</text>
    <text wx:if="{{cur == 'win' || cur == 'loss'}}" class="bar" style="background-color: {{filters.getColor()}};width:{{item.win_loss/list[0].win_loss*320}}rpx"></text>
    <text wx:else class="bar" style="background-color: {{filters.getColor()}};width:{{item.total_win_loss/list[0].total_win_loss*320}}rpx"></text>
    <text wx:if="{{cur == 'win' || cur == 'loss'}}">{{item.win_loss}}w</text>
    <text wx:else>{{item.total_win_loss}}w</text>
  </navigator>
  <block wx:if='{{total >= 20}}'>
      <view class='loading' wx:if='{{list.length < total}}'>加载更多...</view>
  </block>
</scroll-view>