<template>
  <div class="openCardDivC">
    <div :class="['ui-modal-body', 'animate__animated', animateName]" :style="styleData.uiModalBody" @click="btnClick"></div></div>
</template>

<script>
import { closeGiftPop } from '../../../../util/shopGiftBag.js';
export default {
  // isMember 1是会员  0不是会员
  props: ['styleData', 'giftBagData', 'dynamicEffect', 'isMember'],
  data() {
    return {
      animateName:null
    };
  },
  created() {
    console.log(this.giftBagData, '开卡礼包模板数据');
    console.log(this.dynamicEffect, '动态效果');
    console.log(this.isMember, 'isMember');
    this.initData();
  },
  methods: {
    initData() {
      this.animateName = this.dynamicEffect.animateName
      if (this.dynamicEffect.isSetOpen) {
        //设置会员开卡样式
        if (this.isMember > 0) {
          //弹出会员开卡样式
          this.styleData.uiModalBody['background-image'] = `url(${this.dynamicEffect.cardTopicImage})`;
        } else {
          //弹出非会员开卡样式
          this.styleData.uiModalBody['background-image'] = `url(${this.dynamicEffect.topicImage})`;
        }
      } else {
        //没有设置会员开卡样式
        if (this.isMember > 0) {
          // console.log('xzcccccccccccccccc')
          //关闭弹窗
          closeGiftPop(this, () => {});
        } else {
          // console.log('11111111111')
          //弹出非会员开卡样式
          this.styleData.uiModalBody['background-image'] = `url(${this.dynamicEffect.topicImage})`;
        }
      }
    },
    btnClick() {
      this.$emit('btnClickEmit', {});
      this.animateName = this.dynamicEffect.outAnimateName
    }
  }
};
</script>

<style lang="scss" scoped="scoped">
.openCardDivC {
}
</style>
