<template>
  <div class="common-banner" :style="{'height': height + 'px'}">
    <img class="bg-img" :src="img" :style="{'height': height + 'px', 'max-height': height + 'px'}" alt="" srcset="">
    <div class="bg-content">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    img: {
      type: String,
      default: ''
    },
    height: {
      type: Number,
      default: 521
    }
  },
  data() {
    return {
      // bannerImg: require('~/assets/images/products/product_banner.png')
    }
  }
}
</script>

<style lang="scss">
.common-banner {
  // height: 521px;
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  text-align: center;
  max-width: 1920px;
  .bg-img {
    position: absolute;
    top: 0px;
    left: 50%;
    bottom: 0px;
    right: 0px;
    z-index: 1;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    max-width: 1920px;
    // max-height: 521px;
    // height: 521px;
    display: block;
  }
  .bg-content {
    position: absolute;
    top: 0;
    z-index: 10;
    height: 100%;
    width: 100%;
    background: rgba(13, 92, 250, 0.8);
  }
  h2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 66px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #FFFFFF;
    z-index: 10;
  }
  h4 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #FFFFFF;
    line-height: 25px;
    z-index: 10;
    margin-top: 82px;
  }
}
.content-wrap {
  margin-top: 85px;
  width: 100%;
  position: absolute;
  z-index: 10;
  .content {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .title {
    width: 396px;
    height: 92px;
    font-size: 66px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #FFFFFF;
    line-height: 92px;
  }
}
</style>
