<template>
  <div id="smartDatav">
    <dv-full-screen-container class="bg">
      <dv-loading v-if="loading">Loading...</dv-loading>
      <div v-else class="host-body" style="width: 100%;height: 100%;">
        <headBtn></headBtn>
        <div class="d-flex jc-center">
          <dv-decoration-10 style="width:33.3%;height:.0625rem;" />
          <div class="d-flex jc-center">
            <dv-decoration-8 :color="['#568aea', '#000000']" style="width:2.5rem;height:.625rem;" />
            <div class="title">
              <span class="title-text">智慧社区养老数据平台</span>
              <dv-decoration-6
                class="title-bototm"
                :reverse="true"
                :color="['#50e3c2', '#67a1e5']"
                style="width:3.125rem;height:.1rem;"
              />
            </div>
            <dv-decoration-8
              :reverse="true"
              :color="['#568aea', '#000000']"
              style="width:2.5rem;height:.625rem;"
            />
          </div>
          <dv-decoration-10 style="width:33.3%;height:.0625rem; transform: rotateY(180deg);" />
        </div>

        <!-- 第二行 -->
        <div class="d-flex jc-between px-2">
          <div class="d-flex" style="width: 40%">
            <div
              class="react-right ml-4"
              style="width: 6.25rem; text-align: left;background-color: #0f1325;"
            >
              <span class="react-before"></span>
              <span class="text"></span>
            </div>
            <div class="react-right ml-3" style="background-color: #0f1325;" @click="jump()">
              <!-- <span class="text colorBlue">数据分析11</span> -->
            </div>
          </div>
          <div style="width: 40%" class="d-flex">
            <div class="react-left bg-color-blue mr-3" style="background-color: #0f1325;">
              <!-- <span class="text fw-b">小区数据</span> -->
            </div>
            <div
              class="react-left mr-4"
              style="width: 6.25rem; background-color: #0f1325; text-align: right;"
            >
              <span class="react-after"></span>
              <span class="text">{{dateYear}} {{dateWeek}} {{dateDay}}</span>
            </div>
          </div>
        </div>
        <div style="width: 100%;height: 9rem;display: flex;">
          <div style="width: 60%;height: 100%;position: relative;">
            <!-- <div style="height: 20%;width: 100%;"></div> -->
              <div style="height: 80%;width: 100%;">
                <mapCmp></mapCmp>
              </div>
              <div class="bottom-ani-circle"></div>
          </div>
          <dv-border-box-7 :color="['rgba(0,0,0,0)','#07fcfd']" backgroundColor="rgba(29,89,159,.1)" style="width: 40%;height: 100%;">
            <cmp1></cmp1>
            <cmp2></cmp2>
            <cmp3></cmp3>
          </dv-border-box-7>
        </div>
        <div style="width: 100%;height: 3rem;display: flex;">
          <dv-border-box-7 :color="['rgba(0,0,0,0)','#07fcfd']" backgroundColor="rgba(29,89,159,.1)">
            <cmp4></cmp4>
          </dv-border-box-7>
          <dv-border-box-7 :color="['rgba(0,0,0,0)','#07fcfd']" backgroundColor="rgba(29,89,159,.1)">
            <cmp5></cmp5>
          </dv-border-box-7>
          <dv-border-box-7 :color="['rgba(0,0,0,0)','#07fcfd']" backgroundColor="rgba(29,89,159,.1)">
            <cmp6></cmp6>
          </dv-border-box-7>
        </div>
      </div>
    </dv-full-screen-container>
  </div>
</template>

<script>
import { formatTime } from './utils/index.js'
import centerLeft1 from "./components/centerLeft1";
import centerLeft2 from "./components/centerLeft2";
import centerRight1 from "./components/centerRight1";
import centerRight2 from "./components/centerRight2";
import center from "./components/center";
import bottomLeft from "./components/bottomLeft";
import bottomRight from "./components/bottomRight";
import cmp1 from "./components/pensionCmp/cmp1";
import cmp2 from "./components/pensionCmp/cmp2";
import cmp3 from "./components/pensionCmp/cmp3";
import cmp4 from "./components/pensionCmp/cmp4";
import cmp5 from "./components/pensionCmp/cmp5";
import cmp6 from "./components/pensionCmp/cmp6";
import mapCmp from "./components/pensionCmp/map";
import headBtn from "./components/headBtn.vue";
export default {
  data () {
    return {
      loading: true,
      dateDay: null,
      dateYear: null,
      dateWeek: null,
      weekday: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
    };
  },
  components: {
    centerLeft1,
    centerLeft2,
    centerRight1,
    centerRight2,
    center,
    bottomLeft,
    bottomRight,
    cmp1,
    cmp2,
    cmp3,
    cmp4,
    cmp5,
    cmp6,
    mapCmp,
    headBtn
  },
  mounted () {
    this.timeFn();
    this.cancelLoading();
  },
  methods: {
    jump(v){

    },
    timeFn () {
      setInterval(() => {
        this.dateDay = formatTime(new Date(), 'HH: mm: ss');
        this.dateYear = formatTime(new Date(), 'yyyy-MM-dd');
        this.dateWeek = this.weekday[new Date().getDay()];
      }, 1000)
    },
    cancelLoading () {
      setTimeout(() => {
        this.loading = false;
      }, 500);
    }
  }
};
</script>

<style lang="scss">
@import './assets/scss/index.scss';
  .bottom-ani-circle{
        width:  80%;
        height: 80%;
        position: absolute;
        left: 50%;
        bottom: 0;
        background: url(./assets/circle.png) no-repeat center;
        background-size: 100%;
        transform-style: preserve-3d;
        transform: translateX(-50%) rotateX(75deg) translateY(120%);
        animation: rotate3 20s linear infinite;
  }
  @keyframes rotate3{
    0% {
        transform: translateX(-50%) rotateX(75deg) translateY(120%) rotateZ(0) ;
    }
    100% {
        transform: translateX(-50%) rotateX(75deg) translateY(120%) rotateZ(360deg);
    }
  }

</style>
