<template>
    <div class="app-container">
      <van-nav-bar
        title="农村宅基地申请表"
        left-arrow
        fixed
        placeholder
        @click-left="$router.back(-1)"
      />
      <div class="main_box">
        <van-row>
          <van-col span="8"><p class="tit">01 申请</p></van-col>
          <van-col span="8"><p class="tit">02 开工</p></van-col>
          <van-col span="8"><p class="tit">03 验收</p></van-col>
        </van-row>
        <van-row>
          <van-col span="8">
            <van-steps direction="vertical" active-color="#1D6FE9" :active="applicationDetail.proposerActiveIndex">
              <van-step v-for="(item,index) in applicationDetail.applyStepList" :key="index">{{item}}</van-step>
            </van-steps>
          </van-col>
          <van-col span="8">
            <van-steps direction="vertical" active-color="#1D6FE9" :active="applicationDetail.startActiveIndex">
              <van-step v-for="(item,index) in applicationDetail.startStepList" :key="index">{{item}}</van-step>
            </van-steps>
          </van-col>
          <van-col span="8">
            <van-steps direction="vertical" active-color="#1D6FE9" :active="applicationDetail.endActiveIndex">
              <van-step v-for="(item,index) in applicationDetail.endStepList" :key="index">{{item}}</van-step>
            </van-steps>
          </van-col>
        </van-row>
      </div>
    </div>
</template>

<script>
  import { allInformation, allInformationWLHT } from "@/api/onlineHome/homestead/application";
  export default {
    name: "flowChart",
  data() {
    return {
      applicationDetail:[],
      id:'',
      processKey: '',
    };
  },
  created() {
    this.id = this.$route.query.id;
    this.processKey = this.$route.query.processKey;
    this.getDetail();
  },
  methods: {
//获取数据集合
    getDetail(){
      (this.processKey && this.processKey.endsWith('WLHT') ? allInformationWLHT : allInformation)(this.id).then(response => {
        console.log(response)
        this.applicationDetail = response.data;
      });
    },
  },
}
</script>

<style scoped lang="scss">
  .app-container {
  }
  .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;
    margin-top: 2%;
    padding: 5% 1%;
  }
  .van-col{
    text-align: center;
  }
  .tit{
    background: #1d6fe9;
    border-radius: 12px;
    font-size: 0.4rem;
    font-family: Source Han Sans CN, Source Han Sans CN-Regular;
    font-weight: 400;
    color: #ffffff;
    line-height: 0.65rem;
    letter-spacing: 0px;
    width: 70%;
    margin: 0 auto;
  }
  .van-step--vertical{
    padding-right: 0;
    text-align: left;
  }
  .van-step--vertical:not(:last-child)::after{
    border: none;
  }
  .van-step--finish{
    color: #1d6fe9;
  }
</style>
