<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Kole UI · ConfirmModal（普通 H5）</title>
  <link rel="stylesheet" href="../.design_library/kole-ui/colors_and_type.css" />
  <link rel="stylesheet" href="ConfirmModal.css" />
  <style>body{margin:0;padding:24px;background: var(--kole-color-page-bg);}</style>
</head>
<body>
  <button id="open">删除确认</button>
  <button id="openPrimary">普通确认</button>

  <div class="kole-modal-mask" id="mask" style="display:none">
    <div class="kole-confirm is-primary" id="confirmPrimary" hidden>
      <div class="kole-confirm-head">
        <span class="kole-confirm-icon">i</span>
        <div class="kole-confirm-title">提交该申请？</div>
      </div>
      <div class="kole-confirm-content">提交后将进入审批流程。</div>
      <div class="kole-confirm-footer">
        <button class="kole-confirm-btn" id="cancelPrimary">取消</button>
        <button class="kole-confirm-btn primary" id="okPrimary">提交</button>
      </div>
    </div>
    <div class="kole-confirm is-danger">
      <div class="kole-confirm-head">
        <span class="kole-confirm-icon">!</span>
        <div class="kole-confirm-title">删除该成员？</div>
      </div>
      <div class="kole-confirm-content">删除后该成员将无法访问系统，且不可恢复。</div>
      <label class="kole-confirm-extra"><input type="checkbox" id="dont" /> 不再提示</label>
      <div class="kole-confirm-footer">
        <button class="kole-confirm-btn" id="cancel">取消</button>
        <button class="kole-confirm-btn danger" id="ok">删除</button>
      </div>
    </div>
  </div>

  <script>
    var mask = document.getElementById('mask');
    document.getElementById('open').onclick = function () { document.getElementById('confirmPrimary').hidden = true; mask.style.display = 'flex'; };
    document.getElementById('openPrimary').onclick = function () { document.getElementById('confirmPrimary').hidden = false; mask.style.display = 'flex'; };
    document.getElementById('cancelPrimary').onclick = function () { mask.style.display = 'none'; };
    document.getElementById('okPrimary').onclick = function () { alert('已提交'); mask.style.display = 'none'; };
    document.getElementById('cancel').onclick = function () { mask.style.display = 'none'; };
    document.getElementById('ok').onclick = function () {
      alert('已删除' + (document.getElementById('dont').checked ? '（不再提示）' : ''));
      mask.style.display = 'none';
    };
    mask.addEventListener('click', function (e) { if (e.target === mask) mask.style.display = 'none'; });
  </script>
</body>
</html>
