<view class="container">
  <!-- 头部信息 -->
  <view class="header" wx:if="{{userInfo}}">
    <image class="avatar" src="{{userInfo.avatar}}" mode="aspectFill"></image>
    <view class="info">
      <view class="name">{{userInfo.name}}</view>
      <view class="contribution">累计贡献：¥{{userInfo.contribution}}</view>
    </view>
  </view>

  <scroll-view 
    scroll-y 
    class="list-scroll" 
    bindscrolltolower="onReachBottom"
    enable-back-to-top
  >
    <!-- 订单列表 -->
    <view class="list-container" wx:if="{{list.length > 0}}">
      <view class="list-item" wx:for="{{list}}" wx:key="id">
        <view class="item-header">
          <text class="order-type">{{item.orderTypeText}}</text>
          <text class="status {{item.statusClass}}">{{item.statusText}}</text>
        </view>
        <view class="item-content">
          <view class="row">
            <text class="label">订单金额</text>
            <text class="value">¥{{item.orderAmount}}</text>
          </view>
          <view class="row">
            <text class="label">获得佣金</text>
            <text class="value highlight">+¥{{item.commissionAmount}}</text>
          </view>
          <view class="row">
            <text class="label">佣金比例</text>
            <text class="value">{{item.commissionRate}}%</text>
          </view>
          <view class="row">
            <text class="label">时间</text>
            <text class="value">{{item.createdAtFormatted}}</text>
          </view>
        </view>
      </view>
    </view>
    
    <!-- 空状态 -->
    <view class="empty-state" wx:if="{{list.length === 0 && !loading}}">
      <image src="/images/empty-orders.png" class="empty-icon" mode="aspectFit"></image>
      <text>该用户暂无贡献订单</text>
    </view>
    
    <!-- 加载状态 -->
    <view class="loading-state" wx:if="{{loading}}">
      <view class="loading-spinner"></view>
      <text>加载中...</text>
    </view>
    
    <view class="no-more" wx:if="{{!hasMore && list.length > 0}}">
      <text>没有更多了</text>
    </view>
  </scroll-view>
</view>
