<!--pages/business/loan-releases/loan-releases.wxml-->
<view class="loan-releases-container">
  <!-- 搜索栏 -->
  <view class="search-bar">
    <view class="search-input">
      <text class="search-icon">🔍</text>
      <input 
        placeholder="搜索申请单号或客户姓名" 
        value="{{searchKeyword}}"
        bindinput="onSearchInput"
      />
    </view>
  </view>

  <!-- 筛选栏 -->
  <view class="filter-bar">
    <picker 
      bindchange="onFilterChange" 
      value="{{filterStatus}}" 
      range="{{['全部', '待处理', '处理中', '已通过', '已拒绝', '已完成', '已解押']}}"
      range-key=""
    >
      <view class="filter-item">
        <text>状态筛选</text>
        <text class="filter-value">{{filterStatus === 'all' ? '全部' : filterStatus}}</text>
        <text class="arrow">></text>
      </view>
    </picker>
  </view>

  <!-- 解押申请列表 -->
  <view class="release-list">
    <view 
      class="release-item" 
      wx:for="{{releases}}" 
      wx:key="id"
      data-release-id="{{item.id}}"
      bindtap="viewReleaseDetail"
    >
      <view class="release-header">
        <text class="release-number">{{item.applicationNumber}}</text>
        <view class="release-status {{item.status}}">
          <text>{{item.statusText}}</text>
        </view>
      </view>
      
      <view class="release-info">
        <view class="info-row">
          <text class="info-label">客户姓名：</text>
          <text class="info-value">{{item.customerName}}</text>
        </view>
        
        <view class="info-row">
          <text class="info-label">产品名称：</text>
          <text class="info-value">{{item.productName}}</text>
        </view>
        
        <view class="info-row">
          <text class="info-label">抵押物类型：</text>
          <text class="info-value">{{item.assetType}}</text>
        </view>
        
        <view class="info-row">
          <text class="info-label">解押数量：</text>
          <text class="info-value">{{item.releaseQuantity}}</text>
        </view>
        
        <view class="info-row">
          <text class="info-label">解押金额：</text>
          <text class="info-value">{{item.releaseAmount}}元</text>
        </view>
        
        <view class="info-row">
          <text class="info-label">申请时间：</text>
          <text class="info-value">{{item.applicationTime}}</text>
        </view>
        
        <view class="info-row">
          <text class="info-label">联系电话：</text>
          <text class="info-value">{{item.applicantPhone}}</text>
        </view>
        
        <view class="info-row" wx:if="{{item.processComment}}">
          <text class="info-label">处理意见：</text>
          <text class="info-value">{{item.processComment}}</text>
        </view>
      </view>
    </view>
  </view>

  <!-- 加载状态 -->
  <view class="loading" wx:if="{{loading}}">
    <text>加载中...</text>
  </view>

  <!-- 空状态 -->
  <view class="empty-state" wx:if="{{!loading && releases.length === 0}}">
    <text class="empty-icon">🔓</text>
    <text class="empty-text">暂无解押申请数据</text>
  </view>
</view>
