<template>
    <div class="app-container">
      <van-nav-bar
        left-arrow
        fixed
        placeholder
        @click-left="$router.back(-1)"
      >
        <template #title>
          <p style="font-weight: bold;">添加有偿退出</p>
        </template>
      </van-nav-bar>
      <van-form @submit="onSubmit">
        <div class="main_box">
          <van-field
            readonly
            clickable
            name="picker"
            :value="value"
            label="宅基地代码"
            placeholder="请选择"
            @click="showPicker = true"
            input-align="right"
            right-icon="arrow-down"
          />
          <van-popup v-model="showPicker" position="bottom">
            <van-picker
              show-toolbar
              :columns="columns"
              @confirm="onConfirm"
              @cancel="showPicker = false"
            />
          </van-popup>
          <van-field label="申请人姓名" placeholder="申请人姓名" input-align="right" label-width="auto"/>
          <van-field
            readonly
            clickable
            name="picker"
            :value="value"
            label="申请人证件类型"
            placeholder="请选择"
            @click="showPicker = true"
            input-align="right"
            right-icon="arrow-down"
            label-width="auto"
          />
          <van-popup v-model="showPicker" position="bottom">
            <van-picker
              show-toolbar
              :columns="columns"
              @confirm="onConfirm"
              @cancel="showPicker = false"
            />
          </van-popup>
          <van-field label="申请人证件号码" placeholder="申请人证件号码" input-align="right" label-width="auto"/>
        </div>

        <p class="main_title">退出信息</p>
        <div class="main_box">
          <van-field
            readonly
            clickable
            name="picker"
            :value="value"
            label="退出权利类型"
            placeholder="请选择退出权利类型"
            @click="showPicker = true"
            input-align="right"
            right-icon="arrow-down"
            label-width="auto"
          />
          <van-popup v-model="showPicker" position="bottom">
            <van-picker
              show-toolbar
              :columns="columns"
              @confirm="onConfirm"
              @cancel="showPicker = false"
            />
          </van-popup>

          <van-field
            readonly
            clickable
            name="picker"
            :value="value"
            label="退出类型"
            placeholder="请选择退出类型"
            @click="showPicker = true"
            input-align="right"
            right-icon="arrow-down"
            label-width="auto"
          />
          <van-popup v-model="showPicker" position="bottom">
            <van-picker
              show-toolbar
              :columns="columns"
              @confirm="onConfirm"
              @cancel="showPicker = false"
            />
          </van-popup>

          <van-field
            readonly
            clickable
            name="picker"
            :value="value"
            label="退出方式"
            placeholder="请选择退出方式"
            @click="showPicker = true"
            input-align="right"
            right-icon="arrow-down"
            label-width="auto"
          />
          <van-popup v-model="showPicker" position="bottom">
            <van-picker
              show-toolbar
              :columns="columns"
              @confirm="onConfirm"
              @cancel="showPicker = false"
            />
          </van-popup>
          <van-field label="退出面积" placeholder="请输入退出面积㎡" input-align="right" label-width="auto"/>
          <van-field label="退出年限" placeholder="请输入退出年限" input-align="right" label-width="auto"/>
        </div>

        <p class="main_title">补偿信息</p>
        <div class="main_box">
          <van-field
            readonly
            clickable
            name="picker"
            :value="value"
            label="补偿方式"
            placeholder="请选择补偿方式"
            @click="showPicker = true"
            label-width="auto"
            input-align="right"
            right-icon="arrow-down"
          />
          <van-popup v-model="showPicker" position="bottom">
            <van-picker
              show-toolbar
              :columns="columns"
              @confirm="onConfirm"
              @cancel="showPicker = false"
            />
          </van-popup>
          <van-field label="补偿金额" placeholder="请输入补偿金额 元" input-align="right" label-width="auto"/>
          <van-field label="置换房屋面积" placeholder="请输入房屋面积㎡" input-align="right" label-width="auto"/>
          <van-field label="置换房屋坐落" placeholder="请输入房屋坐落" input-align="right" label-width="auto"/>
          <van-field label="备注" placeholder="请输入内容" input-align="right" label-width="auto"/>

        </div>

        <div style="padding: 16px 0;">
          <van-row>
            <van-col span="12" align="center">
              <van-button type="info" color="#B4B0B0" native-type="submit" class="submitButton">关闭</van-button>
            </van-col>
            <van-col span="12" align="center">
              <van-button type="info" native-type="submit" class="submitButton">保存</van-button>
            </van-col>
          </van-row>
          <div class="clear"></div>
        </div>

      </van-form>
    </div>
</template>

<script>
export default {
    name: "circulationAdd",
  data() {
    return {
      value: '',
      columns: ['杭州', '宁波', '温州', '嘉兴', '湖州'],
      showPicker: false,
      showPicker1: false,
      minDate: new Date(2020, 0, 1),
      maxDate: new Date(2025, 10, 1),
      currentDate: new Date(2021, 0, 17),
    };
  },
  created() {

  },
  methods: {
    onConfirm(value) {
      this.value = value;
      this.showPicker = false;
    },
  },
}
</script>

<style scoped lang="scss">
  .app-container {
    padding: 2% 0;
  }
  .main_title{
    font-size: 0.4rem;
    color: #1D6FE9;
    margin: 0.2rem 6%;
    position: relative;
  }
  .main_box{
    width: 96%;
    margin: 0 auto;
    border-radius: 6px;
    box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
    overflow: hidden;
    background-color: #FFF;
  }
  .submitButton{
    width: 80%;
    margin: 0 auto;
    background-color: #1D6FE9;

  }
</style>
