mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-09 03:22:51 +08:00
新增手机端浏览模式
This commit is contained in:
@@ -9,11 +9,11 @@ loading.show = function (count) {
|
||||
}
|
||||
|
||||
if (loading.showCount == 0) {
|
||||
loading.index = layer.load()
|
||||
loading.index = layer.load();
|
||||
}
|
||||
|
||||
loading.showCount += count;
|
||||
}
|
||||
};
|
||||
|
||||
loading.hide = function (count) {
|
||||
|
||||
@@ -37,4 +37,26 @@ loading.hide = function (count) {
|
||||
layer.close(loading.index);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
const tools = {};
|
||||
|
||||
tools.checkMobile = function () {
|
||||
var userAgentInfo = navigator.userAgent;
|
||||
var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
|
||||
var mobile_flag = false;
|
||||
//根据userAgent判断是否是手机
|
||||
for (var v = 0; v < mobileAgents.length; v++) {
|
||||
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
|
||||
mobile_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var screen_width = window.screen.width;
|
||||
var screen_height = window.screen.height;
|
||||
//根据屏幕分辨率判断是否是手机
|
||||
if (screen_width < 600 && screen_height < 800) {
|
||||
mobile_flag = true;
|
||||
}
|
||||
return mobile_flag;
|
||||
};
|
||||
Reference in New Issue
Block a user