| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
- <title>巨龙之戒-经典冒险主公闯关开局</title>
- <script src="./js/jquery.min.js"></script>
- <style>
- * {
- margin: 0;
- padding: 0;
- border: 0;
- box-sizing: border-box;
- }
- body {
- padding-top: 60px;
- background-color: #000;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
- }
- img {
- display: block;
- width: 100%;
- }
- a {
- text-decoration: none;
- }
- #content-wrapper {
- background-color: #fff;
- max-width: 750px;
- margin: 0 auto;
- overflow: hidden;
- }
- #top-banner {
- position: fixed;
- top: 0;
- width: 100%;
- height: 60px;
- background: rgba(0, 0, 0, 0.8);
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 20px;
- max-width: 750px;
- z-index: 100;
- }
- .btn {
- display: inline-block;
- color: #fff;
- font-size: 20px;
- background-color: #f64e4e;
- border-radius: 15px;
- padding: 5px 20px;
-
- cursor: pointer;
- }
- /* Modal Styles */
- .modal-overlay {
- display: none;
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, 0.6);
- backdrop-filter: blur(5px);
- z-index: 1000;
- align-items: center;
- justify-content: center;
- }
- .modal-content {
- width: 90%;
- max-width: 320px;
- background: #f5f7f8;
- border-radius: 20px;
- overflow: hidden;
- box-shadow: 0 10px 25px rgba(0,0,0,0.3);
- animation: modalFadeIn 0.3s ease-out;
- }
- @keyframes modalFadeIn {
- from { opacity: 0; transform: scale(0.9); }
- to { opacity: 1; transform: scale(1); }
- }
- .modal-header {
- padding: 20px;
- text-align: center;
- border-bottom: 1px solid #eee;
- }
- .modal-header h2 {
- font-size: 20px;
- color: #333;
- }
- .modal-body {
- padding: 20px;
- }
- .form-group {
- margin-bottom: 15px;
- }
- .form-input {
- width: 100%;
- height: 45px;
- padding: 0 15px;
- border: 1px solid #ddd;
- border-radius: 10px;
- font-size: 14px;
- outline: none;
- }
- .form-input:focus {
- border-color: #f64e4e;
- }
- .captcha-group {
- display: flex;
- gap: 10px;
- }
- .btn-captcha {
- height: 45px;
- padding: 0 10px;
- background: #eee;
- border-radius: 10px;
- font-size: 13px;
- color: #666;
- cursor: pointer;
- white-space: nowrap;
- }
- .btn-login {
- width: 100%;
- height: 45px;
- background: #f64e4e;
- color: #fff;
- border-radius: 10px;
- font-size: 16px;
- font-weight: bold;
- cursor: pointer;
- margin-top: 10px;
- }
- .privacy-text {
- font-size: 10px;
- color: #999;
- text-align: center;
- margin-top: 15px;
- line-height: 1.4;
- }
- .close-btn {
- position: absolute;
- top: 10px;
- right: 15px;
- font-size: 24px;
- color: #999;
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <div id="content-wrapper">
- <div id="top-banner">
- <div style="display: flex;align-items: center;justify-content: center;">
- <img src="./assets/icon.png" style="width: 50px;">
- <span style="color: #fff;font-size: 25px;">巨龙之戒</span>
- </div>
- <a class="btn btn-download" style="justify-self: end;">开始游戏</a>
- </div>
- <a class="btn-download"><img src="./assets/1.gif"></a>
- <a class="btn-download"><img src="./assets/2.gif"></a>
- <a class="btn-download"><img src="./assets/3.gif"></a>
- </div>
- <!-- Login Modal -->
- <div id="loginModal" class="modal-overlay">
- <div class="modal-content" style="position: relative;">
- <span class="close-btn" onclick="closeModal()">×</span>
- <div class="modal-header">
- <h2>游戏登录</h2>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <input type="tel" id="phone" class="form-input" placeholder="请输入手机号">
- </div>
- <div class="form-group captcha-group">
- <input type="text" id="captcha" class="form-input" placeholder="请输入验证码">
- <button type="button" class="btn-captcha" id="getCaptcha">获取验证码</button>
- </div>
-
- <button type="button" class="btn-login" id="loginBtn">登录并进入游戏</button>
- <p class="privacy-text">
- 登录即代表您已同意 <span style="color:#f64e4e">服务协议</span> 和 <span style="color:#f64e4e">隐私政策</span>
- </p>
- </div>
- </div>
- </div>
- <script src="./js/md5.min.js"></script>
- <script>
- function getUrlParam(name, defaultValue = '') {
- const urlParams = new URLSearchParams(window.location.search);
- return urlParams.get(name) || defaultValue;
- }
- const API_URL = 'https://app.hainanruiyu.cn/landingpage/index.php';
- const APP_ID = parseInt(getUrlParam('appid', ''));
- const APP_KEY = 'b995721db94fa9b206fab7ef687a13d3';
- const MEDIA_ID = getUrlParam('media_id', '');
-
- const modal = document.getElementById('loginModal');
- const loginBtn = document.getElementById('loginBtn');
- const getCaptchaBtn = document.getElementById('getCaptcha');
- let sessionId = '';
- function getOS() {
- const ua = navigator.userAgent;
- if (/iPad|iPhone|iPod/.test(ua)) return 'ios';
- if (/Android/.test(ua)) return 'android';
- return 'pc';
- }
- function makeSign(time) {
- return md5(APP_KEY + time);
- }
- function openModal() {
- modal.style.display = 'flex';
- }
- function closeModal() {
- modal.style.display = 'none';
- }
- // Intercept download clicks
- document.querySelectorAll('.btn-download').forEach(link => {
- link.addEventListener('click', function(e) {
- e.preventDefault();
- openModal();
- });
- });
- function sendVerificationCode() {
- const phone = document.getElementById('phone').value;
- const os = getOS() === 'ios' ? 'ios' : 'android';
-
- if (!/^1[3-9]\d{9}$/.test(phone)) {
- alert('请输入正确的手机号');
- return;
- }
- getCaptchaBtn.disabled = true;
- let count = 60;
- const originalText = getCaptchaBtn.innerText;
- getCaptchaBtn.innerText = count + 's';
-
- const timer = setInterval(() => {
- count--;
- if (count <= 0) {
- clearInterval(timer);
- getCaptchaBtn.disabled = false;
- getCaptchaBtn.innerText = '获取验证码';
- } else {
- getCaptchaBtn.innerText = count + 's';
- }
- }, 1000);
- const time = Math.floor(Date.now() / 1000);
-
- $.ajax({
- url: API_URL,
- type: 'POST',
- contentType: 'application/json',
- data: JSON.stringify({
- do: 'send_code',
- appid: APP_ID,
- time: time,
- sign: makeSign(time),
- phone: phone,
- media_id: MEDIA_ID,
- os: os
- }),
- success: function(res) {
- let result = typeof res === 'string' ? JSON.parse(res) : res;
- console.log(result)
- if (result && result.ret == 1) {
- sessionId = result.sessionid;
- alert('验证码已发送');
- } else {
- alert(result.msg || '发送失败,请稍后重试');
- clearInterval(timer);
- getCaptchaBtn.disabled = false;
- getCaptchaBtn.innerText = '获取验证码';
- }
- },
- error: function() {
- alert('发送失败,网络错误');
- clearInterval(timer);
- getCaptchaBtn.disabled = false;
- getCaptchaBtn.innerText = '获取验证码';
- }
- });
- }
- getCaptchaBtn.addEventListener('click', function() {
- sendVerificationCode();
- });
- function executeLogin() {
- const phone = document.getElementById('phone').value;
- const code = document.getElementById('captcha').value;
- const os = getOS() === 'ios' ? 'ios' : 'android';
-
- if (!phone || !code) {
- alert('请填写手机号和验证码');
- return;
- }
-
- loginBtn.innerText = '登录中...';
- loginBtn.disabled = true;
-
- const time = Math.floor(Date.now() / 1000);
- const url = sessionId ? `${API_URL}?phpsessid=${sessionId}` : API_URL;
- $.ajax({
- url: url,
- type: 'POST',
- contentType: 'application/json',
- data: JSON.stringify({
- do: 'register',
- appid: APP_ID,
- time: time,
- sign: makeSign(time),
- phone: phone,
- code: code,
- media_id: MEDIA_ID,
- os: os
- }),
- success: function(res) {
- let result = typeof res === 'string' ? JSON.parse(res) : res;
- console.log(result)
- if (result && result.ret == 1) {
- closeModal();
- window.location.href = 'download.html';
- } else {
- alert(result.msg || '登录失败,请重试');
- loginBtn.innerText = '登录并进入游戏';
- loginBtn.disabled = false;
- }
- },
- error: function() {
- alert('登录失败,网络错误');
- loginBtn.innerText = '登录并进入游戏';
- loginBtn.disabled = false;
- }
- });
- }
- loginBtn.addEventListener('click', function() {
- if (!this.disabled) {
- executeLogin();
- }
- });
- window.addEventListener('click', (e) => {
- if (e.target === modal) {
- closeModal();
- }
- });
- </script>
- </body>
- </html>
|