<!--pages/index/index.wxml-->
<view class="container listMain">
  <block wx:if="{{loginStatus}}">
    <van-sticky>
      <view class="topSeach">
        <view class="rightBox" style="position: relative;">
          <van-search value="{{ searchVal }}" shape="round" placeholder="请输入车牌号码" bind:change="onChange" bind:search="onSearch" bind:cancel="onCancel" use-action-slot>
            <van-icon slot="action" class-prefix="iconfont" name="arrow3-right_fill" size="28px" color="#4B70EA" bind:tap="toSearch" />
          </van-search>
        </view>
      </view>
      <!-- <view class="filterStatus">
        <text data-type="" class="{{activeIndex==''?'active':''}}" bindtap="changeTypeFun">全部</text>
        <text data-type="1" class="{{activeIndex=='1'?'active':''}}" bindtap="changeTypeFun">管理员</text>
        <text data-type="2" class="{{activeIndex=='2'?'active':''}}" bindtap="changeTypeFun">业务部门</text>
        <text data-type="3" class="{{activeIndex=='3'?'active':''}}" bindtap="changeTypeFun">司机</text>
      </view> -->
    </van-sticky>

    <view class="width710">
      <block wx:if="{{!requestStatu}}">
        <block wx:if="{{resData.length>0}}">
          <block wx:for="{{resData}}" wx:key="index">
            <navigator url="info?id={{item.id}}&type=double&index={{index}}" class="listItem">
              <view class="title">
                <view class="title-left">
                  <van-icon class='iconfont' name='/images/licensePlate.png' size="36rpx"></van-icon><text>{{item.licensePlate}}</text>
                  <text class="licensePlate yellow_licensePlate" wx:if="{{item.plateColor=='黄色'}}">黄</text>
                  <text class="licensePlate blue_licensePlate" wx:elif="{{item.plateColor=='蓝色'}}">蓝</text>
                  <text class="licensePlate green_licensePlate" wx:elif="{{item.plateColor=='绿色'}}">绿</text>
                  <text class="licensePlate white_licensePlate" wx:elif="{{item.plateColor=='白色'}}">白</text>
                  <text class="licensePlate black_licensePlate" wx:elif="{{item.plateColor=='黑色'}}">黑</text>
                  <text class="licensePlate other_licensePlate" wx:else>其他</text>
                  <text class="status reservationType{{item.reservationType}}">{{ filters.reservationType(item.reservationType) }}</text>
                </view>
                <view class="title-right">
                  <view wx:if="{{item.grossTime}}">过毛时间：{{ filters.tosubStr(item.grossTime,0,19) }}</view>
                  <view wx:if="{{item.tareTime}}">过皮时间：{{ filters.tosubStr(item.tareTime,0,19) }}</view>
                </view>
              </view>
              <view class="codeType" style="min-height: 20rpx;">
                <text wx:if="{{item.goodsName}}">{{item.goodsName}}</text>
                <text wx:if="{{item.goodsModel}}">{{item.goodsModel}}</text>
              </view>
              <view class="weightNum">
                <view class="weightLeft"><text>首次称重</text><text>{{filters.numberFormat(item.grossWeight,2)}} 吨</text></view>
                <view class="weightLeft"><text>末次称重</text><text>{{filters.numberFormat(item.tareWeight,2)}} 吨</text></view>
                <view><text>净重</text><text>{{filters.numberFormat(item.netWeight,2)}} 吨</text></view>
              </view>
              <view class="info">
                <view><text>车次编码：{{item.carNumber?item.carNumber:'--'}}</text></view>
              </view>
              <view class="info">
                <view><text decode="{{true}}">司{{str+str}}机：{{item.driverName?item.driverName:'--'}}</text><text>司机电话：{{item.driverMobile?item.driverMobile:'--'}}</text></view>
                <!-- <view>
                  <van-button data-index="{{index}}" type="info" data-id="{{item.id}}" catchtap="showPopup" size="mini">审核</van-button>
                </view> -->
              </view>
              <view class="bottomBtn" wx:if="{{ item.status == '12' }}">
                <van-button type="primary" size="small" data-id="{{item.id}}" data-url="sign?id={{item.id}}" catchtap="toLink">审核</van-button>
              </view>

            </navigator>
          </block>
          <!-- 底部加载动画 -->
          <view class='more'>
            <block wx:if="{{more}}">
              <van-loading size="24px" color="#1989fa">加载中...</van-loading>
            </block>
            <block wx:else>{{nomore}}</block>
          </view>
          <view style="height: 160rpx;"> </view>
        </block>
        <block wx:else>
          <van-empty description="未搜索到相关记录" image="/images/null3.png" />
        </block>
      </block>

    </view>
  </block>
  <block wx:else>
    <view>
      <van-empty image="/images/loginNull.png">
        <view slot="description" style="text-align: center;">
          <text style="display:block;margin-bottom: 20rpx;">您还未登录，登录后查看更多～</text>
          <van-button type="info" bindtap="toLogin">立即登录</van-button>
        </view>
      </van-empty>
    </view>
  </block>
</view>

<!-- 弹窗 -->
<van-popup show="{{ show }}" position="bottom" round closeable custom-style="width:100%;padding:0rpx 30rpx 160rpx;" bind:close="onClose">
  <view style="height: 90rpx;line-height: 90rpx;text-align: center;">审核</view>
  <form bindsubmit="formSubmit">
    <view class="part">
      <view class="height20"> </view>
      <view class="height20"> </view>
      <input name="id" value='{{id}}' hidden='true' />
      <van-field label="审核结果" name="auditFlag" value="{{ auditFlag }}" required input-align="right" class="radioHeight fieldAutoHeight">
        <view slot="input" class="radioHeightBx">
          <radio-group class="radio-group" bindchange="dangerStatusChange" data-radioType="auditFlag">
            <label class="radio">
              <radio value="false" checked="{{auditFlag=='false'}}" color="#4B70EA" />通过
            </label>
            <label class="radio">
              <radio value="true" checked="{{auditFlag=='true'}}" color="#4B70EA" />不通过
            </label>
          </radio-group>
        </view>
      </van-field>
      <van-field label="审核备注" required="{{auditFlag=='true'}}" name="auditReason" value="{{ auditReason }}" type="textarea" input-align="right" placeholder="请输入审核备注" autosize></van-field>
    </view>

    <view class="submitBtn">
      <view style="padding-top: 60rpx;">
        <van-button block round type="info" form-type="submit" color="#0396FF">确认</van-button>
      </view>
    </view>
  </form>
</van-popup>

<wxs module="filters" src="../../utils/filter.wxs"></wxs>