<template>
  <div class="stat-cards-container">
    <div class="stat-card" v-for="(item, idx) in props.numberList" :key="idx">
      <div class="stat-card-title">{{ item.title }}</div>
      <div class="stat-card-value">
        <div class="card-value-top">
          <div>
            <p class="pro-title">{{ item.protitle }}</p>
            <p class="pro-value">{{ item.proValue }}<span>亿元</span></p>
          </div>
          <div>
            <p class="pro-title">{{ item.thirdTtile }}</p>
            <p class="pro-value">{{ item.thirdValue }}<span>亿元</span></p>
          </div>
        </div>
        <div class="card-value-bottom">
          <div>
            <p class="pro-title">2025年累计完成</p>
            <p class="pro-value">112.1<span>亿元</span></p>
          </div>
          <div class="value-bottom-right">
            <p class="comparison">累计同期环比</p>
            <p
              class="comparison-value"
              :class="{ 'down-trend': item.title === '运营成本' }"
            >
              {{ item.compareValue }}
              <el-icon
                class="trend-icon"
                :class="{ 'down-trend': item.title === '运营成本' }"
              >
                <Bottom v-if="item.title === '运营成本'" />
                <Top v-else />
              </el-icon>
            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { onMounted, reactive, watch, ref } from "vue";
import { Top, Bottom } from "@element-plus/icons-vue";
const props = defineProps({
  numberList: {
    type: Array,
    default: () => [],
  },
});
</script>

<style scoped lang="less">
.stat-cards-container {
  display: flex;
  justify-content: center;
  align-items: center;
  .stat-card {
    .vw(width, 180);
    .vw(border-radius, 5);
    .vw(margin-right,10);
    .vw(padding, 10);
    background-image: url("@/assets/images/complete.png");
    background-repeat: no-repeat;
    .stat-card-title {
      .font(12);
      text-align: center;
    }
    .stat-card-value {
      .font(12);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .vh(margin-top,20);
      .card-value-top {
        .vh(margin-bottom,10);
      }
      .card-value-top,
      .card-value-bottom {
        display: flex;
        justify-content: space-between;
        .pro-title {
          .font(10);
        }
        .pro-value {
          .font(16);
          font-family: "DIN";
          color: @Color;
          span {
            .font(10);
            // font-weight: 400;
          }
        }
      }
      .value-bottom-right {
        .vh(margin-top,10);
        .font(10);
        .comparison {
          font-family: "Alibaba PuHuiTi";
        }
        .comparison-value {
          color: #32d25a;
          display: flex;
          align-items: center;
          gap: 2px;

          &.down-trend {
            color: #ff4757;
          }

          .trend-icon {
            .font(12);
            color: #32d25a;

            &.down-trend {
              color: #ff4757;
            }
          }
        }
      }
    }
  }
}
</style>
