From 70266967e15e313355ef166aa8b177ef7dc8f648 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=BF=B7=E5=92=8C=E6=B2=B9?= <2249412933@qq.oom>
Date: Thu, 19 Jun 2025 11:50:22 +0800
Subject: [PATCH] =?UTF-8?q?reset=EF=BC=9A=E8=BF=98=E5=8E=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/index/view/mobile/public/header.html | 68 ------------------------
app/index/view/pc/public/header.html | 67 -----------------------
2 files changed, 135 deletions(-)
diff --git a/app/index/view/mobile/public/header.html b/app/index/view/mobile/public/header.html
index abe27cac..d8c30371 100644
--- a/app/index/view/mobile/public/header.html
+++ b/app/index/view/mobile/public/header.html
@@ -107,73 +107,5 @@
$('.top-country .close-icon').click(function(){
$(".mask,.action-sheet").hide();
})
-
-// 缓存检测结果
- let _deviceType = null;
-
- /**
- * 检测当前设备类型
- * @returns {'mobile'|'tablet'|'desktop'}
- */
- function detectDevice() {
- if (_deviceType) return _deviceType;
-
- const isTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
- const screenWidth = window.innerWidth || document.documentElement.clientWidth;
- const userAgent = navigator.userAgent.toLowerCase();
-
- const isTablet =
- userAgent.includes('tablet') ||
- (userAgent.includes('android') && !userAgent.includes('mobile')) ||
- userAgent.includes('ipad') ||
- userAgent.includes('kindle');
-
- _deviceType =
- isTouch && (screenWidth < 768 || !isTablet) ? 'mobile' :
- isTouch && screenWidth >= 768 ? 'tablet' : 'desktop';
-
- return _deviceType;
- }
-
- /**
- * 显示设备类型提示
- */
- function showDeviceAlert() {
- const device = detectDevice();
- const message = `您正在使用${
- device === 'mobile' ? '手机' :
- device === 'tablet' ? '平板' : '电脑'
- }访问本页面`;
-
- // 使用原生alert
- alert(message);
-
- // 或者使用自定义样式的提示(需要引入相关CSS)
- /*
- $('
' + message + '
')
- .css({
- position: 'fixed',
- top: '10px',
- right: '10px',
- padding: '10px 15px',
- background: '#333',
- color: 'white',
- borderRadius: '5px',
- zIndex: '9999'
- })
- .appendTo('body')
- .fadeIn()
- .delay(3000)
- .fadeOut(function() {
- $(this).remove();
- });
- */
- }
-
- // 页面加载完成后自动检测并提示
- $(document).ready(showDeviceAlert);
-
- // 暴露检测方法供外部使用
- $.detectDevice = detectDevice;
})
\ No newline at end of file
diff --git a/app/index/view/pc/public/header.html b/app/index/view/pc/public/header.html
index abda5fd7..35110ba2 100644
--- a/app/index/view/pc/public/header.html
+++ b/app/index/view/pc/public/header.html
@@ -201,72 +201,5 @@
$('.closecountrybt').click(function () {
$('#top-country').hide();
});
-// 缓存检测结果
- let _deviceType = null;
-
- /**
- * 检测当前设备类型
- * @returns {'mobile'|'tablet'|'desktop'}
- */
- function detectDevice() {
- if (_deviceType) return _deviceType;
-
- const isTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
- const screenWidth = window.innerWidth || document.documentElement.clientWidth;
- const userAgent = navigator.userAgent.toLowerCase();
-
- const isTablet =
- userAgent.includes('tablet') ||
- (userAgent.includes('android') && !userAgent.includes('mobile')) ||
- userAgent.includes('ipad') ||
- userAgent.includes('kindle');
-
- _deviceType =
- isTouch && (screenWidth < 768 || !isTablet) ? 'mobile' :
- isTouch && screenWidth >= 768 ? 'tablet' : 'desktop';
-
- return _deviceType;
- }
-
- /**
- * 显示设备类型提示
- */
- function showDeviceAlert() {
- const device = detectDevice();
- const message = `您正在使用${
- device === 'mobile' ? '手机' :
- device === 'tablet' ? '平板' : '电脑'
- }访问本页面`;
-
- // 使用原生alert
- alert(message);
-
- // 或者使用自定义样式的提示(需要引入相关CSS)
- /*
- $('' + message + '
')
- .css({
- position: 'fixed',
- top: '10px',
- right: '10px',
- padding: '10px 15px',
- background: '#333',
- color: 'white',
- borderRadius: '5px',
- zIndex: '9999'
- })
- .appendTo('body')
- .fadeIn()
- .delay(3000)
- .fadeOut(function() {
- $(this).remove();
- });
- */
- }
-
- // 页面加载完成后自动检测并提示
- $(document).ready(showDeviceAlert);
-
- // 暴露检测方法供外部使用
- $.detectDevice = detectDevice;
});
\ No newline at end of file