<template>
  <div class="prizeTypeThreeDivAllC1">
    <div class="ui-modal-body" :style="styleData.uiModalBody">
      <div class="ui-content-box">
        <div class="getPrizePic"></div>
        <div class="prizeItemDiv" v-for="(item, index) in giftBagData.prizeData">
          <div class="prizeIconDiv">
            <img v-if="item.prizeType == '1'" src="https://img10.360buyimg.com/imgzone/jfs/t1/215686/35/12596/38974/620b6dacE10f612d4/97a766f8921fe39f.png" />
            <img v-if="item.prizeType == '4'" src="https://img10.360buyimg.com/imgzone/jfs/t1/221283/19/10655/37277/620b6dacEf759d417/0132c2aa75302c3a.png" />
            <img v-if="item.prizeType == '101' || item.prizeType == '102'" src="https://img10.360buyimg.com/imgzone/jfs/t1/87934/29/22879/19787/620b6dadE6e712f6f/5ade96e178f1fbb0.png" />
          </div>
          <div class="beanNumDiv">
            <div class="prizeNames">
              <span>{{ (item.prizeType == '1' || item.prizeType == '4') ? item.beanNum : item.priceInfo+'元' }}</span>
              {{ (item.prizeType == '101' || item.prizeType == '102') ? '优惠券' : item.prizeTypeName }}
            </div>
            <div class="prizeLimit" v-if="item.prizeType == '101' || item.prizeType == '102'">
              满{{ item.fullPriceInfo }}元可用
            </div>
          </div>
        </div>
      </div>
      <div class="btnDiv" @click="btnClick()"></div>
    </div>
  </div>
</template>

<script>
  export default {
    props: ['styleData', 'giftBagData'],
    data() {
      return {};
    },
    created() {
      console.log(this.giftBagData, '3个奖品数据');
    },
    methods: {
      btnClick() {
        this.$emit('btnClickEmit', {});
      }
    }
  };
</script>

<style lang="scss" scoped="scoped">
  .prizeTypeThreeDivAllC1 {
    .ui-content-box {
      height: 4.2rem;
      width: 5rem;
      position: absolute;
      left: 1.2rem;
      top: 5.2rem;
      display: flex;
      justify-content: center;
      align-content: flex-start;
      flex-wrap: wrap;
      @keyframes rotate {
        0% {
          transform: rotate(0deg);
        }
        100% {
          transform: rotate(-15deg);
        }
      }
      .getPrizePic {
        position: absolute;
        width: 1.67rem;
        height: 1.1rem;
        background: url('//img10.360buyimg.com/imgzone/jfs/t1/242605/12/8614/14556/664db3f0Fde5476e9/1695128a8840bf86.png')
          no-repeat;
        background-size: 100%;
        z-index: 1;
        top: -0.5rem;
        right: -0.3rem;
        animation-name: rotate;
        animation-direction: alternate;
        animation-timing-function: linear;
        animation-duration: 1s;
        animation-iteration-count: infinite;
      }
      .prizeItemDiv {
        width: 4.11rem;
        height: 1.21rem;
        background: url('//img10.360buyimg.com/imgzone/jfs/t1/203940/29/42215/6215/664db3f0Fe176e749/d4179ad88d0769fb.png')
          no-repeat;
        background-size: 100%;
        position: relative;
        margin-bottom: 0.1rem;
        display: flex;
        &:last-child {
          margin-bottom: 0;
        }
        .prizeIconDiv {
          width: 1.5rem;
          height: 100%;
          overflow: hidden;
          display: flex;
          justify-content: center;
          align-items: center;
          opacity: 0.9;
          img {
            width: 0.7rem;
            height: 0.7rem;
          }
        }
        .beanNumDiv {
          width: 2.6rem;
          display: flex;
          justify-content: center;
          align-items: center;
          flex-direction: column;
          .prizeNames {
            width: 100%;
            text-align: center;
            color: #f40f36;
            font-size: 0.3rem;
            font-weight: 600;
            span {
              color: #f40f36;
              font-size: 0.3rem;
              font-weight: 600;
            }
          }
          .prizeLimit {
            width: 100%;
            height: 0.3rem;
            line-height: 0.3rem;
            font-size: 0.2rem;
            text-align: center;
            color: #f40f36;
          }
        }
      }
    }
    .btnDiv {
      width: 3.42rem;
      height: 1.01rem;
      position: absolute;
      left: calc(50% - 3.42rem / 2);
      background: url(//img10.360buyimg.com/imgzone/jfs/t1/223948/8/33095/18645/664db3f0F2e04c8f4/6cd8a940bd52fbf3.png)
        no-repeat;
      background-size: 100% 100%;
      bottom: 2rem;
      animation-name: smallBig;
      animation-direction: alternate;
      animation-timing-function: linear;
      animation-duration: 1s;
      animation-iteration-count: infinite;
    }
    @keyframes smallBig {
      0% {
        transform: scale(1);
      }
      50% {
        transform: scale(0.8);
      }
      100% {
        transform: scale(1);
      }
    }
  }
</style>
