<!--pages/apply/apply.wxml-->
<view class="apply-page">
  <navBar bg="#3A61B1">
    <image src="/assets/images/navbar/logo.png" class="logo" />
  </navBar>
  <view wx:if="{{list && list.length}}" class="list-box">
    <view wx:for="{{list}}" wx:key="id" class="white-box">
      <view wx:if="{{batch && item.status === 'WAIT'}}" class="radio-box">
        <radio checked="{{selectObj[item.id]}}" data-id="{{item.id}}" bind:tap="radioChange" />
      </view>
      <view class="info-container">
        <view class="title-box">
          <text>{{item.name}}的查验申请</text>
          <text wx:if="{{item.isRead}}" class="status">对方已读</text>
          <text wx:else class="status {{item.status === 'WAIT' ? 'warning' : ''}}">{{status[item.status]}}</text>
        </view>
        <view class="info-box">申请时间：
          <filter type="parseTime" value="{{item.createDate}}" params="{{['{y}-{m}-{d} {h}:{i}']}}" />
        </view>
        <view class="info-box">手机号：{{item.phone}}</view>
        <view class="btn-container">
          <view class="btn-box">
            <text class="btn" data-item="{{item}}" bind:tap="jumpInspected">查验对方</text>
            <view wx:if="{{item.status !== 'REFUSE'}}" class="line"></view>
            <text wx:if="{{item.status !== 'REFUSE'}}" class="btn">在线沟通</text>
          </view>
          <btn wx:if="{{item.status === 'WAIT'}}" data-item="{{item}}" width="162rpx" height="60rpx" fontSize="24rpx" bind:tap="handleClick">去授权</btn>
          <btn wx:if="{{item.status === 'AGREE'}}" data-id="{{item.reportId}}" width="190rpx" height="60rpx" fontSize="24rpx" plain class="primary-btn" bind:tap="jumpReport">查看授权报告</btn>
        </view>
      </view>
    </view>
  </view>
  <not wx:else top="250rpx"></not>

  <view class="bottom-fill"></view>
  <view class="bottom-box">
    <view class="batch-btn" bind:tap="changeBatch">{{batch ? '退出' : ''}}批量处理</view>
    <btn wx:if="{{batch}}" width="196rpx" height="63rpx" fontSize="26rpx" bind:tap="handleBatch">去操作</btn>
    <!-- <btn wx:else width="196rpx" height="63rpx" fontSize="26rpx" bind:tap="jumpAnswer">设置默认操作</btn> -->
    <!-- <button wx:else class="btn_default"></button> -->
    <image wx:else src="/assets/images/apply/btn_setDefault.png" class="btn_setDefault" bind:tap="jumpAnswer"></image>
  </view>

  <!-- 新手指引 -->
  <guide></guide>
  <shadow wx:if="{{shadowShow}}">
    <view class="modal-shadow">
      <image class="cancel" src="/assets/images/message/cancel.png" bind:tap="hideShadow" />
      <image class="report-icon" src="/assets/images/apply/report-search.png" />
      <view class="infomation">
        <text wx:if="{{batch}}">以上用户</text>
        <text wx:else>用户{{selectItem.name}}</text>
        实名向您发起查验申请，您同意后可授权其查验您的个人信息报告。是否同意授权？
      </view>
      <view class="btn-box">
        <view class="btn agree" data-agree="{{true}}" bind:tap="handleAgree">
          <image src="/assets/images/apply/agree.png" />
          同意
        </view>
        <view class="btn refuse" bind:tap="handleRefuse">
          <image src="/assets/images/apply/refuse.png" />
          拒绝
        </view>
      </view>
    </view>
  </shadow>
</view>