<template>
  <div class="border" :style="{height: boxHeight}">
    <div class="card_box">
      <div class="title_trapezoid center_in">
        <span class="center_in">{{title}}</span>
      </div>
    </div>
    <div class="card_collect">
      <div class="card_amount" v-for="(item,index) in list" :key="index">
        <div class="title_card">{{item.num}}</div>
        <div style="display: flex;align-items: center;">
          <img class="item_image" :src="require('@/assets/image/' + item.icon)" alt="" />
          <div class="title_am">{{item.title}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'wavyBlock',
    props: {
      title: {
        type: String,
        default: () => '文字',
      },
      boxWidth: {
        type: String,
        default: () => '200px',
      },
      boxHeight: {
        type: String,
        default: () => '95%',
      },
      list: {
        type: Array,
        default: () => [],
      },
    },
    data() {
      return {
      }
    }
  }
</script>

<style lang="scss">
  .border {
    position: relative;
    width: calc(100% - 10px);
    border: 1px solid #3077ca;
    margin: 0 10px 0 auto;
    border-radius: 4px;
    box-shadow: inset 0 0 40px rgba(48, 119, 202, 0.3);
  }

  .card_box {
    position: absolute;
    top: 0;
    left: calc(50% - 80px);
    right: 0;
  }

  .title_trapezoid {
    position: relative;
    color: #fff !important;
    width: 160px;
    height: 30px;
    text-align: center;
    z-index: 2;
  }

  .title_trapezoid span {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 160px;
    top: -1px;
    z-index: 2;
    font-size: 15px;
    line-height: 25px;
  }

  .title_trapezoid::before {
    border-bottom: 2px solid #2CD5FF;
    content: '';
    z-index: 1;
    width: 100%;
    height: 30px;
    background-image: linear-gradient(to top, #3077ca99, #3077ca7f, transparent);
    display: inline-block;
    position: absolute;
    left: 0;
    top: -1px;
    transform: perspective(100px) rotateX(150deg);
  }

  .card_collect {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    margin-top: 30px;
    height: calc(100% - 30px);
  }

  .card_amount {
    margin-top: 10px;
    margin-bottom: 10px;
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .item_image {
    height: 24px;
  }

  .title_card {
    color: #fff;
    text-align: center;
    font-size: 30px;
    color: #2CD5FF;
    font: bold 35px mFont;
  }

  .title_am {
    margin-left: 10px;
    color: #fff;
  }
</style>
