<!--packageH/deposit_group/rankList/rankList.wxml-->
<!-- --bgColor 主题背景颜色 -->
<view class="rank-wrap size-con" style="--bgRGB: {{backgroundRGB[0]}}, {{backgroundRGB[1]}}, {{backgroundRGB[2]}};">

  <!-- 头部用户信息 -->
  <view class="user-info">
    <view class="left">
      <view class="avatar">
      <image class="img" src="{{userInfo.avatar}}" mode='widthFix'></image>
    </view>
    <view class="user-rank">
      <text wx:if="{{userInfo.rank_no == '未上榜' || userInfo.rank_no > 100}}">未上榜</text>
      <text wx:else>NO.{{userInfo.rank_no}}</text>
    </view>
    </view>
    <view class="user-name">{{userInfo.nickname}}</view>
  </view>
  <view class="sale-info">
    <view class="invitation-num" style="margin-left: 10rpx; margin-right: 35rpx;">
      <view class="num">{{userInfo.buy_count}}人</view>
      <view class="text">邀请人数</view>
    </view>
    <view class="invitation-num">
      <view class="num">￥{{userInfo.commission_sum}}</view>
      <view class="text">分销受益</view>
    </view>
  </view>

  <!-- 排行榜信息 -->
  <view class="rank-info">
    <view class="rank-top">
      <view class="title">收益排行榜</view>
      <view class="hander">
        <view class="hander-left">排行</view>
        <view class="hander-center">会员</view>
        <view class="hander-right">收益</view>
      </view>
    </view>
    <view class="rank-list">
      <block wx:if="{{rankList.length > 0}}">
        <view class="item" wx:for="{{rankList}}" wx:key="index">
          <view class="left size-con">
            <image class="friend-img size-con" src="{{item.has_one_members.avatar}}"></image>
            <text class="friend-rank">{{item.rank_no}}</text>
          </view>
          <view class="center">{{item.has_one_members.nickname}}</view>
          <view class="right">
            累计收益￥{{item.commission_sum}}
          </view>
        </view>
        <view class="more" bindtap="loadMore" wx:if="{{isMore}}">查看更多
          <van-icon name="arrow-down" style="margin-left: 2rpx;" color="red"/>
        </view>
      </block>

      <block wx:else>
        <view class="rank-empty">---暂无排名---</view>
      </block>

 
    </view>

  </view>

  <!-- 海报 -->
  <yz-share-poster isshow="{{posterShow}}" activityid="{{activity_id}}" ></yz-share-poster>

</view>

<van-popup show="{{isShow}}"  
  custom-style="width: 70%; height: 70%;margin-top: -100rpx; overflow: visible; " 
  class="sharePopup" 
  round="{{true}}" 
  close-on-click-overlay="true" 
  bind:close="closeSharePopup"
>
  <view style="width:100%; height: 100%; border-radius: 30rpx;overflow: hidden;">
    <image src="{{posterImg}}" class="poster-img" show-menu-by-longpress mode="aspectFit"></image>
  </view>
  <view class="tipText" wx:if="{{commission > 0}}">
    <view>长按保存海报，分享到群/朋友圈</view>
    <view style="margin-top: 20rpx">每成功邀请1位好友下定金，可获得{{commission}}元</view>
  </view>
</van-popup>

<!-- 底部栏 -->
<yz-foot showExtension="{{true}}" bind:earnreward="showSharePopup"></yz-foot>