<template>
  <div class="body">
    <vTitle
      ><span>环境情况</span><span class="time">2021 / 11 / 25</span></vTitle
    >
    <div class="con">
      <ul>
        <li v-for="(item, i) in data" :key="i">
          <div class="item" :style="{ color: item.color }">
            <img
              :src="require(`@/assets/images/gdjiankong/${item.img}`)"
              alt=""
            />
            <div>
              <p>{{ item.num }}</p>
              <p>{{ item.danwei }}</p>
            </div>
            <span class="s-t">{{ item.name }}</span>
          </div>
          <span>{{ item.status }}</span>
        </li>
      </ul>
      <ul class="btm">
        <li v-for="(item, i) in data1" :key="i">
          <div class="item">
            <img
              :src="require(`@/assets/images/gdjiankong/${item.img}`)"
              alt=""
            />
            <div>
              <p>{{ item.num }}</p>
            </div>
            <span class="bs-t">{{ item.name }}</span>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      data: [
        {
          name: "温度",
          danwei: "℃",
          num: "28",
          status: "正常",
          img: "t1.png",
          color: "#0AD5FF",
        },
        {
          name: "湿度",
          danwei: "%",
          num: "45",
          status: "正常",
          img: "t2.png",
          color: "#269F98",
        },
        {
          name: "PM2.5",
          danwei: "μg/m³",
          num: "98",
          status: "正常",
          img: "t3.png",
          color: "#D11B14",
        },
      ],
      data1: [
        {
          name: "PM 10",
          num: "22",
          img: "1.png",
          color: "#0ad5ff",
        },
        {
          name: "噪音",
          num: "16",
          img: "2.png",
          color: "#66B0C9",
        },
        {
          name: "风速",
          num: "22",
          img: "3.png",
          color: "#E0B822",
        },
        {
          name: "AIQ",
          num: "24",
          img: "4.png",
          color: "#E0B822",
        },
      ],
    };
  },
  mounted() {},
};
</script>

<style lang="less" scoped>
.content {
  flex: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  justify-content: space-between;
  > span {
    width: 100%;
    font-size: 16px;
    text-align: center;
    &:first-of-type {
      color: #e0b822;
      font-size: 30px;
      display: inline-block;
    }
  }
}
.con {
  background-position: top left;
  background-size: 100% 70%;
  background-repeat: no-repeat;
  padding-top: 10px;

  > ul {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    > li {
      width: 28%;
      align-items: center;
      position: relative;
      padding: 20px 0;
      margin: 10px 0;
      display: flex;
      justify-content: space-between;
      .item {
        position: relative;
        width: 70%;
        .s-t {
          position: absolute;
          top: -30px;
          left: 50%;
          transform: translateX(-50%);
          color: #fff;
        }
        > img {
          width: 100%;
        }
        > div {
          position: absolute;
          top: 50%;
          left: 50%;
          width: 50%;
          transform: translate(-50%, -50%);
          font-size: 14px;
          text-align: center;
          > p {
            width: 100%;
            padding: 2px 0;
            &:first-of-type {
              font-size: 24px;
              border-bottom: 1px solid #fff;
            }
          }
        }
      }
      > span {
        width: 30%;
        display: inline-block;
        margin-left: 10px;
        font-size: 14px;
      }
    }
  }

  .btm {
    > li {
      width: 25%;
      .item {
        position: relative;
        width: 100%;
        .bs-t {
          position: absolute;
          top: 10px;
          right: 10px;
        }
        > img {
          width: 100%;
        }
        > div {
          > p {
            padding: 0;
            &:first-of-type {
              font-size: 18px;
              border-bottom: none;
            }
          }
        }
      }
    }
  }
}
</style>
