<wxs module="filters" src="../../../../utils/filter.wxs"></wxs>
<view>
	<view>
		<view class="flex jc_sb pd bg-red ai-center">
			<view>
				<view class="t1">排行榜</view>
				<view class="t2 pdt10 pdr40" wx:if="{{userRanking.rownum == 1}}">恭喜您当前排名第一！</view>
				<view class="t2 pdt10 pdr40" wx:elif="{{userRanking.mindistribut_money}}">您距离前一名还差<text class="money">{{filters.toFix(userRanking.mindistribut_money - userRanking.distribut_money,2)}}</text></view>
				<view class="t2 pdt10 pdr40" wx:elif="{{userRanking.underling_number}}">您距离前一名还差{{userRanking.underling_number}}人</view>
				<view class="t2 pdt10 pdr40" wx:else>好好努力，天天向上！</view>
			</view>
			<view><image class="badge" src="../../../images/badge.png"/></view>
		</view>
		
		<view class="tab-head flex t-c bg-red2 fs26">
			<view class="tab-head-item pd20 f1 {{currentTabIndex == index ? 'active':''}}" wx:for="{{tabArr}}" bindtap="clickTab" data-index="{{index}}">{{item}}</view>
		</view>
		
		<view class="pd20 flex ai-center fs26 arrow-r bdb">
			<view class="pdr20"><image class="avatar" src="{{userInfo.head_pic}}"/></view>
			<view>
				<view class="fs30">{{userInfo.nickname}}</view>
				<view class="pdt10 c-a" wx:if="{{currentTabIndex == 0}}">当前排名：<text class="c-red fs32">{{userRanking.rownum}}</text>，获得佣金：<text class="money c-red fs32">{{userRanking.distribut_money}}</text></view>
				<view class="pdt10 c-a" wx:else>当前排名：<text class="c-red fs32">{{userRanking.rownum}}</text>，下线人数：<text class="c-red fs32">{{userRanking.underling_number}}</text></view>
			</view>
		</view>
	</view>
	
	<view class="tab-content">
		<view class="flex ai-center pd20 fs26" wx:for="{{list.pageData}}">
			<view class="badge2-container pd20">
				<image wx:if="{{index < 3}}" src="../../../images/no{{index + 1}}.png" class="badge2" data-num="{{index+1}}"/>
				<text wx:else>{{index + 1}}</text>
			</view>
			<view class="pdr20"><image class="avatar2" src="{{item.head_pic}}"/></view>
			<view>
				<view class="fs30">{{item.nickname}}</view>
				<view class="pdt10 c-a" wx:if="{{currentTabIndex == 0}}">获得佣金：<text class="money c-red fs32">{{item.distribut_money}}</text></view>
				<view class="pdt10 c-a" wx:else>下线人数：<text class="c-red">{{item.underling_number}}</text></view>
			</view>
		</view>
	</view>
	<view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
	<nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata>
</view>