<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="data.imageSelectUrl" 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,
    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: 45%;
  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{
  width: 100%;
  margin: 0 auto;
  height: 320px;
}

.dialog-bg .content .handle-btn{
  margin: -12px auto 0;
  width: 180px;
  height: 40px;
  border-radius: 20px;
  background: #12B4BB;
  text-align: center;
  line-height: 40px;
  color: white;
  font-size: 20px;
  font-weight: 500;
  box-shadow: inset 0px 3px 3px 0px rgba(255, 255, 255, 0.8);
}

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


</style>
