<!--shoppingGuid/page/pages/home/home.wxml-->
<wxs src="../../../../wxs/utils.wxs" module="utils" />
<!-- 导购首页 -->
<view class='main-container'>
	<!-- top -->
	<view class='top-icons'>
		<view class='icon-item' bindtap='onTapShowMyQrcode'>
			<image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/home_qrcode.png' mode='aspectFit' />
			<view class='icon-title'>招募码</view>
		</view>
		<view class='icon-item' bindtap='onTapToMall'>
			<image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/home_go_mall.png' mode='aspectFit' />
			<view class='icon-title'>前往商城</view>
		</view>
		<view class='icon-item' bindtap='onTapToMember'>
			<image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/home_member.png' mode='aspectFit' />
			<view class='icon-title'>会员</view>
		</view>
	</view>
	<!--招募榜 -->
	<view class='header-tab'>
		<view
		 class='header-tab-item'
		 wx:for="{{navBar}}"
		 wx:key="topbar"
		 wx:for-index="idx"
		 bindtap='onTopBarTap'
		 data-index="{{idx}}"
		 data-item="{{item}}"
		 wx:for-item="item"
		>
			<view class='item-text {{item.isActive ? "active" : ""}}'>{{item.name}}</view>
		</view>
	</view>
	<view class='list-container'>
		<!-- 招募榜 -->
		<view class='list' wx:if="{{current == 1}}">
			<view class='title'>
				<image src='/assets/imgs/shoppingGuide/home_top20.png' mode='widthFix' />
			</view>
			<view class='table-list' wx:if="{{rankList.length}}">
				<block wx:for="{{rankList}}" wx:key="{{index}}" wx:for-item="item">
					<view class='table-list-item'>
						<view class='lf'>
							<image src='{{item.member.avatar? item.member.avatar : defaultAvatar}}' mode='aspectFit' />
							<text>{{utils.phoneFormat(item.member.mobile || 17521232119)}}</text>
						</view>
						<view class='rg'>已招募
							<text>{{item.recruitCount}}</text>
							人
						</view>
					</view>
				</block>
			</view>
      <view class="no-list" wx:else>{{loadingText}}</view>
		</view>
		<!-- 门店榜单 -->
		<view class='list' wx:if="{{current == 2}}">
			<view class='title'>
				<image src='/assets/imgs/shoppingGuide/home_top20.png' mode='widthFix' />
			</view>
			<view class='table-list' wx:if="{{storeList.length}}">
				<block wx:for="{{storeList}}" wx:key="{{index}}" wx:for-item="item">
					<view class='table-list-item'>
						<view class='lf'>
							<image src='{{item.member.avatar? item.member.avatar : defaultAvatar}}' mode='aspectFit' />
							<text>{{item.store.name}}</text>
						</view>
						<view class='rg'>已招募
							<text>{{item.recruitCount}}</text>
							人
						</view>
					</view>
				</block>
			</view>
      <view class="no-list" wx:else>暂无榜单</view>
		</view>
	</view>
</view>

<!-- 整体布局 -->
<!-- tabbar -->
<tab-bar index="{{0}}" />

