<template>
  <div v-if="show" class="modal-bg">
    <div class="modal-container">
      <el-button
        type="text"
        class="button"
        @click="$emit('showDialog')"
      ><i
        class="el-icon-close"
      /></el-button>
      <div class="modal-main">
        <slot />
      </div>
      <div class="bottom">
        <el-button style="width: 160px;" type="primary" round @click="$emit('showDialog')">{{ button }}</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'JdDialog',
  props: {
    show: {
      type: Boolean,
      default: false
    },
    button: {
      type: String,
      default: ''
    }
  },
  methods: {
  }
}
</script>

<style scoped>
.modal-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10;
}
.modal-container {
  position: fixed;
  width: 624px;
  height: 443px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-image: url('../../assets/profile/dialog.png');
  background-size: cover;
}
.modal-main {
  position: fixed;
  top: 38%;
  width: 624px;
}
.button {
  position: fixed;
  top: 10%;
  right: 3%;
  color: #fff;
  font-size: 28px;
}
.bottom{
  position: fixed;
  width: 160px;
  transform: translate(-50%, -50%);
  bottom: 2%;
  left: 50%;
}
</style>

