<template>
  <div class="dialog-bg" v-if="show">
    <img src="../images/mould_01_box_bg.png" class="dialog-bg-img">
    <div class="content">
      <div class="title">{{ title }}</div>
      <img :src="isOpening ? data.imageSelectUrl : data.imageNoSelectUrl" class="box-img" mode="widthFix">
      <div class="handle-btn" @click="open">立即拆开</div>
      <div class="iconfont icon-guanbi" @click="close"></div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: String,
    data: Object,
    isOpening: Boolean,
    show: Boolean
  },
  data() {
    return {};
  },
  methods: {
    open(){
      this.$emit('open');
    },
    close(){
      this.$emit('update:show', false);
    },
  },
};
</script>

<style scoped>

.dialog-bg{
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 99;

  background: rgba(0, 0, 0, 0.85);
}

.dialog-bg-img{
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.dialog-bg .content{
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 49%;
  transform: translate(-50%,-50%);
  text-align: center;
  width: 82%;
}

.dialog-bg .content .title{
  color: white;
  font-size: 16px;
  font-weight: 500;
}

.dialog-bg .content .box-img{
  margin: 60px auto 0;
  height: 160px;
}

.dialog-bg .content .handle-btn{
  margin: 65px auto 0;
  width: 180px;
  height: 40px;
  border-radius: 20px;
  background: #D8FCFA;
  text-align: center;
  line-height: 40px;
  color: #21252B;
  font-size: 20px;
  font-weight: 500;
  box-shadow: inset 0px 1px 1px 0px rgba(246, 255, 212, 0.8);
  position: relative;
  z-index: 2;
}

.dialog-bg .content .icon-guanbi{
  margin: 40px auto 0;
  color: white;
  opacity: 0.8;
  padding: 15px;
  font-size: 28px;
  height: 28px;
  width: 28px;
}


</style>
