| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481 |
- <!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;
- }
- /* WeChat Tip Styles */
- #weixin-tip {
- position: fixed;
- left: 0;
- top: 0;
- background: rgba(0, 0, 0, 0.8);
- width: 100%;
- height: 100%;
- z-index: 2000;
- display: none;
- }
- #weixin-tip p {
- text-align: center;
- margin-top: 10%;
- padding: 0 5%;
- }
- .wechat-img {
- max-width: 100%;
- height: auto;
- }
- /* Toast Styles */
- .total-toast {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- background: rgba(0, 0, 0, 0.7);
- color: #fff;
- padding: 12px 24px;
- border-radius: 8px;
- font-size: 14px;
- z-index: 9999;
- text-align: center;
- pointer-events: none;
- display: none;
- max-width: 80%;
- word-wrap: break-word;
- }
- </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>
-
- </div>
- </div>
- </div>
- <div id="weixin-tip">
- <p><img src="./assets/live_weixin.png" alt="微信打开" class="wechat-img"/></p>
- </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', '');
-
- function is_weixin() {
- var ua = navigator.userAgent.toLowerCase();
- return ua.indexOf('micromessenger') !== -1;
- }
-
- const DOWNLOAD_LINKS = {
- ios: 'https://apps.apple.com/cn/app/id6746466555',
- android: 'https://apps.apple.com/cn/app/id6746466555', // 这里以后可以替换为安卓下载包地址
- default: 'https://apps.apple.com/cn/app/id6746466555'
- };
- const modal = document.getElementById('loginModal');
- const loginBtn = document.getElementById('loginBtn');
- const getCaptchaBtn = document.getElementById('getCaptcha');
- let pendingUrl = '';
- let sessionId = '';
- function total(msg) {
- $('.total-toast').remove();
- const toast = $('<div class="total-toast">' + msg + '</div>');
- $('body').append(toast);
- toast.fadeIn(300).delay(2000).fadeOut(300, function() {
- $(this).remove();
- });
- }
- function getBrowserID() {
- let id = localStorage.getItem('browser_unique_id');
- if (!id) {
- id = 'br_' + Math.random().toString(36).substr(2, 9) + Date.now().toString(36);
- localStorage.setItem('browser_unique_id', id);
- }
- return id;
- }
- const IMEI = getBrowserID();
- // 当前投放只针对IOS, 这里默认都是ios
- function getOS() {
- // const ua = navigator.userAgent;
- // if (/iPad|iPhone|iPod/.test(ua)) return 'ios';
- // if (/Android/.test(ua)) return 'android';
- // return 'pc';
- return 'ios'
- }
- function makeSign(time) {
- return md5(APP_KEY + time);
- }
- function openModal(url) {
- // 如果按钮没有 href 或者 href 为空,则根据系统自动分配下载链接
- pendingUrl = url || DOWNLOAD_LINKS[getOS()] || DOWNLOAD_LINKS.default;
- 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();
- if (is_weixin()) {
- document.getElementById('weixin-tip').style.display = 'block';
- } else {
- openModal(this.getAttribute('href'));
- }
- });
- });
- // Close WeChat tip on click
- document.getElementById('weixin-tip').addEventListener('click', function() {
- this.style.display = 'none';
- });
- function sendVerificationCode() {
- const phone = document.getElementById('phone').value;
- const os = getOS() === 'ios' ? 'ios' : 'android';
-
- if (!/^1[3-9]\d{9}$/.test(phone)) {
- total('请输入正确的手机号');
- 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,
- imei: IMEI
- }),
- success: function(res) {
- let result = typeof res === 'string' ? JSON.parse(res) : res;
- console.log(result)
- if (result && result.ret == 1) {
- sessionId = result.sessionid;
- total('验证码已发送');
- } else {
- total(result.msg || '发送失败,请稍后重试');
- clearInterval(timer);
- getCaptchaBtn.disabled = false;
- getCaptchaBtn.innerText = '获取验证码';
- }
- },
- error: function() {
- total('发送失败,网络错误');
- 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) {
- total('请填写手机号和验证码');
- 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,
- imei: IMEI
- }),
- success: function(res) {
- let result = typeof res === 'string' ? JSON.parse(res) : res;
- console.log(result)
- if (result && result.ret == 1) {
- closeModal();
- if (MEDIA_ID) {
- const reportUrl = `https://tj.hainanruiyu.cn/api/cps.php?c=${MEDIA_ID}`;
- $.get(reportUrl).always(function() {
- window.location.href = pendingUrl;
- });
- } else {
- window.location.href = pendingUrl;
- }
- } else {
- total(result.msg || '登录失败,请重试');
- loginBtn.innerText = '登录并进入游戏';
- loginBtn.disabled = false;
- }
- },
- error: function() {
- total('登录失败,网络错误');
- 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>
|