<template>
  <div class="DataStatistics">
    <div style="width:  200px;">
      <el-icon class="iconStyle">
        <Dish />
      </el-icon>
      <span>总订单数</span>
      <span>{{ datas.count }}</span>
    </div>
    <div style="width:  200px;">
      <el-icon class="iconStyle">
        <CreditCard />
      </el-icon>
      <span>已支付金额</span>
      <span>{{ datas.totalAmount }}</span>
    </div>
  </div>
</template>
<script setup>
import API from "./api";
import { onMounted, reactive } from "vue";
onMounted(() => {
  getPage();
})
let datas = reactive({
  count: 0,
  totalAmount: 0,
})
async function getPage() {
  let res = await API.gettotal();
  for (let i in res) {
    datas[i] = res[i]
  }
}
</script>


<style scoped lang="scss">
.DataStatistics {
  border: 1px solid #e4e7ed;
  background-color: #fff;
  border-radius: 4px;
  margin-top: 20px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-around;

  >div {
    height: 80px;
    background-color: #f4f9ff;
    display: flex;
    align-items: center;
    justify-content: space-around;

    padding: 20px;

    .iconStyle {
      background-color: #d4e9fe;
      border-radius: 50%;
      padding: 6px;
      font-size: 36px;
      color: #3f9eff;
    }

    span {
      color: #666;
      font-size: 14px;
    }
  }
}
</style>