<template>
  <div class="mask" v-if="visibile">
    <div class="comfirm-container">
      <svg-icon name="info" size="48" />
    <div class="msg_container">
      <div class="msg">{{ msg }}</div>
      <div v-if="smMsg">{{ smMsg }}</div>
    </div>
      
      <div class="btns">
        <CommonButton size="default" type="info" msg="取消" @click="emit('cancel')" />
        <CommonButton size="default" type="danger" msg="确定" @click="emit('confirm')" />
      </div>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  visibile: {
    type: Boolean,
    default: false
  },
  msg: {
    type: String,
    default: ''
  },
  smMsg: {
    type: String,
    default: ''
  }
});
const emit = defineEmits(['confirm', 'cancel']);
</script>
<style lang="less" scoped>
.mask {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  .comfirm-container {
    width: 260px;
    height: 180px;
    background: #f8f8f8;
    box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16);
    border-radius: 8px 8px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    padding: 16px;
    justify-content: space-between;
    text-align: center;
    .msg {
      margin-top: 20px;
      font-size: 16px;
    }
    .msg_container{
      margin-bottom: 15px;
    }
    .btns {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-around;
    }
  }
}
</style>
