<template>
  <div>
    <van-nav-bar
      @click-left="onClickLeft"
      @click-right="onClickRight"
      style="background-color: #1989fa"
    >
      <template #title>
        <van-col style="color: #ffffff">房产信息</van-col>
      </template>
      <template #left>
        <i
          class="fa fa-arrow-circle-left"
          aria-hidden="true"
          style="color: #ffffff; font-size: 18px"
        ></i>
      </template>
      <template #right>
        <van-icon name="replay" size="18" color="#ffffff" />
      </template>
    </van-nav-bar>

            <van-row class="borderTop"   v-for="item in info" :key="item.hcode">
              <van-col span="24">
                <van-row>
                  <van-col span="19" class="paddingLeft15"><van-icon name="friends" color="#ff6600" />{{ item.bname }}</van-col>
                </van-row>
                 <van-row>
                  <van-col span="19"  class="paddingLeft15"><van-icon name="location"  color="#ff6600"/>{{ item.hname }}</van-col>
                </van-row>
              </van-col>

            </van-row>

  </div>
</template>

<script>
import { GetOwnerHouse } from '@/common/api/loginApi.js'
export default {
  name: 'login',
  data () {
    return {
      info: [] // 房产信息

    }
  },
  created: function () {
    console.info('created')
    // console.info(this.$util);
    this.$util.persistLogin(this)
    this.GetOwnerHouse()
  },
  methods: {
    GetOwnerHouse: function () { // 获取房产信息
      var that = this
      let phone = that.$store.state.data.tel
      if (that.$util.isEmpty(phone)) {
        that.$router.push('/')
        return
      }
      GetOwnerHouse(phone).then((res) => {
        console.info('GetOwnerHouse', res)
        if (!res.isSuccess) {
          that.$toast(res.errMsg)
          return
        }
        res.data.forEach(function (item, index, arr) {
          that.$set(that.info, index, item)
        })

        // that.loading = false;
        // that.finished = true;
      })
    },

    onClickLeft () {
      // this.$toast('返回')
      console.info('left')
      this.$router.go(-1)
    },
    onClickRight () {
      this.$router.go(0)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.title1 {
  color: #999;
}
.value1 {
  color: #999;
  font-size: 15px;
}
.borderTop{
    margin-top:50px;
}
.paddingLeft15{
    padding-left: 15px;
    text-align: left;
    height: 50px;
    line-height: 50px;
    font-size: 28px;
}
</style>
