<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 v-if="item.proValue !== '*'">亿元</span>
            </p>
          </div>
          <div>
            <p class="pro-title">{{ item.thirdTtile }}</p>
            <p class="pro-value">
              {{ item.thirdValue }}
              <span v-if="item.thirdValue !== '*'">亿元</span>
            </p>
          </div>
        </div>
        <div class="card-value-bottom">
          <div>
            <p class="pro-title">2025年累计完成</p>
            <p class="pro-value">
              {{ item.cumulativeValue
              }}<span v-if="item.cumulativeValue !== '*'">亿元</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 === '运营成本' }"
              >
                <span v-if="item.compareValue !== '*'">
                  <Bottom
                    v-if="
                      item.title === '运营成本' || item.title === '利润总额'
                    "
                  />
                  <Top v-else />
                </span>
              </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;
    background-size: 100% 100%;
    .stat-card-title {
      .font(16);
      .vh(margin-top,-8);
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .stat-card-value {
      .font(12);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .vh(margin-top,10);
      .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: #ff4757;
          display: flex;
          align-items: center;
          gap: 2px;

          &.down-trend {
            color: #32d25a;
          }

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

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