<!--pages/reservationPipe/add.wxml-->
<view class="container" style="padding-bottom:100px;">
  <view class="height20"></view>
  <view>
    <form bindsubmit="formSubmit">
      <view class="part">
        <van-field required label="车牌号码" readonly border="{{false}}"></van-field>
        <car-num-input bind:setCarNum="licensePlate" isKeyboard="{{isKeyboard}}" inputOnFocusIndex="{{inputOnFocusIndex}}" inputPlates="{{inputPlates}}" isNewEnergy="{{isNewEnergy}}"></car-num-input>
        <input name="licenseNumber" value='{{licensePlate}}' hidden='true' />
      </view>
        
      <view class="part">
        <!-- 司机 -->
        <van-field label="司机" required input-align="right">
          <view slot="input" style="width: 100%;">
            <input name="driverId" value='{{driverArray[driverIndex].id}}' hidden='true' />
            <picker bindchange="bindPickerChange" value="{{driverIndex}}" range="{{driverArray}}" range-key="name" data-pickername='driver'>
              <view wx:if="{{driverArray[driverIndex].name}}"> {{driverArray[driverIndex].name}}</view>
              <view wx:else class="selectPlaceholder">{{ defaultText }}</view>
            </picker>
          </view>
          <view slot="right-icon">
            <van-icon name="arrow" />
          </view>
        </van-field>

        <van-field label="司机电话" wx:if="{{driverArray[driverIndex].id}}" name="driverMobile" readonly value="{{ driverMobile }}" placeholder="选择司机自动填入" input-align="right">
        </van-field>
      </view>

      <view class="fixedBtn submitBtn">
        <van-button loading="{{isSubmitting}}" round block disabled="{{isSubmitting}}" loading-text="{{isSubmitting?'提交中...':''}}" type="info" form-type="submit">确定
        </van-button>
      </view>

    </form>
  </view>
</view>

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