<!--downline.wxml-->
<view class="user_info">
  <view class="avatar">
    <image src="{{userInfo.headimgurl}}"></image>
  </view>
  <view class="user_desc">
    <view class="user_name">{{userInfo.nickname}}</view>
    <view class="user_banlance">可用佣金：<text class="num">¥ {{money}}</text> </view>
    <view class="withdraw">
      <view class="withdraw_btn" style="{{money <= 0?'color:#999':''}}" data-attr="content" bindtap="showWithdraw">申请提现</view>
    </view>
  </view>
  <button open-type="share" class="share_btn" bindtap="shareApp">分享</button>
</view>

<block wx:if="{{downline.one.length > 0}}">
  <view class="downline" style="height:{{firstActive?'auto':'72rpx'}};max-height:{{firstActive?'none':'72rpx'}};">
    <view class="downline_header" bindtap="showFirstDownline">
      <view class="title">一级伙伴</view>
      <view class="iconfont icon-enter" style="transform: rotateZ({{firstActive?'90':'0'}}deg)"></view>
    </view>
    <view class="downline_item" wx:for="{{downline.one}}">
      <view class="avatar">
        <image src="{{item.headimgurl}}"></image>
      </view>
      <view class="user_name">{{item.nickname}}</view>
    </view>
  </view>
</block>

<block wx:if="{{downline.two[0].length > 0}}">
  <view class="downline" style="height:{{secondActive?'auto':'72rpx'}};max-height:{{secondActive?'none':'72rpx'}};">
    <view class="downline_header" bindtap="showSecondDownline">
      <view class="title">二级伙伴</view>
      <view class="iconfont icon-enter" style="transform: rotateZ({{secondActive?'90':'0'}}deg)"></view>
    </view>
    <block wx:for="{{downline.two}}">
      <block wx:for="{{item}}">
        <view class="downline_item">
          <view class="avatar">
            <image src="{{item.headimgurl}}"></image>
          </view>
          <view class="user_name">{{item.nickname}}</view>
        </view>
      </block>
    </block>
  </view>
</block>

<block wx:if="{{downline.one.length == 0 ||!downline.one||!downline}}">
  <view class="downline_tips">暂无伙伴</view>
</block>

<block wx:if="{{withdrawFlag}}">
  <view class="mask" bindtap="showWithdraw">
    <view class="withdraw_wrapper" data-attr="content">
      <view class="title" data-attr="content">请输入您的提现信息</view>
      <view class="withdraw_money" data-attr="content">
        <input placeholder-style="gray" placeholder="姓名" type="text" bindinput="syncInfo" data-info="name" data-attr="content" />
        <text class="iconfont icon-name" data-attr="content"></text>
      </view>
      <view class="withdraw_money" data-attr="content">
        <input placeholder-style="gray" placeholder="开户行" type="text" bindinput="syncInfo" data-info="bank" data-attr="content" />
        <text class="iconfont icon-bank" data-attr="content"></text>
      </view>
      <view class="withdraw_money" data-attr="content">
        <input placeholder-style="gray" placeholder="银行卡号" type="number" bindinput="syncInfo" data-info="card_num" data-attr="content" />
        <text class="iconfont icon-card" data-attr="content"></text>
      </view>
      <view class="withdraw_money" data-attr="content">
        <input placeholder-style="gray" placeholder="提现金额" type="number" bindinput="syncInfo" data-info="money" data-attr="content"/>
        <text class="iconfont icon-newbimoney" data-attr="content"></text>
      </view>
      <button data-attr="content" type="primary" bindtap="getWithdraw" disabled="{{!withdrawMoney&&!withdrawName&&!withdrawCard&&!withdrawBank}}">提交</button>
    </view>
  </view>
</block>