<!-- 管事会员记录页面 -->
<view class="page-container">
  <!-- 固定顶部区域 - 不动 -->
  <view class="fixed-top">
    <!-- 顶部统计区域 -->
    <view class="tongji-quyu">
      <!-- 分红总额 -->
      <view class="fenyong-zonge">
        <view class="zonge-label">分红总额</view>
        <view class="zonge-value">¥{{fenyongzonge}}</view>
        <view class="zonge-tip">累计收益</view>
      </view>

      <!-- 底部统计信息 -->
      <view class="tongji-bottom">
        <view class="tongji-item">
          <view class="tongji-number">{{yaoqingzongshu}}</view>
          <view class="tongji-label">邀请接单员</view>
        </view>
        
        <view class="tongji-divider"></view>
        
        <view class="tongji-item">
          <view class="tongji-number">{{chongzhiDashouShuliang}}</view>
          <view class="tongji-label">充值接单员</view>
        </view>
      </view>
    </view>

    <!-- 刷新按钮 -->
    <view class="shuaxin-anniu" bindtap="shuaxinShuju">
      <text class="shuaxin-icon {{shuaxinKezhi ? 'shuaxin-disabled' : ''}}">↻</text>
    </view>
  </view>

  <!-- 滚动区域 - 只包裹列表部分 -->
  <scroll-view 
    class="scroll-area"
    scroll-y
    enable-back-to-top
    bindscrolltolower="shanglaJiazai">
    
    <!-- 全局加载状态 -->
    <view wx:if="{{jiazaiZhong && dashouList.length === 0}}" class="jiazai-quanju">
      <view class="jiazai-spinner"></view>
      <view class="jiazai-text">加载中...</view>
    </view>
    
    <!-- 空数据提示 -->
    <view wx:if="{{!jiazaiZhong && dashouList.length === 0}}" class="kong-shuju">
      <view class="kong-icon">🚀</view>
      <view class="kong-text">暂无会员记录</view>
      <view class="kong-tip">快去邀请接单员吧</view>
      <view class="kong-btn" bindtap="shuaxinShuju">点击刷新</view>
    </view>

    <!-- 会员记录卡片列表 -->
    <block wx:if="{{dashouList.length > 0}}">
      <!-- 列表标题 -->
      <view class="list-title">
        <text class="title-text">充值记录</text>
        <text class="title-count">({{dashouList.length}}/{{zongTiaoshu}})</text>
      </view>
      
      <!-- 卡片列表 -->
      <view class="card-list">
        <block wx:for="{{dashouList}}" wx:key="index">
          <view class="dashou-card">
            <!-- 圆形头像区域 -->
            <view class="touxiang-quyu">
              <image 
                class="dashou-touxiang" 
                src="{{item.touxiangUrl}}"
                mode="aspectFill">
              </image>
              <!-- 头像边框效果 -->
              <view class="touxiang-border"></view>
            </view>

            <!-- 信息区域 -->
            <view class="xinxi-quyu">
              <view class="nicheng">{{item.nicheng}}</view>
              <view class="dashou-id">ID: {{item.yonghuid}}</view>
            </view>

            <!-- 分红金额区域 -->
            <view class="fenhong-quyu">
              <view class="fenhong-value">
                <text class="fenhong-jiahao">+</text>
                <text class="fenhong-shuzi">¥{{item.fenhong}}</text>
              </view>
              <view class="shijian">{{item.shijian}}</view>
            </view>
          </view>
        </block>
      </view>
      
      <!-- 加载更多提示 -->
      <view wx:if="{{jiazaiGengduo}}" class="jiazai-gengduo">
        <view class="gengduo-spinner"></view>
        <text class="gengduo-text">加载更多中...</text>
      </view>
      
      <!-- 没有更多数据 -->
      <view wx:if="{{meiyouGengduo && dashouList.length > 0}}" class="meiyou-gengduo">
        <view class="meiyou-icon">✓</view>
        <text class="meiyou-text">已经到底了，共{{dashouList.length}}条记录</text>
      </view>
    </block>
  </scroll-view>

  <!-- 错误提示 -->
  <view wx:if="{{cuowuTishi}}" class="cuowu-quyu">
    <view class="cuowu-icon">⚠️</view>
    <view class="cuowu-text">{{cuowuTishi}}</view>
    <view class="cuowu-btn" bindtap="chongshiJiazai">重试加载</view>
  </view>
</view>
<global-notification id="global-notification" />
