<template>
  <div>
    <el-dialog
      custom-class="check-media"
      destroy-on-close
      :model-value="showDialog"
      :fullscreen="screenWidth < 900"
      :show-close="false"
      width="40%"
      title="用户协议"
    >
      <div class="agreement-body">
        <div class="title">楚桓会议系统用户信息协议</div>
        <div class="content">
          <p>
            对本公司在提供服务过程中获取的您的个人信息，仅用于本次会议使用和会议举办方使用，本公司将按照法律法规予以妥善保管，您悉知并同意。
          </p>
          <p>
            请您仔细阅读用户信息协议，并同意使用电子同意的方式代替书面签名同意。您点击按钮后，即视为已经了解并悉知此同意书。
          </p>
        </div>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button type="primary" @click="decline">拒绝</el-button>
          <el-button type="primary" @click="agree">同意</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import { ref, toRefs } from "vue";

const props = defineProps({
  showDialog: {
    type: Boolean,
    default: false,
  },
});
const emit = defineEmits(["agree", "close", "decline"]);
const { showDialog } = toRefs(props);
const screenWidth = ref(screen.width);
const close = () => {
  emit("close");
};
const decline = () => {
  emit("decline");
  close();
};
const agree = () => {
  emit("agree");
  close();
};
</script>
<style lang="scss" scoped>
// :deep(.el-dialog__body) {
.agreement-body {
  .title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
  }
  .content {
    font-size: 16px;
    text-indent: 2em;
  }
}
// }
</style>
