<template>
  <div class="bigBox">
    <div class="card" :class="{ flipped: mode === 1|| mode === 3}">
      <div v-if="mode!==2" class="fornt">
        <img :src="poster" class="nowimage" />
      </div>
      <div class="back">
        <img :src="nowBackImg" class="nowimage" />
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    prize: {
      type: Object,
      default: () => ({})
    }
  },
  computed: {
    poster() {
      return this.mode === 1
        ? require('../assets/index.jpg')
        : this.mode === 3
        ? this.prize.posterImg
        : ''
    },
    mode() {
      return this.prize.mode
    },
    nowBackImg() {
      return this.mode === 3 ? this.prize.popImg : ''
    }
  }
}
</script>
<style lang="less" scoped>
.bigBox {
  perspective: 600px;
  overflow: hidden;
  .card {
    position: relative;
    width: 22vw;
    height: 49.5vw;
    transform-style: preserve-3d;
    transition: all 0.6s ease;
    transform: rotateY(-180deg) scale(2);
    .back {
      transform: rotateY(-180deg);
    }
    .nowimage {
      width: 22vw;
      height: 49.5vw;
    }
  }
  .card > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;

    /* 背面不显示 */
    backface-visibility: hidden;
  }
  .flipped {
    transform: rotateY(0);
  }
}
</style>
