<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, 170);
    .vw(border-radius, 5);
    .vw(padding, 10);
    .vw(margin,10);
    background-image: url("@/assets/images/complete.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center;
    .stat-card-title {
      .font(12);
      text-align: center;
    }
    .stat-card-value {
      .font(12);
      .card-value-top,
      .card-value-bottom {
        display: flex;
        justify-content: space-between;
        p {
          .vh(height,10);
        }
        .pro-title {
          .font(10);
          margin-bottom: -12px;
        }
        .pro-value {
          .font(18);
          font-family: "DIN";
          color: @Color;
          font-weight: 100;
          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-size: 12px;
            color: #32d25a;

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