<template>
  <div class="person-item">
    <div class="item-content">
      <img src="../assets/img/avator.d7401229.png" class="avator" alt="" v-if="data.sex == 1">
      <img src="../assets/img/female.6523fb21.png" class="avator" alt="" v-if="data.sex == 2">
      <div>
        <div class="person-content">
          <div>姓名：</div>
          <div>{{data.name}}</div>
        </div>
        <div class="person-content">
          <div>身份证号：</div>
          <div>{{data.number}}</div>
        </div>
        <div class="person-content">
          <div>手机号：</div>
          <div>{{data.phone}}</div>
        </div>
      </div>
    </div>
    <div class="person-bottom" v-if="data.rommNameText"><span>{{data.rommNameText}}</span></div>
    <div class="person-bottom" v-else>未入住</div>
    <div class="person-normal normal" v-if="data.cardState == 1">正常</div>
    <div class="person-normal normal" v-else-if="data.type==12">企业</div>
    <div class="person-normal abnormal" v-else>异常</div>
  </div>
</template>

<script>
  export default {
    name: "personLi",
    props: ['data'],
    methods: {}
  };
</script>

<style scoped>
  .person-item {
    width: 300px;
    border-radius: 10px;
    margin: 0 20px;
    margin-bottom: 29px;
    position: relative;
    background: #fff;
    border: 1px solid #98dbd6;
    border-top: 5px solid #16c2b5;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    height: 160px;
  }

  .item-content {
    height: 121px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center
  }

  .person-item .avator {
    width: 60px;
    height: 60px;
    margin: 0 15px;
    border-radius: 50%;
  }

  .person-content {
    font-size: 12px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #333;
    line-height: 24px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
  }

  .person-content div:first-child {
    width: 60px;
  }

  .person-content div:last-child {
    overflow: hidden;
    width: 100px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .person-bottom {
    width: 100%;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    height: 33px;
    background: #f0fbfa;
    border-radius: 0 0 10px 10px;
    font-size: 12px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #00a397;
    text-align: center;
    line-height: 33px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .person-bottom span {
    width: 90%;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .person-normal {
    width: 42px;
    height: 22px;
    position: absolute;
    top: 9px;
    right: 9px;
    text-align: center;
    line-height: 22px;
    font-size: 12px;
    font-family: Microsoft YaHei;
    font-weight: 400;
  }

  .person-normal.normal {
    background: rgba(0, 163, 151, .1);
    border: 1px solid #91dad5;
    border-radius: 4px;
    color: #00a397;
  }

  .person-normal.abnormal {
    background: rgb(163 0 0 / 10%);
    border: 1px solid #da9891;
    border-radius: 4px;
    color: #a30f00;
  }
</style>
