<template>
  <div class="realtime-container">
    <div class="title">小车状态</div>
    <div class="info">
      <div class="item">
        <div class="item-icon"></div>
        <div class="item-label">电压：</div>
        <div class="item-value">{{carInfo.voltage || '-'}}V</div>
      </div>
      <div class="item">
        <div class="item-icon"></div>
        <div class="item-label">电流：</div>
        <div class="item-value">{{carInfo.current || '-'}}A</div>
      </div>
      <div class="item">
        <div class="item-icon"></div>
        <div class="item-label">电量：</div>
        <div class="item-value">{{carInfo.eq || '-' | twoDecimalPlaces}}%</div>
      </div>
      <div class="item">
        <div class="item-icon"></div>
        <div class="item-label">信号强度：</div>
        <div class="item-value">{{carInfo.signalstrength || '-'}}</div>
      </div>
      <div class="item">
        <div class="item-icon"></div>
        <div class="item-label">温度：</div>
        <div class="item-value">{{carInfo.temperature || '-'}}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    carInfo: Object,
  },
}
</script>

<style scoped>
.realtime-container {
  background: #fff;
  height: 190px;
  border-radius: 4px;
  padding: 10px 20px;
}
.title {
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
  color: #1D2738;
}
.info {
  padding-top: 5px;
  font-size: 14px;
  line-height: 18px;
  color: #54606C;
}
.item {
  display: flex;
  align-items: center;
  padding: 5px 0;
}
.item-icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #55DA74;
  margin-right: 8px;
}
.item-label {
  width: 70px;
  color: #54606C;
}
.item-value {
  color: #1D2738;
}
</style>
