<template>
  <div>
    <van-grid :border="false" :column-num="4">
      <van-grid-item>
        <router-link to="/Getfdc_pm_unfare">
          <van-image
            :src="require('@/assets/img/xing.jpg')"
            width="50"
            height="50"
          />
          <van-col span="24">我要缴费</van-col>
        </router-link>
      </van-grid-item>
      <van-grid-item>
        <router-link to="/Insertfdc_pm_repair">
          <van-image
            :src="require('@/assets/img/tel.jpg')"
            width="50"
            height="50"
          />
          <van-col span="24">我要报修</van-col>
        </router-link>
      </van-grid-item>
      <van-grid-item>
        <router-link to="/Insertfdc_pm_repairByTousu">
          <van-image
            :src="require('@/assets/img/tanhao.png')"
            width="50"
            height="50"
          />
          <van-col span="24">我要投诉</van-col>
        </router-link>
      </van-grid-item>
      <van-grid-item>
        <router-link to="/Getfdc_pm_revfare">
          <van-image
            :src="require('@/assets/img/file.png')"
            width="50"
            height="50"
          />
          <van-col span="24">缴费记录</van-col>
        </router-link>
      </van-grid-item>
    </van-grid>
    <van-grid :border="false" :column-num="4">
      <van-grid-item>
        <router-link to="/GetRepaireList">
          <van-image
            :src="require('@/assets/img/file1.png')"
            width="50"
            height="50"
          />
          <van-col span="24">报修记录</van-col>
        </router-link>
      </van-grid-item>
      <van-grid-item>
        <router-link to="/GetComplaintList">
          <van-image
            :src="require('@/assets/img/file1.png')"
            width="50"
            height="50"
          />
          <van-col span="24">投诉记录</van-col>
        </router-link>
      </van-grid-item>
      <van-grid-item>
        <router-link to="/GetOwnerHouse">
          <van-image
            :src="require('@/assets/img/house.jpg')"
            width="50"
            height="50"
          />
          <van-col span="24">房产信息</van-col>
        </router-link>
      </van-grid-item>
      <van-grid-item>
        <router-link to="/GetvehicleList">
          <van-image
            :src="require('@/assets/img/bing.png')"
            width="50"
            height="50"
          />
          <van-col span="24">车辆信息</van-col>
        </router-link>
      </van-grid-item>
    </van-grid>
  </div>
</template>

<script>
import { } from '@/common/api/loginApi.js'
import Decimal from 'decimal.js'
export default {
  name: 'login',
  data () {
    return {
      info: this.$store.state.data
    }
  },
  created: function () {
    console.info('created')
    this.$util.persistLogin(this)
    console.info(this.$route.query)
  },
  computed: {
    text () {
      return Decimal(this.currentRate).toNumber().toFixed(0) + '%'
    }
  },
  methods: {
    SaReportToday: function () {
      // 案场日报
      var that = this
      var data = {
        userCode: that.$store.state.data.userCode,
        projectId: that.$store.state.projectId
      }
      // console.info("data", data);
      // eslint-disable-next-line no-undef
      SaReportToday(data).then((res) => {
        console.info('SaReportToday', res)
        if (!res.result) {
          that.$toast(res.msg)
          return
        }
        that.saleprompt = res.data.saleprompt
        that.vistitcount = res.data.vistitcount
        that.currentRate = Decimal(that.saleprompt.complete).toNumber()
      })
    },
    GetSaRoomList: function () {
      // 房源套数
      var that = this
      let jsonQuery = {rState: 2}
      var data = {
        userCode: that.$store.state.data.userCode,
        projectId: that.$store.state.projectId,
        page: '',
        pageCount: '',
        jsonQuery: JSON.stringify(jsonQuery)
      }
      // console.info("data", data);
      // eslint-disable-next-line no-undef
      GetSaRoomList(data).then((res) => {
        console.info('GetSaRoomList', res)
        if (!res.result) {
          that.$toast(res.msg)
          return
        }
        that.remainNum = 0
        if (res.data != null && res.data.list != null && res.data.list.length > 0) {
          res.data.list.forEach(function (item, index, arr) {
            // eslint-disable-next-line eqeqeq
            if (item.rState == 2) {
              that.remainNum++
            }
          })
        }
      })
    },
    // 单选按钮点击事件
    routeToProject: function () {
      this.$router.push('/getproject')
    },
    onClickLeft () {
      // this.$toast('返回')
      this.$router.go(-1)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.bgGray {
  background-color: #cfcfcf;
  font-size: 15px;
  font-weight: 900;
  height: 30px;
  padding-top: 10px;
  padding-bottom: 10px;
  text-align: left;
  padding-left: 5px;
}

.height {
  height: 20px;
  font-size: 15px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: #cfcfcf solid 1px;
  text-align: left;
  padding-left: 10px;
}
.area {
  width: 100%;
  height: 300px;
  border-radius: 15px;
  background-color: #1989fa;
  border: #1989fa solid 1px;
}
.colorWhite {
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
}
.colorDark {
  color: #ffeeee;
  font-size: 13px;
}
</style>
