<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>loading error</title>
  <style>
    /* 弹窗容器样式 */
    .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      justify-content: center;
      align-items: center;
    }

    /* 弹窗内容样式 */
    .modal-content {
      background-color: #fff;
      padding: 50px;
      border-radius: 8px;
      width: 240px;
      text-align: center;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
      position: relative;
    }
    /* 重试按钮样式 */
    .quit-btn {
      background-color: #f0ad4e;
      color: #fff;
      border: none;
      padding: 8px 16px;
      border-radius: 4px;
      cursor: pointer;
      margin-top: 30px;
    }
  </style>
</head>

<body>
  <!-- 弹窗 -->
  <div class="modal" id="myModal">
    <div class="modal-content">
      <p id="messageText">加载中...</p>
      <button class="quit-btn" id="exitBtn" onclick="quit()">退出</button>
    </div>
  </div>

  <script>
    // 获取弹窗元素
    var modal = document.getElementById("myModal");
    modal.style.display = "flex";
  
    // 重试函数，实际场景中这里写重试的逻辑
    function quit() {
      u3d_func('integrity_quit', {});
    }

    // Unity调用JavaScript函数
    function unityToJsLoadErr(str)
    {
        modal.style.display = "none";
    }
	
	function getQueryParam(name) {
		const urlParams = new URLSearchParams(window.location.search);
		return urlParams.get(name);
	}
	
	   // 页面加载完成后执行
    document.addEventListener('DOMContentLoaded', function() {
      // 显示弹窗
      modal.style.display = "flex";
      
      // 获取URL参数
      const message = getQueryParam('message');
      const exitText = getQueryParam('exit');
      // 设置显示内容
      const messageText = document.getElementById('messageText');
      const exitBtn = document.getElementById('exitBtn');
      if (message) {
        messageText.textContent = message;
      }
      if (exitText) {
        exitBtn.textContent = exitText;
      }
    });
	
  </script>
</body>

</html>