<template>
<div>
  <div class="lists">
    <div class="listitem" @click="navto(1)">
      <div class="top">
        <img src="@/static/images/zhibotjicon.png" alt="" class="icon" />
        <span>{{lan.$t('zhiboliebiao')}}</span>
      </div>
      <div class="mid">
        <div>
          <div class="data">
            <div class="label">{{lan.$t('zhibokecheng')}}</div>
            <div class="right">{{statistics.liveInfo?statistics.liveInfo.sum:0}}</div>
          </div>
          <div class="data">
            <div class="label">{{lan.$t('canyurenshu')}}</div>
            <div class="right">{{statistics.liveInfo?statistics.liveInfo.student:0}}</div>
          </div>
          <div class="data">
            <div class="label">{{lan.$t('kechengpingfen')}}</div>
            <div class="right">{{statistics.liveInfo?statistics.liveInfo.avg:0}}</div>
          </div>
          <img src="@/static/images/zhibotj.png" alt="" class="zhuzi" />
        </div>
      </div>
    </div>
    <div class="listitem" @click="navto(2)">
      <div class="top">
        <img src="@/static/images/shipintjicon.png" alt="" class="icon" />
        <span class="label1">{{lan.$t('shipinliebiao')}}</span>
      </div>
      <div class="mid">
        <div>
          <div class="data">
            <div class="label">{{lan.$t('fabushipin')}}</div>
            <div class="right">{{statistics.videoInfo?statistics.videoInfo.sum:0}}</div>
          </div>
          <div class="data">
            <div class="label">{{lan.$t('zongguankanshu')}}</div>
            <div class="right">{{statistics.videoInfo?statistics.videoInfo.watch:0}}</div>
          </div>
          <div class="data">
            <div class="label">{{lan.$t('pingjundefen')}}</div>
            <div class="right">{{statistics.videoInfo?statistics.videoInfo.avg:0}}</div>
          </div>
          <img src="@/static/images/shipintj.png" alt="" class="zhuzi" />
        </div>
      </div>
    </div>
    <div class="listitem" @click="navto(3)">
      <div class="top">
        <img src="@/static/images/dingyuetjicon.png" alt="" class="icon" />
        <span class="label2">{{lan.$t('dingyueliebiao')}}</span>
      </div>
      <div class="mid">
        <div>
          <div class="data">
            <div class="label">{{lan.$t('dingyuerenshu')}}</div>
            <div class="right">{{statistics.studentInfo?statistics.studentInfo.sum:0}}</div>
          </div>
   
          <img src="@/static/images/dingyuetj.png" alt="" class="zhuzi zhuzi1" />
        </div>
      </div>
    </div>
   
  </div>
   <NavBottom class="navbottom"></NavBottom>
</div>

</template>

<script lang="ts">
import { defineComponent, onMounted, ref } from "vue";
import NavBottom from "@/components/NavBottom.vue";
import { getstatisticlist } from "@/api"
import router from '@/router';
import { useI18n } from '@/utils/i18n';
export default defineComponent({
  name: "Liststatistic",
  components: {
      NavBottom
  },
  setup(){
    const lan: any = useI18n();
    const statistics = ref({})
    onMounted(async ()=>{
      statistics.value = await getstatisticlist()
    })
    function navto(e?: number){
      switch(e){
        case 1:
            router.push("/regime/live");
            break;
        case 2:
          router.push("/regime/video")
          break;
        case 3:
          router.push("/regime/subscriber")
      }
    }

    // console.log(statistics,111)
    return {
      statistics,
      navto,
      lan
    };
  },
});
</script>
<style lang="scss" scoped>
.lists {
  font-size: 11px;
  color: #111111;
  display: flex;
  .listitem {
    width: 372px;
    height: 256px;
    background: white;
    border-radius: 17px;
    // padding-bottom: 17px;
    margin-right: 17px;
    .top {
      width: 292px;
      margin: 0 auto;
      border-bottom: 1px solid #eeeeee;
      padding-top: 34px;
      padding-bottom: 12px;
      color: #08ae98;
      font-size: 13px;
      font-weight: bold;
      margin-bottom: 28px;
         .label1{
        color: #D12C2E;
      }
      .label2{
        color: #F4C85E;
      }
      .icon {
        width: 18px;
        height: 17px;
        margin-right: 6px;
      }
    }
    .mid {
      .data {
        width: 292px;
        margin: 0 auto;
        display: flex;
        margin-bottom: 28px;
        .label {
          margin-right: 18px;
        }
      }
   
      .zhuzi {
        width: 170px;
        height: 85px;
        float: right;
        position: relative;
        top: -69px;
        right: 34px;
      }
      .zhuzi1{
        top: 28px;
      }
    }
  }

}
  .navbottom {
   margin-top: 250px;
  //  margin-bottom: 28px;
  }
</style>